ZAP Scanning Report_HRIS
| Risk Level | Number of Alerts |
|---|---|
|
High
|
1
|
|
Medium
|
6
|
|
Low
|
5
|
|
Informational
|
7
|
| Name | Risk Level | Number of Instances |
|---|---|---|
| Anti-CSRF Tokens Check | High | 1 |
| CSP: Wildcard Directive | Medium | 7 |
| CSP: script-src unsafe-inline | Medium | 7 |
| CSP: style-src unsafe-inline | Medium | 7 |
| Hidden File Found | Medium | 1 |
| Relative Path Confusion | Medium | 1 |
| Vulnerable JS Library | Medium | 3 |
| Absence of Anti-CSRF Tokens | Low | 3 |
| Dangerous JS Functions | Low | 2 |
| Permissions Policy Header Not Set | Low | 30 |
| Private IP Disclosure | Low | 1 |
| Timestamp Disclosure - Unix | Low | 37 |
| Base64 Disclosure | Informational | 8 |
| Content-Type Header Missing | Informational | 1 |
| Cookie Slack Detector | Informational | 1 |
| Information Disclosure - Suspicious Comments | Informational | 40 |
| Non-Storable Content | Informational | 5 |
| Storable and Cacheable Content | Informational | 40 |
| User Agent Fuzzer | Informational | 7 |
| HTTP Response Code | Number of Responses |
|---|
| Parameter Name | Type | Flags | Times Used | # Values |
|---|
| HTTP Response Code | Number of Responses |
|---|
| Parameter Name | Type | Flags | Times Used | # Values |
|---|
| HTTP Response Code | Number of Responses |
|---|
| Parameter Name | Type | Flags | Times Used | # Values |
|---|
| HTTP Response Code | Number of Responses |
|---|
| Parameter Name | Type | Flags | Times Used | # Values |
|---|
| HTTP Response Code | Number of Responses |
|---|
| Parameter Name | Type | Flags | Times Used | # Values |
|---|
| HTTP Response Code | Number of Responses |
|---|---|
| 501 Not Implemented |
1
|
| 403 Forbidden |
2
|
| 404 Not Found |
108
|
| 405 Method Not Allowed |
4
|
| 200 OK |
145
|
| Authentication Statistics | Number of Responses |
|---|---|
|
!reports.report.stats.auth.proxy.state.nothtml!
|
43
|
|
!reports.report.stats.auth.manual.state.unknown!
|
1
|
|
!reports.report.stats.auth.proxy.state.unknown!
|
12
|
|
!reports.report.stats.auth.ascan.state.notsuccess!
|
114
|
|
!reports.report.stats.auth.10.state.nothtml!
|
33
|
|
!reports.report.stats.auth.10.state.unknown!
|
1
|
|
!reports.report.stats.auth.ascan.state.unknown!
|
46
|
| Parameter Name | Type | Flags | Times Used | # Values |
|---|
|
High |
Anti-CSRF Tokens Check |
|---|---|
| Description |
A cross-site request forgery is an attack that involves forcing a victim to send an HTTP request to a target destination without their knowledge or intent in order to perform an action as the victim. The underlying cause is application functionality using predictable URL/form actions in a repeatable way. The nature of the attack is that CSRF exploits the trust that a web site has for a user. By contrast, cross-site scripting (XSS) exploits the trust that a user has for a web site. Like XSS, CSRF attacks are not necessarily cross-site, but they can be. Cross-site request forgery is also known as CSRF, XSRF, one-click attack, session riding, confused deputy, and sea surf.
CSRF attacks are effective in a number of situations, including:
* The victim has an active session on the target site.
* The victim is authenticated via HTTP auth on the target site.
* The victim is on the same local network as the target site.
CSRF has primarily been used to perform an action against a target site using the victim's privileges, but recent techniques have been discovered to disclose information by gaining access to the response. The risk of information disclosure is dramatically increased when the target site is vulnerable to XSS, because XSS can be used as a platform for CSRF, allowing the attack to operate within the bounds of the same-origin policy.
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > |
| Request Header - size: 543 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:04:10 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("aXJFWXbtxoumqjNQ0DXgqlL74ST7dXdmFkYBJnYHkEz2AbS0aK8mUuMVp1SF8s5+VGJgami6DRwyDk5jsgQwIw==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("aXJFWXbtxoumqjNQ0DXgqlL74ST7dXdmFkYBJnYHkEz2AbS0aK8mUuMVp1SF8s5+VGJgami6DRwyDk5jsgQwIw==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("aXJFWXbtxoumqjNQ0DXgqlL74ST7dXdmFkYBJnYHkEz2AbS0aK8mUuMVp1SF8s5+VGJgami6DRwyDk5jsgQwIw==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("PoQWm5lQBK7Oi/fj5v+5pQ4QKCcL3XGX8iHi+CWrmmbH3DbUTTtO4PCa0mfsiY6mlNXOP7cAaHY38JfMTJn1ig==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("PoQWm5lQBK7Oi/fj5v+5pQ4QKCcL3XGX8iHi+CWrmmbH3DbUTTtO4PCa0mfsiY6mlNXOP7cAaHY38JfMTJn1ig==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("PoQWm5lQBK7Oi/fj5v+5pQ4QKCcL3XGX8iHi+CWrmmbH3DbUTTtO4PCa0mfsiY6mlNXOP7cAaHY38JfMTJn1ig==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("cd1Hf7SaT3opOVN7/VTfZQ1voWVqvZyOlBJPyKOiyvws6AnC+S1Y7dGOzVcG5ogNFZQ8xhbGvK1tMK8XUFFsww==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("cd1Hf7SaT3opOVN7/VTfZQ1voWVqvZyOlBJPyKOiyvws6AnC+S1Y7dGOzVcG5ogNFZQ8xhbGvK1tMK8XUFFsww==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("cd1Hf7SaT3opOVN7/VTfZQ1voWVqvZyOlBJPyKOiyvws6AnC+S1Y7dGOzVcG5ogNFZQ8xhbGvK1tMK8XUFFsww==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("pAsPVs83dFn0pfiap0NUe82MTjvKg0g0mqDdw++Bzjii+b8WdjcWCJAwnHG2lt1ogyyx+jhK/PpBjhbSRRqY/g==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("pAsPVs83dFn0pfiap0NUe82MTjvKg0g0mqDdw++Bzjii+b8WdjcWCJAwnHG2lt1ogyyx+jhK/PpBjhbSRRqY/g==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("pAsPVs83dFn0pfiap0NUe82MTjvKg0g0mqDdw++Bzjii+b8WdjcWCJAwnHG2lt1ogyyx+jhK/PpBjhbSRRqY/g==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| Instances | 1 |
| Solution |
Phase: Architecture and Design
Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
For example, use anti-CSRF packages such as the OWASP CSRFGuard.
Phase: Implementation
Ensure that your application is free of cross-site scripting issues, because most CSRF defenses can be bypassed using attacker-controlled script.
Phase: Architecture and Design
Generate a unique nonce for each form, place the nonce into the form, and verify the nonce upon receipt of the form. Be sure that the nonce is not predictable (CWE-330).
Note that this can be bypassed using XSS.
Identify especially dangerous operations. When the user performs a dangerous operation, send a separate confirmation request to ensure that the user intended to perform that operation.
Note that this can be bypassed using XSS.
Use the ESAPI Session Management control.
This control includes a component for CSRF.
Do not use the GET method for any request that triggers a state change.
Phase: Implementation
Check the HTTP Referer header to see if the request originated from an expected page. This could break legitimate functionality, because users or proxies may have disabled sending the Referer for privacy reasons.
|
| Reference |
http://projects.webappsec.org/Cross-Site-Request-Forgery
http://cwe.mitre.org/data/definitions/352.html |
| Tags |
OWASP_2021_A05
WSTG-v42-SESS-05 OWASP_2017_A06 |
| CWE Id | 352 |
| WASC Id | 9 |
| Plugin Id | 20012 |
|
Medium |
CSP: Wildcard Directive |
|---|---|
| Description |
The following directives either allow wildcard sources (or ancestors), are not defined, or are overly broadly defined:
connects-src, frame-ancestors, manifest-src, prefetch-src, form-action
The directive(s): frame-ancestors, form-action are among the directives that do not fallback to default-src, missing/excluding them is the same as allowing anything.
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 234 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php HTTP/1.1
Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 19,386 bytes. |
<style type="text/css">
.div_border_front2 table:nth-child(2) input[type="button"] { color: #fff; background: #627d4d; } #forgot { color: ; } .applist_gradient { background: #627d4d; } .head_title { color: #fff; } .head_title, .apptitle { text-transform: uppercase; } .head_title1, .apptitle1 { text-transform: uppercase; } .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header { background: #627d4d; } .ui-widget-header { background: #627d4d !important; color: #fff; } .ui-dialog .ui-dialog-buttonpane button { color: #fff; } header#header,.theme_header { background: #627d4d !important; } /*header#header2 { background: #627d4d; }*/ ._program li { color: #fff; } .button1 { color: #fff; background: #627d4d; } ._figure span:first-child { color: #fff; } #hris_sub_container ul figure { background: #627d4d; } .dc_empstatico { color: ; /* colored */ } .dbg_empstatico { background: #627d4d; /* colored */ } ::-webkit-scrollbar { background: #627d4d; } ::-webkit-scrollbar-thumb { background: #627d4d; } #hris_sub_container header { color: ; /* colored */ } .gp, .ui-widget-header, .fc-day-header, { background: #627d4d; } .ui-widget-header, .fc-day-header { color : white !important;; } </style><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "/strict.dtd"> <html> <head> <title>WEBTEMPLATE</title> <link REL="SHORTCUT ICON" HREF="./images/lst_logo.ico" /> <link href='../css/applist.css' media='screen' type='text/css' /> <!-- include a theme, can be included into the core instead of 2 separate files --> <link rel="stylesheet" href="lib/alertify/css/themes/bootstrap.min.css" /> <link rel="stylesheet" href="./css/modified_layout.css" type="text/css" media="screen" /> <link rel='stylesheet' type='text/css' media='screen' href='./css/layout.css'/> </head> <body> <form name='myform' id='myform' method='post'> <link rel='stylesheet' type='text/css' href='css/login.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_view.css?v=20220209161346' /><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/layout.css?v=20220209161346' /><script type='text/javascript' src='javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='lib/pager.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/pager.css?v=20220209161346' /><script type='text/javascript' src='lib/alertify/alertify.min.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_page.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/applist.css?v=20220209161346' /> <!-- <link rel="stylesheet" type="text/css" href="css/login_page.css"> --> <input name='xpage_uri' id='xpage_uri'> <input name='xpage_dir' id='xpage_dir'> <input name='txt_action' id='txt_action'> <input name='txtappcde' id='txtappcde'> <input name='txtoutsource' id='txtoutsource'> <input id='seccode_validated' value=""> <input id="gl_comcde" name="gl_comcde" value="ATESTWEBTKM"> <!-- <input type="hidden" id="tmp_redirect_path" name="tmp_redirect_path"> --> <!-- <input type="hidden" id="tmp_appcde" name="tmp_appcde"> --> <style type="text/css"> .seccode_continue:hover { color: white; background-color: #1947D1 !important; border: 0; } .seccode_continue { background-color: #335CD6 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; /* border-radius: .3em; */ width: auto; min-width: 70px; } .seccode_cancel:hover { color: white; background-color: #990000 !important; border: 0; } .seccode_cancel { /* border-radius: .3em; */ background-color: #aa4935 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; width: 70px; /*margin-right: 3px;*/ } </style> <script type='text/javascript'> //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "WEBAPP"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function() {}; jQuery(document).ready(function() { if (jQuery('#seccode_validated').val() == 0 && jQuery('#seccode_validated').val() != '') { alertify.alert('Accesing any programs must start here.'); } jQuery('#seccode_diag').dialog({ title: "Security Code", resizable: false, autoOpen: false, height: 'auto', width: 'auto', position: { my: "center", at: "center", of: window }, modal: true, open: function() { jQuery('body').css('overflow', 'hidden'); jQuery('.ui-button-icon-primary.ui-icon.ui-icon-closethick').closest('button').remove(); jQuery(this).closest('.ui-dialog').find('.seccode_cancel').focus(); }, close: function() { jQuery('body').css('overflow', 'auto'); }, buttons: [{ text: "Continue", "class": 'seccode_continue', click: function() { val_seccode_path(jQuery('#seccode_diag').find('#seccode_path')); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { jQuery('#seccode_diag').dialog('close'); } }, ] }); jQuery('#diag_subsidiary').dialog({ title: 'Select Subsidiary', width: 500, height: 'auto', draggable: false, resizable: false, autoOpen: false, modal: true, open: function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [{ text: "Proceed", "class": 'seccode_continue', click: function() { update_pay_subdrycde_link($(this).find('#pay_subdrycde').val()); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { $(this).dialog('close'); } }, ] }); }) function val_blank_session() { alertify.alert('You must login first.', function() { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) // window.open('login_view.php', '_self'); }) } function val_seccode(xloc, xcde) { var xdata = "event_action=val_seccode"; xdata += "&xloc=" + xloc; xdata += "&xcde=" + xcde; xdata += "&" + jQuery('#myform *').serialize(); return jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata }); } function val_seccode_path(selectObj) { var xdata = "event_action=val_seccode_path"; xdata += "&apploc=" + selectObj.val(); xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { if (xret.bridge_found) { // document.forms.myform.txtappcde.value=selectObj.find("option:selected").data('appcde'); document.forms.myform.action = selectObj.val(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { alertify.alert(selectObj.find(':selected').text(), xret.bridge_found_msg); } } }); } function open_seccode_diag() { var xdata = "event_action=validate_comcde"; xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { jQuery('#seccode_diag').dialog('open'); } }); } function transaction_click(xappcde, xloc, obj) { // alert(xappcde,xloc,obj); document.forms.myform.action = xloc; document.forms.myform.txtappcde.value = xappcde; if (jQuery(obj).hasClass('show_sub_diag') || xappcde == "PAY") { var xdata = "event_action=get_user_subdry&xappcde=" + xappcde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { $.unblockUI(); console.log(response) if (response.pass == true) { if (response.show_diag == true && response.has_access == true) { var subdry_note = "Payroll"; if(xappcde == "PAY_OUTSRC") { subdry_note = "Payroll Out Sourcing"; } jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); // jQuery('#diag_subsidiary').find('#subdry_note').html(subdry_note); jQuery('#diag_subsidiary').dialog('open'); } else if (response.show_diag == false && response.has_access == true) { blockui(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); update_pay_subdrycde_link($('#pay_subdrycde').val()); } } else { alertify.alert('You must have a subsidiary access to use the payroll program.'); } } }); } else { blockui(); //20190311 donita //add check update structure // if(xappcde != "PAY_OUTSRC" || xappcde != "PAY") // { update_empstatus(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action = "admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); // } // else // { // document.forms.myform.method='POST'; // document.forms.myform.target = '_self'; // document.forms.myform.submit(); // } } } function update_empstatus(subdrycde="") { var xdata= "event_action=update_empstatus&subdrycde="+subdrycde; jQuery.ajax({ type : 'post', data : xdata, url : 'login_applist_ajax.php', success : function (xretobj) { } }); } function logout_click() { alertify.confirm('Are you sure you want to logout?', function() { blockui(); var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) } }); }); } function update_pay_subdrycde_link(xsubdrycde) { blockui(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { var xappcde = $('#txtappcde').val(); var xdata = "event_action=update_pay_subdrycde_link&xappcde=" + xappcde; xdata += "&subdrycde=" + xsubdrycde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { jQuery('#diag_subsidiary').dialog('close'); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } }); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action="admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); } function admin_click(xloc) { document.forms.myform.action = xloc; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } function getclientdir(){ var xparams = 'txt_action=getclientdir'; return jQuery.ajax({ dataType: 'json', type: 'post', data: xparams, url : 'login_validate_redirect.php' }) } </script> <style> footer { width: 580px; margin: 0 auto 50px; } footer .ftr_con { margin: 20px auto 0; } footer .ftr_con p { text-align: center; } .appgrp { margin-top: 20px; display: flex; justify-content: center; align-items: center; } </style> <!-- <form id="myform"> </form> --> <div class='applist_body' align='center'> <div class='applist_all'> <div class="logo"> <img src='img/lst.png' style="width: 100%;height: 100%;"> </div> <table border='0' align='center'> <tr> <td align='center'> <table class='applist_table'> <tr> <td align='right' colspan='10'> <span class='applist_logout' onclick='logout_click()'><b>LOGOUT</b></span> </td> </tr> <tr> <td colspan='10'> <hr> </td> </tr> <tr> <td style='white-space:nowrap;' align='center'> <div class="appgrp"> <div class='applist_button' onclick="admin_click('admin/main.php')"> <div class='applist_gradient'> <img class='applist_button_img' src='images/admin.png'> </div> <div class='admin_label'> <p>Admin</p> </div> </div> <div class="applist_button show_sub_diag" onclick='transaction_click("PAY","payroll/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/PAY.png' ></div><div class='admin_label'><p>Payroll</p></div></div><div class="applist_button " onclick='transaction_click("HR","hris/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/hr_0.png' ></div><div class='admin_label'><p>Human Resource Information System</p></div></div><div class="applist_button " onclick='transaction_click("TKM","tkm/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/clock.png' ></div><div class='admin_label'><p>Time Keeping Management</p></div></div> </div> </td> </tr> </table> </td> </tr> <tr style="height:50px;"> <td colspan="100"></td> </tr> <tr> <td colspan="10" align="center"> <input type="button" class="print" onclick="open_seccode_diag()" value="Enter Security Code"> </td> </tr> </table> </div> </div> <br> <br> <br> <div id="seccode_diag" style="display: none;"> <table><tr><td style="width:110px;">Select Program</td><td><select class="input" style="margin-right:10px;" id="seccode_path"><option value="payroll/bridge/">Payroll</option><option value="hris/bridge/">Human Resource Information System</option><option value="tkm/bridge/">Time Keeping Management</option></select></td></tr></table></div> <div id="diag_subsidiary" style="display:none;"> <table style="width:100%"> <!-- <tr> <td colspan="100"><i>Note: Only subsidiaries with <i id="subdry_note"></i> database connection setup.</i></td> </tr> --> <tr> <td><b>Subsidiary</b></td> <td><select id="pay_subdrycde" name="pay_subdrycde" class="input"></select></td> </tr> </table> </div> <!-- <footer> <div class="ftr_con" style='font-size:11px;width:60%'> <p>Copyright © 2015, LEE Systems Technology Ventures</p> <p align='right' style='padding-right : 18px;font-size : 11px;font-weight : bold;'>IP Details : 10.0.0.18</p> </div> </footer> --> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 222 bytes. |
GET http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php HTTP/1.1
Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,055 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=UTF-8 |
| Response Body - size: 34,194 bytes. |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "/strict.dtd">
<html> <head> <title>LST</title> <link REL="SHORTCUT ICON" HREF="images/lst_logo.ico"> <style type="text/css"> html{ font-family: Arial, Helvetica, sans-serif; height: 100%; } a{ text-decoration: none; } .applist_body{ background : white; height: 500px; } .applist_all{ height : 100%; display: inline-block; } .div_applist_header{ vertical-align :middle; height : 50px; } .applist_button_border{ height : 60%; /*border: 2px outset #f2f0f0;*/ padding : 20px; border-top-left-radius:7em; border-top-right-radius:0em; border-bottom-right-radius:7em; border-bottom-left-radius:0em; display: inline-block; /*background : #e5e3e3;8*/ border-top-style:solid; border-top-width:15px; border-top-color:#003300; border-left-style:solid; border-left-width:1px; border-left-color:#003300; border-right-style:solid; border-right-width:30px; border-right-color:#006633; border-bottom-style:solid; border-bottom-width:1px; border-bottom-color:#006633; } .applist_button{ /*margin-right: auto;*/ /*padding : 5px;*/ /*background: #ffffff;*/ /* for non-css3 browsers */ /*background: #627d4d;*/ /*background: #fe941b;*/ /*-webkit-border-radius: 6px;*/ /*-moz-border-radius: 6px;*/ /*border-radius: 8px;*/ /* border:1px inset;*/ display:inline-block; width : 120px; height : 170px; cursor : pointer; /*box-shadow: 0 2px 4px rgba(0,0,0,0.5);*/ transition: all 0.15s linear; overflow: hidden; } .applist_logout{ background: transparent; /* for non-css3 browsers */ cursor : pointer; font-family : Arial; } .applist_table{ width:800px; height:100px; } .applist_table td{ padding : 0px; } .applist_gradient{ /* filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#ffffff'); /* for IE */ /* background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#fff)); /* for webkit browsers */ /* background: -moz-linear-gradient(top, #ccc, #fff); /* for firefox 3.6+ */ /*height: 100%;*/ width: 100px; height: 100px; display: flex; justify-content: center; align-items: center; border-radius: 50%; } .applist_button_img{ width : 60px; height : 60px; margin: 10px auto 10px; transition: all 0.2s; /*transform: scale(0.75);*/ } .applist_button:hover{ /*box-shadow: 0 3px 20px rgba(0,0,0,0.4), 0 7px 13px rgba(0,0,0,0.2);*/ opacity: 0.8; } .applist_button:hover img { transform: rotateY(180deg); /*-webkit-filter: blur(0.05em);*/ } .applist_logout:hover{ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; cursor : pointer; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .applist_circle { position: absolute; margin-top:-30px; margin-left:-20%; width: 300px; height: 300px; -moz-border-radius: 500px; -webkit-border-radius: 500px; border-radius: 500px; border-top: #383838 20px solid; border-right: #383838 20px solid; border-bottom: #383838 20px solid; border-left: #383838 20px solid; background:#484848 ; } .applist_footer{ font-family:"Verdana", verdana, sans-serif; font-size:15px; font-weight:bold; } .admin_label { width: 100%; height: calc(100% - 120px); background: #fff; /*border-bottom: 1px solid #627d4d;*/ z-index: 10; display: flex; } .admin_label p { /*margin: 13px auto 0;*/ margin: 0 auto; /*padding: 10px;*/ white-space: normal; font-size: 13px; align-self: center; } :root { --cuscol: #87c43e; --progh: 50px; --footer: 50px; --navtop: 2vh; /*--max: 100%;*/ } * { margin: 0; padding: 0; box-sizing: border-box; font-size: 13px; font-family: 'Calibri'; } img { /* width: var(--max); height: var(--max); object-fit: contain; */ } select, input, button { outline: none; } ._textbox { border: 1px solid transparent; border-bottom: 1px solid #ccc; padding: 8px 10px; background: transparent; } .prog { width: 100vw; height: var(--progh); /*margin-top: var(--navtop);*/ margin: calc(var(--navtop) - 1vh) auto var(--navtop); /*position: fixed;*/ /*top: 1vh;*/ display: flex; justify-content: center; } .prog .progicon { width: var(--progh); height: var(--progh); margin: 0 15px; border-radius: 50%; /*border: 1px solid #ccc;*/ box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.3); /*overflow: hidden;*/ } .progicon .label { text-align: center; display: block; width: 100%; height: 30px; display: flex; justify-content: center; align-items: center; } .progicon .label span { font-size: 10px; } .loginwrapper { width: 100%; margin-top:1rem; /* height: calc(100vh - (var(--navtop) + (var(--progh)*1.5) + var(--footer))); */ position: relative; padding: 0 15vw; display: flex; flex-direction: column; justify-content: space-between; align-items: center; /* flex-wrap: wrap; */ } .loginwrapper > div { width: calc(100% / 2); display: flex; justify-content: center; align-items: center; } .left { flex-direction: column; display: none; } .right{ margin: auto; } .logo { /* width: 400px; height: 160px; */ /* margin: 20px auto; */ /*border: 1px solid #000;*/ } .companyname { color: var(--cuscol); font-size: 25px; } .logincontainer { width: 350px; background: #fff; padding: 2rem; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 2px 1px rgba(0,0,0,0.1); } .logincred { width: var(--max); margin: 40px 0 25px; } .top header { font-size: 28px; } .inputwrapper { width: var(--max); height: auto; display: flex; align-items: center; margin: 35px 0; position: relative; } .inputwrapper input, .inputwrapper select { width: var(--max); z-index: 2; padding: 8px 1px; font-weight: bold; } .inputwrapper span { display: block; width: var(--max); position: absolute; z-index: 1; color: #999; transition: all 0.3s; } .inputwrapper .underline { position: absolute; bottom: -1px; left: 0; width: var(--max); height: 1px; background: #87c43e; transition: transform 0.3s, opacity 0.1s; transform: scaleX(0); opacity: 0; } .inputwrapper .underline.full { transform: scaleX(1); opacity: 1; } .btngrp { display: flex; justify-content: space-between; align-items: center; } .loginbtn, .loginbtn * { cursor: pointer; } .loginbtn { position: relative; overflow: hidden; background: var(--cuscol); } .loginbtn input { width: 100px; padding: 6px 0; color: #fff; border: none; background: transparent; position: relative; z-index: 2; } .licagrmnt { color: #0c56f5b1; /* font-weight: bold; */ cursor: pointer; } .licagrmnt_container { position: absolute; top: 0; left: 0; /* width: 100vw; height: 100vh; */ padding: 0 25vw; background: #fff; /* background: rgb(114, 114, 114); */ z-index: 100; /* overflow-y: auto; */ /* overflow-y: scroll; */ counter-reset: x; display: flex; flex-direction: column; } .licagrmnt_container > header { /*position: absolute;*/ /*top: 0; left: 0;*/ width: 100%; height: auto; font-size: 25px; padding: 10px 0 15px; font-weight: bold; text-align: center; border-bottom: 1px solid #ccc ; /* display: flex; justify-content: center; align-items: center; */ } .licagrmnt_container article { overflow: scroll; width: 100%; scroll-behavior: smooth; padding: 15px 0 100px; } .licagrmnt_container article::-webkit-scrollbar{ overflow: hidden; } .licagrmnt_container article .xcount::before { counter-increment: x; content: counter(x) '. '; } .licagrmnt_container article section { margin-bottom: 40px; } .licagrmnt_container article section > label { font-weight: bold; font-size: 20px; margin-bottom: 15px; display: block; } .licagrmnt_container article section p { text-indent: calc(20px * 2); line-height: 1.4; margin-bottom: 15px; } .licagrmnt_container article section p, .licagrmnt_container article section li { text-align: justify; } .licagrmnt_container article section strong { text-align: center; } .licagrmnt_container article section ul.circle { list-style-type: circle; padding: 0 0 0 20px; } .licagrmnt_container > div { position: fixed; bottom: 0; left: 0; width: 100%; height: 50px; background: #fff; display: flex; justify-content: center; align-items: center; } .licagrmnt_container > div:after { /*content: '';*/ width: 100vw; height: 70px; background: linear-gradient(transparent, rgba(0,0,0,0.5)); position: absolute; z-index: -1; } .closebtn { width: 60px; height: 60px; border-radius: 50%; position: absolute; bottom: 7vh; display: flex; justify-content: center; align-items: center; cursor: pointer; background: #fff; transition: all 0.3s; } .closebtn svg { /*width: 100%; height: 100%;*/ transform: scale(0.4); stroke: #000; stroke-width: 3; transition: all 0.3s; } .closebtn:hover { background: #87c43e; } .closebtn:hover svg { stroke: #fff; } footer { /* margin-top: 120px; */ width: 100%; height: var(--footer); /*position: fixed;*/ /*bottom: 0; left: 0;*/ display: flex; justify-content: center; align-items: center; background: transparent; } .inputwrapper span.inputfocus { transform: translate(-35px, -25px) scale(0.8); font-weight: bold; /* color: var(--cuscol); */ } .explode { display: block; position: absolute; background: hsl(90, 53%, 40%); /* background: hsl(216, 53%, 40%); */ border-radius: var(--max); transform: scale(0); z-index: 1; } .explode.animate { animation: explodeAnimate 0.65s linear; } @keyframes explodeAnimate { 100% {opacity: 0; transform: scale(2.5);} } ._fadeout { opacity: 0; } ._strtoupper { text-transform: uppercase; } @media only screen and (max-width: 1024px) { .licagrmnt_container { padding: 0 15vw; } .licagrmnt_container header { padding: 5px 0 10px; } } @media only screen and (max-width: 850px) { .loginwrapper { align-items: center; flex-direction: column; height: auto; padding: 0; } .left { margin: 4vh 0; } .loginwrapper > div { width: calc((100% / 3) * 2); } .logo { width: 300px; height: 120px; } footer { margin-top: 6vh; } .licagrmnt_container { padding: 0 5vw; } .licagrmnt_container header { padding: 2px 0 5px; } } @media only screen and (max-width: 600px) { .companyname { display: none; } } @media only screen and (max-width: 480px) { .loginwrapper > div { width: calc((100% / 7) * 6); } } .table_disp{ font-family: arial; font-size: 12px; border: 1px; border-collapse: collapse; cursor: pointer; } .table_disp th{ background-color: #bdbdbd; color: black; height:30px; } .table_disp tbody tr:hover{ background-color:silver; } #login_frame{ border: 1px solid #696; padding: 60px 0; text-align: center; width: 400px; -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 10px; -webkit-box-shadow: #666 0px 2px 3px; -moz-box-shadow: #666 0px 2px 3px; box-shadow: #666 0px 2px 3px; background : white; behavior: url(./css/PIE.htc); } .gp{ width : 80%; } #login_frame table{ align-items : center; } .div_border_back{ /*border: 0px solid gainsboro;*/ /*background : #204f1e;*/ width : 350px; height : 280px; /*-webkit-border-radius: 8px;*/ /*-moz-border-radius: 8px;*/ /*border-radius: 10px;*/ -webkit-box-shadow: #666 0px 3px 10px; -moz-box-shadow: #666 0px 3px 10px; box-shadow: #666 0px 3px 10px; } .div_border_front1{ background : #3a6f8f; width : 100%; height : 4%; -webkit-border-top-left-radius: 8px; -moz-border-top-left-radius: 8px; border-top-left-radius: 10px; -webkit-border-top-right-radius: 8px; -moz-border-top-right-radius: 8px; border-top-right-radius: 10px; } .div_border_front2{ /*background : white;*/ width : 100%; height : 96%; -webkit-border-bottom-left-radius: 6px; -moz-border-bottom-left-radius: 6px; border-bottom-left-radius: 8px; -webkit-border-bottom-right-radius: 6px; -moz-border-bottom-right-radius: 6px; border-bottom-right-radius: 8px; } .gp{ width : 96%; border : solid 1px rgba(98, 125, 77, 0.5) !important; margin-bottom: 15px; } .sublabel{ color : #555555; } .headlabel{ color : #555555; } :root { --cuscol: #052b00; --progh: 50px; --footer: 50px; --navtop: 2vh; --max: 100%; } .licagrmnt { /* color: var(--cuscol); */ } /* .inputwrapper .underline { background-color: var(--cuscol); } */ * { font-family: unset; } .div_version{ display: flex; justify-content: flex-end; } .tbl_versions, .tbl_versions td, .tbl_versions th { border: 1px solid #ddd; text-align: left; } .tbl_versions { border-collapse: collapse; width: 100%; } .tbl_versions th, .tbl_versions td { padding: 5px; } </style> <script type="text/javascript" src="jquery-1.10.2.min.js"></script> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon"> <link rel="icon" href="img/favicon.ico" type="image/x-icon"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <!-- <link rel="stylesheet" type="text/css" href="css/login_page.css"> --> </head> <body> <!-- <div class="prog"> </div> --> <div class="loginwrapper"> <div class="left"> <div class="logo"> <img src="lst.png"> </div> </div> <div class="right"> <!-- <form name="myform" id="myform" action="https://www.lstviweb.com/online/redfiel/login.php" method="POST"> --> <form name="myform" id="myform" action="" method="POST"> <div class="logincontainer"> <div class="top"> <header>Login</header> <span>Please enter a valid USER ID and Password</span> </div> <div class="logincred"> <div class="inputgrp"> <div class="inputwrapper"> <input type="text" name="dsply_gl_comcde" id="dsply_gl_comcde" class="_textbox _strtoupper" autocomplete="off" value=''> <input name="gl_comcde" id="gl_comcde" class="_textbox _strtoupper" autocomplete="off" value=''> <span class="inputfocus">Company ID</span> <div class="underline full"></div> </div> <div class="inputwrapper"> <input type="text" name="txtusrcde" id="txtusrcde" class="_textbox _strtoupper" autocomplete="off"> <span>User ID</span> <div class="underline"></div> </div> <div class="inputwrapper"> <input type="password" name="txtusrpwd" id="txtusrpwd" class="_textbox"> <span>Password</span> <div class="underline"></div> </div> <div class="inputwrapper"> <span style="text-align: center;"> <label style="color: red;" id="lbl_valmsg"> </label> </span> </div> </div> <div class="btngrp"> <div> <span id="forgot" onclick="forgot_password()" style="cursor: pointer;">Forgot Password ?</span> </div> <div class="loginbtn"> <!-- <input type="button" id="loginBtn" name="" class="" onclick="login_click();" value="Login"> --> <input type="button" id="loginBtn" name="" class="" value="Login"> </div> </div> </div> <div class=""> <p>By using this program you agree to the terms and conditions of the <span class="licagrmnt">license agreement</span>.</p> </div> <div style="padding: 5px;"> <div style="float: left; cursor: pointer;"> <!-- <span onclick="view_versions()"><u>versions</u></span> --> </div> <div style="float: right;"> <!-- <span>v</span> --> </div> </div> </div> <input name="browser" id="browser" value=""> <input name="module" id="module" value=""> <input name="txt_event" id="txt_event" value=""> <input name="txt_url" id="txt_url" value=""> </form> </div> <footer> <span>Copyright © 2021 LEE Systems Technology Ventures Inc</span> </footer> <div class="licagrmnt_container" style=" width:100vw; display:none;"> <header>SOFTWARE LICENSE AGREEMENT FOR LEE SYSTEMS TECHNOLOGY VENTURES INCORPORATED SOFTWARE</header> <article> <section> <label> License Agreement </label> <p> You should carefully read the following terms and conditions before using this software. This Lee Systems Technology Ventures Incorporated Software License Agreement ("SLA") is a legal agreement between you (either an individual or a single entity) and Lee Systems Technology Ventures Incorporated for this Software product which will be referred in this agreement as the "SOFTWARE". Unless you have a different license agreement signed by Lee Systems Technology Ventures, your use of this software indicates your acceptance of this license agreement and warranty. <strong>IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, DO NOT USE THE SOFTWARE</strong>. </p> </section> <section> <label> Governing Law </label> <p> You should carefully read the following terms and conditions before using this software. This Lee Systems Technology Ventures Incorporated Software License Agreement ("SLA") is a legal agreement between you (either an individual or a single entity) and Lee Systems Technology Ventures Incorporated for this Software product which will be referred in this agreement as the "SOFTWARE". Unless you have a different license agreement signed by Lee Systems Technology Ventures, your use of this software indicates your acceptance of this license agreement and warranty. <strong>IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, DO NOT USE THE SOFTWARE</strong>. </p> <p> This agreement shall be governed by the laws of the Republic of the Philippines. </p> </section> <section> <label> SOFTWARE PRODUCT LICENSE </label> <p> The software product is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The software is licensed, NOT SOLD. </p> </section> <section> <label> Use and Registration </label> <p> This is not a free software. You agree to register this software in the website of Lee Systems Technology Ventures (www.lstventures.com). </p> </section> <section> <label class="xcount"> GRANT OF LICENSE. This SLA grants you the following rights: </label> <p> Lee Systems Technology Ventures grants you as an individual , a personal, non-exclusive license to use the software product. You may install and use one copy of the software on a single computer. You may also store or install a copy of the Software Product, such as a network server or back-up disk, used only for the said purpose. A license for the software product may not be shared or used concurrently on different computers. </p> </section> <section> <label class="xcount"> DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS. </label> <p> <ul class="circle"> <li> Not for Resale nor Sublease. you may not resell, sublease or otherwise transfer for value, the software product. </li> <li> You acknowledge that Lee Systems Technology Ventures Software contains proprietary and confidential information that is protected by applicable intellectual property and other laws. Except as expressly permitted herein, you agree not to copy, modify, rent, lease, loan, sell, distribute or create derivative works based on this Software, in whole or in part. </li> <li> You agree not to translate, reverse engineer, decompile, disassemble or make derivative works from this software. You agree not to modify this Software in any manner or form, or to use modified versions of this Software including (without limitation) for the purpose of obtaining unauthorized access to the data and unlimited use of this program. </li> <li> Separation of Components. The software product is licensed as a single product. Its component parts may not be separated for use on more than one computer. </li> <li> Lee Systems Technology Ventures is not responsible for obtaining and maintaining the computer equipment and accessories used by the Software. </li> </ul> </p> </section> <section> <label class="xcount"> UPGRADES OR MODIFICATIONS </label> <p> If the software is upgraded or modified, you must be properly licensed to use a product identified by Lee Systems Technology Ventures as being eligible for the upgrade/modified in order to use the software. You may use the resulting upgraded/modified product only in accordance with the terms of this SLA. If the software is an upgrade/modified of a component of a package of software programs that you licensed as a single product, the software may be used and transferred only as part of that single product package and may not be separated for use on more than one computer. </p> </section> <section> <label class="xcount"> COPYRIGHT & INTELLECTUAL PROPERTY </label> <p> Republic Act No. 8293. All title and copyrights in and to the software products (including but not limited to any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the software), the accompanying printed materials, and any copies of the software are owned by Lee Systems Technology Ventures or its suppliers. All title and intellectual property rights in and to the content which may be accessed through use of the Software Product is the property of the respective content owners and may be protected by applicable copyright or other intellectual laws and treaties. The software is protected by copyright laws and international treaty provisions. Therefore, you must treat the software like any other copyrighted material except that you may install the software on a single computer provided you keep the original solely for backup or archival purposes. You may not copy the printed materials accompanying the software. </p> </section> <section> <label class="xcount"> LIMITED WARRANTY </label> <p> The Software is provided "AS IS" and without warranties as to performance or merchantability or any other warranties whether expressed or implied. </p> </section> <section> <strong> <p> LEE SYSTEMS TECHNOLOGY VENTURES INCORPORATED ENTIRE LIABILITY TO YOU AND YOUR EXCLUSIVE REMEDY SHALL BE THE REPLACEMENT OF ANY DEFECTIVE MEDIA(SUCH AS CD-ROM) RETURNED BY YOU TO LEE SYSTEMS TECHNOLOGY WITH PROOF OF PURCHASE DURING THE 30-DAY LIMITED WARRANTY PERIOD. IN NO EVENT SHALL THE LIABILITY OF LEE SYSTEMS TECHNOLOGY ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE EXCEED THE FEE PAID BY YOU FOR THIS LICENSE. </p> <p> NO OTHER WARRANTIES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, LEE SYSTEMS TECHNOLOGY VENTURES AND ITS REFERRALS DISCLAIM ALL WARRANTIES AND CONDITIONS, WHETHER EXPRESS OR IMPLIED, STATUTORY OR OTHERWISE, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY , FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE PRODUCT, AND THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES. LEE SYSTEMS DISCLAIMS ANY WARRANTY AS TO THE PERFORMANCE OF THE SOFTWARE OR AS TO THE RESULTS THAT MAY BE OBTAINED BY USING THE SOFTWARE. THE ENTIRE RISK AS TO THE INSTALLATION, QUALITY, USE AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. IN NO EVENT SHALL LEE SYSTEMS TECHNOLOGY VENTURES OR ITS STAFF, REFERRALS AND REPRESENTATIVES BE LIABLE FOR ANY SPECIAL, INCIDENTAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER ( INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE PRODUCT OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF LEE SYSTEMS TECHNOLOGY VENTURES HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. LEE SYSTEMS TECHNOLOGY GRANTS NO WARRANTY AND SHALL HAVE NO LIABILITY WHATSOEVER BEYOND THE 30 DAY PERIOD WARRANTY. </p> </strong> </section> </article> <div> <div class="closebtn"> <svg height="50" width="50"> <line x1="0" y1="0" x2="50" y2="50"/> <line x1="50" y1="0" x2="0" y2="50"/> Sorry, your browser does not support inline SVG. </svg> </div> <span>Lee Systems Technology Ventures</span> </div> </div> </div> <script type="text/javascript"> window.onload = () => { const username = document.getElementById('txtusrcde'); const password = document.getElementById('txtusrpwd'); const companyid = document.getElementById('gl_comcde'); const display_companyid = document.getElementById('dsply_gl_comcde'); const errorMsg = document.getElementById("lbl_valmsg"); const loginBtn = document.getElementById('loginBtn'); const forgotBtn = document.getElementById('forgot'); // console.log(username) // username.addEventListener('change', () => console.log(username.value)) // password.addEventListener('change', () => console.log(password.value)) display_companyid.focus() loginBtn.addEventListener('click', () => login()); forgotBtn.addEventListener('click', () => forgot_password()) //window listener window.addEventListener('keydown', (e) => { if(e.ctrlKey == true && e.keyCode == 122 ){ let mainprogdir = 'https://vps1.lstventures.com/online/onedb/webapp/'; window.open(mainprogdir+'lstv_params.php', '_blank'); } else if(e.keyCode == 13){ login(); console.log(e) } }) function login(){ var xparams = jQuery('#myform *').serialize(); xparams += "&event_action=login"; $.ajax({ dataType: "json", type: "post", url: "login_ajax.php", data: xparams, success : function (xretobj) { if (xretobj.bool == false) { errorMsg.innerText = 'Contact LSTV Inc. for assistance'; } else { errorMsg.innerText = '' if(display_companyid.value == ''){ // console.log(errorMsg) display_companyid.focus(); errorMsg.innerText = 'Company ID should not be empty'; } else if( username.value == ''){ // console.log(errorMsg) username.focus() errorMsg.innerText = 'User ID should not be empty' } else if( password.value == '' ){ // console.log(errorMsg) password.focus() errorMsg.innerText = 'Password should not be empty' } else{ loginBtn.disabled = true; loginBtn.value = "Please wait..."; var mainprogdir = xretobj.mainprogdir; // var mainprogdir = ''; var mainpage = 'http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php?'; var dbprefix = ''; document.getElementById("gl_comcde").value = dbprefix+dsply_gl_comcde.value; // Add the DB Prefix in Company ID // document.getElementById("gl_comcde").value = dsply_gl_comcde.value; // Add the DB Prefix in Company ID document.forms.myform.txt_event.value= 'login'; document.forms.myform.txt_url.value= mainpage; document.forms.myform.action= mainprogdir+'login_validate.php'; document.forms.myform.method='post'; document.forms.myform.target='_self'; document.forms.myform.submit(); } } } }) } function forgot_password(){ var xparams = jQuery('#myform *').serialize(); xparams += "&event_action=login"; $.ajax({ dataType: "json", type: "post", url: "login_ajax.php", data: xparams, success : function (xretobj) { if (xretobj.bool == false) { errorMsg.innerText = 'Contact LSTV Inc. for assistance'; } else { // let mainprogdir = ''; // var dbprefix = ''; var dbprefix = ""; var mainprogdir = xretobj.mainprogdir; document.getElementById("gl_comcde").value = dbprefix+dsply_gl_comcde.value; // Add the DB Prefix in Company ID document.forms.myform.action = mainprogdir+'login_forgot.php'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } } }); } } $(function() { // ripple click for buttons var explode, xpld, m, x, y; $('.loginbtn').each(function() { $(this).click(function(e) { $(this).find('.explode').length == 0 ? $(this).prepend('<span class=\'explode\'></span>') : ''; xpld = $(this).find('.explode'); xpld.removeClass('animate'); !xpld.height() && !xpld.width() ? m = Math.max($(this).outerWidth(), $(this).outerHeight()) : ''; xpld.css({ height: m, width: m }); x = e.pageX - $(this).offset().left - xpld.width() / 2; y = e.pageY - $(this).offset().top - xpld.height() / 2; // console.log(e); $(this).find('.explode').css({ top: y + 'px', left: x + 'px' }).addClass('animate'); }) }); // ends here // transition of placeholder up to the top of input text box and effects of underline located aat the bottom of the input tag. $('.inputwrapper').each(function() { var input = $(this).find('input').val(); if (input != "") { $(this).find('input').siblings('span').addClass('inputfocus'); $(this).find('input').siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); } $(this).find('input').on({ focus: function() { $(this).siblings('span').addClass('inputfocus'); $(this).siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); }, blur: function() { if ($(this).val() != '') { $(this).siblings('span').addClass('inputfocus'); $(this).siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); } else { $(this).siblings('span').removeClass('inputfocus'); $(this).siblings('.underline').removeClass('full'); } } }) }); // ends here // show the licence agreement $('.licagrmnt').click(function() { $('.licagrmnt_container').fadeIn(); }); // ends here // close the licence agreement $('.closebtn').click(function() { $(this).parents('.licagrmnt_container').fadeOut(); }) $('body').on('keydown', function(e) { var esc = e.which || e.keyCode; esc == 27 ? $('.licagrmnt_container').fadeOut() : ''; }) $('.licagrmnt_container').fadeOut() // ends here // alert($(window).width()+' x '+$(window).height()); }); </script> </body> <html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/ajax_menu.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 289 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/ajax_menu.php HTTP/1.1
Proxy-Connection: keep-alive X-Requested-With: XMLHttpRequest Origin: http://192.168.2.47 Content-Length: 11 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,205 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 656 Connection: close Content-Type: text/html; charset=utf-8 |
| Response Body - size: 656 bytes. |
{"form":"<aside><a><h3 class='menu_has_mensub active' id='389' onclick=\"load_page2('COD00','389')\" style='cursor:pointer'>Code Definition<i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><\/h3><\/a><\/h3><\/a><a><h3 class='menu_has_mensub ' id='30' onclick=\"load_page2('PIM00','30')\" style='cursor:pointer'>Employees<i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><\/h3><\/a><\/h3><\/a><a><h3 class='menu_has_mensub ' id='57' onclick=\"load_page2('UTL00','57')\" style='cursor:pointer'>Utilities<i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><\/h3><\/a><\/h3><\/a><\/aside>","active_menrecid":"389"}
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/cm_bread_ajax.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 664 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/cm_bread_ajax.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Content-Length: 34 Accept: application/json, text/javascript, */*; q=0.01 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Origin: http://192.168.2.47 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 34 bytes. |
cap=Position Type File&url=current
|
| Response Header - size: 1,076 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:42 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 167 Content-Type: text/html; charset=UTF-8 |
| Response Body - size: 167 bytes. |
"<a href=\"#\" onclick=load_page(\"main.php\",\"\",\"\",\"\",\"1\")>Dashboard<\/a><div class=\"breadcrumb_divider\"><\/div> <a class='current'>Position Type File<\/a>"
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/db_field_length_checker_ajax.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 680 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/db_field_length_checker_ajax.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Content-Length: 113 Accept: application/json, text/javascript, */*; q=0.01 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Origin: http://192.168.2.47 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 113 bytes. |
link_hash_id=cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85&link_id=&tablename=positiontypefile
|
| Response Header - size: 1,161 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:42 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 2 Content-Type: text/html; charset=utf-8 |
| Response Body - size: 2 bytes. |
[]
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/menu_view_ajax.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 665 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/menu_view_ajax.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Content-Length: 22 Accept: application/json, text/javascript, */*; q=0.01 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Origin: http://192.168.2.47 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 22 bytes. |
menid=389&mensub=COD00
|
| Response Header - size: 1,187 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:42 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 2558 Content-Type: text/html; charset=utf-8 |
| Response Body - size: 2,558 bytes. |
{"form":"<div id=\"menu2_sub\"><div class='mendiv'><p>General Setup<\/p><ul><li ><a id='men_22' onclick=\"load_page('mf_area.php','Area','','22')\">Area<\/a><\/li><li ><a id='men_201' onclick=\"load_page('mf_city.php','City','','201')\">City<\/a><\/li><li ><a id='men_256' onclick=\"load_page('mf_cvlstatfile.php','Civil Status File','','256')\">Civil Status File<\/a><\/li><li ><a id='men_170' onclick=\"load_page('mf_country.php','Country','','170')\">Country<\/a><\/li><li ><a id='men_28' onclick=\"load_page('mf_dept.php','Department','','28')\">Department<\/a><\/li><li ><a id='men_27' onclick=\"load_page('mf_division.php','Division','','27')\">Division<\/a><\/li><li ><a id='men_41' onclick=\"load_page('mf_employmenttype.php','Employment Type','','41')\">Employment Type<\/a><\/li><li ><a id='men_60' onclick=\"load_page('mf_nationality.php','Nationality','','60')\">Nationality<\/a><\/li><li ><a id='men_283' onclick=\"load_page('mf_postype.php','Position Type','','283')\">Position Type<\/a><\/li><li ><a id='men_254' onclick=\"load_page('mf_prefix.php','Prefix','','254')\">Prefix<\/a><\/li><li ><a id='men_265' onclick=\"load_page('mf_province.php','Province','','265')\">Province<\/a><\/li><li ><a id='men_257' onclick=\"load_page('mf_region.php','Region','','257')\">Region<\/a><\/li><li ><a id='men_266' onclick=\"load_page('mf_regionprovcity_con.php','Region,Province City Con.','','266')\">Region,Province City Con.<\/a><\/li><li ><a id='men_23' onclick=\"load_page('mf_religion.php','Religion','','23')\">Religion<\/a><\/li><li ><a id='men_255' onclick=\"load_page('mf_suffix.php','Suffix','','255')\">Suffix<\/a><\/li><\/ul><\/div><div class='mendiv'><p>Employees<\/p><ul><li ><a id='men_32' onclick=\"load_page('mf_bankacct.php','Bank','','32')\">Bank<\/a><\/li><li ><a id='men_62' onclick=\"load_page('mf_accountype.php','Bank Account Type','','62')\">Bank Account Type<\/a><\/li><li ><a id='men_24' onclick=\"load_page('mf_status.php','Employee Status','','24')\">Employee Status<\/a><\/li><li ><a id='men_58' onclick=\"load_page('mf_leave.php','Leaves','','58')\">Leaves<\/a><\/li><li ><a id='men_190' onclick=\"load_page('mf_paycycle.php','Payroll Cycle','','190')\">Payroll Cycle<\/a><\/li><li ><a id='men_26' onclick=\"load_page('mf_payrollgrp.php','Payroll Group','','26')\">Payroll Group<\/a><\/li><li ><a id='men_29' onclick=\"load_page('mf_pos.php','Position','','29')\">Position<\/a><\/li><li ><a id='men_250' onclick=\"load_page('mf_taxcode.php','Tax Code','','250')\">Tax Code<\/a><\/li><\/ul><\/div><\/div>","menwidth":null}
|
| Instances | 7 |
| Solution |
Ensure that your web server, application server, load balancer, etc. is properly configured to set the Content-Security-Policy header.
|
| Reference |
http://www.w3.org/TR/CSP2/
http://www.w3.org/TR/CSP/ http://caniuse.com/#search=content+security+policy http://content-security-policy.com/ https://github.com/shapesecurity/salvation https://developers.google.com/web/fundamentals/security/csp#policy_applies_to_a_wide_variety_of_resources |
| Tags |
OWASP_2021_A05
OWASP_2017_A06 |
| CWE Id | 693 |
| WASC Id | 15 |
| Plugin Id | 10055 |
|
Medium |
CSP: script-src unsafe-inline |
|---|---|
| Description |
script-src includes unsafe-inline.
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 234 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php HTTP/1.1
Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 19,386 bytes. |
<style type="text/css">
.div_border_front2 table:nth-child(2) input[type="button"] { color: #fff; background: #627d4d; } #forgot { color: ; } .applist_gradient { background: #627d4d; } .head_title { color: #fff; } .head_title, .apptitle { text-transform: uppercase; } .head_title1, .apptitle1 { text-transform: uppercase; } .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header { background: #627d4d; } .ui-widget-header { background: #627d4d !important; color: #fff; } .ui-dialog .ui-dialog-buttonpane button { color: #fff; } header#header,.theme_header { background: #627d4d !important; } /*header#header2 { background: #627d4d; }*/ ._program li { color: #fff; } .button1 { color: #fff; background: #627d4d; } ._figure span:first-child { color: #fff; } #hris_sub_container ul figure { background: #627d4d; } .dc_empstatico { color: ; /* colored */ } .dbg_empstatico { background: #627d4d; /* colored */ } ::-webkit-scrollbar { background: #627d4d; } ::-webkit-scrollbar-thumb { background: #627d4d; } #hris_sub_container header { color: ; /* colored */ } .gp, .ui-widget-header, .fc-day-header, { background: #627d4d; } .ui-widget-header, .fc-day-header { color : white !important;; } </style><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "/strict.dtd"> <html> <head> <title>WEBTEMPLATE</title> <link REL="SHORTCUT ICON" HREF="./images/lst_logo.ico" /> <link href='../css/applist.css' media='screen' type='text/css' /> <!-- include a theme, can be included into the core instead of 2 separate files --> <link rel="stylesheet" href="lib/alertify/css/themes/bootstrap.min.css" /> <link rel="stylesheet" href="./css/modified_layout.css" type="text/css" media="screen" /> <link rel='stylesheet' type='text/css' media='screen' href='./css/layout.css'/> </head> <body> <form name='myform' id='myform' method='post'> <link rel='stylesheet' type='text/css' href='css/login.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_view.css?v=20220209161346' /><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/layout.css?v=20220209161346' /><script type='text/javascript' src='javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='lib/pager.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/pager.css?v=20220209161346' /><script type='text/javascript' src='lib/alertify/alertify.min.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_page.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/applist.css?v=20220209161346' /> <!-- <link rel="stylesheet" type="text/css" href="css/login_page.css"> --> <input name='xpage_uri' id='xpage_uri'> <input name='xpage_dir' id='xpage_dir'> <input name='txt_action' id='txt_action'> <input name='txtappcde' id='txtappcde'> <input name='txtoutsource' id='txtoutsource'> <input id='seccode_validated' value=""> <input id="gl_comcde" name="gl_comcde" value="ATESTWEBTKM"> <!-- <input type="hidden" id="tmp_redirect_path" name="tmp_redirect_path"> --> <!-- <input type="hidden" id="tmp_appcde" name="tmp_appcde"> --> <style type="text/css"> .seccode_continue:hover { color: white; background-color: #1947D1 !important; border: 0; } .seccode_continue { background-color: #335CD6 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; /* border-radius: .3em; */ width: auto; min-width: 70px; } .seccode_cancel:hover { color: white; background-color: #990000 !important; border: 0; } .seccode_cancel { /* border-radius: .3em; */ background-color: #aa4935 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; width: 70px; /*margin-right: 3px;*/ } </style> <script type='text/javascript'> //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "WEBAPP"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function() {}; jQuery(document).ready(function() { if (jQuery('#seccode_validated').val() == 0 && jQuery('#seccode_validated').val() != '') { alertify.alert('Accesing any programs must start here.'); } jQuery('#seccode_diag').dialog({ title: "Security Code", resizable: false, autoOpen: false, height: 'auto', width: 'auto', position: { my: "center", at: "center", of: window }, modal: true, open: function() { jQuery('body').css('overflow', 'hidden'); jQuery('.ui-button-icon-primary.ui-icon.ui-icon-closethick').closest('button').remove(); jQuery(this).closest('.ui-dialog').find('.seccode_cancel').focus(); }, close: function() { jQuery('body').css('overflow', 'auto'); }, buttons: [{ text: "Continue", "class": 'seccode_continue', click: function() { val_seccode_path(jQuery('#seccode_diag').find('#seccode_path')); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { jQuery('#seccode_diag').dialog('close'); } }, ] }); jQuery('#diag_subsidiary').dialog({ title: 'Select Subsidiary', width: 500, height: 'auto', draggable: false, resizable: false, autoOpen: false, modal: true, open: function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [{ text: "Proceed", "class": 'seccode_continue', click: function() { update_pay_subdrycde_link($(this).find('#pay_subdrycde').val()); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { $(this).dialog('close'); } }, ] }); }) function val_blank_session() { alertify.alert('You must login first.', function() { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) // window.open('login_view.php', '_self'); }) } function val_seccode(xloc, xcde) { var xdata = "event_action=val_seccode"; xdata += "&xloc=" + xloc; xdata += "&xcde=" + xcde; xdata += "&" + jQuery('#myform *').serialize(); return jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata }); } function val_seccode_path(selectObj) { var xdata = "event_action=val_seccode_path"; xdata += "&apploc=" + selectObj.val(); xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { if (xret.bridge_found) { // document.forms.myform.txtappcde.value=selectObj.find("option:selected").data('appcde'); document.forms.myform.action = selectObj.val(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { alertify.alert(selectObj.find(':selected').text(), xret.bridge_found_msg); } } }); } function open_seccode_diag() { var xdata = "event_action=validate_comcde"; xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { jQuery('#seccode_diag').dialog('open'); } }); } function transaction_click(xappcde, xloc, obj) { // alert(xappcde,xloc,obj); document.forms.myform.action = xloc; document.forms.myform.txtappcde.value = xappcde; if (jQuery(obj).hasClass('show_sub_diag') || xappcde == "PAY") { var xdata = "event_action=get_user_subdry&xappcde=" + xappcde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { $.unblockUI(); console.log(response) if (response.pass == true) { if (response.show_diag == true && response.has_access == true) { var subdry_note = "Payroll"; if(xappcde == "PAY_OUTSRC") { subdry_note = "Payroll Out Sourcing"; } jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); // jQuery('#diag_subsidiary').find('#subdry_note').html(subdry_note); jQuery('#diag_subsidiary').dialog('open'); } else if (response.show_diag == false && response.has_access == true) { blockui(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); update_pay_subdrycde_link($('#pay_subdrycde').val()); } } else { alertify.alert('You must have a subsidiary access to use the payroll program.'); } } }); } else { blockui(); //20190311 donita //add check update structure // if(xappcde != "PAY_OUTSRC" || xappcde != "PAY") // { update_empstatus(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action = "admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); // } // else // { // document.forms.myform.method='POST'; // document.forms.myform.target = '_self'; // document.forms.myform.submit(); // } } } function update_empstatus(subdrycde="") { var xdata= "event_action=update_empstatus&subdrycde="+subdrycde; jQuery.ajax({ type : 'post', data : xdata, url : 'login_applist_ajax.php', success : function (xretobj) { } }); } function logout_click() { alertify.confirm('Are you sure you want to logout?', function() { blockui(); var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) } }); }); } function update_pay_subdrycde_link(xsubdrycde) { blockui(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { var xappcde = $('#txtappcde').val(); var xdata = "event_action=update_pay_subdrycde_link&xappcde=" + xappcde; xdata += "&subdrycde=" + xsubdrycde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { jQuery('#diag_subsidiary').dialog('close'); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } }); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action="admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); } function admin_click(xloc) { document.forms.myform.action = xloc; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } function getclientdir(){ var xparams = 'txt_action=getclientdir'; return jQuery.ajax({ dataType: 'json', type: 'post', data: xparams, url : 'login_validate_redirect.php' }) } </script> <style> footer { width: 580px; margin: 0 auto 50px; } footer .ftr_con { margin: 20px auto 0; } footer .ftr_con p { text-align: center; } .appgrp { margin-top: 20px; display: flex; justify-content: center; align-items: center; } </style> <!-- <form id="myform"> </form> --> <div class='applist_body' align='center'> <div class='applist_all'> <div class="logo"> <img src='img/lst.png' style="width: 100%;height: 100%;"> </div> <table border='0' align='center'> <tr> <td align='center'> <table class='applist_table'> <tr> <td align='right' colspan='10'> <span class='applist_logout' onclick='logout_click()'><b>LOGOUT</b></span> </td> </tr> <tr> <td colspan='10'> <hr> </td> </tr> <tr> <td style='white-space:nowrap;' align='center'> <div class="appgrp"> <div class='applist_button' onclick="admin_click('admin/main.php')"> <div class='applist_gradient'> <img class='applist_button_img' src='images/admin.png'> </div> <div class='admin_label'> <p>Admin</p> </div> </div> <div class="applist_button show_sub_diag" onclick='transaction_click("PAY","payroll/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/PAY.png' ></div><div class='admin_label'><p>Payroll</p></div></div><div class="applist_button " onclick='transaction_click("HR","hris/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/hr_0.png' ></div><div class='admin_label'><p>Human Resource Information System</p></div></div><div class="applist_button " onclick='transaction_click("TKM","tkm/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/clock.png' ></div><div class='admin_label'><p>Time Keeping Management</p></div></div> </div> </td> </tr> </table> </td> </tr> <tr style="height:50px;"> <td colspan="100"></td> </tr> <tr> <td colspan="10" align="center"> <input type="button" class="print" onclick="open_seccode_diag()" value="Enter Security Code"> </td> </tr> </table> </div> </div> <br> <br> <br> <div id="seccode_diag" style="display: none;"> <table><tr><td style="width:110px;">Select Program</td><td><select class="input" style="margin-right:10px;" id="seccode_path"><option value="payroll/bridge/">Payroll</option><option value="hris/bridge/">Human Resource Information System</option><option value="tkm/bridge/">Time Keeping Management</option></select></td></tr></table></div> <div id="diag_subsidiary" style="display:none;"> <table style="width:100%"> <!-- <tr> <td colspan="100"><i>Note: Only subsidiaries with <i id="subdry_note"></i> database connection setup.</i></td> </tr> --> <tr> <td><b>Subsidiary</b></td> <td><select id="pay_subdrycde" name="pay_subdrycde" class="input"></select></td> </tr> </table> </div> <!-- <footer> <div class="ftr_con" style='font-size:11px;width:60%'> <p>Copyright © 2015, LEE Systems Technology Ventures</p> <p align='right' style='padding-right : 18px;font-size : 11px;font-weight : bold;'>IP Details : 10.0.0.18</p> </div> </footer> --> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 222 bytes. |
GET http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php HTTP/1.1
Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,055 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=UTF-8 |
| Response Body - size: 34,194 bytes. |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "/strict.dtd">
<html> <head> <title>LST</title> <link REL="SHORTCUT ICON" HREF="images/lst_logo.ico"> <style type="text/css"> html{ font-family: Arial, Helvetica, sans-serif; height: 100%; } a{ text-decoration: none; } .applist_body{ background : white; height: 500px; } .applist_all{ height : 100%; display: inline-block; } .div_applist_header{ vertical-align :middle; height : 50px; } .applist_button_border{ height : 60%; /*border: 2px outset #f2f0f0;*/ padding : 20px; border-top-left-radius:7em; border-top-right-radius:0em; border-bottom-right-radius:7em; border-bottom-left-radius:0em; display: inline-block; /*background : #e5e3e3;8*/ border-top-style:solid; border-top-width:15px; border-top-color:#003300; border-left-style:solid; border-left-width:1px; border-left-color:#003300; border-right-style:solid; border-right-width:30px; border-right-color:#006633; border-bottom-style:solid; border-bottom-width:1px; border-bottom-color:#006633; } .applist_button{ /*margin-right: auto;*/ /*padding : 5px;*/ /*background: #ffffff;*/ /* for non-css3 browsers */ /*background: #627d4d;*/ /*background: #fe941b;*/ /*-webkit-border-radius: 6px;*/ /*-moz-border-radius: 6px;*/ /*border-radius: 8px;*/ /* border:1px inset;*/ display:inline-block; width : 120px; height : 170px; cursor : pointer; /*box-shadow: 0 2px 4px rgba(0,0,0,0.5);*/ transition: all 0.15s linear; overflow: hidden; } .applist_logout{ background: transparent; /* for non-css3 browsers */ cursor : pointer; font-family : Arial; } .applist_table{ width:800px; height:100px; } .applist_table td{ padding : 0px; } .applist_gradient{ /* filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#ffffff'); /* for IE */ /* background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#fff)); /* for webkit browsers */ /* background: -moz-linear-gradient(top, #ccc, #fff); /* for firefox 3.6+ */ /*height: 100%;*/ width: 100px; height: 100px; display: flex; justify-content: center; align-items: center; border-radius: 50%; } .applist_button_img{ width : 60px; height : 60px; margin: 10px auto 10px; transition: all 0.2s; /*transform: scale(0.75);*/ } .applist_button:hover{ /*box-shadow: 0 3px 20px rgba(0,0,0,0.4), 0 7px 13px rgba(0,0,0,0.2);*/ opacity: 0.8; } .applist_button:hover img { transform: rotateY(180deg); /*-webkit-filter: blur(0.05em);*/ } .applist_logout:hover{ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; cursor : pointer; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .applist_circle { position: absolute; margin-top:-30px; margin-left:-20%; width: 300px; height: 300px; -moz-border-radius: 500px; -webkit-border-radius: 500px; border-radius: 500px; border-top: #383838 20px solid; border-right: #383838 20px solid; border-bottom: #383838 20px solid; border-left: #383838 20px solid; background:#484848 ; } .applist_footer{ font-family:"Verdana", verdana, sans-serif; font-size:15px; font-weight:bold; } .admin_label { width: 100%; height: calc(100% - 120px); background: #fff; /*border-bottom: 1px solid #627d4d;*/ z-index: 10; display: flex; } .admin_label p { /*margin: 13px auto 0;*/ margin: 0 auto; /*padding: 10px;*/ white-space: normal; font-size: 13px; align-self: center; } :root { --cuscol: #87c43e; --progh: 50px; --footer: 50px; --navtop: 2vh; /*--max: 100%;*/ } * { margin: 0; padding: 0; box-sizing: border-box; font-size: 13px; font-family: 'Calibri'; } img { /* width: var(--max); height: var(--max); object-fit: contain; */ } select, input, button { outline: none; } ._textbox { border: 1px solid transparent; border-bottom: 1px solid #ccc; padding: 8px 10px; background: transparent; } .prog { width: 100vw; height: var(--progh); /*margin-top: var(--navtop);*/ margin: calc(var(--navtop) - 1vh) auto var(--navtop); /*position: fixed;*/ /*top: 1vh;*/ display: flex; justify-content: center; } .prog .progicon { width: var(--progh); height: var(--progh); margin: 0 15px; border-radius: 50%; /*border: 1px solid #ccc;*/ box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.3); /*overflow: hidden;*/ } .progicon .label { text-align: center; display: block; width: 100%; height: 30px; display: flex; justify-content: center; align-items: center; } .progicon .label span { font-size: 10px; } .loginwrapper { width: 100%; margin-top:1rem; /* height: calc(100vh - (var(--navtop) + (var(--progh)*1.5) + var(--footer))); */ position: relative; padding: 0 15vw; display: flex; flex-direction: column; justify-content: space-between; align-items: center; /* flex-wrap: wrap; */ } .loginwrapper > div { width: calc(100% / 2); display: flex; justify-content: center; align-items: center; } .left { flex-direction: column; display: none; } .right{ margin: auto; } .logo { /* width: 400px; height: 160px; */ /* margin: 20px auto; */ /*border: 1px solid #000;*/ } .companyname { color: var(--cuscol); font-size: 25px; } .logincontainer { width: 350px; background: #fff; padding: 2rem; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 2px 1px rgba(0,0,0,0.1); } .logincred { width: var(--max); margin: 40px 0 25px; } .top header { font-size: 28px; } .inputwrapper { width: var(--max); height: auto; display: flex; align-items: center; margin: 35px 0; position: relative; } .inputwrapper input, .inputwrapper select { width: var(--max); z-index: 2; padding: 8px 1px; font-weight: bold; } .inputwrapper span { display: block; width: var(--max); position: absolute; z-index: 1; color: #999; transition: all 0.3s; } .inputwrapper .underline { position: absolute; bottom: -1px; left: 0; width: var(--max); height: 1px; background: #87c43e; transition: transform 0.3s, opacity 0.1s; transform: scaleX(0); opacity: 0; } .inputwrapper .underline.full { transform: scaleX(1); opacity: 1; } .btngrp { display: flex; justify-content: space-between; align-items: center; } .loginbtn, .loginbtn * { cursor: pointer; } .loginbtn { position: relative; overflow: hidden; background: var(--cuscol); } .loginbtn input { width: 100px; padding: 6px 0; color: #fff; border: none; background: transparent; position: relative; z-index: 2; } .licagrmnt { color: #0c56f5b1; /* font-weight: bold; */ cursor: pointer; } .licagrmnt_container { position: absolute; top: 0; left: 0; /* width: 100vw; height: 100vh; */ padding: 0 25vw; background: #fff; /* background: rgb(114, 114, 114); */ z-index: 100; /* overflow-y: auto; */ /* overflow-y: scroll; */ counter-reset: x; display: flex; flex-direction: column; } .licagrmnt_container > header { /*position: absolute;*/ /*top: 0; left: 0;*/ width: 100%; height: auto; font-size: 25px; padding: 10px 0 15px; font-weight: bold; text-align: center; border-bottom: 1px solid #ccc ; /* display: flex; justify-content: center; align-items: center; */ } .licagrmnt_container article { overflow: scroll; width: 100%; scroll-behavior: smooth; padding: 15px 0 100px; } .licagrmnt_container article::-webkit-scrollbar{ overflow: hidden; } .licagrmnt_container article .xcount::before { counter-increment: x; content: counter(x) '. '; } .licagrmnt_container article section { margin-bottom: 40px; } .licagrmnt_container article section > label { font-weight: bold; font-size: 20px; margin-bottom: 15px; display: block; } .licagrmnt_container article section p { text-indent: calc(20px * 2); line-height: 1.4; margin-bottom: 15px; } .licagrmnt_container article section p, .licagrmnt_container article section li { text-align: justify; } .licagrmnt_container article section strong { text-align: center; } .licagrmnt_container article section ul.circle { list-style-type: circle; padding: 0 0 0 20px; } .licagrmnt_container > div { position: fixed; bottom: 0; left: 0; width: 100%; height: 50px; background: #fff; display: flex; justify-content: center; align-items: center; } .licagrmnt_container > div:after { /*content: '';*/ width: 100vw; height: 70px; background: linear-gradient(transparent, rgba(0,0,0,0.5)); position: absolute; z-index: -1; } .closebtn { width: 60px; height: 60px; border-radius: 50%; position: absolute; bottom: 7vh; display: flex; justify-content: center; align-items: center; cursor: pointer; background: #fff; transition: all 0.3s; } .closebtn svg { /*width: 100%; height: 100%;*/ transform: scale(0.4); stroke: #000; stroke-width: 3; transition: all 0.3s; } .closebtn:hover { background: #87c43e; } .closebtn:hover svg { stroke: #fff; } footer { /* margin-top: 120px; */ width: 100%; height: var(--footer); /*position: fixed;*/ /*bottom: 0; left: 0;*/ display: flex; justify-content: center; align-items: center; background: transparent; } .inputwrapper span.inputfocus { transform: translate(-35px, -25px) scale(0.8); font-weight: bold; /* color: var(--cuscol); */ } .explode { display: block; position: absolute; background: hsl(90, 53%, 40%); /* background: hsl(216, 53%, 40%); */ border-radius: var(--max); transform: scale(0); z-index: 1; } .explode.animate { animation: explodeAnimate 0.65s linear; } @keyframes explodeAnimate { 100% {opacity: 0; transform: scale(2.5);} } ._fadeout { opacity: 0; } ._strtoupper { text-transform: uppercase; } @media only screen and (max-width: 1024px) { .licagrmnt_container { padding: 0 15vw; } .licagrmnt_container header { padding: 5px 0 10px; } } @media only screen and (max-width: 850px) { .loginwrapper { align-items: center; flex-direction: column; height: auto; padding: 0; } .left { margin: 4vh 0; } .loginwrapper > div { width: calc((100% / 3) * 2); } .logo { width: 300px; height: 120px; } footer { margin-top: 6vh; } .licagrmnt_container { padding: 0 5vw; } .licagrmnt_container header { padding: 2px 0 5px; } } @media only screen and (max-width: 600px) { .companyname { display: none; } } @media only screen and (max-width: 480px) { .loginwrapper > div { width: calc((100% / 7) * 6); } } .table_disp{ font-family: arial; font-size: 12px; border: 1px; border-collapse: collapse; cursor: pointer; } .table_disp th{ background-color: #bdbdbd; color: black; height:30px; } .table_disp tbody tr:hover{ background-color:silver; } #login_frame{ border: 1px solid #696; padding: 60px 0; text-align: center; width: 400px; -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 10px; -webkit-box-shadow: #666 0px 2px 3px; -moz-box-shadow: #666 0px 2px 3px; box-shadow: #666 0px 2px 3px; background : white; behavior: url(./css/PIE.htc); } .gp{ width : 80%; } #login_frame table{ align-items : center; } .div_border_back{ /*border: 0px solid gainsboro;*/ /*background : #204f1e;*/ width : 350px; height : 280px; /*-webkit-border-radius: 8px;*/ /*-moz-border-radius: 8px;*/ /*border-radius: 10px;*/ -webkit-box-shadow: #666 0px 3px 10px; -moz-box-shadow: #666 0px 3px 10px; box-shadow: #666 0px 3px 10px; } .div_border_front1{ background : #3a6f8f; width : 100%; height : 4%; -webkit-border-top-left-radius: 8px; -moz-border-top-left-radius: 8px; border-top-left-radius: 10px; -webkit-border-top-right-radius: 8px; -moz-border-top-right-radius: 8px; border-top-right-radius: 10px; } .div_border_front2{ /*background : white;*/ width : 100%; height : 96%; -webkit-border-bottom-left-radius: 6px; -moz-border-bottom-left-radius: 6px; border-bottom-left-radius: 8px; -webkit-border-bottom-right-radius: 6px; -moz-border-bottom-right-radius: 6px; border-bottom-right-radius: 8px; } .gp{ width : 96%; border : solid 1px rgba(98, 125, 77, 0.5) !important; margin-bottom: 15px; } .sublabel{ color : #555555; } .headlabel{ color : #555555; } :root { --cuscol: #052b00; --progh: 50px; --footer: 50px; --navtop: 2vh; --max: 100%; } .licagrmnt { /* color: var(--cuscol); */ } /* .inputwrapper .underline { background-color: var(--cuscol); } */ * { font-family: unset; } .div_version{ display: flex; justify-content: flex-end; } .tbl_versions, .tbl_versions td, .tbl_versions th { border: 1px solid #ddd; text-align: left; } .tbl_versions { border-collapse: collapse; width: 100%; } .tbl_versions th, .tbl_versions td { padding: 5px; } </style> <script type="text/javascript" src="jquery-1.10.2.min.js"></script> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon"> <link rel="icon" href="img/favicon.ico" type="image/x-icon"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <!-- <link rel="stylesheet" type="text/css" href="css/login_page.css"> --> </head> <body> <!-- <div class="prog"> </div> --> <div class="loginwrapper"> <div class="left"> <div class="logo"> <img src="lst.png"> </div> </div> <div class="right"> <!-- <form name="myform" id="myform" action="https://www.lstviweb.com/online/redfiel/login.php" method="POST"> --> <form name="myform" id="myform" action="" method="POST"> <div class="logincontainer"> <div class="top"> <header>Login</header> <span>Please enter a valid USER ID and Password</span> </div> <div class="logincred"> <div class="inputgrp"> <div class="inputwrapper"> <input type="text" name="dsply_gl_comcde" id="dsply_gl_comcde" class="_textbox _strtoupper" autocomplete="off" value=''> <input name="gl_comcde" id="gl_comcde" class="_textbox _strtoupper" autocomplete="off" value=''> <span class="inputfocus">Company ID</span> <div class="underline full"></div> </div> <div class="inputwrapper"> <input type="text" name="txtusrcde" id="txtusrcde" class="_textbox _strtoupper" autocomplete="off"> <span>User ID</span> <div class="underline"></div> </div> <div class="inputwrapper"> <input type="password" name="txtusrpwd" id="txtusrpwd" class="_textbox"> <span>Password</span> <div class="underline"></div> </div> <div class="inputwrapper"> <span style="text-align: center;"> <label style="color: red;" id="lbl_valmsg"> </label> </span> </div> </div> <div class="btngrp"> <div> <span id="forgot" onclick="forgot_password()" style="cursor: pointer;">Forgot Password ?</span> </div> <div class="loginbtn"> <!-- <input type="button" id="loginBtn" name="" class="" onclick="login_click();" value="Login"> --> <input type="button" id="loginBtn" name="" class="" value="Login"> </div> </div> </div> <div class=""> <p>By using this program you agree to the terms and conditions of the <span class="licagrmnt">license agreement</span>.</p> </div> <div style="padding: 5px;"> <div style="float: left; cursor: pointer;"> <!-- <span onclick="view_versions()"><u>versions</u></span> --> </div> <div style="float: right;"> <!-- <span>v</span> --> </div> </div> </div> <input name="browser" id="browser" value=""> <input name="module" id="module" value=""> <input name="txt_event" id="txt_event" value=""> <input name="txt_url" id="txt_url" value=""> </form> </div> <footer> <span>Copyright © 2021 LEE Systems Technology Ventures Inc</span> </footer> <div class="licagrmnt_container" style=" width:100vw; display:none;"> <header>SOFTWARE LICENSE AGREEMENT FOR LEE SYSTEMS TECHNOLOGY VENTURES INCORPORATED SOFTWARE</header> <article> <section> <label> License Agreement </label> <p> You should carefully read the following terms and conditions before using this software. This Lee Systems Technology Ventures Incorporated Software License Agreement ("SLA") is a legal agreement between you (either an individual or a single entity) and Lee Systems Technology Ventures Incorporated for this Software product which will be referred in this agreement as the "SOFTWARE". Unless you have a different license agreement signed by Lee Systems Technology Ventures, your use of this software indicates your acceptance of this license agreement and warranty. <strong>IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, DO NOT USE THE SOFTWARE</strong>. </p> </section> <section> <label> Governing Law </label> <p> You should carefully read the following terms and conditions before using this software. This Lee Systems Technology Ventures Incorporated Software License Agreement ("SLA") is a legal agreement between you (either an individual or a single entity) and Lee Systems Technology Ventures Incorporated for this Software product which will be referred in this agreement as the "SOFTWARE". Unless you have a different license agreement signed by Lee Systems Technology Ventures, your use of this software indicates your acceptance of this license agreement and warranty. <strong>IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, DO NOT USE THE SOFTWARE</strong>. </p> <p> This agreement shall be governed by the laws of the Republic of the Philippines. </p> </section> <section> <label> SOFTWARE PRODUCT LICENSE </label> <p> The software product is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The software is licensed, NOT SOLD. </p> </section> <section> <label> Use and Registration </label> <p> This is not a free software. You agree to register this software in the website of Lee Systems Technology Ventures (www.lstventures.com). </p> </section> <section> <label class="xcount"> GRANT OF LICENSE. This SLA grants you the following rights: </label> <p> Lee Systems Technology Ventures grants you as an individual , a personal, non-exclusive license to use the software product. You may install and use one copy of the software on a single computer. You may also store or install a copy of the Software Product, such as a network server or back-up disk, used only for the said purpose. A license for the software product may not be shared or used concurrently on different computers. </p> </section> <section> <label class="xcount"> DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS. </label> <p> <ul class="circle"> <li> Not for Resale nor Sublease. you may not resell, sublease or otherwise transfer for value, the software product. </li> <li> You acknowledge that Lee Systems Technology Ventures Software contains proprietary and confidential information that is protected by applicable intellectual property and other laws. Except as expressly permitted herein, you agree not to copy, modify, rent, lease, loan, sell, distribute or create derivative works based on this Software, in whole or in part. </li> <li> You agree not to translate, reverse engineer, decompile, disassemble or make derivative works from this software. You agree not to modify this Software in any manner or form, or to use modified versions of this Software including (without limitation) for the purpose of obtaining unauthorized access to the data and unlimited use of this program. </li> <li> Separation of Components. The software product is licensed as a single product. Its component parts may not be separated for use on more than one computer. </li> <li> Lee Systems Technology Ventures is not responsible for obtaining and maintaining the computer equipment and accessories used by the Software. </li> </ul> </p> </section> <section> <label class="xcount"> UPGRADES OR MODIFICATIONS </label> <p> If the software is upgraded or modified, you must be properly licensed to use a product identified by Lee Systems Technology Ventures as being eligible for the upgrade/modified in order to use the software. You may use the resulting upgraded/modified product only in accordance with the terms of this SLA. If the software is an upgrade/modified of a component of a package of software programs that you licensed as a single product, the software may be used and transferred only as part of that single product package and may not be separated for use on more than one computer. </p> </section> <section> <label class="xcount"> COPYRIGHT & INTELLECTUAL PROPERTY </label> <p> Republic Act No. 8293. All title and copyrights in and to the software products (including but not limited to any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the software), the accompanying printed materials, and any copies of the software are owned by Lee Systems Technology Ventures or its suppliers. All title and intellectual property rights in and to the content which may be accessed through use of the Software Product is the property of the respective content owners and may be protected by applicable copyright or other intellectual laws and treaties. The software is protected by copyright laws and international treaty provisions. Therefore, you must treat the software like any other copyrighted material except that you may install the software on a single computer provided you keep the original solely for backup or archival purposes. You may not copy the printed materials accompanying the software. </p> </section> <section> <label class="xcount"> LIMITED WARRANTY </label> <p> The Software is provided "AS IS" and without warranties as to performance or merchantability or any other warranties whether expressed or implied. </p> </section> <section> <strong> <p> LEE SYSTEMS TECHNOLOGY VENTURES INCORPORATED ENTIRE LIABILITY TO YOU AND YOUR EXCLUSIVE REMEDY SHALL BE THE REPLACEMENT OF ANY DEFECTIVE MEDIA(SUCH AS CD-ROM) RETURNED BY YOU TO LEE SYSTEMS TECHNOLOGY WITH PROOF OF PURCHASE DURING THE 30-DAY LIMITED WARRANTY PERIOD. IN NO EVENT SHALL THE LIABILITY OF LEE SYSTEMS TECHNOLOGY ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE EXCEED THE FEE PAID BY YOU FOR THIS LICENSE. </p> <p> NO OTHER WARRANTIES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, LEE SYSTEMS TECHNOLOGY VENTURES AND ITS REFERRALS DISCLAIM ALL WARRANTIES AND CONDITIONS, WHETHER EXPRESS OR IMPLIED, STATUTORY OR OTHERWISE, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY , FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE PRODUCT, AND THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES. LEE SYSTEMS DISCLAIMS ANY WARRANTY AS TO THE PERFORMANCE OF THE SOFTWARE OR AS TO THE RESULTS THAT MAY BE OBTAINED BY USING THE SOFTWARE. THE ENTIRE RISK AS TO THE INSTALLATION, QUALITY, USE AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. IN NO EVENT SHALL LEE SYSTEMS TECHNOLOGY VENTURES OR ITS STAFF, REFERRALS AND REPRESENTATIVES BE LIABLE FOR ANY SPECIAL, INCIDENTAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER ( INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE PRODUCT OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF LEE SYSTEMS TECHNOLOGY VENTURES HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. LEE SYSTEMS TECHNOLOGY GRANTS NO WARRANTY AND SHALL HAVE NO LIABILITY WHATSOEVER BEYOND THE 30 DAY PERIOD WARRANTY. </p> </strong> </section> </article> <div> <div class="closebtn"> <svg height="50" width="50"> <line x1="0" y1="0" x2="50" y2="50"/> <line x1="50" y1="0" x2="0" y2="50"/> Sorry, your browser does not support inline SVG. </svg> </div> <span>Lee Systems Technology Ventures</span> </div> </div> </div> <script type="text/javascript"> window.onload = () => { const username = document.getElementById('txtusrcde'); const password = document.getElementById('txtusrpwd'); const companyid = document.getElementById('gl_comcde'); const display_companyid = document.getElementById('dsply_gl_comcde'); const errorMsg = document.getElementById("lbl_valmsg"); const loginBtn = document.getElementById('loginBtn'); const forgotBtn = document.getElementById('forgot'); // console.log(username) // username.addEventListener('change', () => console.log(username.value)) // password.addEventListener('change', () => console.log(password.value)) display_companyid.focus() loginBtn.addEventListener('click', () => login()); forgotBtn.addEventListener('click', () => forgot_password()) //window listener window.addEventListener('keydown', (e) => { if(e.ctrlKey == true && e.keyCode == 122 ){ let mainprogdir = 'https://vps1.lstventures.com/online/onedb/webapp/'; window.open(mainprogdir+'lstv_params.php', '_blank'); } else if(e.keyCode == 13){ login(); console.log(e) } }) function login(){ var xparams = jQuery('#myform *').serialize(); xparams += "&event_action=login"; $.ajax({ dataType: "json", type: "post", url: "login_ajax.php", data: xparams, success : function (xretobj) { if (xretobj.bool == false) { errorMsg.innerText = 'Contact LSTV Inc. for assistance'; } else { errorMsg.innerText = '' if(display_companyid.value == ''){ // console.log(errorMsg) display_companyid.focus(); errorMsg.innerText = 'Company ID should not be empty'; } else if( username.value == ''){ // console.log(errorMsg) username.focus() errorMsg.innerText = 'User ID should not be empty' } else if( password.value == '' ){ // console.log(errorMsg) password.focus() errorMsg.innerText = 'Password should not be empty' } else{ loginBtn.disabled = true; loginBtn.value = "Please wait..."; var mainprogdir = xretobj.mainprogdir; // var mainprogdir = ''; var mainpage = 'http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php?'; var dbprefix = ''; document.getElementById("gl_comcde").value = dbprefix+dsply_gl_comcde.value; // Add the DB Prefix in Company ID // document.getElementById("gl_comcde").value = dsply_gl_comcde.value; // Add the DB Prefix in Company ID document.forms.myform.txt_event.value= 'login'; document.forms.myform.txt_url.value= mainpage; document.forms.myform.action= mainprogdir+'login_validate.php'; document.forms.myform.method='post'; document.forms.myform.target='_self'; document.forms.myform.submit(); } } } }) } function forgot_password(){ var xparams = jQuery('#myform *').serialize(); xparams += "&event_action=login"; $.ajax({ dataType: "json", type: "post", url: "login_ajax.php", data: xparams, success : function (xretobj) { if (xretobj.bool == false) { errorMsg.innerText = 'Contact LSTV Inc. for assistance'; } else { // let mainprogdir = ''; // var dbprefix = ''; var dbprefix = ""; var mainprogdir = xretobj.mainprogdir; document.getElementById("gl_comcde").value = dbprefix+dsply_gl_comcde.value; // Add the DB Prefix in Company ID document.forms.myform.action = mainprogdir+'login_forgot.php'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } } }); } } $(function() { // ripple click for buttons var explode, xpld, m, x, y; $('.loginbtn').each(function() { $(this).click(function(e) { $(this).find('.explode').length == 0 ? $(this).prepend('<span class=\'explode\'></span>') : ''; xpld = $(this).find('.explode'); xpld.removeClass('animate'); !xpld.height() && !xpld.width() ? m = Math.max($(this).outerWidth(), $(this).outerHeight()) : ''; xpld.css({ height: m, width: m }); x = e.pageX - $(this).offset().left - xpld.width() / 2; y = e.pageY - $(this).offset().top - xpld.height() / 2; // console.log(e); $(this).find('.explode').css({ top: y + 'px', left: x + 'px' }).addClass('animate'); }) }); // ends here // transition of placeholder up to the top of input text box and effects of underline located aat the bottom of the input tag. $('.inputwrapper').each(function() { var input = $(this).find('input').val(); if (input != "") { $(this).find('input').siblings('span').addClass('inputfocus'); $(this).find('input').siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); } $(this).find('input').on({ focus: function() { $(this).siblings('span').addClass('inputfocus'); $(this).siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); }, blur: function() { if ($(this).val() != '') { $(this).siblings('span').addClass('inputfocus'); $(this).siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); } else { $(this).siblings('span').removeClass('inputfocus'); $(this).siblings('.underline').removeClass('full'); } } }) }); // ends here // show the licence agreement $('.licagrmnt').click(function() { $('.licagrmnt_container').fadeIn(); }); // ends here // close the licence agreement $('.closebtn').click(function() { $(this).parents('.licagrmnt_container').fadeOut(); }) $('body').on('keydown', function(e) { var esc = e.which || e.keyCode; esc == 27 ? $('.licagrmnt_container').fadeOut() : ''; }) $('.licagrmnt_container').fadeOut() // ends here // alert($(window).width()+' x '+$(window).height()); }); </script> </body> <html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/ajax_menu.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 289 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/ajax_menu.php HTTP/1.1
Proxy-Connection: keep-alive X-Requested-With: XMLHttpRequest Origin: http://192.168.2.47 Content-Length: 11 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,205 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 656 Connection: close Content-Type: text/html; charset=utf-8 |
| Response Body - size: 656 bytes. |
{"form":"<aside><a><h3 class='menu_has_mensub active' id='389' onclick=\"load_page2('COD00','389')\" style='cursor:pointer'>Code Definition<i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><\/h3><\/a><\/h3><\/a><a><h3 class='menu_has_mensub ' id='30' onclick=\"load_page2('PIM00','30')\" style='cursor:pointer'>Employees<i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><\/h3><\/a><\/h3><\/a><a><h3 class='menu_has_mensub ' id='57' onclick=\"load_page2('UTL00','57')\" style='cursor:pointer'>Utilities<i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><\/h3><\/a><\/h3><\/a><\/aside>","active_menrecid":"389"}
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/cm_bread_ajax.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 664 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/cm_bread_ajax.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Content-Length: 34 Accept: application/json, text/javascript, */*; q=0.01 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Origin: http://192.168.2.47 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 34 bytes. |
cap=Position Type File&url=current
|
| Response Header - size: 1,076 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:42 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 167 Content-Type: text/html; charset=UTF-8 |
| Response Body - size: 167 bytes. |
"<a href=\"#\" onclick=load_page(\"main.php\",\"\",\"\",\"\",\"1\")>Dashboard<\/a><div class=\"breadcrumb_divider\"><\/div> <a class='current'>Position Type File<\/a>"
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/db_field_length_checker_ajax.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 680 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/db_field_length_checker_ajax.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Content-Length: 113 Accept: application/json, text/javascript, */*; q=0.01 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Origin: http://192.168.2.47 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 113 bytes. |
link_hash_id=cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85&link_id=&tablename=positiontypefile
|
| Response Header - size: 1,161 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:42 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 2 Content-Type: text/html; charset=utf-8 |
| Response Body - size: 2 bytes. |
[]
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/menu_view_ajax.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 665 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/menu_view_ajax.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Content-Length: 22 Accept: application/json, text/javascript, */*; q=0.01 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Origin: http://192.168.2.47 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 22 bytes. |
menid=389&mensub=COD00
|
| Response Header - size: 1,187 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:42 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 2558 Content-Type: text/html; charset=utf-8 |
| Response Body - size: 2,558 bytes. |
{"form":"<div id=\"menu2_sub\"><div class='mendiv'><p>General Setup<\/p><ul><li ><a id='men_22' onclick=\"load_page('mf_area.php','Area','','22')\">Area<\/a><\/li><li ><a id='men_201' onclick=\"load_page('mf_city.php','City','','201')\">City<\/a><\/li><li ><a id='men_256' onclick=\"load_page('mf_cvlstatfile.php','Civil Status File','','256')\">Civil Status File<\/a><\/li><li ><a id='men_170' onclick=\"load_page('mf_country.php','Country','','170')\">Country<\/a><\/li><li ><a id='men_28' onclick=\"load_page('mf_dept.php','Department','','28')\">Department<\/a><\/li><li ><a id='men_27' onclick=\"load_page('mf_division.php','Division','','27')\">Division<\/a><\/li><li ><a id='men_41' onclick=\"load_page('mf_employmenttype.php','Employment Type','','41')\">Employment Type<\/a><\/li><li ><a id='men_60' onclick=\"load_page('mf_nationality.php','Nationality','','60')\">Nationality<\/a><\/li><li ><a id='men_283' onclick=\"load_page('mf_postype.php','Position Type','','283')\">Position Type<\/a><\/li><li ><a id='men_254' onclick=\"load_page('mf_prefix.php','Prefix','','254')\">Prefix<\/a><\/li><li ><a id='men_265' onclick=\"load_page('mf_province.php','Province','','265')\">Province<\/a><\/li><li ><a id='men_257' onclick=\"load_page('mf_region.php','Region','','257')\">Region<\/a><\/li><li ><a id='men_266' onclick=\"load_page('mf_regionprovcity_con.php','Region,Province City Con.','','266')\">Region,Province City Con.<\/a><\/li><li ><a id='men_23' onclick=\"load_page('mf_religion.php','Religion','','23')\">Religion<\/a><\/li><li ><a id='men_255' onclick=\"load_page('mf_suffix.php','Suffix','','255')\">Suffix<\/a><\/li><\/ul><\/div><div class='mendiv'><p>Employees<\/p><ul><li ><a id='men_32' onclick=\"load_page('mf_bankacct.php','Bank','','32')\">Bank<\/a><\/li><li ><a id='men_62' onclick=\"load_page('mf_accountype.php','Bank Account Type','','62')\">Bank Account Type<\/a><\/li><li ><a id='men_24' onclick=\"load_page('mf_status.php','Employee Status','','24')\">Employee Status<\/a><\/li><li ><a id='men_58' onclick=\"load_page('mf_leave.php','Leaves','','58')\">Leaves<\/a><\/li><li ><a id='men_190' onclick=\"load_page('mf_paycycle.php','Payroll Cycle','','190')\">Payroll Cycle<\/a><\/li><li ><a id='men_26' onclick=\"load_page('mf_payrollgrp.php','Payroll Group','','26')\">Payroll Group<\/a><\/li><li ><a id='men_29' onclick=\"load_page('mf_pos.php','Position','','29')\">Position<\/a><\/li><li ><a id='men_250' onclick=\"load_page('mf_taxcode.php','Tax Code','','250')\">Tax Code<\/a><\/li><\/ul><\/div><\/div>","menwidth":null}
|
| Instances | 7 |
| Solution |
Ensure that your web server, application server, load balancer, etc. is properly configured to set the Content-Security-Policy header.
|
| Reference |
http://www.w3.org/TR/CSP2/
http://www.w3.org/TR/CSP/ http://caniuse.com/#search=content+security+policy http://content-security-policy.com/ https://github.com/shapesecurity/salvation https://developers.google.com/web/fundamentals/security/csp#policy_applies_to_a_wide_variety_of_resources |
| Tags |
OWASP_2021_A05
OWASP_2017_A06 |
| CWE Id | 693 |
| WASC Id | 15 |
| Plugin Id | 10055 |
|
Medium |
CSP: style-src unsafe-inline |
|---|---|
| Description |
style-src includes unsafe-inline.
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 234 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php HTTP/1.1
Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 19,386 bytes. |
<style type="text/css">
.div_border_front2 table:nth-child(2) input[type="button"] { color: #fff; background: #627d4d; } #forgot { color: ; } .applist_gradient { background: #627d4d; } .head_title { color: #fff; } .head_title, .apptitle { text-transform: uppercase; } .head_title1, .apptitle1 { text-transform: uppercase; } .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header { background: #627d4d; } .ui-widget-header { background: #627d4d !important; color: #fff; } .ui-dialog .ui-dialog-buttonpane button { color: #fff; } header#header,.theme_header { background: #627d4d !important; } /*header#header2 { background: #627d4d; }*/ ._program li { color: #fff; } .button1 { color: #fff; background: #627d4d; } ._figure span:first-child { color: #fff; } #hris_sub_container ul figure { background: #627d4d; } .dc_empstatico { color: ; /* colored */ } .dbg_empstatico { background: #627d4d; /* colored */ } ::-webkit-scrollbar { background: #627d4d; } ::-webkit-scrollbar-thumb { background: #627d4d; } #hris_sub_container header { color: ; /* colored */ } .gp, .ui-widget-header, .fc-day-header, { background: #627d4d; } .ui-widget-header, .fc-day-header { color : white !important;; } </style><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "/strict.dtd"> <html> <head> <title>WEBTEMPLATE</title> <link REL="SHORTCUT ICON" HREF="./images/lst_logo.ico" /> <link href='../css/applist.css' media='screen' type='text/css' /> <!-- include a theme, can be included into the core instead of 2 separate files --> <link rel="stylesheet" href="lib/alertify/css/themes/bootstrap.min.css" /> <link rel="stylesheet" href="./css/modified_layout.css" type="text/css" media="screen" /> <link rel='stylesheet' type='text/css' media='screen' href='./css/layout.css'/> </head> <body> <form name='myform' id='myform' method='post'> <link rel='stylesheet' type='text/css' href='css/login.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_view.css?v=20220209161346' /><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/layout.css?v=20220209161346' /><script type='text/javascript' src='javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='lib/pager.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/pager.css?v=20220209161346' /><script type='text/javascript' src='lib/alertify/alertify.min.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_page.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/applist.css?v=20220209161346' /> <!-- <link rel="stylesheet" type="text/css" href="css/login_page.css"> --> <input name='xpage_uri' id='xpage_uri'> <input name='xpage_dir' id='xpage_dir'> <input name='txt_action' id='txt_action'> <input name='txtappcde' id='txtappcde'> <input name='txtoutsource' id='txtoutsource'> <input id='seccode_validated' value=""> <input id="gl_comcde" name="gl_comcde" value="ATESTWEBTKM"> <!-- <input type="hidden" id="tmp_redirect_path" name="tmp_redirect_path"> --> <!-- <input type="hidden" id="tmp_appcde" name="tmp_appcde"> --> <style type="text/css"> .seccode_continue:hover { color: white; background-color: #1947D1 !important; border: 0; } .seccode_continue { background-color: #335CD6 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; /* border-radius: .3em; */ width: auto; min-width: 70px; } .seccode_cancel:hover { color: white; background-color: #990000 !important; border: 0; } .seccode_cancel { /* border-radius: .3em; */ background-color: #aa4935 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; width: 70px; /*margin-right: 3px;*/ } </style> <script type='text/javascript'> //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "WEBAPP"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function() {}; jQuery(document).ready(function() { if (jQuery('#seccode_validated').val() == 0 && jQuery('#seccode_validated').val() != '') { alertify.alert('Accesing any programs must start here.'); } jQuery('#seccode_diag').dialog({ title: "Security Code", resizable: false, autoOpen: false, height: 'auto', width: 'auto', position: { my: "center", at: "center", of: window }, modal: true, open: function() { jQuery('body').css('overflow', 'hidden'); jQuery('.ui-button-icon-primary.ui-icon.ui-icon-closethick').closest('button').remove(); jQuery(this).closest('.ui-dialog').find('.seccode_cancel').focus(); }, close: function() { jQuery('body').css('overflow', 'auto'); }, buttons: [{ text: "Continue", "class": 'seccode_continue', click: function() { val_seccode_path(jQuery('#seccode_diag').find('#seccode_path')); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { jQuery('#seccode_diag').dialog('close'); } }, ] }); jQuery('#diag_subsidiary').dialog({ title: 'Select Subsidiary', width: 500, height: 'auto', draggable: false, resizable: false, autoOpen: false, modal: true, open: function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [{ text: "Proceed", "class": 'seccode_continue', click: function() { update_pay_subdrycde_link($(this).find('#pay_subdrycde').val()); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { $(this).dialog('close'); } }, ] }); }) function val_blank_session() { alertify.alert('You must login first.', function() { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) // window.open('login_view.php', '_self'); }) } function val_seccode(xloc, xcde) { var xdata = "event_action=val_seccode"; xdata += "&xloc=" + xloc; xdata += "&xcde=" + xcde; xdata += "&" + jQuery('#myform *').serialize(); return jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata }); } function val_seccode_path(selectObj) { var xdata = "event_action=val_seccode_path"; xdata += "&apploc=" + selectObj.val(); xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { if (xret.bridge_found) { // document.forms.myform.txtappcde.value=selectObj.find("option:selected").data('appcde'); document.forms.myform.action = selectObj.val(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { alertify.alert(selectObj.find(':selected').text(), xret.bridge_found_msg); } } }); } function open_seccode_diag() { var xdata = "event_action=validate_comcde"; xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { jQuery('#seccode_diag').dialog('open'); } }); } function transaction_click(xappcde, xloc, obj) { // alert(xappcde,xloc,obj); document.forms.myform.action = xloc; document.forms.myform.txtappcde.value = xappcde; if (jQuery(obj).hasClass('show_sub_diag') || xappcde == "PAY") { var xdata = "event_action=get_user_subdry&xappcde=" + xappcde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { $.unblockUI(); console.log(response) if (response.pass == true) { if (response.show_diag == true && response.has_access == true) { var subdry_note = "Payroll"; if(xappcde == "PAY_OUTSRC") { subdry_note = "Payroll Out Sourcing"; } jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); // jQuery('#diag_subsidiary').find('#subdry_note').html(subdry_note); jQuery('#diag_subsidiary').dialog('open'); } else if (response.show_diag == false && response.has_access == true) { blockui(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); update_pay_subdrycde_link($('#pay_subdrycde').val()); } } else { alertify.alert('You must have a subsidiary access to use the payroll program.'); } } }); } else { blockui(); //20190311 donita //add check update structure // if(xappcde != "PAY_OUTSRC" || xappcde != "PAY") // { update_empstatus(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action = "admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); // } // else // { // document.forms.myform.method='POST'; // document.forms.myform.target = '_self'; // document.forms.myform.submit(); // } } } function update_empstatus(subdrycde="") { var xdata= "event_action=update_empstatus&subdrycde="+subdrycde; jQuery.ajax({ type : 'post', data : xdata, url : 'login_applist_ajax.php', success : function (xretobj) { } }); } function logout_click() { alertify.confirm('Are you sure you want to logout?', function() { blockui(); var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) } }); }); } function update_pay_subdrycde_link(xsubdrycde) { blockui(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { var xappcde = $('#txtappcde').val(); var xdata = "event_action=update_pay_subdrycde_link&xappcde=" + xappcde; xdata += "&subdrycde=" + xsubdrycde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { jQuery('#diag_subsidiary').dialog('close'); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } }); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action="admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); } function admin_click(xloc) { document.forms.myform.action = xloc; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } function getclientdir(){ var xparams = 'txt_action=getclientdir'; return jQuery.ajax({ dataType: 'json', type: 'post', data: xparams, url : 'login_validate_redirect.php' }) } </script> <style> footer { width: 580px; margin: 0 auto 50px; } footer .ftr_con { margin: 20px auto 0; } footer .ftr_con p { text-align: center; } .appgrp { margin-top: 20px; display: flex; justify-content: center; align-items: center; } </style> <!-- <form id="myform"> </form> --> <div class='applist_body' align='center'> <div class='applist_all'> <div class="logo"> <img src='img/lst.png' style="width: 100%;height: 100%;"> </div> <table border='0' align='center'> <tr> <td align='center'> <table class='applist_table'> <tr> <td align='right' colspan='10'> <span class='applist_logout' onclick='logout_click()'><b>LOGOUT</b></span> </td> </tr> <tr> <td colspan='10'> <hr> </td> </tr> <tr> <td style='white-space:nowrap;' align='center'> <div class="appgrp"> <div class='applist_button' onclick="admin_click('admin/main.php')"> <div class='applist_gradient'> <img class='applist_button_img' src='images/admin.png'> </div> <div class='admin_label'> <p>Admin</p> </div> </div> <div class="applist_button show_sub_diag" onclick='transaction_click("PAY","payroll/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/PAY.png' ></div><div class='admin_label'><p>Payroll</p></div></div><div class="applist_button " onclick='transaction_click("HR","hris/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/hr_0.png' ></div><div class='admin_label'><p>Human Resource Information System</p></div></div><div class="applist_button " onclick='transaction_click("TKM","tkm/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/clock.png' ></div><div class='admin_label'><p>Time Keeping Management</p></div></div> </div> </td> </tr> </table> </td> </tr> <tr style="height:50px;"> <td colspan="100"></td> </tr> <tr> <td colspan="10" align="center"> <input type="button" class="print" onclick="open_seccode_diag()" value="Enter Security Code"> </td> </tr> </table> </div> </div> <br> <br> <br> <div id="seccode_diag" style="display: none;"> <table><tr><td style="width:110px;">Select Program</td><td><select class="input" style="margin-right:10px;" id="seccode_path"><option value="payroll/bridge/">Payroll</option><option value="hris/bridge/">Human Resource Information System</option><option value="tkm/bridge/">Time Keeping Management</option></select></td></tr></table></div> <div id="diag_subsidiary" style="display:none;"> <table style="width:100%"> <!-- <tr> <td colspan="100"><i>Note: Only subsidiaries with <i id="subdry_note"></i> database connection setup.</i></td> </tr> --> <tr> <td><b>Subsidiary</b></td> <td><select id="pay_subdrycde" name="pay_subdrycde" class="input"></select></td> </tr> </table> </div> <!-- <footer> <div class="ftr_con" style='font-size:11px;width:60%'> <p>Copyright © 2015, LEE Systems Technology Ventures</p> <p align='right' style='padding-right : 18px;font-size : 11px;font-weight : bold;'>IP Details : 10.0.0.18</p> </div> </footer> --> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 222 bytes. |
GET http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php HTTP/1.1
Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,055 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=UTF-8 |
| Response Body - size: 34,194 bytes. |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "/strict.dtd">
<html> <head> <title>LST</title> <link REL="SHORTCUT ICON" HREF="images/lst_logo.ico"> <style type="text/css"> html{ font-family: Arial, Helvetica, sans-serif; height: 100%; } a{ text-decoration: none; } .applist_body{ background : white; height: 500px; } .applist_all{ height : 100%; display: inline-block; } .div_applist_header{ vertical-align :middle; height : 50px; } .applist_button_border{ height : 60%; /*border: 2px outset #f2f0f0;*/ padding : 20px; border-top-left-radius:7em; border-top-right-radius:0em; border-bottom-right-radius:7em; border-bottom-left-radius:0em; display: inline-block; /*background : #e5e3e3;8*/ border-top-style:solid; border-top-width:15px; border-top-color:#003300; border-left-style:solid; border-left-width:1px; border-left-color:#003300; border-right-style:solid; border-right-width:30px; border-right-color:#006633; border-bottom-style:solid; border-bottom-width:1px; border-bottom-color:#006633; } .applist_button{ /*margin-right: auto;*/ /*padding : 5px;*/ /*background: #ffffff;*/ /* for non-css3 browsers */ /*background: #627d4d;*/ /*background: #fe941b;*/ /*-webkit-border-radius: 6px;*/ /*-moz-border-radius: 6px;*/ /*border-radius: 8px;*/ /* border:1px inset;*/ display:inline-block; width : 120px; height : 170px; cursor : pointer; /*box-shadow: 0 2px 4px rgba(0,0,0,0.5);*/ transition: all 0.15s linear; overflow: hidden; } .applist_logout{ background: transparent; /* for non-css3 browsers */ cursor : pointer; font-family : Arial; } .applist_table{ width:800px; height:100px; } .applist_table td{ padding : 0px; } .applist_gradient{ /* filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#ffffff'); /* for IE */ /* background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#fff)); /* for webkit browsers */ /* background: -moz-linear-gradient(top, #ccc, #fff); /* for firefox 3.6+ */ /*height: 100%;*/ width: 100px; height: 100px; display: flex; justify-content: center; align-items: center; border-radius: 50%; } .applist_button_img{ width : 60px; height : 60px; margin: 10px auto 10px; transition: all 0.2s; /*transform: scale(0.75);*/ } .applist_button:hover{ /*box-shadow: 0 3px 20px rgba(0,0,0,0.4), 0 7px 13px rgba(0,0,0,0.2);*/ opacity: 0.8; } .applist_button:hover img { transform: rotateY(180deg); /*-webkit-filter: blur(0.05em);*/ } .applist_logout:hover{ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; cursor : pointer; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .applist_circle { position: absolute; margin-top:-30px; margin-left:-20%; width: 300px; height: 300px; -moz-border-radius: 500px; -webkit-border-radius: 500px; border-radius: 500px; border-top: #383838 20px solid; border-right: #383838 20px solid; border-bottom: #383838 20px solid; border-left: #383838 20px solid; background:#484848 ; } .applist_footer{ font-family:"Verdana", verdana, sans-serif; font-size:15px; font-weight:bold; } .admin_label { width: 100%; height: calc(100% - 120px); background: #fff; /*border-bottom: 1px solid #627d4d;*/ z-index: 10; display: flex; } .admin_label p { /*margin: 13px auto 0;*/ margin: 0 auto; /*padding: 10px;*/ white-space: normal; font-size: 13px; align-self: center; } :root { --cuscol: #87c43e; --progh: 50px; --footer: 50px; --navtop: 2vh; /*--max: 100%;*/ } * { margin: 0; padding: 0; box-sizing: border-box; font-size: 13px; font-family: 'Calibri'; } img { /* width: var(--max); height: var(--max); object-fit: contain; */ } select, input, button { outline: none; } ._textbox { border: 1px solid transparent; border-bottom: 1px solid #ccc; padding: 8px 10px; background: transparent; } .prog { width: 100vw; height: var(--progh); /*margin-top: var(--navtop);*/ margin: calc(var(--navtop) - 1vh) auto var(--navtop); /*position: fixed;*/ /*top: 1vh;*/ display: flex; justify-content: center; } .prog .progicon { width: var(--progh); height: var(--progh); margin: 0 15px; border-radius: 50%; /*border: 1px solid #ccc;*/ box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.3); /*overflow: hidden;*/ } .progicon .label { text-align: center; display: block; width: 100%; height: 30px; display: flex; justify-content: center; align-items: center; } .progicon .label span { font-size: 10px; } .loginwrapper { width: 100%; margin-top:1rem; /* height: calc(100vh - (var(--navtop) + (var(--progh)*1.5) + var(--footer))); */ position: relative; padding: 0 15vw; display: flex; flex-direction: column; justify-content: space-between; align-items: center; /* flex-wrap: wrap; */ } .loginwrapper > div { width: calc(100% / 2); display: flex; justify-content: center; align-items: center; } .left { flex-direction: column; display: none; } .right{ margin: auto; } .logo { /* width: 400px; height: 160px; */ /* margin: 20px auto; */ /*border: 1px solid #000;*/ } .companyname { color: var(--cuscol); font-size: 25px; } .logincontainer { width: 350px; background: #fff; padding: 2rem; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 2px 1px rgba(0,0,0,0.1); } .logincred { width: var(--max); margin: 40px 0 25px; } .top header { font-size: 28px; } .inputwrapper { width: var(--max); height: auto; display: flex; align-items: center; margin: 35px 0; position: relative; } .inputwrapper input, .inputwrapper select { width: var(--max); z-index: 2; padding: 8px 1px; font-weight: bold; } .inputwrapper span { display: block; width: var(--max); position: absolute; z-index: 1; color: #999; transition: all 0.3s; } .inputwrapper .underline { position: absolute; bottom: -1px; left: 0; width: var(--max); height: 1px; background: #87c43e; transition: transform 0.3s, opacity 0.1s; transform: scaleX(0); opacity: 0; } .inputwrapper .underline.full { transform: scaleX(1); opacity: 1; } .btngrp { display: flex; justify-content: space-between; align-items: center; } .loginbtn, .loginbtn * { cursor: pointer; } .loginbtn { position: relative; overflow: hidden; background: var(--cuscol); } .loginbtn input { width: 100px; padding: 6px 0; color: #fff; border: none; background: transparent; position: relative; z-index: 2; } .licagrmnt { color: #0c56f5b1; /* font-weight: bold; */ cursor: pointer; } .licagrmnt_container { position: absolute; top: 0; left: 0; /* width: 100vw; height: 100vh; */ padding: 0 25vw; background: #fff; /* background: rgb(114, 114, 114); */ z-index: 100; /* overflow-y: auto; */ /* overflow-y: scroll; */ counter-reset: x; display: flex; flex-direction: column; } .licagrmnt_container > header { /*position: absolute;*/ /*top: 0; left: 0;*/ width: 100%; height: auto; font-size: 25px; padding: 10px 0 15px; font-weight: bold; text-align: center; border-bottom: 1px solid #ccc ; /* display: flex; justify-content: center; align-items: center; */ } .licagrmnt_container article { overflow: scroll; width: 100%; scroll-behavior: smooth; padding: 15px 0 100px; } .licagrmnt_container article::-webkit-scrollbar{ overflow: hidden; } .licagrmnt_container article .xcount::before { counter-increment: x; content: counter(x) '. '; } .licagrmnt_container article section { margin-bottom: 40px; } .licagrmnt_container article section > label { font-weight: bold; font-size: 20px; margin-bottom: 15px; display: block; } .licagrmnt_container article section p { text-indent: calc(20px * 2); line-height: 1.4; margin-bottom: 15px; } .licagrmnt_container article section p, .licagrmnt_container article section li { text-align: justify; } .licagrmnt_container article section strong { text-align: center; } .licagrmnt_container article section ul.circle { list-style-type: circle; padding: 0 0 0 20px; } .licagrmnt_container > div { position: fixed; bottom: 0; left: 0; width: 100%; height: 50px; background: #fff; display: flex; justify-content: center; align-items: center; } .licagrmnt_container > div:after { /*content: '';*/ width: 100vw; height: 70px; background: linear-gradient(transparent, rgba(0,0,0,0.5)); position: absolute; z-index: -1; } .closebtn { width: 60px; height: 60px; border-radius: 50%; position: absolute; bottom: 7vh; display: flex; justify-content: center; align-items: center; cursor: pointer; background: #fff; transition: all 0.3s; } .closebtn svg { /*width: 100%; height: 100%;*/ transform: scale(0.4); stroke: #000; stroke-width: 3; transition: all 0.3s; } .closebtn:hover { background: #87c43e; } .closebtn:hover svg { stroke: #fff; } footer { /* margin-top: 120px; */ width: 100%; height: var(--footer); /*position: fixed;*/ /*bottom: 0; left: 0;*/ display: flex; justify-content: center; align-items: center; background: transparent; } .inputwrapper span.inputfocus { transform: translate(-35px, -25px) scale(0.8); font-weight: bold; /* color: var(--cuscol); */ } .explode { display: block; position: absolute; background: hsl(90, 53%, 40%); /* background: hsl(216, 53%, 40%); */ border-radius: var(--max); transform: scale(0); z-index: 1; } .explode.animate { animation: explodeAnimate 0.65s linear; } @keyframes explodeAnimate { 100% {opacity: 0; transform: scale(2.5);} } ._fadeout { opacity: 0; } ._strtoupper { text-transform: uppercase; } @media only screen and (max-width: 1024px) { .licagrmnt_container { padding: 0 15vw; } .licagrmnt_container header { padding: 5px 0 10px; } } @media only screen and (max-width: 850px) { .loginwrapper { align-items: center; flex-direction: column; height: auto; padding: 0; } .left { margin: 4vh 0; } .loginwrapper > div { width: calc((100% / 3) * 2); } .logo { width: 300px; height: 120px; } footer { margin-top: 6vh; } .licagrmnt_container { padding: 0 5vw; } .licagrmnt_container header { padding: 2px 0 5px; } } @media only screen and (max-width: 600px) { .companyname { display: none; } } @media only screen and (max-width: 480px) { .loginwrapper > div { width: calc((100% / 7) * 6); } } .table_disp{ font-family: arial; font-size: 12px; border: 1px; border-collapse: collapse; cursor: pointer; } .table_disp th{ background-color: #bdbdbd; color: black; height:30px; } .table_disp tbody tr:hover{ background-color:silver; } #login_frame{ border: 1px solid #696; padding: 60px 0; text-align: center; width: 400px; -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 10px; -webkit-box-shadow: #666 0px 2px 3px; -moz-box-shadow: #666 0px 2px 3px; box-shadow: #666 0px 2px 3px; background : white; behavior: url(./css/PIE.htc); } .gp{ width : 80%; } #login_frame table{ align-items : center; } .div_border_back{ /*border: 0px solid gainsboro;*/ /*background : #204f1e;*/ width : 350px; height : 280px; /*-webkit-border-radius: 8px;*/ /*-moz-border-radius: 8px;*/ /*border-radius: 10px;*/ -webkit-box-shadow: #666 0px 3px 10px; -moz-box-shadow: #666 0px 3px 10px; box-shadow: #666 0px 3px 10px; } .div_border_front1{ background : #3a6f8f; width : 100%; height : 4%; -webkit-border-top-left-radius: 8px; -moz-border-top-left-radius: 8px; border-top-left-radius: 10px; -webkit-border-top-right-radius: 8px; -moz-border-top-right-radius: 8px; border-top-right-radius: 10px; } .div_border_front2{ /*background : white;*/ width : 100%; height : 96%; -webkit-border-bottom-left-radius: 6px; -moz-border-bottom-left-radius: 6px; border-bottom-left-radius: 8px; -webkit-border-bottom-right-radius: 6px; -moz-border-bottom-right-radius: 6px; border-bottom-right-radius: 8px; } .gp{ width : 96%; border : solid 1px rgba(98, 125, 77, 0.5) !important; margin-bottom: 15px; } .sublabel{ color : #555555; } .headlabel{ color : #555555; } :root { --cuscol: #052b00; --progh: 50px; --footer: 50px; --navtop: 2vh; --max: 100%; } .licagrmnt { /* color: var(--cuscol); */ } /* .inputwrapper .underline { background-color: var(--cuscol); } */ * { font-family: unset; } .div_version{ display: flex; justify-content: flex-end; } .tbl_versions, .tbl_versions td, .tbl_versions th { border: 1px solid #ddd; text-align: left; } .tbl_versions { border-collapse: collapse; width: 100%; } .tbl_versions th, .tbl_versions td { padding: 5px; } </style> <script type="text/javascript" src="jquery-1.10.2.min.js"></script> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon"> <link rel="icon" href="img/favicon.ico" type="image/x-icon"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <!-- <link rel="stylesheet" type="text/css" href="css/login_page.css"> --> </head> <body> <!-- <div class="prog"> </div> --> <div class="loginwrapper"> <div class="left"> <div class="logo"> <img src="lst.png"> </div> </div> <div class="right"> <!-- <form name="myform" id="myform" action="https://www.lstviweb.com/online/redfiel/login.php" method="POST"> --> <form name="myform" id="myform" action="" method="POST"> <div class="logincontainer"> <div class="top"> <header>Login</header> <span>Please enter a valid USER ID and Password</span> </div> <div class="logincred"> <div class="inputgrp"> <div class="inputwrapper"> <input type="text" name="dsply_gl_comcde" id="dsply_gl_comcde" class="_textbox _strtoupper" autocomplete="off" value=''> <input name="gl_comcde" id="gl_comcde" class="_textbox _strtoupper" autocomplete="off" value=''> <span class="inputfocus">Company ID</span> <div class="underline full"></div> </div> <div class="inputwrapper"> <input type="text" name="txtusrcde" id="txtusrcde" class="_textbox _strtoupper" autocomplete="off"> <span>User ID</span> <div class="underline"></div> </div> <div class="inputwrapper"> <input type="password" name="txtusrpwd" id="txtusrpwd" class="_textbox"> <span>Password</span> <div class="underline"></div> </div> <div class="inputwrapper"> <span style="text-align: center;"> <label style="color: red;" id="lbl_valmsg"> </label> </span> </div> </div> <div class="btngrp"> <div> <span id="forgot" onclick="forgot_password()" style="cursor: pointer;">Forgot Password ?</span> </div> <div class="loginbtn"> <!-- <input type="button" id="loginBtn" name="" class="" onclick="login_click();" value="Login"> --> <input type="button" id="loginBtn" name="" class="" value="Login"> </div> </div> </div> <div class=""> <p>By using this program you agree to the terms and conditions of the <span class="licagrmnt">license agreement</span>.</p> </div> <div style="padding: 5px;"> <div style="float: left; cursor: pointer;"> <!-- <span onclick="view_versions()"><u>versions</u></span> --> </div> <div style="float: right;"> <!-- <span>v</span> --> </div> </div> </div> <input name="browser" id="browser" value=""> <input name="module" id="module" value=""> <input name="txt_event" id="txt_event" value=""> <input name="txt_url" id="txt_url" value=""> </form> </div> <footer> <span>Copyright © 2021 LEE Systems Technology Ventures Inc</span> </footer> <div class="licagrmnt_container" style=" width:100vw; display:none;"> <header>SOFTWARE LICENSE AGREEMENT FOR LEE SYSTEMS TECHNOLOGY VENTURES INCORPORATED SOFTWARE</header> <article> <section> <label> License Agreement </label> <p> You should carefully read the following terms and conditions before using this software. This Lee Systems Technology Ventures Incorporated Software License Agreement ("SLA") is a legal agreement between you (either an individual or a single entity) and Lee Systems Technology Ventures Incorporated for this Software product which will be referred in this agreement as the "SOFTWARE". Unless you have a different license agreement signed by Lee Systems Technology Ventures, your use of this software indicates your acceptance of this license agreement and warranty. <strong>IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, DO NOT USE THE SOFTWARE</strong>. </p> </section> <section> <label> Governing Law </label> <p> You should carefully read the following terms and conditions before using this software. This Lee Systems Technology Ventures Incorporated Software License Agreement ("SLA") is a legal agreement between you (either an individual or a single entity) and Lee Systems Technology Ventures Incorporated for this Software product which will be referred in this agreement as the "SOFTWARE". Unless you have a different license agreement signed by Lee Systems Technology Ventures, your use of this software indicates your acceptance of this license agreement and warranty. <strong>IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, DO NOT USE THE SOFTWARE</strong>. </p> <p> This agreement shall be governed by the laws of the Republic of the Philippines. </p> </section> <section> <label> SOFTWARE PRODUCT LICENSE </label> <p> The software product is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The software is licensed, NOT SOLD. </p> </section> <section> <label> Use and Registration </label> <p> This is not a free software. You agree to register this software in the website of Lee Systems Technology Ventures (www.lstventures.com). </p> </section> <section> <label class="xcount"> GRANT OF LICENSE. This SLA grants you the following rights: </label> <p> Lee Systems Technology Ventures grants you as an individual , a personal, non-exclusive license to use the software product. You may install and use one copy of the software on a single computer. You may also store or install a copy of the Software Product, such as a network server or back-up disk, used only for the said purpose. A license for the software product may not be shared or used concurrently on different computers. </p> </section> <section> <label class="xcount"> DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS. </label> <p> <ul class="circle"> <li> Not for Resale nor Sublease. you may not resell, sublease or otherwise transfer for value, the software product. </li> <li> You acknowledge that Lee Systems Technology Ventures Software contains proprietary and confidential information that is protected by applicable intellectual property and other laws. Except as expressly permitted herein, you agree not to copy, modify, rent, lease, loan, sell, distribute or create derivative works based on this Software, in whole or in part. </li> <li> You agree not to translate, reverse engineer, decompile, disassemble or make derivative works from this software. You agree not to modify this Software in any manner or form, or to use modified versions of this Software including (without limitation) for the purpose of obtaining unauthorized access to the data and unlimited use of this program. </li> <li> Separation of Components. The software product is licensed as a single product. Its component parts may not be separated for use on more than one computer. </li> <li> Lee Systems Technology Ventures is not responsible for obtaining and maintaining the computer equipment and accessories used by the Software. </li> </ul> </p> </section> <section> <label class="xcount"> UPGRADES OR MODIFICATIONS </label> <p> If the software is upgraded or modified, you must be properly licensed to use a product identified by Lee Systems Technology Ventures as being eligible for the upgrade/modified in order to use the software. You may use the resulting upgraded/modified product only in accordance with the terms of this SLA. If the software is an upgrade/modified of a component of a package of software programs that you licensed as a single product, the software may be used and transferred only as part of that single product package and may not be separated for use on more than one computer. </p> </section> <section> <label class="xcount"> COPYRIGHT & INTELLECTUAL PROPERTY </label> <p> Republic Act No. 8293. All title and copyrights in and to the software products (including but not limited to any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the software), the accompanying printed materials, and any copies of the software are owned by Lee Systems Technology Ventures or its suppliers. All title and intellectual property rights in and to the content which may be accessed through use of the Software Product is the property of the respective content owners and may be protected by applicable copyright or other intellectual laws and treaties. The software is protected by copyright laws and international treaty provisions. Therefore, you must treat the software like any other copyrighted material except that you may install the software on a single computer provided you keep the original solely for backup or archival purposes. You may not copy the printed materials accompanying the software. </p> </section> <section> <label class="xcount"> LIMITED WARRANTY </label> <p> The Software is provided "AS IS" and without warranties as to performance or merchantability or any other warranties whether expressed or implied. </p> </section> <section> <strong> <p> LEE SYSTEMS TECHNOLOGY VENTURES INCORPORATED ENTIRE LIABILITY TO YOU AND YOUR EXCLUSIVE REMEDY SHALL BE THE REPLACEMENT OF ANY DEFECTIVE MEDIA(SUCH AS CD-ROM) RETURNED BY YOU TO LEE SYSTEMS TECHNOLOGY WITH PROOF OF PURCHASE DURING THE 30-DAY LIMITED WARRANTY PERIOD. IN NO EVENT SHALL THE LIABILITY OF LEE SYSTEMS TECHNOLOGY ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE EXCEED THE FEE PAID BY YOU FOR THIS LICENSE. </p> <p> NO OTHER WARRANTIES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, LEE SYSTEMS TECHNOLOGY VENTURES AND ITS REFERRALS DISCLAIM ALL WARRANTIES AND CONDITIONS, WHETHER EXPRESS OR IMPLIED, STATUTORY OR OTHERWISE, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY , FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE PRODUCT, AND THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES. LEE SYSTEMS DISCLAIMS ANY WARRANTY AS TO THE PERFORMANCE OF THE SOFTWARE OR AS TO THE RESULTS THAT MAY BE OBTAINED BY USING THE SOFTWARE. THE ENTIRE RISK AS TO THE INSTALLATION, QUALITY, USE AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. IN NO EVENT SHALL LEE SYSTEMS TECHNOLOGY VENTURES OR ITS STAFF, REFERRALS AND REPRESENTATIVES BE LIABLE FOR ANY SPECIAL, INCIDENTAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER ( INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE PRODUCT OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF LEE SYSTEMS TECHNOLOGY VENTURES HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. LEE SYSTEMS TECHNOLOGY GRANTS NO WARRANTY AND SHALL HAVE NO LIABILITY WHATSOEVER BEYOND THE 30 DAY PERIOD WARRANTY. </p> </strong> </section> </article> <div> <div class="closebtn"> <svg height="50" width="50"> <line x1="0" y1="0" x2="50" y2="50"/> <line x1="50" y1="0" x2="0" y2="50"/> Sorry, your browser does not support inline SVG. </svg> </div> <span>Lee Systems Technology Ventures</span> </div> </div> </div> <script type="text/javascript"> window.onload = () => { const username = document.getElementById('txtusrcde'); const password = document.getElementById('txtusrpwd'); const companyid = document.getElementById('gl_comcde'); const display_companyid = document.getElementById('dsply_gl_comcde'); const errorMsg = document.getElementById("lbl_valmsg"); const loginBtn = document.getElementById('loginBtn'); const forgotBtn = document.getElementById('forgot'); // console.log(username) // username.addEventListener('change', () => console.log(username.value)) // password.addEventListener('change', () => console.log(password.value)) display_companyid.focus() loginBtn.addEventListener('click', () => login()); forgotBtn.addEventListener('click', () => forgot_password()) //window listener window.addEventListener('keydown', (e) => { if(e.ctrlKey == true && e.keyCode == 122 ){ let mainprogdir = 'https://vps1.lstventures.com/online/onedb/webapp/'; window.open(mainprogdir+'lstv_params.php', '_blank'); } else if(e.keyCode == 13){ login(); console.log(e) } }) function login(){ var xparams = jQuery('#myform *').serialize(); xparams += "&event_action=login"; $.ajax({ dataType: "json", type: "post", url: "login_ajax.php", data: xparams, success : function (xretobj) { if (xretobj.bool == false) { errorMsg.innerText = 'Contact LSTV Inc. for assistance'; } else { errorMsg.innerText = '' if(display_companyid.value == ''){ // console.log(errorMsg) display_companyid.focus(); errorMsg.innerText = 'Company ID should not be empty'; } else if( username.value == ''){ // console.log(errorMsg) username.focus() errorMsg.innerText = 'User ID should not be empty' } else if( password.value == '' ){ // console.log(errorMsg) password.focus() errorMsg.innerText = 'Password should not be empty' } else{ loginBtn.disabled = true; loginBtn.value = "Please wait..."; var mainprogdir = xretobj.mainprogdir; // var mainprogdir = ''; var mainpage = 'http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php?'; var dbprefix = ''; document.getElementById("gl_comcde").value = dbprefix+dsply_gl_comcde.value; // Add the DB Prefix in Company ID // document.getElementById("gl_comcde").value = dsply_gl_comcde.value; // Add the DB Prefix in Company ID document.forms.myform.txt_event.value= 'login'; document.forms.myform.txt_url.value= mainpage; document.forms.myform.action= mainprogdir+'login_validate.php'; document.forms.myform.method='post'; document.forms.myform.target='_self'; document.forms.myform.submit(); } } } }) } function forgot_password(){ var xparams = jQuery('#myform *').serialize(); xparams += "&event_action=login"; $.ajax({ dataType: "json", type: "post", url: "login_ajax.php", data: xparams, success : function (xretobj) { if (xretobj.bool == false) { errorMsg.innerText = 'Contact LSTV Inc. for assistance'; } else { // let mainprogdir = ''; // var dbprefix = ''; var dbprefix = ""; var mainprogdir = xretobj.mainprogdir; document.getElementById("gl_comcde").value = dbprefix+dsply_gl_comcde.value; // Add the DB Prefix in Company ID document.forms.myform.action = mainprogdir+'login_forgot.php'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } } }); } } $(function() { // ripple click for buttons var explode, xpld, m, x, y; $('.loginbtn').each(function() { $(this).click(function(e) { $(this).find('.explode').length == 0 ? $(this).prepend('<span class=\'explode\'></span>') : ''; xpld = $(this).find('.explode'); xpld.removeClass('animate'); !xpld.height() && !xpld.width() ? m = Math.max($(this).outerWidth(), $(this).outerHeight()) : ''; xpld.css({ height: m, width: m }); x = e.pageX - $(this).offset().left - xpld.width() / 2; y = e.pageY - $(this).offset().top - xpld.height() / 2; // console.log(e); $(this).find('.explode').css({ top: y + 'px', left: x + 'px' }).addClass('animate'); }) }); // ends here // transition of placeholder up to the top of input text box and effects of underline located aat the bottom of the input tag. $('.inputwrapper').each(function() { var input = $(this).find('input').val(); if (input != "") { $(this).find('input').siblings('span').addClass('inputfocus'); $(this).find('input').siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); } $(this).find('input').on({ focus: function() { $(this).siblings('span').addClass('inputfocus'); $(this).siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); }, blur: function() { if ($(this).val() != '') { $(this).siblings('span').addClass('inputfocus'); $(this).siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); } else { $(this).siblings('span').removeClass('inputfocus'); $(this).siblings('.underline').removeClass('full'); } } }) }); // ends here // show the licence agreement $('.licagrmnt').click(function() { $('.licagrmnt_container').fadeIn(); }); // ends here // close the licence agreement $('.closebtn').click(function() { $(this).parents('.licagrmnt_container').fadeOut(); }) $('body').on('keydown', function(e) { var esc = e.which || e.keyCode; esc == 27 ? $('.licagrmnt_container').fadeOut() : ''; }) $('.licagrmnt_container').fadeOut() // ends here // alert($(window).width()+' x '+$(window).height()); }); </script> </body> <html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/ajax_menu.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 289 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/ajax_menu.php HTTP/1.1
Proxy-Connection: keep-alive X-Requested-With: XMLHttpRequest Origin: http://192.168.2.47 Content-Length: 11 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,205 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 656 Connection: close Content-Type: text/html; charset=utf-8 |
| Response Body - size: 656 bytes. |
{"form":"<aside><a><h3 class='menu_has_mensub active' id='389' onclick=\"load_page2('COD00','389')\" style='cursor:pointer'>Code Definition<i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><\/h3><\/a><\/h3><\/a><a><h3 class='menu_has_mensub ' id='30' onclick=\"load_page2('PIM00','30')\" style='cursor:pointer'>Employees<i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><\/h3><\/a><\/h3><\/a><a><h3 class='menu_has_mensub ' id='57' onclick=\"load_page2('UTL00','57')\" style='cursor:pointer'>Utilities<i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><\/h3><\/a><\/h3><\/a><\/aside>","active_menrecid":"389"}
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/cm_bread_ajax.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 664 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/cm_bread_ajax.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Content-Length: 34 Accept: application/json, text/javascript, */*; q=0.01 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Origin: http://192.168.2.47 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 34 bytes. |
cap=Position Type File&url=current
|
| Response Header - size: 1,076 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:42 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 167 Content-Type: text/html; charset=UTF-8 |
| Response Body - size: 167 bytes. |
"<a href=\"#\" onclick=load_page(\"main.php\",\"\",\"\",\"\",\"1\")>Dashboard<\/a><div class=\"breadcrumb_divider\"><\/div> <a class='current'>Position Type File<\/a>"
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/db_field_length_checker_ajax.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 680 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/db_field_length_checker_ajax.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Content-Length: 113 Accept: application/json, text/javascript, */*; q=0.01 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Origin: http://192.168.2.47 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 113 bytes. |
link_hash_id=cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85&link_id=&tablename=positiontypefile
|
| Response Header - size: 1,161 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:42 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 2 Content-Type: text/html; charset=utf-8 |
| Response Body - size: 2 bytes. |
[]
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/menu_view_ajax.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com |
| Request Header - size: 665 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/menu_view_ajax.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Content-Length: 22 Accept: application/json, text/javascript, */*; q=0.01 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Origin: http://192.168.2.47 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 22 bytes. |
menid=389&mensub=COD00
|
| Response Header - size: 1,187 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:42 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 2558 Content-Type: text/html; charset=utf-8 |
| Response Body - size: 2,558 bytes. |
{"form":"<div id=\"menu2_sub\"><div class='mendiv'><p>General Setup<\/p><ul><li ><a id='men_22' onclick=\"load_page('mf_area.php','Area','','22')\">Area<\/a><\/li><li ><a id='men_201' onclick=\"load_page('mf_city.php','City','','201')\">City<\/a><\/li><li ><a id='men_256' onclick=\"load_page('mf_cvlstatfile.php','Civil Status File','','256')\">Civil Status File<\/a><\/li><li ><a id='men_170' onclick=\"load_page('mf_country.php','Country','','170')\">Country<\/a><\/li><li ><a id='men_28' onclick=\"load_page('mf_dept.php','Department','','28')\">Department<\/a><\/li><li ><a id='men_27' onclick=\"load_page('mf_division.php','Division','','27')\">Division<\/a><\/li><li ><a id='men_41' onclick=\"load_page('mf_employmenttype.php','Employment Type','','41')\">Employment Type<\/a><\/li><li ><a id='men_60' onclick=\"load_page('mf_nationality.php','Nationality','','60')\">Nationality<\/a><\/li><li ><a id='men_283' onclick=\"load_page('mf_postype.php','Position Type','','283')\">Position Type<\/a><\/li><li ><a id='men_254' onclick=\"load_page('mf_prefix.php','Prefix','','254')\">Prefix<\/a><\/li><li ><a id='men_265' onclick=\"load_page('mf_province.php','Province','','265')\">Province<\/a><\/li><li ><a id='men_257' onclick=\"load_page('mf_region.php','Region','','257')\">Region<\/a><\/li><li ><a id='men_266' onclick=\"load_page('mf_regionprovcity_con.php','Region,Province City Con.','','266')\">Region,Province City Con.<\/a><\/li><li ><a id='men_23' onclick=\"load_page('mf_religion.php','Religion','','23')\">Religion<\/a><\/li><li ><a id='men_255' onclick=\"load_page('mf_suffix.php','Suffix','','255')\">Suffix<\/a><\/li><\/ul><\/div><div class='mendiv'><p>Employees<\/p><ul><li ><a id='men_32' onclick=\"load_page('mf_bankacct.php','Bank','','32')\">Bank<\/a><\/li><li ><a id='men_62' onclick=\"load_page('mf_accountype.php','Bank Account Type','','62')\">Bank Account Type<\/a><\/li><li ><a id='men_24' onclick=\"load_page('mf_status.php','Employee Status','','24')\">Employee Status<\/a><\/li><li ><a id='men_58' onclick=\"load_page('mf_leave.php','Leaves','','58')\">Leaves<\/a><\/li><li ><a id='men_190' onclick=\"load_page('mf_paycycle.php','Payroll Cycle','','190')\">Payroll Cycle<\/a><\/li><li ><a id='men_26' onclick=\"load_page('mf_payrollgrp.php','Payroll Group','','26')\">Payroll Group<\/a><\/li><li ><a id='men_29' onclick=\"load_page('mf_pos.php','Position','','29')\">Position<\/a><\/li><li ><a id='men_250' onclick=\"load_page('mf_taxcode.php','Tax Code','','250')\">Tax Code<\/a><\/li><\/ul><\/div><\/div>","menwidth":null}
|
| Instances | 7 |
| Solution |
Ensure that your web server, application server, load balancer, etc. is properly configured to set the Content-Security-Policy header.
|
| Reference |
http://www.w3.org/TR/CSP2/
http://www.w3.org/TR/CSP/ http://caniuse.com/#search=content+security+policy http://content-security-policy.com/ https://github.com/shapesecurity/salvation https://developers.google.com/web/fundamentals/security/csp#policy_applies_to_a_wide_variety_of_resources |
| Tags |
OWASP_2021_A05
OWASP_2017_A06 |
| CWE Id | 693 |
| WASC Id | 15 |
| Plugin Id | 10055 |
|
Medium |
Hidden File Found |
|---|---|
| Description |
A sensitive file was identified as accessible or available. This may leak administrative, configuration, or credential information which can be leveraged by a malicious individual to further attack the system or conduct social engineering efforts.
|
| URL | http://192.168.2.47/adminer.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | HTTP/1.1 200 OK |
| Request Header - size: 515 bytes. |
GET http://192.168.2.47/adminer.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Language: en-US,en;q=0.9 Content-Length: 0 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,341 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 05:59:02 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Set-Cookie: adminer_sid=lnavs3tbvqtgul11kic68ak73e; path=/adminer.php; HttpOnly; SameSite=Lax Set-Cookie: adminer_key=60ef697eb07e916943abe8760f3e2fcc; path=/adminer.php; HttpOnly; SameSite=lax Cache-Control: no-cache X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Referrer-Policy: origin-when-cross-origin Vary: Accept-Encoding Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 4297 Content-Type: text/html; charset=utf-8 |
| Response Body - size: 4,297 bytes. |
<!DOCTYPE html>
<html lang="en" dir="ltr"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="robots" content="noindex"> <title>Login - Adminer</title> <link rel="stylesheet" type="text/css" href="adminer.php?file=default.css&version=4.8.0"> <script src='adminer.php?file=functions.js&version=4.8.0' nonce="ZGFhM2MyNDI1YWJmYWNjZjA2ZWVjNzk0ZDI5ZTNhYWU="></script> <link rel="shortcut icon" type="image/x-icon" href="adminer.php?file=favicon.ico&version=4.8.0"> <link rel="apple-touch-icon" href="adminer.php?file=favicon.ico&version=4.8.0"> <body class="ltr nojs"> <script nonce="ZGFhM2MyNDI1YWJmYWNjZjA2ZWVjNzk0ZDI5ZTNhYWU="> mixin(document.body, {onkeydown: bodyKeydown, onclick: bodyClick, onload: partial(verifyVersion, '4.8.0', 'adminer.php?', '410093:866939')}); document.body.className = document.body.className.replace(/ nojs/, ' js'); var offlineMessage = 'You are offline.'; var thousandsSeparator = ','; </script> <div id="help" class="jush-sql jsonly hidden"></div> <script nonce="ZGFhM2MyNDI1YWJmYWNjZjA2ZWVjNzk0ZDI5ZTNhYWU=">mixin(qs('#help'), {onmouseover: function () { helpOpen = 1; }, onmouseout: helpMouseout});</script> <div id="content"> <h2>Login</h2> <div id='ajaxstatus' class='jsonly hidden'></div> <form action='' method='post'> <div></div> <table cellspacing='0' class='layout'> <tr><th>System<td><select name='auth[driver]'><option value="server" selected>MySQL</select><script nonce="ZGFhM2MyNDI1YWJmYWNjZjA2ZWVjNzk0ZDI5ZTNhYWU=">qsl('select').onchange = function () { loginDriver(this); };</script> <tr><th>Server<td><input name="auth[server]" value="" title="hostname[:port]" placeholder="localhost" autocapitalize="off"> <tr><th>Username<td><input name="auth[username]" id="username" value="" autocomplete="username" autocapitalize="off"><script nonce="ZGFhM2MyNDI1YWJmYWNjZjA2ZWVjNzk0ZDI5ZTNhYWU=">focus(qs('#username')); qs('#username').form['auth[driver]'].onchange();</script> <tr><th>Password<td><input type="password" name="auth[password]" autocomplete="current-password"> <tr><th>Database<td><input name="auth[db]" value="" autocapitalize="off"> </table> <p><input type='submit' value='Login'> <label><input type='checkbox' name='auth[permanent]' value='1'>Permanent login</label> </form> </div> <form action='' method='post'> <div id='lang'>Language: <select name='lang'><option value="en" selected>English<option value="ar">العربية<option value="bg">Български<option value="bn">বাংলা<option value="bs">Bosanski<option value="ca">Català<option value="cs">Čeština<option value="da">Dansk<option value="de">Deutsch<option value="el">Ελληνικά<option value="es">Español<option value="et">Eesti<option value="fa">فارسی<option value="fi">Suomi<option value="fr">Français<option value="gl">Galego<option value="he">עברית<option value="hu">Magyar<option value="id">Bahasa Indonesia<option value="it">Italiano<option value="ja">日本語<option value="ka">ქართული<option value="ko">한국어<option value="lt">Lietuvių<option value="ms">Bahasa Melayu<option value="nl">Nederlands<option value="no">Norsk<option value="pl">Polski<option value="pt">Português<option value="pt-br">Português (Brazil)<option value="ro">Limba Română<option value="ru">Русский<option value="sk">Slovenčina<option value="sl">Slovenski<option value="sr">Српски<option value="sv">Svenska<option value="ta">தமிழ்<option value="th">ภาษาไทย<option value="tr">Türkçe<option value="uk">Українська<option value="vi">Tiếng Việt<option value="zh">简体中文<option value="zh-tw">繁體中文</select><script nonce="ZGFhM2MyNDI1YWJmYWNjZjA2ZWVjNzk0ZDI5ZTNhYWU=">qsl('select').onchange = function () { this.form.submit(); };</script> <input type='submit' value='Use' class='hidden'> <input type='hidden' name='token' value='832138:510236'> </div> </form> <div id="menu"> <h1> <a href='https://www.adminer.org/' target="_blank" rel="noreferrer noopener" id='h1'>Adminer</a> <span class="version">4.8.0</span> <a href="https://www.adminer.org/#download" target="_blank" rel="noreferrer noopener" id="version"></a> </h1> </div> <script nonce="ZGFhM2MyNDI1YWJmYWNjZjA2ZWVjNzk0ZDI5ZTNhYWU=">setupSubmitHighlight(document);</script> |
| Instances | 1 |
| Solution |
Consider whether or not the component is actually required in production, if it isn't then disable it. If it is then ensure access to it requires appropriate authentication and authorization, or limit exposure to internal systems or specific source IPs, etc.
|
| Reference | https://blog.hboeck.de/archives/892-Introducing-Snallygaster-a-Tool-to-Scan-for-Secrets-on-Web-Servers.html |
| Tags |
OWASP_2021_A05
WSTG-v42-CONF-05 OWASP_2017_A06 |
| CWE Id | 538 |
| WASC Id | 13 |
| Plugin Id | 40035 |
|
Medium |
Relative Path Confusion |
|---|---|
| Description |
The web server is configured to serve responses to ambiguous URLs in a manner that is likely to lead to confusion about the correct "relative path" for the URL. Resources (CSS, images, etc.) are also specified in the page response using relative, rather than absolute URLs. In an attack, if the web browser parses the "cross-content" response in a permissive manner, or can be tricked into permissively parsing the "cross-content" response, using techniques such as framing, then the web browser may be fooled into interpreting HTML as CSS (or other content types), leading to an XSS vulnerability.
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php/br1w9/o89rr |
| Evidence | <link rel="SHORTCUT ICON" href="img/tab_title.ico"> |
| Request Header - size: 378 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php/br1w9/o89rr HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Content-Length: 0 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:55:13 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,447 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("RR5EcwAXm0UYJ4nZXcxpDs/Rx5PZNSkf5JwBrHLPIPXvQYjjgoU9eiq/9Gg0lxsmwZJ+kVWhOKxf/Wkaf2iLIQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("RR5EcwAXm0UYJ4nZXcxpDs/Rx5PZNSkf5JwBrHLPIPXvQYjjgoU9eiq/9Gg0lxsmwZJ+kVWhOKxf/Wkaf2iLIQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("RR5EcwAXm0UYJ4nZXcxpDs/Rx5PZNSkf5JwBrHLPIPXvQYjjgoU9eiq/9Gg0lxsmwZJ+kVWhOKxf/Wkaf2iLIQ==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("0M9bGNBc19gfJUZZFs/wT/Fi1+ZQAD9WKgwVp3YUP6CqlXqFJviYcH1ZnhiZwcGzbG6TgHpTpM3tuTG9Sbun/A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("0M9bGNBc19gfJUZZFs/wT/Fi1+ZQAD9WKgwVp3YUP6CqlXqFJviYcH1ZnhiZwcGzbG6TgHpTpM3tuTG9Sbun/A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("0M9bGNBc19gfJUZZFs/wT/Fi1+ZQAD9WKgwVp3YUP6CqlXqFJviYcH1ZnhiZwcGzbG6TgHpTpM3tuTG9Sbun/A==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("94WGNyDxaSo5cU5gTdnleJS6uxr5XzfM68ZtXgyHl2yZLw1RqCKq59Tyivu9r+vDP9DK1UHL8ECm87V4DFzYKg==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("94WGNyDxaSo5cU5gTdnleJS6uxr5XzfM68ZtXgyHl2yZLw1RqCKq59Tyivu9r+vDP9DK1UHL8ECm87V4DFzYKg==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("94WGNyDxaSo5cU5gTdnleJS6uxr5XzfM68ZtXgyHl2yZLw1RqCKq59Tyivu9r+vDP9DK1UHL8ECm87V4DFzYKg==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("SteWHsd2Y9s7IDuHoLi5cJyO3A4ZWAOW+/hWKhVsZZWN/r5Luct3hTwMD69rY1wW7ax7gQ8ZRjWlI/4bMxWvEA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("SteWHsd2Y9s7IDuHoLi5cJyO3A4ZWAOW+/hWKhVsZZWN/r5Luct3hTwMD69rY1wW7ax7gQ8ZRjWlI/4bMxWvEA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("SteWHsd2Y9s7IDuHoLi5cJyO3A4ZWAOW+/hWKhVsZZWN/r5Luct3hTwMD69rY1wW7ax7gQ8ZRjWlI/4bMxWvEA==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php/br1w9/o89rr'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| Instances | 1 |
| Solution |
Web servers and frameworks should be updated to be configured to not serve responses to ambiguous URLs in such a way that the relative path of such URLs could be mis-interpreted by components on either the client side, or server side.
Within the application, the correct use of the "<base>" HTML tag in the HTTP response will unambiguously specify the base URL for all relative URLs in the document.
Use the "Content-Type" HTTP response header to make it harder for the attacker to force the web browser to mis-interpret the content type of the response.
Use the "X-Content-Type-Options: nosniff" HTTP response header to prevent the web browser from "sniffing" the content type of the response.
Use a modern DOCTYPE such as "<!doctype html>" to prevent the page from being rendered in the web browser using "Quirks Mode", since this results in the content type being ignored by the web browser.
Specify the "X-Frame-Options" HTTP response header to prevent Quirks Mode from being enabled in the web browser using framing attacks.
|
| Reference |
http://www.thespanner.co.uk/2014/03/21/rpo/
https://hsivonen.fi/doctype/ http://www.w3schools.com/tags/tag_base.asp |
| Tags |
OWASP_2021_A05
OWASP_2017_A06 |
| CWE Id | 20 |
| WASC Id | 20 |
| Plugin Id | 10051 |
|
Medium |
Vulnerable JS Library |
|---|---|
| Description |
The identified library jquery-ui, version 1.10.4 is vulnerable.
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/tinymce/tinymce.min.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | // 4.4.3 (2016-09-01) !function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){var r,i,o,a,l;for(r=0;r<n.length;r++){i=e,o=n[r],a=o.split(/[.\/]/);for(var c=0;c<a.length-1;++c)i[a[c]]===t&&(i[a[c]]={}),i=i[a[c]];i[a[a.length-1]]=s[o]}if(e.AMDLC_TESTS){l=e.privateModules||{};for(o in s)l[o]=s[o];for(r=0;r<n.length;r++)delete l[n[r]];e.privateModules=l}}var s={},l="tinymce/geom/Rect" |
| Request Header - size: 501 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/tinymce/tinymce.min.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 385081 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 385,081 bytes. |
// 4.4.3 (2016-09-01)
!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){var r,i,o,a,l;for(r=0;r<n.length;r++){i=e,o=n[r],a=o.split(/[.\/]/);for(var c=0;c<a.length-1;++c)i[a[c]]===t&&(i[a[c]]={}),i=i[a[c]];i[a[a.length-1]]=s[o]}if(e.AMDLC_TESTS){l=e.privateModules||{};for(o in s)l[o]=s[o];for(r=0;r<n.length;r++)delete l[n[r]];e.privateModules=l}}var s={},l="tinymce/geom/Rect",c="tinymce/util/Promise",u="tinymce/util/Delay",d="tinymce/Env",f="tinymce/dom/EventUtils",h="tinymce/dom/Sizzle",p="tinymce/util/Arr",m="tinymce/util/Tools",g="tinymce/dom/DomQuery",v="tinymce/html/Styles",y="tinymce/dom/TreeWalker",b="tinymce/dom/Range",C="tinymce/html/Entities",x="tinymce/dom/StyleSheetLoader",w="tinymce/dom/DOMUtils",N="tinymce/dom/ScriptLoader",E="tinymce/AddOnManager",_="tinymce/dom/NodeType",S="tinymce/text/Zwsp",k="tinymce/caret/CaretContainer",T="tinymce/dom/RangeUtils",R="tinymce/NodeChange",A="tinymce/html/Node",B="tinymce/html/Schema",D="tinymce/html/SaxParser",L="tinymce/html/DomParser",M="tinymce/html/Writer",P="tinymce/html/Serializer",O="tinymce/dom/Serializer",H="tinymce/dom/TridentSelection",I="tinymce/util/VK",F="tinymce/dom/ControlSelection",z="tinymce/util/Fun",U="tinymce/caret/CaretCandidate",W="tinymce/geom/ClientRect",V="tinymce/text/ExtendingChar",$="tinymce/caret/CaretPosition",q="tinymce/caret/CaretBookmark",j="tinymce/dom/BookmarkManager",Y="tinymce/dom/Selection",X="tinymce/dom/ElementUtils",K="tinymce/fmt/Preview",G="tinymce/fmt/Hooks",J="tinymce/Formatter",Q="tinymce/UndoManager",Z="tinymce/EnterKey",ee="tinymce/ForceBlocks",te="tinymce/caret/CaretUtils",ne="tinymce/caret/CaretWalker",re="tinymce/InsertList",ie="tinymce/InsertContent",oe="tinymce/EditorCommands",ae="tinymce/util/URI",se="tinymce/util/Class",le="tinymce/util/EventDispatcher",ce="tinymce/data/Binding",ue="tinymce/util/Observable",de="tinymce/data/ObservableObject",fe="tinymce/ui/Selector",he="tinymce/ui/Collection",pe="tinymce/ui/DomUtils",me="tinymce/ui/BoxUtils",ge="tinymce/ui/ClassList",ve="tinymce/ui/ReflowQueue",ye="tinymce/ui/Control",be="tinymce/ui/Factory",Ce="tinymce/ui/KeyboardNavigation",xe="tinymce/ui/Container",we="tinymce/ui/DragHelper",Ne="tinymce/ui/Scrollable",Ee="tinymce/ui/Panel",_e="tinymce/ui/Movable",Se="tinymce/ui/Resizable",ke="tinymce/ui/FloatPanel",Te="tinymce/ui/Window",Re="tinymce/ui/MessageBox",Ae="tinymce/WindowManager",Be="tinymce/ui/Tooltip",De="tinymce/ui/Widget",Le="tinymce/ui/Progress",Me="tinymce/ui/Notification",Pe="tinymce/NotificationManager",Oe="tinymce/dom/NodePath",He="tinymce/util/Quirks",Ie="tinymce/EditorObservable",Fe="tinymce/Mode",ze="tinymce/Shortcuts",Ue="tinymce/file/Uploader",We="tinymce/file/Conversions",Ve="tinymce/file/ImageScanner",$e="tinymce/file/BlobCache",qe="tinymce/file/UploadStatus",je="tinymce/EditorUpload",Ye="tinymce/caret/FakeCaret",Xe="tinymce/dom/Dimensions",Ke="tinymce/caret/LineWalker",Ge="tinymce/caret/LineUtils",Je="tinymce/dom/MousePosition",Qe="tinymce/DragDropOverrides",Ze="tinymce/SelectionOverrides",et="tinymce/util/Uuid",tt="tinymce/Editor",nt="tinymce/util/I18n",rt="tinymce/FocusManager",it="tinymce/EditorManager",ot="tinymce/LegacyInput",at="tinymce/util/XHR",st="tinymce/util/JSON",lt="tinymce/util/JSONRequest",ct="tinymce/util/JSONP",ut="tinymce/util/LocalStorage",dt="tinymce/Compat",ft="tinymce/ui/Layout",ht="tinymce/ui/AbsoluteLayout",pt="tinymce/ui/Button",mt="tinymce/ui/ButtonGroup",gt="tinymce/ui/Checkbox",vt="tinymce/ui/ComboBox",yt="tinymce/ui/ColorBox",bt="tinymce/ui/PanelButton",Ct="tinymce/ui/ColorButton",xt="tinymce/util/Color",wt="tinymce/ui/ColorPicker",Nt="tinymce/ui/Path",Et="tinymce/ui/ElementPath",_t="tinymce/ui/FormItem",St="tinymce/ui/Form",kt="tinymce/ui/FieldSet",Tt="tinymce/ui/FilePicker",Rt="tinymce/ui/FitLayout",At="tinymce/ui/FlexLayout",Bt="tinymce/ui/FlowLayout",Dt="tinymce/ui/FormatControls",Lt="tinymce/ui/GridLayout",Mt="tinymce/ui/Iframe",Pt="tinymce/ui/InfoBox",Ot="tinymce/ui/Label",Ht="tinymce/ui/Toolbar",It="tinymce/ui/MenuBar",Ft="tinymce/ui/MenuButton",zt="tinymce/ui/MenuItem",Ut="tinymce/ui/Throbber",Wt="tinymce/ui/Menu",Vt="tinymce/ui/ListBox",$t="tinymce/ui/Radio",qt="tinymce/ui/ResizeHandle",jt="tinymce/ui/SelectBox",Yt="tinymce/ui/Slider",Xt="tinymce/ui/Spacer",Kt="tinymce/ui/SplitButton",Gt="tinymce/ui/StackLayout",Jt="tinymce/ui/TabPanel",Qt="tinymce/ui/TextBox",Zt="tinymce/Register";r(l,[],function(){function e(e,t,n){var r,i,a,s,l,u;return r=t.x,i=t.y,a=e.w,s=e.h,l=t.w,u=t.h,n=(n||"").split(""),"b"===n[0]&&(i+=u),"r"===n[1]&&(r+=l),"c"===n[0]&&(i+=c(u/2)),"c"===n[1]&&(r+=c(l/2)),"b"===n[3]&&(i-=s),"r"===n[4]&&(r-=a),"c"===n[3]&&(i-=c(s/2)),"c"===n[4]&&(r-=c(a/2)),o(r,i,a,s)}function t(t,n,r,i){var o,a;for(a=0;a<i.length;a++)if(o=e(t,n,i[a]),o.x>=r.x&&o.x+o.w<=r.w+r.x&&o.y>=r.y&&o.y+o.h<=r.h+r.y)return i[a];return null}function n(e,t,n){return o(e.x-t,e.y-n,e.w+2*t,e.h+2*n)}function r(e,t){var n,r,i,a;return n=l(e.x,t.x),r=l(e.y,t.y),i=s(e.x+e.w,t.x+t.w),a=s(e.y+e.h,t.y+t.h),0>i-n||0>a-r?null:o(n,r,i-n,a-r)}function i(e,t,n){var r,i,a,s,c,u,d,f,h,p;return c=e.x,u=e.y,d=e.x+e.w,f=e.y+e.h,h=t.x+t.w,p=t.y+t.h,r=l(0,t.x-c),i=l(0,t.y-u),a=l(0,d-h),s=l(0,f-p),c+=r,u+=i,n&&(d+=r,f+=i,c-=a,u-=s),d-=a,f-=s,o(c,u,d-c,f-u)}function o(e,t,n,r){return{x:e,y:t,w:n,h:r}}function a(e){return o(e.left,e.top,e.width,e.height)}var s=Math.min,l=Math.max,c=Math.round;return{inflate:n,relativePosition:e,findBestRelativePosition:t,intersect:r,clamp:i,create:o,fromClientRect:a}}),r(c,[],function(){function e(e,t){return function(){e.apply(t,arguments)}}function t(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(t,e(r,this),e(i,this))}function n(e){var t=this;return null===this._state?void this._deferreds.push(e):void l(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=n(t._value)}catch(i){return void e.reject(i)}e.resolve(r)})}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void s(e(n,t),e(r,this),e(i,this))}this._state=!0,this._value=t,o.call(this)}catch(a){i.call(this,a)}}function i(e){this._state=!1,this._value=e,o.call(this)}function o(){for(var e=0,t=this._deferreds.length;t>e;e++)n.call(this,this._deferreds[e]);this._deferreds=null}function a(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function s(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(i){if(r)return;r=!0,n(i)}}if(window.Promise)return window.Promise;var l=t.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)},c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return t.prototype["catch"]=function(e){return this.then(null,e)},t.prototype.then=function(e,r){var i=this;return new t(function(t,o){n.call(i,new a(e,r,t,o))})},t.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&c(arguments[0])?arguments[0]:arguments);return new t(function(t,n){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},n)}e[o]=a,0===--i&&t(e)}catch(l){n(l)}}if(0===e.length)return t([]);for(var i=e.length,o=0;o<e.length;o++)r(o,e[o])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(t){t(e)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.race=function(e){return new t(function(t,n){for(var r=0,i=e.length;i>r;r++)e[r].then(t,n)})},t}),r(u,[c],function(e){function t(e,t){function n(e){window.setTimeout(e,0)}var r,i=window.requestAnimationFrame,o=["ms","moz","webkit"];for(r=0;r<o.length&&!i;r++)i=window[o[r]+"RequestAnimationFrame"];i||(i=n),i(e,t)}function n(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)}function r(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)}function i(e){return clearTimeout(e)}function o(e){return clearInterval(e)}var a;return{requestAnimationFrame:function(n,r){return a?void a.then(n):void(a=new e(function(e){r||(r=document.body),t(e,r)}).then(n))},setTimeout:n,setInterval:r,setEditorTimeout:function(e,t,r){return n(function(){e.removed||t()},r)},setEditorInterval:function(e,t,n){var i;return i=r(function(){e.removed?clearInterval(i):t()},n)},throttle:function(e,t){var r,i;return i=function(){var i=arguments;clearTimeout(r),r=n(function(){e.apply(this,i)},t)},i.stop=function(){clearTimeout(r)},i},clearInterval:o,clearTimeout:i}}),r(d,[],function(){function e(e){return"matchMedia"in window?matchMedia(e).matches:!1}var t=navigator,n=t.userAgent,r,i,o,a,s,l,c,u,d,f,h,p,m;r=window.opera&&window.opera.buildNumber,d=/Android/.test(n),i=/WebKit/.test(n),o=!i&&!r&&/MSIE/gi.test(n)&&/Explorer/gi.test(t.appName),o=o&&/MSIE (\w+)\./.exec(n)[1],a=-1==n.indexOf("Trident/")||-1==n.indexOf("rv:")&&-1==t.appName.indexOf("Netscape")?!1:11,s=-1==n.indexOf("Edge/")||o||a?!1:12,o=o||a||s,l=!i&&!a&&/Gecko/.test(n),c=-1!=n.indexOf("Mac"),u=/(iPad|iPhone)/.test(n),f="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,h=e("only screen and (max-device-width: 480px)")&&(d||u),p=e("only screen and (min-width: 800px)")&&(d||u),m=-1!=n.indexOf("Windows Phone"),s&&(i=!1);var g=!u||f||n.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:r,webkit:i,ie:o,gecko:l,mac:c,iOS:u,android:d,contentEditable:g,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=o,range:window.getSelection&&"Range"in window,documentMode:o&&!s?document.documentMode||7:10,fileApi:f,ceFalse:o===!1||o>8,canHaveCSP:o===!1||o>11,desktop:!h&&!p,windowsPhone:m}}),r(f,[u,d],function(e,t){function n(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function r(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function i(e,t){var n,r=t;return n=e.path,n&&n.length>0&&(r=n[0]),e.deepPath&&(n=e.deepPath(),n&&n.length>0&&(r=n[0])),r}function o(e,n){function r(){return!1}function o(){return!0}var a,s=n||{},l;for(a in e)u[a]||(s[a]=e[a]);if(s.target||(s.target=s.srcElement||document),t.experimentalShadowDom&&(s.target=i(e,s.target)),e&&c.test(e.type)&&e.pageX===l&&e.clientX!==l){var d=s.target.ownerDocument||document,f=d.documentElement,h=d.body;s.pageX=e.clientX+(f&&f.scrollLeft||h&&h.scrollLeft||0)-(f&&f.clientLeft||h&&h.clientLeft||0),s.pageY=e.clientY+(f&&f.scrollTop||h&&h.scrollTop||0)-(f&&f.clientTop||h&&h.clientTop||0)}return s.preventDefault=function(){s.isDefaultPrevented=o,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},s.stopPropagation=function(){s.isPropagationStopped=o,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},s.stopImmediatePropagation=function(){s.isImmediatePropagationStopped=o,s.stopPropagation()},s.isDefaultPrevented||(s.isDefaultPrevented=r,s.isPropagationStopped=r,s.isImmediatePropagationStopped=r),"undefined"==typeof s.metaKey&&(s.metaKey=!1),s}function a(t,i,o){function a(){o.domLoaded||(o.domLoaded=!0,i(u))}function s(){("complete"===c.readyState||"interactive"===c.readyState&&c.body)&&(r(c,"readystatechange",s),a())}function l(){try{c.documentElement.doScroll("left")}catch(t){return void e.setTimeout(l)}a()}var c=t.document,u={type:"ready"};return o.domLoaded?void i(u):(c.addEventListener?"complete"===c.readyState?a():n(t,"DOMContentLoaded",a):(n(c,"readystatechange",s),c.documentElement.doScroll&&t.self===t.top&&l()),void n(t,"load",a))}function s(){function e(e,t){var n,r,o,a,s=i[t];if(n=s&&s[e.type])for(r=0,o=n.length;o>r;r++)if(a=n[r],a&&a.func.call(a.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var t=this,i={},s,c,u,d,f;c=l+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},s=1,t.domLoaded=!1,t.events=i,t.bind=function(r,l,h,p){function m(t){e(o(t||N.event),g)}var g,v,y,b,C,x,w,N=window;if(r&&3!==r.nodeType&&8!==r.nodeType){for(r[c]?g=r[c]:(g=s++,r[c]=g,i[g]={}),p=p||r,l=l.split(" "),y=l.length;y--;)b=l[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),t.domLoaded&&"ready"===b&&"complete"==r.readyState?h.call(p,o({type:b})):(d||(C=f[b],C&&(x=function(t){var n,r;if(n=t.currentTarget,r=t.relatedTarget,r&&n.contains)r=n.contains(r);else for(;r&&r!==n;)r=r.parentNode;r||(t=o(t||N.event),t.type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=n,e(t,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(t){t=o(t||N.event),t.type="focus"===t.type?"focusin":"focusout",e(t,g)}),v=i[g][b],v?"ready"===b&&t.domLoaded?h({type:b}):v.push({func:h,scope:p}):(i[g][b]=v=[{func:h,scope:p}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?a(r,x,t):n(r,C||b,x,w)));return r=v=0,h}},t.unbind=function(e,n,o){var a,s,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return t;if(a=e[c]){if(f=i[a],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],s=f[d]){if(o)for(u=s.length;u--;)if(s[u].func===o){var h=s.nativeHandler,p=s.fakeName,m=s.capture;s=s.slice(0,u).concat(s.slice(u+1)),s.nativeHandler=h,s.fakeName=p,s.capture=m,f[d]=s}o&&0!==s.length||(delete f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture))}}else{for(d in f)s=f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture);f={}}for(d in f)return t;delete i[a];try{delete e[c]}catch(g){e[c]=null}}return t},t.fire=function(n,r,i){var a;if(!n||3===n.nodeType||8===n.nodeType)return t;i=o(null,i),i.type=r,i.target=n;do a=n[c],a&&e(i,a),n=n.parentNode||n.ownerDocument||n.defaultView||n.parentWindow;while(n&&!i.isPropagationStopped());return t},t.clean=function(e){var n,r,i=t.unbind;if(!e||3===e.nodeType||8===e.nodeType)return t;if(e[c]&&i(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(i(e),r=e.getElementsByTagName("*"),n=r.length;n--;)e=r[n],e[c]&&i(e);return t},t.destroy=function(){i={}},t.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var l="mce-data-",c=/^(?:mouse|contextmenu)|click/,u={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1};return s.Event=new s,s.Event.bind(window,"ready",function(){}),s}),r(h,[],function(){function e(e,t,n,r){var i,o,a,s,l,c,d,h,p,m;if((t?t.ownerDocument||t:z)!==D&&B(t),t=t||D,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(M&&!r){if(i=ve.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&I(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&x.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(x.qsa&&(!P||!P.test(e))){if(h=d=F,p=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=_(e),(d=t.getAttribute("id"))?h=d.replace(be,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=c.length;l--;)c[l]=h+f(c[l]);p=ye.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return Z.apply(n,p.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return k(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>w.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[F]=!0,e}function i(e){var t=D.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||X)-(~e.sourceIndex||X);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&typeof e.getElementsByTagName!==Y&&e}function d(){}function f(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[U,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[F]||(t[F]={}),(s=l[r])&&s[0]===U&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),c&&t.push(s)));return a}function v(e,t,n,i,o,a){return i&&!i[F]&&(i=v(i)),o&&!o[F]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,f=[],h=[],p=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,f,e,s,l),b=n?o||(r?e:p||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[h[u]]=!(y[h[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?te.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(p,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return te.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==T)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=w.relative[e[s].type])u=[h(p(u),n)];else{if(n=w.filter[e[s].type].apply(null,e[s].matches),n[F]){for(r=++s;i>r&&!w.relative[e[r].type];r++);return v(s>1&&p(u),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&f(e))}u.push(n)}return p(u)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,s,l,c){var u,d,f,h=0,p="0",m=r&&[],v=[],y=T,b=r||o&&w.find.TAG("*",c),C=U+=null==y?1:Math.random()||.1,x=b.length;for(c&&(T=a!==D&&a);p!==x&&null!=(u=b[p]);p++){if(o&&u){for(d=0;f=t[d++];)if(f(u,a,s)){l.push(u);break}c&&(U=C)}i&&((u=!f&&u)&&h--,r&&m.push(u))}if(h+=p,i&&p!==h){for(d=0;f=n[d++];)f(m,v,a,s);if(r){if(h>0)for(;p--;)m[p]||v[p]||(v[p]=J.call(l));v=g(v)}Z.apply(l,v),c&&!r&&v.length>0&&h+n.length>1&&e.uniqueSort(l)}return c&&(U=C,T=y),m};return i?r(a):a}var C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F="sizzle"+-new Date,z=window.document,U=0,W=0,V=n(),$=n(),q=n(),j=function(e,t){return e===t&&(A=!0),0},Y=typeof t,X=1<<31,K={}.hasOwnProperty,G=[],J=G.pop,Q=G.push,Z=G.push,ee=G.slice,te=G.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},ne="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",re="[\\x20\\t\\r\\n\\f]",ie="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",oe="\\["+re+"*("+ie+")(?:"+re+"*([*^$|!~]?=)"+re+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+re+"*\\]",ae=":("+ie+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp("^"+re+"+|((?:^|[^\\\\])(?:\\\\.)*)"+re+"+$","g"),le=new RegExp("^"+re+"*,"+re+"*"),ce=new RegExp("^"+re+"*([>+~]|"+re+")"+re+"*"),ue=new RegExp("="+re+"*([^\\]'\"]*?)"+re+"*\\]","g"),de=new RegExp(ae),fe=new RegExp("^"+ie+"$"),he={ID:new RegExp("^#("+ie+")"),CLASS:new RegExp("^\\.("+ie+")"),TAG:new RegExp("^("+ie+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+re+"*(even|odd|(([+-]|)(\\d*)n|)"+re+"*(?:([+-]|)"+re+"*(\\d+)|))"+re+"*\\)|)","i"),bool:new RegExp("^(?:"+ne+")$","i"),needsContext:new RegExp("^"+re+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+re+"*((?:-\\d)?\\d*)"+re+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ge=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,be=/'|\\/g,Ce=new RegExp("\\\\([\\da-f]{1,6}"+re+"?|("+re+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Z.apply(G=ee.call(z.childNodes),z.childNodes),G[z.childNodes.length].nodeType}catch(we){Z={apply:G.length?function(e,t){Q.apply(e,ee.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}x=e.support={},E=e.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},B=e.setDocument=function(e){function t(e){try{return e.top}catch(t){}return null}var n,r=e?e.ownerDocument||e:z,o=r.defaultView;return r!==D&&9===r.nodeType&&r.documentElement?(D=r,L=r.documentElement,M=!E(r),o&&o!==t(o)&&(o.addEventListener?o.addEventListener("unload",function(){B()},!1):o.attachEvent&&o.attachEvent("onunload",function(){B()})),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=ge.test(r.getElementsByClassName),x.getById=i(function(e){return L.appendChild(e).id=F,!r.getElementsByName||!r.getElementsByName(F).length}),x.getById?(w.find.ID=function(e,t){if(typeof t.getElementById!==Y&&M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){return e.getAttribute("id")===t}}):(delete w.find.ID,w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),w.find.TAG=x.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Y?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=x.getElementsByClassName&&function(e,t){return M?t.getElementsByClassName(e):void 0},O=[],P=[],(x.qsa=ge.test(r.querySelectorAll))&&(i(function(e){e.innerHTML="<select msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+re+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||P.push("\\["+re+"*(?:value|"+ne+")"),e.querySelectorAll(":checked").length||P.push(":checked")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&P.push("name"+re+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||P.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),P.push(",.*:")})),(x.matchesSelector=ge.test(H=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){x.disconnectedMatch=H.call(e,"div"),H.call(e,"[s!='']:x"),O.push("!=",ae)}),P=P.length&&new RegExp(P.join("|")),O=O.length&&new RegExp(O.join("|")),n=ge.test(L.compareDocumentPosition),I=n||ge.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},j=n?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===z&&I(z,e)?-1:t===r||t.ownerDocument===z&&I(z,t)?1:R?te.call(R,e)-te.call(R,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:R?te.call(R,e)-te.call(R,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===z?-1:c[i]===z?1:0},r):D},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==D&&B(t),n=n.replace(ue,"='$1']"),x.matchesSelector&&M&&(!O||!O.test(n))&&(!P||!P.test(n)))try{var r=H.call(t,n);if(r||x.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,D,null,[t]).length>0},e.contains=function(e,t){return(e.ownerDocument||e)!==D&&B(e),I(e,t)},e.attr=function(e,n){(e.ownerDocument||e)!==D&&B(e);var r=w.attrHandle[n.toLowerCase()],i=r&&K.call(w.attrHandle,n.toLowerCase())?r(e,n,!M):t;return i!==t?i:x.attributes||!M?e.getAttribute(n):(i=e.getAttributeNode(n))&&i.specified?i.value:null},e.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},e.uniqueSort=function(e){var t,n=[],r=0,i=0;if(A=!x.detectDuplicates,R=!x.sortStable&&e.slice(0),e.sort(j),A){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return R=null,e},N=e.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=N(t);return n},w=e.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ce,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(Ce,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=_(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ce,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+re+")"+e+"("+re+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,h,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(u=g[F]||(g[F]={}),c=u[e]||[],h=c[0]===U&&c[1],f=c[0]===U&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(f=h=0)||p.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[U,h,f];break}}else if(y&&(c=(t[F]||(t[F]={}))[e])&&c[0]===U)f=c[1];else for(;(d=++h&&d&&d[m]||(f=h=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[F]||(d[F]={}))[e]=[U,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(t,n){var i,o=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[F]?o(n):o.length>1?(i=[t,t,"",n],w.setFilters.hasOwnProperty(t.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=te.call(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=S(e.replace(se,"$1"));return i[F]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(e){return e=e.replace(Ce,xe),function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(t){return fe.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(Ce,xe).toLowerCase(),function(e){var n;do if(n=M?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}},w.pseudos.nth=w.pseudos.eq;for(C in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})w.pseudos[C]=s(C);for(C in{submit:!0,reset:!0})w.pseudos[C]=l(C);return d.prototype=w.filters=w.pseudos,w.setFilters=new d,_=e.tokenize=function(t,n){var r,i,o,a,s,l,c,u=$[t+" "];if(u)return n?0:u.slice(0);for(s=t,l=[],c=w.preFilter;s;){r&&!(i=le.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=ce.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(se," ")}),s=s.slice(r.length));for(a in w.filter)!(i=he[a].exec(s))||c[a]&&!(i=c[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?e.error(t):$(t,l).slice(0)},S=e.compile=function(e,t){var n,r=[],i=[],o=q[e+" "];if(!o){for(t||(t=_(e)),n=t.length;n--;)o=y(t[n]),o[F]?r.push(o):i.push(o);o=q(e,b(i,r)),o.selector=e}return o},k=e.select=function(e,t,n,r){var i,o,a,s,l,c="function"==typeof e&&e,d=!r&&_(e=c.selector||e);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&x.getById&&9===t.nodeType&&M&&w.relative[o[1].type]){if(t=(w.find.ID(a.matches[0].replace(Ce,xe),t)||[])[0], !t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=he.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((l=w.find[s])&&(r=l(a.matches[0].replace(Ce,xe),ye.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&f(o),!e)return Z.apply(n,r),n;break}}return(c||S(e,d))(r,t,!M,n,ye.test(e)&&u(t.parentNode)||t),n},x.sortStable=F.split("").sort(j).join("")===F,x.detectDuplicates=!!A,B(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(ne,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),e}),r(p,[],function(){function e(e){var t=e,n,r;if(!u(e))for(t=[],n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function n(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function r(e,t){var r=[];return n(e,function(n,i){r.push(t(n,i,e))}),r}function i(e,t){var r=[];return n(e,function(n,i){t&&!t(n,i,e)||r.push(n)}),r}function o(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function a(e,t,n,r){var i=0;for(arguments.length<3&&(n=e[0]);i<e.length;i++)n=t.call(r,n,e[i],i);return n}function s(e,t,n){var r,i;for(r=0,i=e.length;i>r;r++)if(t.call(n,e[r],r,e))return r;return-1}function l(e,n,r){var i=s(e,n,r);return-1!==i?e[i]:t}function c(e){return e[e.length-1]}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{isArray:u,toArray:e,each:n,map:r,filter:i,indexOf:o,reduce:a,findIndex:s,find:l,last:c}}),r(m,[d,p],function(e,n){function r(e){return null===e||e===t?"":(""+e).replace(h,"")}function i(e,r){return r?"array"==r&&n.isArray(e)?!0:typeof e==r:e!==t}function o(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function a(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],c?o[a]=function(){return i[s].apply(this,arguments)}:o[a]=function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function s(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function l(e,t,r,i){i=i||this,e&&(r&&(e=e[r]),n.each(e,function(e,n){return t.call(i,e,n,r)===!1?!1:void l(e,t,r,i)}))}function c(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)r=e[n],t[r]||(t[r]={}),t=t[r];return t}function u(e,t){var n,r;for(t=t||window,e=e.split("."),n=0,r=e.length;r>n&&(t=t[e[n]],t);n++);return t}function d(e,t){return!e||i(e,"array")?e:n.map(e.split(t||","),r)}function f(t){var n=e.cacheSuffix;return n&&(t+=(-1===t.indexOf("?")?"?":"&")+n),t}var h=/^\s*|\s*$/g;return{trim:r,isArray:n.isArray,is:i,toArray:n.toArray,makeMap:o,each:n.each,map:n.map,grep:n.filter,inArray:n.indexOf,extend:s,create:a,walk:l,createNS:c,resolve:u,explode:d,_addCacheSuffix:f}}),r(g,[f,h,m,d],function(e,n,r,i){function o(e){return"undefined"!=typeof e}function a(e){return"string"==typeof e}function s(e){return e&&e==e.window}function l(e,t){var n,r,i;for(t=t||w,i=t.createElement("div"),n=t.createDocumentFragment(),i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return n}function c(e,t,n,r){var i;if(a(t))t=l(t,v(e[0]));else if(t.length&&!t.nodeType){if(t=f.makeArray(t),r)for(i=t.length-1;i>=0;i--)c(e,t[i],n,r);else for(i=0;i<t.length;i++)c(e,t[i],n,r);return e}if(t.nodeType)for(i=e.length;i--;)n.call(e[i],t);return e}function u(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")}function d(e,t,n){var r,i;return t=f(t)[0],e.each(function(){var e=this;n&&r==e.parentNode?i.appendChild(e):(r=e.parentNode,i=t.cloneNode(!1),e.parentNode.insertBefore(i,e),i.appendChild(e))}),e}function f(e,t){return new f.fn.init(e,t)}function h(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1}function p(e){return null===e||e===k?"":(""+e).replace(P,"")}function m(e,t){var n,r,i,o,a;if(e)if(n=e.length,n===o){for(r in e)if(e.hasOwnProperty(r)&&(a=e[r],t.call(a,r,a)===!1))break}else for(i=0;n>i&&(a=e[i],t.call(a,i,a)!==!1);i++);return e}function g(e,t){var n=[];return m(e,function(e,r){t(r,e)&&n.push(r)}),n}function v(e){return e?9==e.nodeType?e:e.ownerDocument:w}function y(e,n,r){var i=[],o=e[n];for("string"!=typeof r&&r instanceof f&&(r=r[0]);o&&9!==o.nodeType;){if(r!==t){if(o===r)break;if("string"==typeof r&&f(o).is(r))break}1===o.nodeType&&i.push(o),o=o[n]}return i}function b(e,n,r,i){var o=[];for(i instanceof f&&(i=i[0]);e;e=e[n])if(!r||e.nodeType===r){if(i!==t){if(e===i)break;if("string"==typeof i&&f(e).is(i))break}o.push(e)}return o}function C(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType==n)return e;return null}function x(e,t,n){m(n,function(n,r){e[n]=e[n]||{},e[n][t]=r})}var w=document,N=Array.prototype.push,E=Array.prototype.slice,_=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,S=e.Event,k,T=r.makeMap("children,contents,next,prev"),R=r.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),A=r.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),B={"for":"htmlFor","class":"className",readonly:"readOnly"},D={"float":"cssFloat"},L={},M={},P=/^\s*|\s*$/g;return f.fn=f.prototype={constructor:f,selector:"",context:null,length:0,init:function(e,t){var n=this,r,i;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(t&&t.nodeType)n.context=t;else{if(t)return f(e).attr(t);n.context=t=document}if(a(e)){if(n.selector=e,r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:_.exec(e),!r)return f(t).find(e);if(r[1])for(i=l(e,v(t)).firstChild;i;)N.call(n,i),i=i.nextSibling;else{if(i=v(t).getElementById(r[2]),!i)return n;if(i.id!==r[2])return n.find(e);n.length=1,n[0]=i}}else this.add(e,!1);return n},toArray:function(){return r.toArray(this)},add:function(e,t){var n=this,r,i;if(a(e))return n.add(f(e));if(t!==!1)for(r=f.unique(n.toArray().concat(f.makeArray(e))),n.length=r.length,i=0;i<r.length;i++)n[i]=r[i];else N.apply(n,f.makeArray(e));return n},attr:function(e,t){var n=this,r;if("object"==typeof e)m(e,function(e,t){n.attr(e,t)});else{if(!o(t)){if(n[0]&&1===n[0].nodeType){if(r=L[e],r&&r.get)return r.get(n[0],e);if(A[e])return n.prop(e)?e:k;t=n[0].getAttribute(e,2),null===t&&(t=k)}return t}this.each(function(){var n;if(1===this.nodeType){if(n=L[e],n&&n.set)return void n.set(this,t);null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2)}})}return n},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if(e=B[e]||e,"object"==typeof e)m(e,function(e,t){n.prop(e,t)});else{if(!o(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1==this.nodeType&&(this[e]=t)})}return n},css:function(e,t){function n(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})}function r(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})}var i=this,a,s;if("object"==typeof e)m(e,function(e,t){i.css(e,t)});else if(o(t))e=n(e),"number"!=typeof t||R[e]||(t+="px"),i.each(function(){var n=this.style;if(s=M[e],s&&s.set)return void s.set(this,t);try{this.style[D[e]||e]=t}catch(i){}null!==t&&""!==t||(n.removeProperty?n.removeProperty(r(e)):n.removeAttribute(e))});else{if(a=i[0],s=M[e],s&&s.get)return s.get(a);if(a.ownerDocument.defaultView)try{return a.ownerDocument.defaultView.getComputedStyle(a,null).getPropertyValue(r(e))}catch(l){return k}else if(a.currentStyle)return a.currentStyle[n(e)]}return i},remove:function(){for(var e=this,t,n=this.length;n--;)t=e[n],S.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var e=this,t,n=this.length;n--;)for(t=e[n];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(e){var t=this,n;if(o(e)){n=t.length;try{for(;n--;)t[n].innerHTML=e}catch(r){f(t[n]).empty().append(e)}return t}return t[0]?t[0].innerHTML:""},text:function(e){var t=this,n;if(o(e)){for(n=t.length;n--;)"innerText"in t[n]?t[n].innerText=e:t[0].textContent=e;return t}return t[0]?t[0].innerText||t[0].textContent:""},append:function(){return c(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return c(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){var e=this;return e[0]&&e[0].parentNode?c(e,arguments,function(e){this.parentNode.insertBefore(e,this)}):e},after:function(){var e=this;return e[0]&&e[0].parentNode?c(e,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):e},appendTo:function(e){return f(e).append(this),this},prependTo:function(e){return f(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return d(this,e)},wrapAll:function(e){return d(this,e,!0)},wrapInner:function(e){return this.each(function(){f(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){f(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),f(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return"string"!=typeof e?n:(-1!==e.indexOf(" ")?m(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(n,r){var i,o;o=u(r,e),o!==t&&(i=r.className,o?r.className=p((" "+i+" ").replace(" "+e+" "," ")):r.className+=i?" "+e:e)}),n)},hasClass:function(e){return u(this[0],e)},each:function(e){return m(this,e)},on:function(e,t){return this.each(function(){S.bind(this,e,t)})},off:function(e,t){return this.each(function(){S.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?S.fire(this,e.type,e):S.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new f(E.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;n>t;t++)f.find(e,this[t],r);return f(r)},filter:function(e){return f("function"==typeof e?g(this.toArray(),function(t,n){return e(n,t)}):f.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof f&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&f(r).is(e)){t.push(r);break}if(r==e){t.push(r);break}r=r.parentNode}}),f(t)},offset:function(e){var t,n,r,i=0,o=0,a;return e?this.css(e):(t=this[0],t&&(n=t.ownerDocument,r=n.documentElement,t.getBoundingClientRect&&(a=t.getBoundingClientRect(),i=a.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,o=a.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:o})},push:N,sort:[].sort,splice:[].splice},r.extend(f,{extend:r.extend,makeArray:function(e){return s(e)||e.nodeType?[e]:r.toArray(e)},inArray:h,isArray:r.isArray,each:m,trim:p,grep:g,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,contains:n.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!=t[r].nodeType&&t.splice(r,1);return t=1===t.length?f.find.matchesSelector(t[0],e)?[t[0]]:[]:f.find.matches(e,t)}}),m({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return y(e,"parentNode")},next:function(e){return C(e,"nextSibling",1)},prev:function(e){return C(e,"previousSibling",1)},children:function(e){return b(e.firstChild,"nextSibling",1)},contents:function(e){return r.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){f.fn[e]=function(n){var r=this,i=[];return r.each(function(){var e=t.call(i,this,n,i);e&&(f.isArray(e)?i.push.apply(i,e):i.push(e))}),this.length>1&&(T[e]||(i=f.unique(i)),0===e.indexOf("parents")&&(i=i.reverse())),i=f(i),n?i.filter(n):i}}),m({parentsUntil:function(e,t){return y(e,"parentNode",t)},nextUntil:function(e,t){return b(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return b(e,"previousSibling",1,t).slice(1)}},function(e,t){f.fn[e]=function(n,r){var i=this,o=[];return i.each(function(){var e=t.call(o,this,n,o);e&&(f.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=f.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse())),o=f(o),r?o.filter(r):o}}),f.fn.is=function(e){return!!e&&this.filter(e).length>0},f.fn.init.prototype=f.fn,f.overrideDefaults=function(e){function t(r,i){return n=n||e(),0===arguments.length&&(r=n.element),i||(i=n.context),new t.fn.init(r,i)}var n;return f.extend(t,this),t},i.ie&&i.ie<8&&(x(L,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?k:t},size:function(e){var t=e.size;return 20===t?k:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?k:t}}),x(L,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),i.ie&&i.ie<9&&(D["float"]="styleFloat",x(M,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),f.attrHooks=L,f.cssHooks=M,f}),r(v,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d,f,h="\ufeff";for(e=e||{},t&&(d=t.getValidStyles(),f=t.getInvalidStyles()),u=("\\\" \\' \\; \\: ; : "+h).split(" "),l=0;l<u.length;l++)c[u[l]]=h+l,c[h+l]=u[l];return{toHex:function(e){return e.replace(r,n)},parse:function(t){function s(e,t,n){var r,i,o,a;if(r=m[e+"-top"+t],r&&(i=m[e+"-right"+t],i&&(o=m[e+"-bottom"+t],o&&(a=m[e+"-left"+t])))){var s=[r,i,o,a];for(l=s.length-1;l--&&s[l]===s[l+1];);l>-1&&n||(m[e+t]=-1==l?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}}function u(e){var t=m[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return m[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}function f(e){return b=!0,c[e]}function h(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function p(t,n,r,i,o,a){if(o=o||a)return o=h(o),"'"+o.replace(/\'/g,"\\'")+"'";if(n=h(n||r||i),!e.allow_script_urls){var s=n.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(s))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"}var m={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),y=y.replace(/\\[0-9a-f]+/g,function(e){return String.fromCharCode(parseInt(e.substr(1),16))}),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(|\/\*|\*\//.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":"color"!==v&&"background-color"!==v||(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,p),m[v]=b?h(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(e,t){function n(t){var n,r,o,a;if(n=d[t])for(r=0,o=n.length;o>r;r++)t=n[r],a=e[t],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+t+": "+a+";")}function r(e,t){var n;return n=f["*"],n&&n[e]?!1:(n=f[t],!n||!n[e])}var i="",o,a;if(t&&d)n("*"),n(t);else for(o in e)a=e[o],a!==s&&a.length>0&&(f&&!r(o,t)||(i+=(i.length>0?" ":"")+o+": "+a+";"));return i}}}}),r(y,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}function r(e,n,r,i){var o,a,s;if(e){if(o=e[r],t&&o===t)return;if(o){if(!i)for(s=o[n];s;s=s[n])if(!s[n])return s;return o}if(a=e.parentNode,a&&a!==t)return a}}var i=e;this.current=function(){return i},this.next=function(e){return i=n(i,"firstChild","nextSibling",e)},this.prev=function(e){return i=n(i,"lastChild","previousSibling",e)},this.prev2=function(e){return i=r(i,"lastChild","previousSibling",e)}}}),r(b,[m],function(e){function t(n){function r(){return P.createDocumentFragment()}function i(e,t){N(F,e,t)}function o(e,t){N(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(M[V]=M[W],M[$]=M[U]):(M[W]=M[V],M[U]=M[$]),M.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function h(e,t){var n=M[W],r=M[U],i=M[V],o=M[$],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function p(){E(I)}function m(){return E(O)}function g(){return E(H)}function v(e){var t=this[W],r=this[U],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=M.extractContents();M.insertNode(e),e.appendChild(t),M.selectNode(e)}function b(){return q(new t(n),{startContainer:M[W],startOffset:M[U],endContainer:M[V],endOffset:M[$],collapsed:M.collapsed,commonAncestorContainer:M.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return M[W]==M[V]&&M[U]==M[$]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function N(e,t,r){var i,o;for(e?(M[W]=t,M[U]=r):(M[V]=t,M[$]=r),i=M[V];i.parentNode;)i=i.parentNode;for(o=M[W];o.parentNode;)o=o.parentNode;o==i?w(M[W],M[U],M[V],M[$])>0&&M.collapse(e):M.collapse(e),M.collapsed=x(),M.commonAncestorContainer=n.findCommonAncestor(M[W],M[V])}function E(e){var t,n=0,r=0,i,o,a,s,l,c;if(M[W]==M[V])return _(e);for(t=M[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[W])return S(t,e);++n}for(t=M[W],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[V])return k(t,e);++r}for(o=r-n,a=M[W];o>0;)a=a.parentNode,o--;for(s=M[V];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function _(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),M[U]==M[$])return t;if(3==M[W].nodeType){if(n=M[W].nodeValue,i=n.substring(M[U],M[$]),e!=H&&(o=M[W],c=M[U],u=M[$]-M[U],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),M.collapse(F)),e==I)return;return i.length>0&&t.appendChild(P.createTextNode(i)),t}for(o=C(M[W],M[U]),a=M[$]-M[U];o&&a>0;)s=o.nextSibling,l=D(o,e),t&&t.appendChild(l),--a,o=s;return e!=H&&M.collapse(F),t}function S(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-M[U],0>=a)return t!=H&&(M.setEndBefore(e),M.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=D(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=H&&(M.setEndBefore(e),M.collapse(z)),n}function k(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=M[$]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=D(o,t),n&&n.appendChild(l),--a,o=s;return t!=H&&(M.setStartAfter(e),M.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=D(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=H&&(M.setStartAfter(e),M.collapse(F)),o}function R(e,t){var n=C(M[V],M[$]-1),r,i,o,a,s,l=n!=M[V];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(M[W],M[U]),r=n!=M[W],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return D(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=M[U],a=o.substring(l),s=o.substring(0,l)):(l=M[$],a=o.substring(0,l),s=o.substring(l)),i!=H&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function D(e,t){return t!=I?t==H?n.clone(e,F):e:void e.parentNode.removeChild(e)}function L(){return n.create("body",null,g()).outerText}var M=this,P=n.doc,O=0,H=1,I=2,F=!0,z=!1,U="startOffset",W="startContainer",V="endContainer",$="endOffset",q=e.extend,j=n.nodeIndex;return q(M,{startContainer:P,startOffset:0,endContainer:P,endOffset:0,collapsed:F,commonAncestorContainer:P,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:h,deleteContents:p,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:L}),M}return t.prototype.toString=function(){return this.toStringIE()},t}),r(C,[m],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),o[r]||(i="&"+e[n+1]+";",a[r]=i,a[i]=r);return a}}var r=e.makeMap,i,o,a,s=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n){return n?(n="x"===n.charAt(0).toLowerCase()?parseInt(n.substr(1),16):parseInt(n,10),n>65535?(n-=65536,String.fromCharCode(55296+(n>>10),56320+(1023&n))):d[n]||String.fromCharCode(n)):a[e]||i[e]||t(e)})}};return f}),r(x,[m,u],function(e,t){return function(n,r){function i(e){n.getElementsByTagName("head")[0].appendChild(e)}function o(r,o,c){function u(){for(var e=b.passed,t=e.length;t--;)e[t]();b.status=2,b.passed=[],b.failed=[]}function d(){for(var e=b.failed,t=e.length;t--;)e[t]();b.status=3,b.passed=[],b.failed=[]}function f(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function h(e,n){e()||((new Date).getTime()-y<l?t.setTimeout(n):d())}function p(){h(function(){for(var e=n.styleSheets,t,r=e.length,i;r--;)if(t=e[r],i=t.ownerNode?t.ownerNode:t.owningElement,i&&i.id===g.id)return u(),!0},p)}function m(){h(function(){try{var e=v.sheet.cssRules;return u(),!!e}catch(t){}},m)}var g,v,y,b;if(r=e._addCacheSuffix(r),s[r]?b=s[r]:(b={passed:[],failed:[]},s[r]=b),o&&b.passed.push(o),c&&b.failed.push(c),1!=b.status){if(2==b.status)return void u();if(3==b.status)return void d();if(b.status=1,g=n.createElement("link"),g.rel="stylesheet",g.type="text/css",g.id="u"+a++,g.async=!1,g.defer=!1,y=(new Date).getTime(),"onload"in g&&!f())g.onload=p,g.onerror=d;else{if(navigator.userAgent.indexOf("Firefox")>0)return v=n.createElement("style"),v.textContent='@import "'+r+'"',m(),void i(v);p()}i(g),g.href=r}}var a=0,s={},l;r=r||{},l=r.maxLoadTime||5e3,this.load=o}}),r(w,[h,g,v,f,y,b,C,d,m,x],function(e,n,r,i,o,a,s,l,c,u){function d(e,t){var n={},r=t.keep_values,i;return i={set:function(n,r,i){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||e,r,i,n[0])),n.attr("data-mce-"+i,r).attr(i,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},n={style:{set:function(e,t){return null!==t&&"object"==typeof t?void e.css(t):(r&&e.attr("data-mce-style",t),void e.attr("style",t))},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serializeStyle(e.parseStyle(n),t[0].nodeName)}}},r&&(n.href=n.src=i),n}function f(e,t){var n=t.attr("style");n=e.serializeStyle(e.parseStyle(n),t[0].nodeName),n||(n=null),t.attr("data-mce-style",n)}function h(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n}function p(e,t){var o=this,a;o.doc=e,o.win=window,o.files={},o.counter=0,o.stdMode=!b||e.documentMode>=8,o.boxModel=!b||"CSS1Compat"==e.compatMode||o.stdMode,o.styleSheetLoader=new u(e),o.boundEvents=[],o.settings=t=t||{},o.schema=t.schema,o.styles=new r({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),o.fixDoc(e),o.events=t.ownEvents?new i(t.proxy):i.Event,o.attrHooks=d(o,t),a=t.schema?t.schema.getBlockElements():{},o.$=n.overrideDefaults(function(){return{context:e,element:o.getRoot()}}),o.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!a[e.nodeName]):!!a[e]}}var m=c.each,g=c.is,v=c.grep,y=c.trim,b=l.ie,C=/^([a-z0-9],?)+$/i,x=/^[ \t\r\n]*$/;return p.prototype={$$:function(e){return"string"==typeof e&&(e=this.get(e)),this.$(e)},root:null,fixDoc:function(e){var t=this.settings,n;if(b&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!b||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.settings.root_element||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),g(n,"string")&&(a=n, n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.settings.root_element||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(C.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=g(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&"undefined"!=typeof t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"</"+e+">":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return e=this.$$(e),t?e.each(function(){for(var e;e=this.firstChild;)3==e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():e.remove(),e.length>1?e.toArray():e[0]},setStyle:function(e,t,n){e=this.$$(e).css(t,n),this.settings.update_styles&&f(this,e)},getStyle:function(e,n,r){return e=this.$$(e),r?e.css(n):(n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=l.ie&&l.ie<12?"styleFloat":"cssFloat"),e[0]&&e[0].style?e[0].style[n]:t)},setStyles:function(e,t){e=this.$$(e).css(t),this.settings.update_styles&&f(this,e)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this,i,o,a=r.settings;""===n&&(n=null),e=r.$$(e),i=e.attr(t),e.length&&(o=r.attrHooks[t],o&&o.set?o.set(e,n,t):e.attr(t,n),i!=n&&a.onSetAttrib&&a.onSetAttrib({attrElm:e,attrName:t,attrValue:n}))},setAttribs:function(e,t){var n=this;n.$$(e).each(function(e,r){m(t,function(e,t){n.setAttrib(r,t,e)})})},getAttrib:function(e,t,n){var r=this,i,o;return e=r.$$(e),e.length&&(i=r.attrHooks[t],o=i&&i.get?i.get(e,t):e.attr(t)),"undefined"==typeof o&&(o=n||""),o},getPos:function(e,t){var r=this,i=0,o=0,a,s=r.doc,l=s.body,c;if(e=r.get(e),t=t||l,e){if(t===l&&e.getBoundingClientRect&&"static"===n(l).css("position"))return c=e.getBoundingClientRect(),t=r.boxModel?s.documentElement:l,i=c.left+(s.documentElement.scrollLeft||l.scrollLeft)-t.clientLeft,o=c.top+(s.documentElement.scrollTop||l.scrollTop)-t.clientTop,{x:i,y:o};for(a=e;a&&a!=t&&a.nodeType;)i+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=e.parentNode;a&&a!=t&&a.nodeType;)i-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode}return{x:i,y:o}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==p.DOM&&n===document){var o=p.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,p.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==p.DOM&&n===document?void p.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void m(e.split(","),function(e){var i;e=c._addCacheSuffix(e),t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),b&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){this.$$(e).addClass(t)},removeClass:function(e,t){this.toggleClass(e,t,!1)},hasClass:function(e,t){return this.$$(e).hasClass(t)},toggleClass:function(e,t,r){this.$$(e).toggleClass(t,r).each(function(){""===this.className&&n(this).attr("class",null)})},show:function(e){this.$$(e).show()},hide:function(e){this.$$(e).hide()},isHidden:function(e){return"none"==this.$$(e).css("display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){e=this.$$(e),b?e.each(function(e,r){if(r.canHaveHTML!==!1){for(;r.firstChild;)r.removeChild(r.firstChild);try{r.innerHTML="<br>"+t,r.removeChild(r.firstChild)}catch(i){n("<div>").html("<br>"+t).contents().slice(1).appendTo(r)}return t}}):e.html(t)},getOuterHTML:function(e){return e=this.get(e),1==e.nodeType&&"outerHTML"in e?e.outerHTML:n("<div>").append(n(e).clone()).html()},setOuterHTML:function(e,t){var r=this;r.$$(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}r.remove(n(this).html(t),!0)})},decode:s.decode,encode:s.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return g(t,"array")&&(e=e.cloneNode(!0)),n&&m(v(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(c.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],m(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(b){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,i,a,s,l,c=0;if(e=e.firstChild){s=new o(e,e.parentNode),t=t||(n.schema?n.schema.getNonEmptyElements():null);do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(i=n.getAttribs(e),r=i.length;r--;)if(l=i[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!x.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new a(this)},nodeIndex:h,split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=y(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.insertBefore(n,e):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(c.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(c.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return e&&1==e.nodeType?(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null):null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&(n=this.getContentEditable(e),null===n);e=e.parentNode);return n},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},p.DOM=new p(document),p.nodeIndex=h,p}),r(N,[w,m],function(e,t){function n(){function e(e,n){function i(){a.remove(l),s&&(s.onreadystatechange=s.onload=s=null),n()}function o(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var a=r,s,l;l=a.uniqueId(),s=document.createElement("script"),s.id=l,s.type="text/javascript",s.src=t._addCacheSuffix(e),"onreadystatechange"in s?s.onreadystatechange=function(){/loaded|complete/.test(s.readyState)&&i()}:s.onload=i,s.onerror=o,(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}var n=0,a=1,s=2,l={},c=[],u={},d=[],f=0,h;this.isDone=function(e){return l[e]==s},this.markDone=function(e){l[e]=s},this.add=this.load=function(e,t,r){var i=l[e];i==h&&(c.push(e),l[e]=n),t&&(u[e]||(u[e]=[]),u[e].push({func:t,scope:r||this}))},this.remove=function(e){delete l[e],delete u[e]},this.loadQueue=function(e,t){this.loadScripts(c,e,t)},this.loadScripts=function(t,n,r){function c(e){i(u[e],function(e){e.func.call(e.scope)}),u[e]=h}var p;d.push({func:n,scope:r||this}),(p=function(){var n=o(t);t.length=0,i(n,function(t){return l[t]==s?void c(t):void(l[t]!=a&&(l[t]=a,f++,e(t,function(){l[t]=s,f--,c(t),p()})))}),f||(i(d,function(e){e.func.call(e.scope)}),d.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(E,[N,m],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){var i=r.language;if(i&&r.languageLoad!==!1){if(n)if(n=","+n+",",-1!=n.indexOf(","+i.substr(0,2)+","))i=i.substr(0,2);else if(-1==n.indexOf(","+i+","))return;e.ScriptLoader.add(this.urls[t]+"/langs/"+i+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},remove:function(e){delete this.urls[e],delete this.lookup[e]},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&(s?a.call(s):a.call(e))}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(_,[],function(){function e(e){return function(t){return!!t&&t.nodeType==e}}function t(e){return e=e.toLowerCase().split(" "),function(t){var n,r;if(t&&t.nodeType)for(r=t.nodeName.toLowerCase(),n=0;n<e.length;n++)if(r===e[n])return!0;return!1}}function n(e,t){return t=t.toLowerCase().split(" "),function(n){var r,i;if(s(n))for(r=0;r<t.length;r++)if(i=getComputedStyle(n,null).getPropertyValue(e),i===t[r])return!0;return!1}}function r(e,t){return function(n){return s(n)&&n[e]===t}}function i(e,t){return function(n){return s(n)&&n.getAttribute(e)===t}}function o(e){return s(e)&&e.hasAttribute("data-mce-bogus")}function a(e){return function(t){if(s(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}}var s=e(1);return{isText:e(3),isElement:s,isComment:e(8),isBr:t("br"),isContentEditableTrue:a("true"),isContentEditableFalse:a("false"),matchNodeNames:t,hasPropValue:r,hasAttributeValue:i,matchStyleValues:n,isBogus:o}}),r(S,[],function(){function e(e){return e==n}function t(e){return e.replace(new RegExp(n,"g"),"")}var n="\ufeff";return{isZwsp:e,ZWSP:n,trim:t}}),r(k,[_,S],function(e,t){function n(e){return p(e)&&(e=e.parentNode),h(e)&&e.hasAttribute("data-mce-caret")}function r(e){return p(e)&&t.isZwsp(e.data)}function i(e){return n(e)||r(e)}function o(e){var t=e.parentNode;t&&t.removeChild(e)}function a(e){try{return e.nodeValue}catch(t){return""}}function s(e,t){0===t.length?o(e):e.nodeValue=t}function l(e,n){var r,o,a,s;if(r=e.ownerDocument,a=r.createTextNode(t.ZWSP),s=e.parentNode,n){if(o=e.previousSibling,p(o)){if(i(o))return o;if(f(o))return o.splitText(o.data.length-1)}s.insertBefore(a,e)}else{if(o=e.nextSibling,p(o)){if(i(o))return o;if(d(o))return o.splitText(1),o}e.nextSibling?s.insertBefore(a,e.nextSibling):s.appendChild(a)}return a}function c(e,t,n){var r,i,o;return r=t.ownerDocument,i=r.createElement(e),i.setAttribute("data-mce-caret",n?"before":"after"),i.setAttribute("data-mce-bogus","all"),i.appendChild(r.createTextNode("\xa0")),o=t.parentNode,n?o.insertBefore(i,t):t.nextSibling?o.insertBefore(i,t.nextSibling):o.appendChild(i),i}function u(e){if(h(e)&&i(e)&&(" "!=e.innerHTML?e.removeAttribute("data-mce-caret"):o(e)),p(e)){var n=t.trim(a(e));s(e,n)}}function d(e){return p(e)&&e.data[0]==t.ZWSP}function f(e){return p(e)&&e.data[e.data.length-1]==t.ZWSP}var h=e.isElement,p=e.isText;return{isCaretContainer:i,isCaretContainerBlock:n,isCaretContainerInline:r,insertInline:l,insertBlock:c,remove:u,startsWithCaretContainer:d,endsWithCaretContainer:f}}),r(T,[m,y,_,b,k],function(e,t,n,r,i){function o(e,t){var n=e.childNodes;return t--,t>n.length-1?t=n.length-1:0>t&&(t=0),n[t]||e}function a(e){this.walk=function(t,n){function r(e){var t;return t=e[0],3===t.nodeType&&t===c&&u>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===f&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function i(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,o){var a=o?"nextSibling":"previousSibling";for(g=e,v=g.parentNode;g&&g!=t;g=v)v=g.parentNode,y=i(g==e?g:g[a],a),y.length&&(o||y.reverse(),n(r(y)))}var c=t.startContainer,u=t.startOffset,d=t.endContainer,f=t.endOffset,h,p,m,g,v,y,b;if(b=e.select("td[data-mce-selected],th[data-mce-selected]"),b.length>0)return void l(b,function(e){n([e])});if(1==c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[u]),1==d.nodeType&&d.hasChildNodes()&&(d=o(d,f)),c==d)return n(r([c]));for(h=e.findCommonAncestor(c,d),g=c;g;g=g.parentNode){if(g===d)return s(c,h,!0);if(g===h)break}for(g=d;g;g=g.parentNode){if(g===c)return s(d,h);if(g===h)break}p=a(c,h)||c,m=a(d,h)||d,s(c,p,!0),y=i(p==c?p:p.nextSibling,"nextSibling",m==d?m.nextSibling:m),y.length&&n(r(y)),s(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&r<n.nodeValue.length&&(i=t(n,r),n=i.previousSibling,o>r?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r<n.nodeValue.length&&(n=t(n,r),r=0),3==i.nodeType&&o>0&&o<i.nodeValue.length&&(i=t(i,o).previousSibling,o=i.nodeValue.length)),{startContainer:n,startOffset:r,endContainer:i,endOffset:o}},this.normalize=function(n){function r(r){function a(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}function s(n,r){for(var i=new t(n,e.getParent(n.parentNode,e.isBlock)||g);n=i[r?"prev":"next"]();)if("BR"===n.nodeName)return!0}function l(e){for(;e&&e!=g;){if(c(e))return!0;e=e.parentNode}return!1}function d(e,t){return e.previousSibling&&e.previousSibling.nodeName==t}function f(n,r){var a,s,l;if(r=r||h,l=e.getParent(r.parentNode,e.isBlock)||g,n&&"BR"==r.nodeName&&C&&e.isEmpty(l))return h=r.parentNode,p=e.nodeIndex(r),void(i=!0);for(a=new t(r,l);v=a[n?"prev":"next"]();){if("false"===e.getContentEditableParent(v)||u(v))return;if(3===v.nodeType&&v.nodeValue.length>0)return h=v,p=n?v.nodeValue.length:0,void(i=!0);if(e.isBlock(v)||y[v.nodeName.toLowerCase()])return;s=v}o&&s&&(h=s,i=!0,p=0)}var h,p,m,g=e.getRoot(),v,y,b,C;if(h=n[(r?"start":"end")+"Container"],p=n[(r?"start":"end")+"Offset"],C=1==h.nodeType&&p===h.childNodes.length,y=e.schema.getNonEmptyElements(),b=r,!u(h)){if(1==h.nodeType&&p>h.childNodes.length-1&&(b=!1),9===h.nodeType&&(h=e.getRoot(),p=0),h===g){if(b&&(v=h.childNodes[p>0?p-1:0])){if(u(v))return;if(y[v.nodeName]||"TABLE"==v.nodeName)return}if(h.hasChildNodes()){if(p=Math.min(!b&&p>0?p-1:p,h.childNodes.length-1),h=h.childNodes[p],p=0,!o&&h===g.lastChild&&"TABLE"===h.nodeName)return;if(l(h)||u(h))return;if(h.hasChildNodes()&&!/TABLE/.test(h.nodeName)){v=h,m=new t(h,g);do{if(c(v)||u(v)){i=!1;break}if(3===v.nodeType&&v.nodeValue.length>0){p=b?0:v.nodeValue.length,h=v,i=!0;break}if(y[v.nodeName.toLowerCase()]&&!a(v)){p=e.nodeIndex(v),h=v.parentNode,"IMG"!=v.nodeName||b||p++,i=!0;break}}while(v=b?m.next():m.prev())}}}o&&(3===h.nodeType&&0===p&&f(!0),1===h.nodeType&&(v=h.childNodes[p],v||(v=h.childNodes[p-1]),!v||"BR"!==v.nodeName||d(v,"A")||s(v)||s(v,!0)||f(!0,v))),b&&!o&&3===h.nodeType&&p===h.nodeValue.length&&f(!1),i&&n["set"+(r?"Start":"End")](h,p)}}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}function s(t,n,r){var i,o,a;if(i=r.elementFromPoint(t,n),o=r.body.createTextRange(),i&&"HTML"!=i.tagName||(i=r.body),o.moveToElementText(i),a=e.toArray(o.getClientRects()),a=a.sort(function(e,t){return e=Math.abs(Math.max(e.top-n,e.bottom-n)),t=Math.abs(Math.max(t.top-n,t.bottom-n)),e-t}),a.length>0){n=(a[0].bottom+a[0].top)/2;try{return o.moveToPoint(t,n),o.collapse(!0),o}catch(s){}}return null}var l=e.each,c=n.isContentEditableFalse,u=i.isCaretContainer;return a.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},a.getCaretRangeFromPoint=function(e,t,n){var r,i;if(n.caretPositionFromPoint)i=n.caretPositionFromPoint(e,t),r=n.createRange(),r.setStart(i.offsetNode,i.offset),r.collapse(!0);else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r=s(e,t,n)}}return r},a.getSelectedNode=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset==n+1?t.childNodes[n]:null},a.getNode=function(e,t){return 1==e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},a}),r(R,[T,d,u],function(e,t,n){return function(r){function i(e){var t,n;if(n=r.$(e).parentsUntil(r.getBody()).add(e),n.length===a.length){for(t=n.length;t>=0&&n[t]===a[t];t--);if(-1===t)return a=n,!0}return a=n,!1}var o,a=[];"onselectionchange"in r.getDoc()||r.on("NodeChange Click MouseUp KeyUp Focus",function(t){var n,i;n=r.selection.getRng(),i={startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset},"nodechange"!=t.type&&e.compareRanges(i,o)||r.fire("SelectionChange"),o=i}),r.on("contextmenu",function(){r.fire("SelectionChange")}),r.on("SelectionChange",function(){var e=r.selection.getStart(!0);!t.range&&r.selection.isCollapsed()||!i(e)&&r.dom.isChildOf(e,r.getBody())&&r.nodeChanged({selectionChange:!0})}),r.on("MouseUp",function(e){e.isDefaultPrevented()||("IMG"==r.selection.getNode().nodeName?n.setEditorTimeout(r,function(){r.nodeChanged()}):r.nodeChanged())}),this.nodeChanged=function(e){var t=r.selection,n,i,o;r.initialized&&t&&!r.settings.disable_nodechange&&!r.readonly&&(o=r.getBody(),n=t.getStart()||o,n.ownerDocument==r.getDoc()&&r.dom.isChildOf(n,o)||(n=o),"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),i=[],r.dom.getParent(n,function(e){return e===o?!0:void i.push(e)}),e=e||{},e.element=n,e.parents=i,r.fire("NodeChange",e))}}}),r(A,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(B,[m],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e,t){var n={},r,i;for(r=0,i=e.length;i>r;r++)n[e[r]]=t||{};return n}var s,c,u,d=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),c=3;c<d.length;c++)"string"==typeof d[c]&&(d[c]=t(d[c])),r.push.apply(r,d[c]);for(e=t(e),s=e.length;s--;)u=[].concat(l,t(n)),a[e[s]]={attributes:i(u),attributesOrder:u,children:i(r,o)}}function r(e,n){var r,i,o,s;for(e=t(e),r=e.length,n=t(n);r--;)for(i=a[e[r]],o=0,s=n.length;s>o;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},l,c,u,d,f,h;return i[e]?i[e]:(l=t("id accesskey class dir lang style tabindex title"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),u=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(l.push.apply(l,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),u.push.apply(u,t("audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(l.push("xml:lang"),h=t("acronym applet basefont big font strike tt"),u.push.apply(u,h),s(h,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),s(f,function(e){n(e,"",d)})),d=d||[].concat(c,u),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),n("address dt dd div caption","",d),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",u),n("blockquote","cite",d),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",d),n("dl","","dt dd"),n("a","href target rel media hreflang type",u),n("q","cite",u),n("ins del","cite datetime",d),n("img","src sizes srcset alt usemap ismap width height"),n("iframe","src name width height",d),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",d,"param"),n("param","name value"),n("map","name",d,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",d),n("th","colspan rowspan headers scope abbr",d),n("form","accept-charset action autocomplete enctype method name novalidate target",d),n("fieldset","disabled form name",d,"legend"),n("label","form for",u),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?d:u),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",d,"li"),n("noscript","",d),"html4"!=e&&(n("wbr"),n("ruby","",u,"rt rp"),n("figcaption","",d),n("mark rt rp summary bdi","",u),n("canvas","width height",d),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",d,"track source"),n("picture","","img source"),n("source","src srcset type media sizes"),n("track","kind src srclang label default"),n("datalist","",u,"option"),n("article section nav aside header footer","",d),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",d,"figcaption"),n("time","datetime",u),n("dialog","open",d),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",u),n("progress","value max",u),n("meter","value min max low high optimum",u),n("details","open",d,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(r("script","language xml:space"),r("style","xml:space"),r("object","declare classid code codebase codetype archive standby align border hspace vspace"),r("embed","align name hspace vspace"),r("param","valuetype type"),r("a","charset name rev shape coords"),r("br","clear"),r("applet","codebase archive code object alt name width height align hspace vspace"),r("img","name longdesc align border hspace vspace"),r("iframe","longdesc frameborder marginwidth marginheight scrolling align"),r("font basefont","size color face"),r("input","usemap align"),r("select","onchange"),r("textarea"),r("h1 h2 h3 h4 h5 h6 div p legend caption","align"),r("ul","type compact"),r("li","type"),r("ol dl menu dir","compact"),r("pre","width xml:space"),r("hr","align noshade size width"),r("isindex","prompt"),r("table","summary width frame rules cellspacing cellpadding align bgcolor"),r("col","width align char charoff valign"),r("colgroup","width align char charoff valign"),r("thead","align char charoff valign"),r("tr","align char charoff valign bgcolor"),r("th","axis align char charoff valign nowrap bgcolor width height"),r("form","accept"),r("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),r("tfoot","align char charoff valign"),r("tbody","align char charoff valign"),r("area","nohref"),r("body","background bgcolor text link vlink alink")),"html4"!=e&&(r("input button select textarea","autofocus"),r("input textarea","placeholder"),r("a","download"),r("link script img","crossorigin"),r("iframe","sandbox seamless allowfullscreen")),s(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,delete a.script,i[e]=a,a)}function r(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),s(e,function(e,r){n[r]=n[r.toUpperCase()]="map"==t?a(e,/[, ]/):c(e,/[, ]/)})),n}var i={},o={},a=e.makeMap,s=e.each,l=e.extend,c=e.explode,u=e.inArray;return function(e){function o(t,n,r){var o=e[t];return o?o=a(o,/[, ]/,a(o.toUpperCase(),/[, ]/)):(o=i[t],o||(o=a(n," ",a(n.toUpperCase()," ")),o=l(o,r),i[t]=o)),o}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function f(e){var n,r,i,o,s,l,c,f,h,p,m,g,v,b,x,w,N,E,_,S=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,k=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),y["@"]&&(w=y["@"].attributes,N=y["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=S.exec(e[n])){if(b=s[1],h=s[2],x=s[3],f=s[5],g={},v=[],l={attributes:g,attributesOrder:v},"#"===b&&(l.paddEmpty=!0),"-"===b&&(l.removeEmpty=!0),"!"===s[4]&&(l.removeEmptyAttrs=!0),w){for(E in w)g[E]=w[E];v.push.apply(v,N)}if(f)for(f=t(f,"|"),i=0,o=f.length;o>i;i++)if(s=k.exec(f[i])){if(c={},m=s[1],p=s[2].replace(/::/g,":"),b=s[3],_=s[4],"!"===m&&(l.attributesRequired=l.attributesRequired||[],l.attributesRequired.push(p),c.required=!0),"-"===m){delete g[p],v.splice(u(v,p),1);continue}b&&("="===b&&(l.attributesDefault=l.attributesDefault||[],l.attributesDefault.push({name:p,value:_}),c.defaultValue=_),":"===b&&(l.attributesForced=l.attributesForced||[],l.attributesForced.push({name:p,value:_}),c.forcedValue=_),"<"===b&&(c.validValues=a(_,"?"))), T.test(p)?(l.attributePatterns=l.attributePatterns||[],c.pattern=d(p),l.attributePatterns.push(c)):(g[p]||v.push(p),g[p]=c)}w||"@"!=h||(w=g,N=v),x&&(l.outputName=h,y[x]=l),T.test(h)?(l.pattern=d(h),C.push(l)):y[h]=l}}function h(e){y={},C=[],f(e),s(N,function(e,t){b[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&(i.text_block_elements=i.block_elements=null,s(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",o=t[2];if(b[o]=b[i],M[o]=i,r||(R[o.toUpperCase()]={},R[o]={}),!y[o]){var a=y[i];a=l({},a),delete a.removeEmptyAttrs,delete a.removeEmpty,y[o]=a}s(b,function(e,t){e[i]&&(b[t]=e=l({},b[t]),e[o]=e[i])})}))}function m(n){var r=/^([+\-]?)(\w+)\[([^\]]+)\]$/;i[e.schema]=null,n&&s(t(n,","),function(e){var n=r.exec(e),i,o;n&&(o=n[1],i=o?b[n[2]]:b[n[2]]={"#comment":{}},i=b[n[2]],s(t(n[3],"|"),function(e){"-"===o?delete i[e]:i[e]={}}))})}function g(e){var t=y[e],n;if(t)return t;for(n=C.length;n--;)if(t=C[n],t.pattern.test(e))return t}var v=this,y={},b={},C=[],x,w,N,E,_,S,k,T,R,A,B,D,L,M={},P={};e=e||{},N=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),x=r(e.valid_styles),w=r(e.invalid_styles,"map"),T=r(e.valid_classes,"map"),E=o("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=o("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),S=o("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),k=o("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),A=o("non_empty_elements","td th iframe video audio object script",S),B=o("move_caret_before_on_enter_elements","table",A),D=o("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),R=o("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption",D),L=o("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),s((e.special||"script noscript style textarea").split(" "),function(e){P[e]=new RegExp("</"+e+"[^>]*>","gi")}),e.valid_elements?h(e.valid_elements):(s(N,function(e,t){y[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},b[t]=e.children}),"html5"!=e.schema&&s(t("strong/b em/i"),function(e){e=t(e,"/"),y[e[1]].outputName=e[0]}),s(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){y[e]&&(y[e].removeEmpty=!0)}),s(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){y[e].paddEmpty=!0}),s(t("span"),function(e){y[e].removeEmptyAttrs=!0})),p(e.custom_elements),m(e.valid_children),f(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&s(c(e.invalid_elements),function(e){y[e]&&delete y[e]}),g("span")||f("span[!data-mce-type|*]"),v.children=b,v.getValidStyles=function(){return x},v.getInvalidStyles=function(){return w},v.getValidClasses=function(){return T},v.getBoolAttrs=function(){return k},v.getBlockElements=function(){return R},v.getTextBlockElements=function(){return D},v.getTextInlineElements=function(){return L},v.getShortEndedElements=function(){return S},v.getSelfClosingElements=function(){return _},v.getNonEmptyElements=function(){return A},v.getMoveCaretBeforeOnEnterElements=function(){return B},v.getWhiteSpaceElements=function(){return E},v.getSpecialElements=function(){return P},v.isValidChild=function(e,t){var n=b[e];return!(!n||!n[t])},v.isValid=function(e,t){var n,r,i=g(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},v.getElementRule=g,v.getCustomElements=function(){return M},v.addValidElements=f,v.setValidElements=h,v.addCustomElements=p,v.addValidChildren=m,v.elements=y}}),r(D,[B,C,m],function(e,t,n){function r(e,t,n){var r=1,i,o,a,s;for(s=e.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g,a.lastIndex=i=n;o=a.exec(t);){if(i=a.lastIndex,"/"===o[1])r--;else if(!o[1]){if(o[2]in s)continue;r++}if(0===r)break}return i}function i(i,a){function s(){}var l=this;i=i||{},l.schema=a=a||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),o("comment cdata text start end pi doctype".split(" "),function(e){e&&(l[e]=i[e]||s)}),l.parse=function(e){function o(e){var t,n;for(t=h.length;t--&&h[t].name!==e;);if(t>=0){for(n=h.length-1;n>=t;n--)e=h[n],e.valid&&l.end(e.name);h.length=t}}function s(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in x?t:z(n||r||o||""),N&&!y&&0!==t.indexOf("data-")){if(a=T[t],!a&&R){for(s=R.length;s--&&(a=R[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(W[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{c=decodeURIComponent(c)}catch(u){c=unescape(c)}if(V.test(c))return;if(!i.allow_html_data_urls&&$.test(c)&&!/^data:image\//i.test(c))return}p.map[t]=n,p.push({name:t,value:n})}var l=this,c,u=0,d,f,h=[],p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F=0,z=t.decode,U,W=n.makeMap("src,href,data,background,formaction,poster"),V=/((java|vb)script|mhtml):/i,$=/^data:/i;for(P=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),O=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,C=a.getShortEndedElements(),M=i.self_closing_elements||a.getSelfClosingElements(),x=a.getBoolAttrs(),N=i.validate,b=i.remove_internals,U=i.fix_self_closing,H=a.getSpecialElements();c=P.exec(e);){if(u<c.index&&l.text(z(e.substr(u,c.index-u))),d=c[6])d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),o(d);else if(d=c[7]){if(d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),w=d in C,U&&M[d]&&h.length>0&&h[h.length-1].name===d&&o(d),!N||(E=a.getElementRule(d))){if(_=!0,N&&(T=E.attributes,R=E.attributePatterns),(k=c[8])?(y=-1!==k.indexOf("data-mce-type"),y&&b&&(_=!1),p=[],p.map={},k.replace(O,s)):(p=[],p.map={}),N&&!y){if(A=E.attributesRequired,B=E.attributesDefault,D=E.attributesForced,L=E.removeEmptyAttrs,L&&!p.length&&(_=!1),D)for(m=D.length;m--;)S=D[m],v=S.name,I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I});if(B)for(m=B.length;m--;)S=B[m],v=S.name,v in p.map||(I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I}));if(A){for(m=A.length;m--&&!(A[m]in p.map););-1===m&&(_=!1)}if(S=p.map["data-mce-bogus"]){if("all"===S){u=r(a,e,P.lastIndex),P.lastIndex=u;continue}_=!1}}_&&l.start(d,p,w)}else _=!1;if(f=H[d]){f.lastIndex=u=c.index+c[0].length,(c=f.exec(e))?(_&&(g=e.substr(u,c.index-u)),u=c.index+c[0].length):(g=e.substr(u),u=e.length),_&&(g.length>0&&l.text(g,!0),l.end(d)),P.lastIndex=u;continue}w||(k&&k.indexOf("/")==k.length-1?_&&l.end(d):h.push({name:d,valid:_}))}else(d=c[1])?(">"===d.charAt(0)&&(d=" "+d),i.allow_conditional_comments||"[if"!==d.substr(0,3)||(d=" "+d),l.comment(d)):(d=c[2])?l.cdata(d):(d=c[3])?l.doctype(d):(d=c[4])&&l.pi(d,c[5]);u=c.index+c[0].length}for(u<e.length&&l.text(z(e.substr(u))),m=h.length-1;m>=0;m--)d=h[m],d.valid&&l.end(d.name)}}var o=n.each;return i.findEndTag=r,i}),r(L,[A,B,D,m],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,h,p,m,g,v,y,b;for(m=i("tr,td,th,tbody,thead,tfoot,table"),p=l.getNonEmptyElements(),g=l.getTextBlockElements(),v=l.getSpecialElements(),n=0;n<t.length;n++)if(r=t[n],r.parent&&!r.fixed)if(g[r.name]&&"li"==r.parent.name){for(y=r.next;y&&g[y.name];)y.name="li",y.fixed=!0,r.parent.insert(y,r.parent),y=y.next;r.unwrap(r)}else{for(a=[r],o=r.parent;o&&!l.isValidChild(o.name,r.name)&&!m[o.name];o=o.parent)a.push(o);if(o&&a.length>1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),h=0;h<a.length-1;h++){for(l.isValidChild(c.name,a[h].name)?(d=u.filterNode(a[h].clone()),c.append(d)):d=c,f=a[h].firstChild;f&&f!=a[h+1];)b=f.next,d.append(f),f=b;c=d}s.isEmpty(p)?o.insert(r,a[0],!0):(o.insert(s,a[0],!0),o.insert(r,s)),o=a[0],(o.isEmpty(p)||o.firstChild===o.lastChild&&"br"===o.firstChild.name)&&o.empty().remove()}else if(r.parent){if("li"===r.name){if(y=r.prev,y&&("ul"===y.name||"ul"===y.name)){y.append(r);continue}if(y=r.next,y&&("ul"===y.name||"ul"===y.name)){y.insert(r,y.firstChild,!0);continue}r.wrap(u.filterNode(new e("ul",1)));continue}l.isValidChild(r.parent.name,"div")&&l.isValidChild("div",r.name)?r.wrap(u.filterNode(new e("div",1))):v[r.name]?r.empty().remove():r.unwrap()}}}var u=this,d={},f=[],h={},p={};r=r||{},r.validate="validate"in r?r.validate:!0,r.root_name=r.root_name||"body",u.schema=l=l||new t,u.filterNode=function(e){var t,n,r;n in d&&(r=h[n],r?r.push(e):h[n]=[e]),t=f.length;for(;t--;)n=f[t].name,n in e.attributes.map&&(r=p[n],r?r.push(e):p[n]=[e]);return e},u.addNodeFilter=function(e,t){o(a(e),function(e){var n=d[e];n||(d[e]=n=[]),n.push(t)})},u.addAttributeFilter=function(e,t){o(a(e),function(e){var n;for(n=0;n<f.length;n++)if(f[n].name===e)return void f[n].callbacks.push(t);f.push({name:e,callbacks:[t]})})},u.parse=function(t,o){function a(){function e(e){e&&(t=e.firstChild,t&&3==t.type&&(t.value=t.value.replace(R,"")),t=e.lastChild,t&&3==t.type&&(t.value=t.value.replace(D,"")))}var t=y.firstChild,n,i;if(l.isValidChild(y.name,I.toLowerCase())){for(;t;)n=t.next,3==t.type||1==t.type&&"p"!==t.name&&!T[t.name]&&!t.attr("data-mce-type")?i?i.append(t):(i=u(I,1),i.attr(r.forced_root_block_attrs),y.insert(i,t),i.append(t)):(e(i),i=null),t=n;e(i)}}function u(t,n){var r=new e(t,n),i;return t in d&&(i=h[t],i?i.push(r):h[t]=[r]),r}function m(e){var t,n,r,i,o=l.getBlockElements();for(t=e.prev;t&&3===t.type;){if(r=t.value.replace(D,""),r.length>0)return void(t.value=r);if(n=t.next){if(3==n.type&&n.value.length){t=t.prev;continue}if(!o[n.name]&&"script"!=n.name&&"style"!=n.name){t=t.prev;continue}}i=t.prev,t.remove(),t=i}}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,N,E,_,S,k,T,R,A=[],B,D,L,M,P,O,H,I;if(o=o||{},h={},p={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),H=l.getNonEmptyElements(),O=l.children,k=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,P=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,L=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,v=new n({validate:k,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(L," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=k?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=O[b.name],s&&O[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(_=p[a],_?_.push(r):p[a]=[r]);T[e]&&m(r),n||(b=r),!B&&P[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=k?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(D,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o}if(B&&P[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(H))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,T[b.name]?b.empty().remove():b.unwrap(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),k&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(S in h){for(_=d[S],C=h[S],N=C.length;N--;)C[N].parent||C.splice(N,1);for(x=0,w=_.length;w>x;x++)_[x](C,S,o)}for(x=0,w=f.length;w>x;x++)if(_=f[x],_.name in p){for(C=p[_.name],N=C.length;N--;)C[N].parent||C.splice(N,1);for(N=0,E=_.callbacks.length;E>N;N++)_.callbacks[N](C,_.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,h,p;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(h=l.getElementRule(c.name),h&&(h.removeEmpty?c.remove():h.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(p=new e("#text",3),p.value="\xa0",i.replace(p))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}}),r.validate&&l.getValidClasses()&&u.addAttributeFilter("class",function(e){for(var t=e.length,n,r,i,o,a,s=l.getValidClasses(),c,u;t--;){for(n=e[t],r=n.attr("class").split(" "),a="",i=0;i<r.length;i++)o=r[i],u=!1,c=s["*"],c&&c[o]&&(u=!0),c=s[n.name],!u&&c&&c[o]&&(u=!0),u&&(a&&(a+=" "),a+=o);a.length||(a=null),n.attr("class",a)}})}}),r(M,[C,m],function(e,t){var n=t.makeMap;return function(t){var r=[],i,o,a,s,l;return t=t||{},i=t.indent,o=n(t.indent_before||""),a=n(t.indent_after||""),s=e.getEncodeFunc(t.entity_encoding||"raw",t.entities),l="html"==t.element_format,{start:function(e,t,n){var c,u,d,f;if(i&&o[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');!n||l?r[r.length]=">":r[r.length]=" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push("</",e,">"),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("<![CDATA[",e,"]]>")},comment:function(e){r.push("<!--",e,"-->")},pi:function(e,t){t?r.push("<?",e," ",s(t),"?>"):r.push("<?",e,"?>"),i&&r.push("\n")},doctype:function(e){r.push("<!DOCTYPE",e,">",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(P,[M,B],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,h,p,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1&&(f=[],f.map={},m=r.getElementRule(e.name))){for(h=0,p=m.attributesOrder.length;p>h;h++)u=m.attributesOrder[h],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(h=0,p=c.length;p>h;h++)u=c[h].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(O,[w,L,D,C,P,A,B,d,m,S],function(e,t,n,r,i,o,a,s,l,c){function u(e){function t(e){return e&&"br"===e.name}var n,r;n=e.lastChild,t(n)&&(r=n.prev,t(r)&&(n.remove(),r.remove()))}var d=l.each,f=l.trim,h=e.DOM,p=["data-mce-selected"];return function(e,o){function m(e){var t=new RegExp(["<span[^>]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","\\s?("+p.join("|")+')="[^"]+"'].join("|"),"gi");return e=c.trim(e.replace(t,""))}function g(){var e=o.getBody().innerHTML,t=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,r,i,a,s,l,c=o.schema;for(e=m(e),l=c.getShortEndedElements();s=t.exec(e);)i=t.lastIndex,a=s[0].length,r=l[s[1]]?i:n.findEndTag(c,e,i),e=e.substring(0,i-a)+e.substring(r),t.lastIndex=i-a;return f(e)}function v(e){-1===l.inArray(p,e)&&(C.addAttributeFilter(e,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),p.push(e))}var y,b,C;return o&&(y=o.dom,b=o.schema),y=y||h,b=b||new a(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,C=new t(e,b),C.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n=e.length,r;n--;)r=e[n],r.attr("tabindex",r.attributes.map["data-mce-tabindex"]),r.attr(t,null)}),C.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,s=e.url_converter,l=e.url_converter_scope,c;r--;)i=t[r],o=i.attributes.map[a],o!==c?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=y.serializeStyle(y.parseStyle(o),i.name):s&&(o=s.call(l,o,n,i.name)),i.attr(n,o.length>0?o:null))}),C.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class"),r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}),C.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),C.addNodeFilter("noscript",function(e){for(var t=e.length,n;t--;)n=e[t].firstChild,n&&(n.value=r.decode(n.value))}),C.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o,a;r--;)i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t?(a=i.attr("type"),a&&i.attr("type","mce-no/type"==a?null:a.replace(/^mce\-/,"")),o.length>0&&(i.firstChild.value="// <![CDATA[\n"+n(o)+"\n// ]]>")):o.length>0&&(i.firstChild.value="<!--\n"+n(o)+"\n-->")}),C.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),C.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&C.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,"ul"!==r.name&&"ol"!==r.name||n.prev&&"li"===n.prev.name&&n.prev.append(n)}),C.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:b,addNodeFilter:C.addNodeFilter,addAttributeFilter:C.addAttributeFilter,serialize:function(t,n){var r=this,o,a,l,h,p,m;return s.ie&&y.select("script,style,select,map").length>0?(p=t.innerHTML,t=t.cloneNode(!1),y.setHTML(t,p)):t=t.cloneNode(!0),o=document.implementation,o.createHTMLDocument&&(a=o.createHTMLDocument(""),d("BODY"==t.nodeName?t.childNodes:[t],function(e){a.body.appendChild(a.importNode(e,!0))}),t="BODY"!=t.nodeName?a.body.firstChild:a.body,l=y.doc,y.doc=a),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,r.onPreProcess(n)),m=C.parse(f(n.getInner?t.innerHTML:y.getOuterHTML(t)),n),u(m),h=new i(e,b),n.content=h.serialize(m),n.cleanup||(n.content=c.trim(n.content),n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||r.onPostProcess(n),l&&(y.doc=l),n.node=null,n.content},addRules:function(e){b.addValidElements(e)},setRules:function(e){b.setValidElements(e)},onPreProcess:function(e){o&&o.fire("PreProcess",e)},onPostProcess:function(e){o&&o.fire("PostProcess",e)},addTempAttr:v,trimHtml:m,getTrimmedContent:g}}}),r(H,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(3==l.nodeType&&(u=l.nodeValue,s+=u.length,s>=i)){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(3==l.nodeType&&(s+=l.nodeValue.length,s>=i)){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,p;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),t!=f&&t!=f.documentElement||(t=h,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(p=t.childNodes,p.length?(n>=p.length?i.insertAfter(a,p[p.length-1]):t.insertBefore(a,p[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="<span></span>",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,h=f.body,p,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=h.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="<span></span><span></span>",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=h.createControlRange(),a.addElement(m),a.select(),p=e.getRng(),p.item&&m===p.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(I,[d],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(t){return e.mac?t.metaKey:t.ctrlKey&&!t.altKey}}}),r(F,[I,m,u,d,_],function(e,t,n,r,i){function o(e,t){for(;t&&t!=e;){if(s(t)||a(t))return t;t=t.parentNode}return null}var a=i.isContentEditableFalse,s=i.isContentEditableTrue;return function(i,s){function l(e){var t=s.settings.object_resizing;return t===!1||r.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:e==s.getBody()?!1:s.dom.is(e,t))}function c(t){var n,r,i,o,a;n=t.screenX-L,r=t.screenY-M,U=n*B[2]+H,W=r*B[3]+I,U=5>U?5:U,W=5>W?5:W,i="IMG"==k.nodeName&&s.settings.resize_img_proportional!==!1?!e.modifierPressed(t):e.modifierPressed(t)||"IMG"==k.nodeName&&B[2]*B[3]!==0,i&&(j(n)>j(r)?(W=Y(U*F),U=Y(W/F)):(U=Y(W/F),W=Y(U*F))),_.setStyles(T,{width:U,height:W}),o=B.startPos.x+n,a=B.startPos.y+r,o=o>0?o:0,a=a>0?a:0,_.setStyles(R,{left:o,top:a,display:"block"}),R.innerHTML=U+" × "+W,B[2]<0&&T.clientWidth<=U&&_.setStyle(T,"left",P+(H-U)),B[3]<0&&T.clientHeight<=W&&_.setStyle(T,"top",O+(I-W)),n=X.scrollWidth-K,r=X.scrollHeight-G,n+r!==0&&_.setStyles(R,{left:o-n,top:a-r}),z||(s.fire("ObjectResizeStart",{target:k,width:H,height:I}),z=!0)}function u(){function e(e,t){t&&(k.style[e]||!s.schema.isValid(k.nodeName.toLowerCase(),e)?_.setStyle(k,e,t):_.setAttrib(k,e,t))}z=!1,e("width",U),e("height",W),_.unbind(V,"mousemove",c),_.unbind(V,"mouseup",u),$!=V&&(_.unbind($,"mousemove",c),_.unbind($,"mouseup",u)),_.remove(T),_.remove(R),q&&"TABLE"!=k.nodeName||d(k),s.fire("ObjectResized",{target:k,width:U,height:W}),_.setAttrib(k,"style",_.getAttrib(k,"style")),s.nodeChanged()}function d(e,t,n){var i,o,a,d,h;f(),x(),i=_.getPos(e,X),P=i.x,O=i.y,h=e.getBoundingClientRect(),o=h.width||h.right-h.left,a=h.height||h.bottom-h.top,k!=e&&(C(),k=e,U=W=0),d=s.fire("ObjectSelected",{target:e}),l(e)&&!d.isDefaultPrevented()?S(A,function(e,i){function s(t){L=t.screenX,M=t.screenY,H=k.clientWidth,I=k.clientHeight,F=I/H,B=e,e.startPos={x:o*e[0]+P,y:a*e[1]+O},K=X.scrollWidth,G=X.scrollHeight,T=k.cloneNode(!0),_.addClass(T,"mce-clonedresizable"),_.setAttrib(T,"data-mce-bogus","all"),T.contentEditable=!1,T.unSelectabe=!0,_.setStyles(T,{left:P,top:O,margin:0}),T.removeAttribute("data-mce-selected"),X.appendChild(T),_.bind(V,"mousemove",c),_.bind(V,"mouseup",u),$!=V&&(_.bind($,"mousemove",c),_.bind($,"mouseup",u)),R=_.add(X,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},H+" × "+I)}var l;return t?void(i==t&&s(n)):(l=_.get("mceResizeHandle"+i),l&&_.remove(l),l=_.add(X,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),r.ie&&(l.contentEditable=!1),_.bind(l,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),s(e)}),e.elm=l,void _.setStyles(l,{left:o*e[0]+P-l.offsetWidth/2,top:a*e[1]+O-l.offsetHeight/2}))}):f(),k.setAttribute("data-mce-selected","1")}function f(){var e,t;x(),k&&k.removeAttribute("data-mce-selected");for(e in A)t=_.get("mceResizeHandle"+e),t&&(_.unbind(t),_.remove(t))}function h(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n,r;if(!z&&!s.removed)return S(_.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),r="mousedown"==e.type?e.target:i.getNode(),r=_.$(r).closest(q?"table":"table,img,hr")[0],t(r,X)&&(w(),n=i.getStart(!0),t(n,r)&&t(i.getEnd(!0),r)&&(!q||r!=n&&"IMG"!==n.nodeName))?void d(r):void f()}function p(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function m(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function g(e){var t=e.srcElement,n,r,i,o,a,l,c;n=t.getBoundingClientRect(),l=D.clientX-n.left,c=D.clientY-n.top;for(r in A)if(i=A[r],o=t.offsetWidth*i[0],a=t.offsetHeight*i[1],j(o-l)<8&&j(a-c)<8){B=i;break}z=!0,s.fire("ObjectResizeStart",{target:k,width:k.clientWidth,height:k.clientHeight}),s.getDoc().selection.empty(),d(t,r,D)}function v(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function y(e){return a(o(s.getBody(),e))}function b(e){var t=e.srcElement;if(y(t))return void v(e);if(t!=k){if(s.fire("ObjectSelected",{target:t}),C(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);"IMG"!=t.nodeName&&"TABLE"!=t.nodeName||(f(),k=t,p(t,"resizestart",g))}}function C(){m(k,"resizestart",g)}function x(){for(var e in A){var t=A[e];t.elm&&(_.unbind(t.elm),delete t.elm)}}function w(){try{s.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function N(e){var t;if(q){t=V.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function E(){k=T=null,q&&(C(),m(X,"controlselect",b))}var _=s.dom,S=t.each,k,T,R,A,B,D,L,M,P,O,H,I,F,z,U,W,V=s.getDoc(),$=document,q=r.ie&&r.ie<11,j=Math.abs,Y=Math.round,X=s.getBody(),K,G;A={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var J=".mce-content-body";return s.contentStyles.push(J+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: box-sizing;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+J+" .mce-resizehandle:hover {background: #000}"+J+" img[data-mce-selected],"+J+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+J+" .mce-clonedresizable {position: absolute;"+(r.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+J+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}"),s.on("init",function(){q?(s.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(f(),N(e.target))}),p(X,"controlselect",b),s.on("mousedown",function(e){D=e})):(w(),r.ie>=11&&(s.on("mousedown click",function(e){var t=e.target,n=t.nodeName;z||!/^(TABLE|IMG|HR)$/.test(n)||y(t)||(s.selection.select(t,"TABLE"==n),"mousedown"==e.type&&s.nodeChanged())}),s.dom.bind(X,"mscontrolselect",function(e){function t(e){n.setEditorTimeout(s,function(){s.selection.select(e)})}return y(e.target)?(e.preventDefault(),void t(e.target)):void(/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&t(e.target)))})));var e=n.throttle(function(e){s.composing||h(e)});s.on("nodechange ResizeEditor ResizeWindow drop",e),s.on("keyup compositionend",function(t){k&&"TABLE"==k.nodeName&&e(t)}),s.on("hide blur",f)}),s.on("remove",x),{isResizable:l,showResizeRect:d,hideResizeRect:f,updateResizeRect:h,controlSelect:N,destroy:E}}}),r(z,[],function(){function e(e){return function(){return e}}function t(e){return function(t){return!e(t)}}function n(e,t){return function(n){return e(t(n))}}function r(){var e=a.call(arguments);return function(t){for(var n=0;n<e.length;n++)if(e[n](t))return!0;return!1}}function i(){var e=a.call(arguments); return function(t){for(var n=0;n<e.length;n++)if(!e[n](t))return!1;return!0}}function o(e){var t=a.call(arguments);return t.length-1>=e.length?e.apply(this,t.slice(1)):function(){var e=t.concat([].slice.call(arguments));return o.apply(this,e)}}var a=[].slice;return{constant:e,negate:t,and:i,or:r,curry:o,compose:n}}),r(U,[_,p,k],function(e,t,n){function r(e){return m(e)?!1:d(e)?!f(e.parentNode):h(e)||u(e)||p(e)||c(e)}function i(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode){if(c(e))return!1;if(l(e))return!0}return!0}function o(e){return c(e)?t.reduce(e.getElementsByTagName("*"),function(e,t){return e||l(t)},!1)!==!0:!1}function a(e){return h(e)||o(e)}function s(e,t){return r(e)&&i(e,t)}var l=e.isContentEditableTrue,c=e.isContentEditableFalse,u=e.isBr,d=e.isText,f=e.matchNodeNames("script style textarea"),h=e.matchNodeNames("img input textarea hr iframe video audio object"),p=e.matchNodeNames("table"),m=n.isCaretContainer;return{isCaretCandidate:r,isInEditable:i,isAtomic:a,isEditableCaretCandidate:s}}),r(W,[],function(){function e(e){return e?{left:u(e.left),top:u(e.top),bottom:u(e.bottom),right:u(e.right),width:u(e.width),height:u(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}}function t(t,n){return t=e(t),n?t.right=t.left:(t.left=t.left+t.width,t.right=t.left),t.width=0,t}function n(e,t){return e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right}function r(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2}function i(e,t){return e.bottom<t.top?!0:e.top>t.bottom?!1:r(t.top-e.bottom,e,t)}function o(e,t){return e.top>t.bottom?!0:e.bottom<t.top?!1:r(t.bottom-e.top,e,t)}function a(e,t){return e.left<t.left}function s(e,t){return e.right>t.right}function l(e,t){return i(e,t)?-1:o(e,t)?1:a(e,t)?-1:s(e,t)?1:0}function c(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom}var u=Math.round;return{clone:e,collapse:t,isEqual:n,isAbove:i,isBelow:o,isLeft:a,isRight:s,compare:l,containsXY:c}}),r(V,[],function(){function e(e){return"string"==typeof e&&e.charCodeAt(0)>=768&&t.test(e)}var t=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]");return{isExtendingChar:e}}),r($,[z,_,w,T,U,W,V],function(e,t,n,r,i,o,a){function s(e){return"createRange"in e?e.createRange():n.DOM.createRng()}function l(e){return e&&/[\r\n\t ]/.test(e)}function c(e){var t=e.startContainer,n=e.startOffset,r;return!!(l(e.toString())&&v(t.parentNode)&&(r=t.data,l(r[n-1])||l(r[n+1])))}function u(e){function t(e){var t=e.ownerDocument,n=s(t),r=t.createTextNode("\xa0"),i=e.parentNode,a;return i.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1),a=o.clone(n.getBoundingClientRect()),i.removeChild(r),a}function n(e){var n,r;return r=e.getClientRects(),n=r.length>0?o.clone(r[0]):o.clone(e.getBoundingClientRect()),b(e)&&0===n.left?t(e):n}function r(e,t){return e=o.collapse(e,t),e.width=1,e.right=e.left+1,e}function i(e){0!==e.height&&(u.length>0&&o.isEqual(e,u[u.length-1])||u.push(e))}function l(e,t){var o=s(e.ownerDocument);if(t<e.data.length){if(a.isExtendingChar(e.data[t]))return u;if(a.isExtendingChar(e.data[t-1])&&(o.setStart(e,t),o.setEnd(e,t+1),!c(o)))return i(r(n(o),!1)),u}t>0&&(o.setStart(e,t-1),o.setEnd(e,t),c(o)||i(r(n(o),!1))),t<e.data.length&&(o.setStart(e,t),o.setEnd(e,t+1),c(o)||i(r(n(o),!0)))}var u=[],d,h;if(y(e.container()))return l(e.container(),e.offset()),u;if(f(e.container()))if(e.isAtEnd())h=x(e.container(),e.offset()),y(h)&&l(h,h.data.length),g(h)&&!b(h)&&i(r(n(h),!1));else{if(h=x(e.container(),e.offset()),y(h)&&l(h,0),g(h)&&e.isAtEnd())return i(r(n(h),!1)),u;d=x(e.container(),e.offset()-1),g(d)&&!b(d)&&(p(d)||p(h)||!g(h))&&i(r(n(d),!1)),g(h)&&i(r(n(h),!0))}return u}function d(t,n,r){function i(){return y(t)?0===n:0===n}function o(){return y(t)?n>=t.data.length:n>=t.childNodes.length}function a(){var e;return e=s(t.ownerDocument),e.setStart(t,n),e.setEnd(t,n),e}function l(){return r||(r=u(new d(t,n))),r}function c(){return l().length>0}function f(e){return e&&t===e.container()&&n===e.offset()}function h(e){return x(t,e?n-1:n)}return{container:e.constant(t),offset:e.constant(n),toRange:a,getClientRects:l,isVisible:c,isAtStart:i,isAtEnd:o,isEqual:f,getNode:h}}var f=t.isElement,h=i.isCaretCandidate,p=t.matchStyleValues("display","block table"),m=t.matchStyleValues("float","left right"),g=e.and(f,h,e.negate(m)),v=e.negate(t.matchStyleValues("white-space","pre pre-line pre-wrap")),y=t.isText,b=t.isBr,C=n.nodeIndex,x=r.getNode;return d.fromRangeStart=function(e){return new d(e.startContainer,e.startOffset)},d.fromRangeEnd=function(e){return new d(e.endContainer,e.endOffset)},d.after=function(e){return new d(e.parentNode,C(e)+1)},d.before=function(e){return new d(e.parentNode,C(e))},d}),r(q,[_,w,z,p,$],function(e,t,n,r,i){function o(e){var t=e.parentNode;return v(t)?o(t):t}function a(e){return e?r.reduce(e.childNodes,function(e,t){return v(t)&&"BR"!=t.nodeName?e=e.concat(a(t)):e.push(t),e},[]):[]}function s(e,t){for(;(e=e.previousSibling)&&g(e);)t+=e.data.length;return t}function l(e){return function(t){return e===t}}function c(t){var n,i,s;return n=a(o(t)),i=r.findIndex(n,l(t),t),n=n.slice(0,i+1),s=r.reduce(n,function(e,t,r){return g(t)&&g(n[r-1])&&e++,e},0),n=r.filter(n,e.matchNodeNames(t.nodeName)),i=r.findIndex(n,l(t),t),i-s}function u(e){var t;return t=g(e)?"text()":e.nodeName.toLowerCase(),t+"["+c(e)+"]"}function d(e,t,n){var r=[];for(t=t.parentNode;t!=e&&(!n||!n(t));t=t.parentNode)r.push(t);return r}function f(t,i){var o,a,l=[],c,f,h;return o=i.container(),a=i.offset(),g(o)?c=s(o,a):(f=o.childNodes,a>=f.length?(c="after",a=f.length-1):c="before",o=f[a]),l.push(u(o)),h=d(t,o),h=r.filter(h,n.negate(e.isBogus)),l=l.concat(r.map(h,function(e){return u(e)})),l.reverse().join("/")+","+c}function h(t,n,i){var o=a(t);return o=r.filter(o,function(e,t){return!g(e)||!g(o[t-1])}),o=r.filter(o,e.matchNodeNames(n)),o[i]}function p(e,t){for(var n=e,r=0,o;g(n);){if(o=n.data.length,t>=r&&r+o>=t){e=n,t-=r;break}if(!g(n.nextSibling)){e=n,t=o;break}r+=o,n=n.nextSibling}return t>e.data.length&&(t=e.data.length),new i(e,t)}function m(e,t){var n,o,a;return t?(n=t.split(","),t=n[0].split("/"),a=n.length>1?n[1]:"before",o=r.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),h(e,t[1],parseInt(t[2],10))):null},e),o?g(o)?p(o,parseInt(a,10)):(a="after"===a?y(o)+1:y(o),new i(o.parentNode,a)):null):null}var g=e.isText,v=e.isBogus,y=t.nodeIndex;return{create:f,resolve:m}}),r(j,[d,m,k,q,$,_],function(e,t,n,r,i,o){function a(a){var l=a.dom;this.getBookmark=function(e,c){function u(e,n){var r=0;return t.each(l.select(e),function(e){return"all"!==e.getAttribute("data-mce-bogus")?e==n?!1:void r++:void 0}),r}function d(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function f(e){function t(e,t){var r=e[t?"startContainer":"endContainer"],i=e[t?"startOffset":"endOffset"],o=[],a,s,u=0;if(3==r.nodeType){if(c)for(a=r.previousSibling;a&&3==a.nodeType;a=a.previousSibling)i+=a.nodeValue.length;o.push(i)}else s=r.childNodes,i>=s.length&&s.length&&(u=1,i=Math.max(0,s.length-1)),o.push(l.nodeIndex(s[i],c)+u);for(;r&&r!=n;r=r.parentNode)o.push(l.nodeIndex(r,c));return o}var n=l.getRoot(),r={};return r.start=t(e,!0),a.isCollapsed()||(r.end=t(e)),r}function h(e){function t(e){var t;if(n.isCaretContainer(e)){if(o.isText(e)&&n.isCaretContainerBlock(e)&&(e=e.parentNode),t=e.previousSibling,s(t))return t;if(t=e.nextSibling,s(t))return t}}return t(e.startContainer)||t(e.endContainer)}var p,m,g,v,y,b,C="",x;if(2==e)return b=a.getNode(),y=b?b.nodeName:null,p=a.getRng(),s(b)||"IMG"==y?{name:y,index:u(y,b)}:a.tridentSel?a.tridentSel.getBookmark(e):(b=h(p),b?(y=b.tagName,{name:y,index:u(y,b)}):f(p));if(3==e)return p=a.getRng(),{start:r.create(l.getRoot(),i.fromRangeStart(p)),end:r.create(l.getRoot(),i.fromRangeEnd(p))};if(e)return{rng:a.getRng()};if(p=a.getRng(),g=l.uniqueId(),v=a.isCollapsed(),x="overflow:hidden;line-height:0px",p.duplicate||p.item){if(p.item)return b=p.item(0),y=b.nodeName,{name:y,index:u(y,b)};m=p.duplicate();try{p.collapse(),p.pasteHTML('<span data-mce-type="bookmark" id="'+g+'_start" style="'+x+'">'+C+"</span>"),v||(m.collapse(!1),p.moveToElementText(m.parentElement()),0===p.compareEndPoints("StartToEnd",m)&&m.move("character",-1),m.pasteHTML('<span data-mce-type="bookmark" id="'+g+'_end" style="'+x+'">'+C+"</span>"))}catch(w){return null}}else{if(b=a.getNode(),y=b.nodeName,"IMG"==y)return{name:y,index:u(y,b)};m=d(p.cloneRange()),v||(m.collapse(!1),m.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_end",style:x},C))),p=d(p),p.collapse(!0),p.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_start",style:x},C))}return a.moveToBookmark({id:g,keep:1}),{id:g}},this.moveToBookmark=function(n){function i(e){var t=n[e?"start":"end"],r,i,o,a;if(t){for(o=t[0],i=d,r=t.length-1;r>=1;r--){if(a=i.childNodes,t[r]>a.length-1)return;i=a[t[r]]}3===i.nodeType&&(o=Math.min(t[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(t[0],i.childNodes.length)),e?u.setStart(i,o):u.setEnd(i,o)}return!0}function o(r){var i=l.get(n.id+"_"+r),o,a,s,c,u=n.keep;if(i&&(o=i.parentNode,"start"==r?(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),f=h=o,p=m=a):(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),h=o,m=a),!u)){for(c=i.previousSibling,s=i.nextSibling,t.each(t.grep(i.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});i=l.get(n.id+"_"+r);)l.remove(i,1);c&&s&&c.nodeType==s.nodeType&&3==c.nodeType&&!e.opera&&(a=c.nodeValue.length,c.appendData(s.nodeValue),l.remove(s),"start"==r?(f=h=c,p=m=a):(h=c,m=a))}}function s(t){return!l.isBlock(t)||t.innerHTML||e.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t}function c(){var e,t;return e=l.createRng(),t=r.resolve(l.getRoot(),n.start),e.setStart(t.container(),t.offset()),t=r.resolve(l.getRoot(),n.end),e.setEnd(t.container(),t.offset()),e}var u,d,f,h,p,m;if(n)if(t.isArray(n.start)){if(u=l.createRng(),d=l.getRoot(),a.tridentSel)return a.tridentSel.moveToBookmark(n);i(!0)&&i()&&a.setRng(u)}else"string"==typeof n.start?a.setRng(c(n)):n.id?(o("start"),o("end"),f&&(u=l.createRng(),u.setStart(s(f),p),u.setEnd(s(h),m),a.setRng(u))):n.name?a.select(l.select(n.name)[n.index]):n.rng&&a.setRng(n.rng)}}var s=o.isContentEditableFalse;return a.isBookmarkNode=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},a}),r(Y,[y,H,F,T,j,_,d,m,$],function(e,n,r,i,o,a,s,l,c){function u(e,t,i,a){var s=this;s.dom=e,s.win=t,s.serializer=i,s.editor=a,s.bookmarkManager=new o(s),s.controlSelection=new r(s,a),s.win.getSelection||(s.tridentSel=new n(s))}var d=l.each,f=l.trim,h=s.ie;return u.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='<span id="__caret">_</span>',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('<span id="__mce_tmp">_</span>'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(e){var t=this,n=t.getRng(),r,i,o,a;if(n.duplicate||n.item){if(n.item)return n.item(0);for(o=n.duplicate(),o.collapse(1),r=o.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),i=a=n.parentElement();a=a.parentNode;)if(a==r){r=i;break}return r}return r=n.startContainer,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[Math.min(r.childNodes.length-1,n.startOffset)])),r&&3==r.nodeType?r.parentNode:r},getEnd:function(e){var t=this,n=t.getRng(),r,i;return n.duplicate||n.item?n.item?n.item(0):(n=n.duplicate(),n.collapse(0),r=n.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),r&&"BODY"==r.nodeName?r.lastChild||r:r):(r=n.endContainer,i=n.endOffset,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[i>0?i-1:i])),r&&3==r.nodeType?r.parentNode:r)},getBookmark:function(e,t){return this.bookmarkManager.getBookmark(e,t)},moveToBookmark:function(e){return this.bookmarkManager.moveToBookmark(e)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a,s,l;if(!n.win)return null;if(a=n.win.document,!e&&n.lastFocusBookmark){var c=n.lastFocusBookmark;return c.startContainer?(i=a.createRange(),i.setStart(c.startContainer,c.startOffset),i.setEnd(c.endContainer,c.endOffset)):i=c,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(u){}if(l=n.editor.fire("GetSelectionRange",{range:i}),l.range!==i)return l.range;if(h&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(u){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r,i,o;if(e)if(e.select){n.explicitRange=null;try{e.select()}catch(a){}}else if(n.tridentSel){if(e.cloneRange)try{n.tridentSel.addRange(e)}catch(a){}}else{if(r=n.getSel(),o=n.editor.fire("SetSelectionRange",{range:e}),e=o.range,r){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(a){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}e.collapsed||e.startContainer!=e.endContainer||!r.setBaseAndExtent||s.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(i=e.startContainer.childNodes[e.startOffset],i&&"IMG"==i.tagName&&n.getSel().setBaseAndExtent(i,0,i,1))}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i,o,a,s,l=t.dom.getRoot();return n?(i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r)):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return s.range&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};d(n.selectorChangedData,function(e,t){d(o,function(n){return i.is(n,t)?(r[t]||(d(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),d(r,function(e,n){a[n]||(delete r[n],d(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){function n(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var r,i,o=this,s=o.dom,l=s.getRoot(),c,u,d=0;if(a.isElement(e)){if(t===!1&&(d=e.offsetHeight),"BODY"!=l.nodeName){var f=o.getScrollContainer();if(f)return r=n(e).y-n(f).y+d,u=f.clientHeight,c=f.scrollTop,void((c>r||r+25>c+u)&&(f.scrollTop=c>r?r:r-u+25))}i=s.getViewPort(o.editor.getWin()),r=s.getPos(e).y+d,c=i.y,u=i.h,(r<i.y||r+25>c+u)&&o.editor.getWin().scrollTo(0,c>r?r:r-u+25)}},placeCaretAt:function(e,t){this.setRng(i.getCaretRangeFromPoint(e,t,this.editor.getDoc()))},_moveEndPoint:function(t,n,r){var i=n,o=new e(n,i),a=this.dom.schema.getNonEmptyElements();do{if(3==n.nodeType&&0!==f(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"==n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(s.ie&&s.ie<11&&this.dom.isBlock(n)&&this.dom.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?o.next():o.prev());"BODY"==i.nodeName&&(r?t.setStart(i,0):t.setEnd(i,i.childNodes.length))},getBoundingClientRect:function(){var e=this.getRng();return e.collapsed?c.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){this.win=null,this.controlSelection.destroy()}},u}),r(X,[j,m],function(e,t){function n(t){this.compare=function(n,i){function o(e){var n={};return r(t.getAttribs(e),function(r){var i=r.nodeName.toLowerCase();0!==i.indexOf("_")&&"style"!==i&&0!==i.indexOf("data-")&&(n[i]=t.getAttrib(e,i))}),n}function a(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(n=t[r],"undefined"==typeof n)return!1;if(e[r]!=n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0}return n.nodeName!=i.nodeName?!1:a(o(n),o(i))&&a(t.parseStyle(t.getAttrib(n,"style")),t.parseStyle(t.getAttrib(i,"style")))?!e.isBookmarkNode(n)&&!e.isBookmarkNode(i):!1}}var r=t.each;return n}),r(K,[m],function(e){function t(e,t){function r(e){return e.replace(/%(\w+)/g,"")}var i,o,a=e.dom,s="",l,c;if(c=e.settings.preview_styles,c===!1)return"";if(c||(c="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),"string"==typeof t){if(t=e.formatter.get(t),!t)return;t=t[0]}return i=t.block||t.inline||"span",o=a.create(i),n(t.styles,function(e,t){e=r(e),e&&a.setStyle(o,t,e)}),n(t.attributes,function(e,t){e=r(e),e&&a.setAttrib(o,t,e)}),n(t.classes,function(e){e=r(e),a.hasClass(o,e)||a.addClass(o,e)}),e.fire("PreviewFormats"),a.setStyles(o,{position:"absolute",left:-65535}),e.getBody().appendChild(o),l=a.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,n(c.split(" "),function(t){var n=a.getStyle(o,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=a.getStyle(e.getBody(),t,!0),"#ffffff"==a.toHex(n).toLowerCase())||"color"==t&&"#000000"==a.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(s+="padding:0 2px;"),s+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),a.remove(o),s}var n=e.each;return{getCssText:t}}),r(G,[p,_,g],function(e,t,n){function r(e,t){var n=o[e];n||(o[e]=n=[]),o[e].push(t)}function i(e,t){s(o[e],function(e){e(t)})}var o=[],a=e.filter,s=e.each;return r("pre",function(r){function i(t){return c(t.previousSibling)&&-1!=e.indexOf(u,t.previousSibling)}function o(e,t){n(t).remove(),n(e).append("<br><br>").append(t.childNodes)}var l=r.selection.getRng(),c,u;c=t.matchNodeNames("pre"),l.collapsed||(u=r.selection.getSelectedBlocks(),s(a(a(u,c),i),function(e){o(e.previousSibling,e)}))}),{postProcess:i}}),r(J,[y,T,j,X,m,K,G],function(e,t,n,r,i,o,a){return function(s){function l(e){return e.nodeType&&(e=e.nodeName),!!s.schema.getTextBlockElements()[e.toLowerCase()]}function c(e){return/^(TH|TD)$/.test(e.nodeName)}function u(e){return e&&/^(IMG)$/.test(e.nodeName)}function d(e,t){return Y.getParents(e,t,Y.getRoot())}function f(e){return 1===e.nodeType&&"_mce_caret"===e.id}function h(){g({valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,t,n){ue(n,function(t,n){Y.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),ue("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){g(e,{block:e,remove:"all"})}),g(s.settings.formats)}function p(){s.addShortcut("meta+b","bold_desc","Bold"),s.addShortcut("meta+i","italic_desc","Italic"),s.addShortcut("meta+u","underline_desc","Underline");for(var e=1;6>=e;e++)s.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);s.addShortcut("access+7","",["FormatBlock",!1,"p"]),s.addShortcut("access+8","",["FormatBlock",!1,"div"]),s.addShortcut("access+9","",["FormatBlock",!1,"address"])}function m(e){return e?j[e]:j}function g(e,t){e&&("string"!=typeof e?ue(e,function(e,t){g(t,e)}):(t=t.length?t:[t],ue(t,function(e){e.deep===oe&&(e.deep=!e.selector),e.split===oe&&(e.split=!e.selector||e.inline),e.remove===oe&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),j[e]=t))}function v(e){return e&&j[e]&&delete j[e],j}function y(e,t){var n=m(t);if(n)for(var r=0;r<n.length;r++)if(n[r].inherit===!1&&Y.is(e,n[r].selector))return!0;return!1}function b(e){var t;return s.dom.getParent(e,function(e){return t=s.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function C(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=b(e.parentNode),s.dom.getStyle(e,"color")&&t?s.dom.setStyle(e,"text-decoration",t):s.dom.getStyle(e,"text-decoration")===t&&s.dom.setStyle(e,"text-decoration",null))}function x(t,n,r){function i(e,t){if(t=t||d,e){if(t.onformat&&t.onformat(e,t,n,r),ue(t.styles,function(t,r){Y.setStyle(e,r,M(t,n))}),t.styles){var i=Y.getAttrib(e,"style");i&&e.setAttribute("data-mce-style",i)}ue(t.attributes,function(t,r){Y.setAttrib(e,r,M(t,n))}),ue(t.classes,function(t){t=M(t,n),Y.hasClass(e,t)||Y.addClass(e,t)})}}function o(){function t(t,n){var i=new e(n);for(r=i.prev2();r;r=i.prev2()){if(3==r.nodeType&&r.data.length>0)return r;if(r.childNodes.length>1||r==t||"BR"==r.tagName)return r}}var n=s.selection.getRng(),i=n.startContainer,o=n.endContainer;if(i!=o&&0===n.endOffset){var a=t(i,o),l=3==a.nodeType?a.data.length:a.childNodes.length;n.setEnd(a,l)}return n}function c(e,r,o){var a=[],s,c,h=!0;s=d.inline||d.block,c=Y.create(s),i(c),K.walk(e,function(e){function r(e){var m,v,y,b,C;return C=h,m=e.nodeName.toLowerCase(),v=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&ae(e)&&(C=h,h="true"===ae(e),b=!0),B(m,"br")?(p=0,void(d.block&&Y.remove(e))):d.wrapper&&E(e,t,n)?void(p=0):h&&!b&&d.block&&!d.wrapper&&l(m)&&G(v,s)?(e=Y.rename(e,s),i(e),a.push(e),void(p=0)):d.selector&&(ue(u,function(t){return"collapsed"in t&&t.collapsed!==g?void 0:Y.is(e,t.selector)&&!f(e)?(i(e,t),y=!0,!1):void 0}),!d.inline||y)?void(p=0):void(!h||b||!G(s,m)||!G(v,s)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||f(e)||d.inline&&J(e)?(p=0,ue(de(e.childNodes),r),b&&(h=C),p=0):(p||(p=Y.clone(c,ne),e.parentNode.insertBefore(p,e),a.push(p)),p.appendChild(e)))}var p;ue(e,r)}),d.links===!0&&ue(a,function(e){function t(e){"A"===e.nodeName&&i(e,d),ue(de(e.childNodes),t)}t(e)}),ue(a,function(e){function r(e){var t=0;return ue(e.childNodes,function(e){P(e)||ce(e)||t++}),t}function o(e){var t,n;return ue(e.childNodes,function(e){return 1!=e.nodeType||ce(e)||f(e)?void 0:(t=e,ne)}),t&&!ce(t)&&A(t,d)&&(n=Y.clone(t,ne),i(n),Y.replace(n,e,re),Y.remove(t,1)),n||e}var s;if(s=r(e),(a.length>1||!J(e))&&0===s)return void Y.remove(e,1);if(d.inline||d.wrapper){if(d.exact||1!==s||(e=o(e)),ue(u,function(t){ue(Y.select(t.inline,e),function(e){ce(e)||F(t,n,e,t.exact?e:null)})}),E(e.parentNode,t,n))return Y.remove(e,1),e=0,re;d.merge_with_parents&&Y.getParent(e.parentNode,function(r){return E(r,t,n)?(Y.remove(e,1),e=0,re):void 0}),e&&d.merge_siblings!==!1&&(e=W(U(e),e),e=W(e,U(e,re)))}})}var u=m(t),d=u[0],h,p,g=!r&&X.isCollapsed();if("false"!==ae(X.getNode())){if(d){if(r)r.nodeType?(p=Y.createRng(),p.setStartBefore(r),p.setEndAfter(r),c(H(p,u),null,!0)):c(r,null,!0);else if(g&&d.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length)$("apply",t,n);else{var v=s.selection.getNode();Q||!u[0].defaultBlock||Y.getParent(v,Y.isBlock)||x(u[0].defaultBlock),s.selection.setRng(o()),h=X.getBookmark(),c(H(X.getRng(re),u),h),d.styles&&(d.styles.color||d.styles.textDecoration)&&(fe(v,C,"childNodes"),C(v)),X.moveToBookmark(h),q(X.getRng(re)),s.nodeChanged()}a.postProcess(t,s)}}else{r=X.getNode();for(var y=0,b=u.length;b>y;y++)if(u[y].ceFalseOverride&&Y.is(r,u[y].selector))return void i(r,u[y])}}function w(e,t,n,r){function i(e){var n,r,o,a,s;if(1===e.nodeType&&ae(e)&&(a=y,y="true"===ae(e),s=!0),n=de(e.childNodes),y&&!s)for(r=0,o=h.length;o>r&&!F(h[r],t,e,e);r++);if(p.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(y=a)}}function o(n){var i;return ue(d(n.parentNode).reverse(),function(n){var o;i||"_start"==n.id||"_end"==n.id||(o=E(n,e,t,r),o&&o.split!==!1&&(i=n))}),i}function a(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode, o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=Y.clone(o,ne),c=0;c<h.length;c++)if(F(h[c],t,a,a)){a=0;break}a&&(s&&a.appendChild(s),l||(l=a),s=a)}!i||p.mixed&&J(e)||(n=Y.split(e,n)),s&&(r.parentNode.insertBefore(s,r),l.appendChild(r))}return n}function l(e){return a(o(e),e,e,!0)}function u(e){var t=Y.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return ce(n)&&(n=n[e?"firstChild":"lastChild"]),3==n.nodeType&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),Y.remove(t,!0),n}function f(e){var t,n,r=e.commonAncestorContainer;if(e=H(e,h,re),p.split){if(t=V(e,re),n=V(e),t!=n){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"==t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&c(n)&&n.firstChild&&(n=n.firstChild||n),Y.isChildOf(t,n)&&!J(n)&&!c(t)&&!c(n))return t=O(t,"span",{id:"_start","data-mce-type":"bookmark"}),l(t),void(t=u(re));t=O(t,"span",{id:"_start","data-mce-type":"bookmark"}),n=O(n,"span",{id:"_end","data-mce-type":"bookmark"}),l(t),l(n),t=u(re),n=u()}else t=n=l(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=Z(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=Z(n)+1}K.walk(e,function(e){ue(e,function(e){i(e),1===e.nodeType&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===b(e.parentNode)&&F({deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})}var h=m(e),p=h[0],g,v,y=!0;if(n)return void(n.nodeType?(v=Y.createRng(),v.setStartBefore(n),v.setEndAfter(n),f(v)):f(n));if("false"!==ae(X.getNode()))X.isCollapsed()&&p.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length?$("remove",e,t,r):(g=X.getBookmark(),f(X.getRng(re)),X.moveToBookmark(g),p.inline&&_(e,t,X.getStart())&&q(X.getRng(!0)),s.nodeChanged());else{n=X.getNode();for(var C=0,x=h.length;x>C&&(!h[C].ceFalseOverride||!F(h[C],t,n,n));C++);}}function N(e,t,n){var r=m(e);!_(e,t,n)||"toggle"in r[0]&&!r[0].toggle?x(e,t,n):w(e,t,n)}function E(e,t,n,r){function i(e,t,i){var o,a,s=t[i],l;if(t.onmatch)return t.onmatch(e,t,i);if(s)if(s.length===oe){for(o in s)if(s.hasOwnProperty(o)){if(a="attributes"===i?Y.getAttrib(e,o):D(e,o),r&&!a&&!t.exact)return;if((!r||t.exact)&&!B(a,L(M(s[o],n),o)))return}}else for(l=0;l<s.length;l++)if("attributes"===i?Y.getAttrib(e,s[l]):D(e,s[l]))return t;return t}var o=m(t),a,s,l;if(o&&e)for(s=0;s<o.length;s++)if(a=o[s],A(e,a)&&i(e,a,"attributes")&&i(e,a,"styles")){if(l=a.classes)for(s=0;s<l.length;s++)if(!Y.hasClass(e,l[s]))return;return a}}function _(e,t,n){function r(n){var r=Y.getRoot();return n===r?!1:(n=Y.getParent(n,function(n){return y(n,e)?!0:n.parentNode===r||!!E(n,e,t,!0)}),E(n,e,t))}var i;return n?r(n):(n=X.getNode(),r(n)?re:(i=X.getStart(),i!=n&&r(i)?re:ne))}function S(e,t){var n,r=[],i={};return n=X.getStart(),Y.getParent(n,function(n){var o,a;for(o=0;o<e.length;o++)a=e[o],!i[a]&&E(n,a,t)&&(i[a]=!0,r.push(a))},Y.getRoot()),r}function k(e){var t=m(e),n,r,i,o,a;if(t)for(n=X.getStart(),r=d(n),o=t.length-1;o>=0;o--){if(a=t[o].selector,!a||t[o].defaultBlock)return re;for(i=r.length-1;i>=0;i--)if(Y.is(r[i],a))return re}return ne}function T(e,t,n){var r;return ie||(ie={},r={},s.on("NodeChange",function(e){var t=d(e.element),n={};t=i.grep(t,function(e){return 1==e.nodeType&&!e.getAttribute("data-mce-bogus")}),ue(ie,function(e,i){ue(t,function(o){return E(o,i,{},e.similar)?(r[i]||(ue(e,function(e){e(!0,{node:o,format:i,parents:t})}),r[i]=e),n[i]=e,!1):y(o,i)?!1:void 0})}),ue(r,function(i,o){n[o]||(delete r[o],ue(i,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),ue(e.split(","),function(e){ie[e]||(ie[e]=[],ie[e].similar=n),ie[e].push(t)}),this}function R(e){return o.getCssText(s,e)}function A(e,t){return B(e,t.inline)?re:B(e,t.block)?re:t.selector?1==e.nodeType&&Y.is(e,t.selector):void 0}function B(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function D(e,t){return L(Y.getStyle(e,t),t)}function L(e,t){return"color"!=t&&"backgroundColor"!=t||(e=Y.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function M(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function P(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function O(e,t,n){var r=Y.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function H(t,n,r){function i(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=Y.getRoot(),3==r.nodeType&&!P(r)&&(e?v>0:b<r.nodeValue.length))return r;for(;;){if(!n[0].block_expand&&J(i))return i;for(o=i[a];o;o=o[a])if(!ce(o)&&!P(o)&&!t(o))return i;if(i==s||i.parentNode==s){r=i;break}i=i.parentNode}return r}function o(e,t){for(t===oe&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)e=e.childNodes[t],e&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}}function a(e){for(var t=e;t;){if(1===t.nodeType&&ae(t))return"false"===ae(t)?t:e;t=t.parentNode}return e}function c(t,n,i){function o(e,t){var n,o,a=e.nodeValue;return"undefined"==typeof t&&(t=i?a.length:0),i?(n=a.lastIndexOf(" ",t),o=a.lastIndexOf("\xa0",t),n=n>o?n:o,-1===n||r||n++):(n=a.indexOf(" ",t),o=a.indexOf("\xa0",t),n=-1!==n&&(-1===o||o>n)?n:o),n}var a,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(a=new e(t,Y.getParent(t,J)||s.getBody());l=a[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(J(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function u(e,r){var i,o,a,s;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=d(e),o=0;o<i.length;o++)for(a=0;a<n.length;a++)if(s=n[a],!("collapsed"in s&&s.collapsed!==t.collapsed)&&Y.is(i[o],s.selector))return i[o];return e}function f(e,t){var r,i=Y.getRoot();if(n[0].wrapper||(r=Y.getParent(e,n[0].block,i)),r||(r=Y.getParent(3==e.nodeType?e.parentNode:e,function(e){return e!=i&&l(e)})),r&&n[0].wrapper&&(r=d(r,"ul,ol").reverse()[0]||r),!r)for(r=e;r[t]&&!J(r[t])&&(r=r[t],!B(r,"br")););return r||e}var h,p,m,g=t.startContainer,v=t.startOffset,y=t.endContainer,b=t.endOffset;if(1==g.nodeType&&g.hasChildNodes()&&(h=g.childNodes.length-1,g=g.childNodes[v>h?h:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(h=y.childNodes.length-1,y=y.childNodes[b>h?h:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=a(g),y=a(y),(ce(g.parentNode)||ce(g))&&(g=ce(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(ce(y.parentNode)||ce(y))&&(y=ce(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=c(g,v,!0),m&&(g=m.container,v=m.offset),m=c(y,b),m&&(y=m.container,b=m.offset)),p=o(y,b),p.node)){for(;p.node&&0===p.offset&&p.node.previousSibling;)p=o(p.node.previousSibling);p.node&&p.offset>0&&3===p.node.nodeType&&" "===p.node.nodeValue.charAt(p.offset-1)&&p.offset>1&&(y=p.node,y.splitText(p.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=i(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=i())),n[0].selector&&n[0].expand!==ne&&!n[0].inline&&(g=u(g,"previousSibling"),y=u(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(J(g)||(g=i(!0)),J(y)||(y=i()))),1==g.nodeType&&(v=Z(g),g=g.parentNode),1==y.nodeType&&(b=Z(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function I(e,t){return t.links&&"A"==e.tagName}function F(e,t,n,r){var i,o,a;if(!A(n,e)&&!I(n,e))return ne;if("all"!=e.remove)for(ue(e.styles,function(i,o){i=L(M(i,t),o),"number"==typeof o&&(o=i,r=0),(e.remove_similar||!r||B(D(r,o),i))&&Y.setStyle(n,o,""),a=1}),a&&""===Y.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),ue(e.attributes,function(e,i){var o;if(e=M(e,t),"number"==typeof i&&(i=e,r=0),!r||B(Y.getAttrib(r,i),e)){if("class"==i&&(e=Y.getAttrib(n,i),e&&(o="",ue(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void Y.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),te.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),ue(e.classes,function(e){e=M(e,t),r&&!Y.hasClass(r,e)||Y.removeClass(n,e)}),o=Y.getAttribs(n),i=0;i<o.length;i++){var s=o[i].nodeName;if(0!==s.indexOf("_")&&0!==s.indexOf("data-"))return ne}return"none"!=e.remove?(z(n,e),re):void 0}function z(e,t){function n(e,t,n){return e=U(e,t,n),!e||"BR"==e.nodeName||J(e)}var r=e.parentNode,i;t.block&&(Q?r==Y.getRoot()&&(t.list_block&&B(e,t.list_block)||ue(de(e.childNodes),function(e){G(Q,e.nodeName.toLowerCase())?i?i.appendChild(e):(i=O(e,Q),Y.setAttribs(i,s.settings.forced_root_block_attrs)):i=0})):J(e)&&!J(r)&&(n(e,ne)||n(e.firstChild,re,1)||e.insertBefore(Y.create("br"),e.firstChild),n(e,re)||n(e.lastChild,ne,1)||e.appendChild(Y.create("br")))),t.selector&&t.inline&&!B(t.inline,e)||Y.remove(e,1)}function U(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1==e.nodeType||!P(e))return e}function W(e,t){function n(e,t){for(i=e;i;i=i[t]){if(3==i.nodeType&&0!==i.nodeValue.length)return e;if(1==i.nodeType&&!ce(i))return i}return e}var i,o,a=new r(Y);if(e&&t&&(e=n(e,"previousSibling"),t=n(t,"nextSibling"),a.compare(e,t))){for(i=e.nextSibling;i&&i!=t;)o=i,i=i.nextSibling,e.appendChild(o);return Y.remove(t),ue(de(t.childNodes),function(t){e.appendChild(t)}),e}return t}function V(t,n){var r,i,o;return r=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1==r.nodeType&&(o=r.childNodes.length-1,!n&&i&&i--,r=r.childNodes[i>o?o:i]),3===r.nodeType&&n&&i>=r.nodeValue.length&&(r=new e(r,s.getBody()).next()||r),3!==r.nodeType||n||0!==i||(r=new e(r,s.getBody()).prev()||r),r}function $(t,n,r,i){function o(e){var t=Y.create("span",{id:g,"data-mce-bogus":!0,style:v?"color:red":""});return e&&t.appendChild(s.getDoc().createTextNode(ee)),t}function a(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==ee||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function c(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=X.getRng(!0),a(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),Y.remove(e)):(n=u(e),n.nodeValue.charAt(0)===ee&&(n.deleteData(0,1),r.startContainer==n&&r.startOffset>0&&r.setStart(n,r.startOffset-1),r.endContainer==n&&r.endOffset>0&&r.setEnd(n,r.endOffset-1)),Y.remove(e,1)),X.setRng(r);else if(e=c(X.getStart()),!e)for(;e=Y.get(g);)d(e,!1)}function f(){var e,t,i,a,s,l,d;e=X.getRng(!0),a=e.startOffset,l=e.startContainer,d=l.nodeValue,t=c(X.getStart()),t&&(i=u(t)),d&&a>0&&a<d.length&&/\w/.test(d.charAt(a))&&/\w/.test(d.charAt(a-1))?(s=X.getBookmark(),e.collapse(!0),e=H(e,m(n)),e=K.split(e),x(n,r,e),X.moveToBookmark(s)):(t&&i.nodeValue===ee?x(n,r,t):(t=o(!0),i=t.firstChild,e.insertNode(t),a=1,x(n,r,t)),X.setCursorLocation(i,a))}function h(){var e=X.getRng(!0),t,a,s,c,u,d,f=[],h,p;for(t=e.startContainer,a=e.startOffset,u=t,3==t.nodeType&&(a!=t.nodeValue.length&&(c=!0),u=u.parentNode);u;){if(E(u,n,r,i)){d=u;break}u.nextSibling&&(c=!0),f.push(u),u=u.parentNode}if(d)if(c)s=X.getBookmark(),e.collapse(!0),e=H(e,m(n),!0),e=K.split(e),w(n,r,e),X.moveToBookmark(s);else{for(p=o(),u=p,h=f.length-1;h>=0;h--)u.appendChild(Y.clone(f[h],!1)),u=u.firstChild;u.appendChild(Y.doc.createTextNode(ee)),u=u.firstChild;var g=Y.getParent(d,l);g&&Y.isEmpty(g)?d.parentNode.replaceChild(p,d):Y.insertAfter(p,d),X.setCursorLocation(u,1),Y.isEmpty(d)&&Y.remove(d)}}function p(){var e;e=c(X.getStart()),e&&!Y.isEmpty(e)&&fe(e,function(e){1!=e.nodeType||e.id===g||Y.isEmpty(e)||Y.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var g="_mce_caret",v=s.settings.caret_debug;s._hasCaretEvents||(le=function(){var e=[],t;if(a(c(X.getStart()),e))for(t=e.length;t--;)Y.setAttrib(e[t],"data-mce-bogus","1")},se=function(e){var t=e.keyCode;d(),8==t&&X.isCollapsed()&&X.getStart().innerHTML==ee&&d(c(X.getStart())),37!=t&&39!=t||d(c(X.getStart())),p()},s.on("SetContent",function(e){e.selection&&p()}),s._hasCaretEvents=!0),"apply"==t?f():h()}function q(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if((t.startContainer!=t.endContainer||!u(t.startContainer.childNodes[t.startOffset]))&&(3==n.nodeType&&r>=n.nodeValue.length&&(r=Z(n),n=n.parentNode,i=!0),1==n.nodeType))for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,Y.getParent(n,Y.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!P(a))return l=Y.create("a",{"data-mce-bogus":"all"},ee),a.parentNode.insertBefore(l,a),t.setStart(a,0),X.setRng(t),void Y.remove(l)}var j={},Y=s.dom,X=s.selection,K=new t(Y),G=s.schema.isValidChild,J=Y.isBlock,Q=s.settings.forced_root_block,Z=Y.nodeIndex,ee="\ufeff",te=/^(src|href|style)$/,ne=!1,re=!0,ie,oe,ae=Y.getContentEditable,se,le,ce=n.isBookmarkNode,ue=i.each,de=i.grep,fe=i.walk,he=i.extend;he(this,{get:m,register:g,unregister:v,apply:x,remove:w,toggle:N,match:_,matchAll:S,matchNode:E,canApply:k,formatChanged:T,getCssText:R}),h(),p(),s.on("BeforeGetContent",function(e){le&&"raw"!=e.format&&le()}),s.on("mouseup keydown",function(e){se&&se(e)})}}),r(Q,[I,d],function(e,t){return function(e){function n(){return e.serializer.getTrimmedContent()}function r(t){e.setDirty(t)}function i(e){o.typing=!1,o.add({},e)}var o=this,a=0,s=[],l,c,u=0;return e.on("init",function(){o.add()}),e.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&o.beforeChange()}),e.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&i(e)}),e.on("ObjectResizeStart Cut",function(){o.beforeChange()}),e.on("SaveContent ObjectResized blur",i),e.on("DragEnd",i),e.on("KeyUp",function(a){var l=a.keyCode;a.isDefaultPrevented()||((l>=33&&36>=l||l>=37&&40>=l||45==l||13==l||a.ctrlKey)&&(i(),e.nodeChanged()),(46==l||8==l||t.mac&&(91==l||93==l))&&e.nodeChanged(),c&&o.typing&&(e.isDirty()||(r(s[0]&&n()!=s[0].content),e.isDirty()&&e.fire("change",{level:s[0],lastLevel:null})),e.fire("TypingUndo"),c=!1,e.nodeChanged()))}),e.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented()){if(t>=33&&36>=t||t>=37&&40>=t||45==t)return void(o.typing&&i(e));var n=e.ctrlKey&&!e.altKey||e.metaKey;!(16>t||t>20)||224==t||91==t||o.typing||n||(o.beforeChange(),o.typing=!0,o.add({},e),c=!0)}}),e.on("MouseDown",function(e){o.typing&&i(e)}),e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),e.on("AddUndo Undo Redo ClearUndos",function(t){t.isDefaultPrevented()||e.nodeChanged()}),o={data:s,typing:!1,beforeChange:function(){u||(l=e.selection.getBookmark(2,!0))},add:function(t,i){var o,c=e.settings,d;if(t=t||{},t.content=n(),u||e.removed)return null;if(d=s[a],e.fire("BeforeAddUndo",{level:t,lastLevel:d,originalEvent:i}).isDefaultPrevented())return null;if(d&&d.content==t.content)return null;if(s[a]&&(s[a].beforeBookmark=l),c.custom_undo_redo_levels&&s.length>c.custom_undo_redo_levels){for(o=0;o<s.length-1;o++)s[o]=s[o+1];s.length--,a=s.length}t.bookmark=e.selection.getBookmark(2,!0),a<s.length-1&&(s.length=a+1),s.push(t),a=s.length-1;var f={level:t,lastLevel:d,originalEvent:i};return e.fire("AddUndo",f),a>0&&(r(!0),e.fire("change",f)),t},undo:function(){var t;return o.typing&&(o.add(),o.typing=!1),a>0&&(t=s[--a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.beforeBookmark),r(!0),e.fire("undo",{level:t})),t},redo:function(){var t;return a<s.length-1&&(t=s[++a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.bookmark),r(!0),e.fire("redo",{level:t})),t},clear:function(){s=[],a=0,o.typing=!1,o.data=s,e.fire("ClearUndos")},hasUndo:function(){return a>0||o.typing&&s[0]&&n()!=s[0].content},hasRedo:function(){return a<s.length-1&&!this.typing},transact:function(e){o.beforeChange();try{u++,e()}finally{u--}return o.add()},extra:function(t,n){var r,i;o.transact(t)&&(i=s[a].bookmark,r=s[a-1],e.setContent(r.content,{format:"raw"}),e.selection.moveToBookmark(r.beforeBookmark),o.transact(n)&&(s[a-1].beforeBookmark=i))}}}}),r(Z,[y,T,d],function(e,t,n){var r=n.ie&&n.ie<11;return function(i){function o(o){function h(e){return e&&a.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==a.getContentEditable(e)}function p(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}function m(e){var t;a.isBlock(e)&&(t=s.getRng(),e.appendChild(a.create("span",null,"\xa0")),s.select(e),e.lastChild.outerHTML="",s.setRng(t))}function g(e){var t=e,n=[],r;if(t){for(;t=t.firstChild;){if(a.isBlock(t))return;1!=t.nodeType||d[t.nodeName.toLowerCase()]||n.push(t)}for(r=n.length;r--;)t=n[r],!t.hasChildNodes()||t.firstChild==t.lastChild&&""===t.firstChild.nodeValue?a.remove(t):"A"==t.nodeName&&" "===(t.innerText||t.textContent)&&a.remove(t)}}function v(t){function r(e){for(;e;){if(1==e.nodeType||3==e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}var i,o,l,c=t,u;if(t){if(n.ie&&n.ie<9&&M&&M.firstChild&&M.firstChild==M.lastChild&&"BR"==M.firstChild.tagName&&a.remove(M.firstChild),/^(LI|DT|DD)$/.test(t.nodeName)){var d=r(t.firstChild);d&&/^(UL|OL|DL)$/.test(d.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(l=a.createRng(),n.ie||t.normalize(),t.hasChildNodes()){for(i=new e(t,t);o=i.current();){if(3==o.nodeType){l.setStart(o,0),l.setEnd(o,0);break}if(f[o.nodeName.toLowerCase()]){l.setStartBefore(o),l.setEndBefore(o);break}c=o,o=i.next()}o||(l.setStart(c,0),l.setEnd(c,0))}else"BR"==t.nodeName?t.nextSibling&&a.isBlock(t.nextSibling)?((!P||9>P)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}}function y(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function b(e){e.innerHTML=r?"":'<br data-mce-bogus="1">'}function C(e){var t=D,n,i,o,s=u.getTextInlineElements();if(e||"TABLE"==z?(n=a.create(e||W),y(n)):n=M.cloneNode(!1),o=n,l.keep_styles!==!1)do if(s[t.nodeName]){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while((t=t.parentNode)&&t!=B);return r||(o.innerHTML='<br data-mce-bogus="1">'),n}function x(t){var n,r,i;if(3==D.nodeType&&(t?L>0:L<D.nodeValue.length))return!1;if(D.parentNode==M&&V&&!t)return!0;if(t&&1==D.nodeType&&D==M.firstChild)return!0;if("TABLE"===D.nodeName||D.previousSibling&&"TABLE"==D.previousSibling.nodeName)return V&&!t||!V&&t;for(n=new e(D,M),3==D.nodeType&&(t&&0===L?n.prev():t||L!=D.nodeValue.length||n.next());r=n.current();){if(1===r.nodeType){if(!r.getAttribute("data-mce-bogus")&&(i=r.nodeName.toLowerCase(),d[i]&&"br"!==i))return!1}else if(3===r.nodeType&&!/^[ \t\r\n]*$/.test(r.nodeValue))return!1;t?n.prev():n.next()}return!0}function w(e,t){var n,r,o,s,l,c,d=W||"P";if(r=a.getParent(e,a.isBlock),!r||!h(r)){if(r=r||B,c=r==i.getBody()||p(r)?r.nodeName.toLowerCase():r.parentNode.nodeName.toLowerCase(),!r.hasChildNodes())return n=a.create(d),y(n),r.appendChild(n),R.setStart(n,0),R.setEnd(n,0),n;for(s=e;s.parentNode!=r;)s=s.parentNode;for(;s&&!a.isBlock(s);)o=s,s=s.previousSibling;if(o&&u.isValidChild(c,d.toLowerCase())){for(n=a.create(d),y(n),o.parentNode.insertBefore(n,o),s=o;s&&!a.isBlock(s);)l=s.nextSibling,n.appendChild(s),s=l;R.setStart(e,t),R.setEnd(e,t)}}return e}function N(){function e(e){for(var t=F[e?"firstChild":"lastChild"];t&&1!=t.nodeType;)t=t[e?"nextSibling":"previousSibling"];return t===M}function t(){var e=F.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:F}if(F!=i.getBody()){var n=F.parentNode.nodeName;/^(OL|UL|LI)$/.test(n)&&(W="LI"),H=W?C(W):a.create("BR"),e(!0)&&e()?"LI"==n?a.insertAfter(H,t()):a.replace(H,F):e(!0)?"LI"==n?(a.insertAfter(H,t()),H.appendChild(a.doc.createTextNode(" ")),H.appendChild(F)):F.parentNode.insertBefore(H,F):e()?(a.insertAfter(H,t()),m(H)):(F=t(),A=R.cloneRange(),A.setStartAfter(M),A.setEndAfter(F),I=A.extractContents(),"LI"==W&&"LI"==I.firstChild.nodeName?(H=I.firstChild,a.insertAfter(I,F)):(a.insertAfter(I,F),a.insertAfter(H,F))),a.remove(M),v(H),c.add()}}function E(){i.execCommand("InsertLineBreak",!1,o)}function _(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function S(e){var t=a.getRoot(),n,r;for(n=e;n!==t&&"false"!==a.getContentEditable(n);)"true"===a.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function k(e){var t;r||(e.normalize(),t=e.lastChild,t&&!/^(left|right)$/gi.test(a.getStyle(t,"float",!0))||a.add(e,"br"))}function T(){H=/^(H[1-6]|PRE|FIGURE)$/.test(z)&&"HGROUP"!=U?C(W):C(),l.end_container_on_empty_block&&h(F)&&a.isEmpty(M)?H=a.split(F,M):a.insertAfter(H,M),v(H)}var R,A,B,D,L,M,P,O,H,I,F,z,U,W,V;if(R=s.getRng(!0),!o.isDefaultPrevented()){if(!R.collapsed)return void i.execCommand("Delete");if(new t(a).normalize(R),D=R.startContainer,L=R.startOffset,W=(l.force_p_newlines?"p":"")||l.forced_root_block,W=W?W.toUpperCase():"",P=a.doc.documentMode,O=o.shiftKey,1==D.nodeType&&D.hasChildNodes()&&(V=L>D.childNodes.length-1,D=D.childNodes[Math.min(L,D.childNodes.length-1)]||D,L=V&&3==D.nodeType?D.nodeValue.length:0),B=S(D)){if(c.beforeChange(),!a.isBlock(B)&&B!=a.getRoot())return void(W&&!O||E());if((W&&!O||!W&&O)&&(D=w(D,L)),M=a.getParent(D,a.isBlock),F=M?a.getParent(M.parentNode,a.isBlock):null,z=M?M.nodeName.toUpperCase():"",U=F?F.nodeName.toUpperCase():"","LI"!=U||o.ctrlKey||(M=F,z=U),/^(LI|DT|DD)$/.test(z)){if(!W&&O)return void E();if(a.isEmpty(M))return void N()}if("PRE"==z&&l.br_in_pre!==!1){if(!O)return void E()}else if(!W&&!O&&"LI"!=z||W&&O)return void E();W&&M===i.getBody()||(W=W||"P",x()?T():x(!0)?(H=M.parentNode.insertBefore(C(),M),m(H),v(M)):(A=R.cloneRange(),A.setEndAfter(M),I=A.extractContents(),_(I),H=I.firstChild,a.insertAfter(I,M),g(H),k(M),a.isEmpty(M)&&b(M),H.normalize(),a.isEmpty(H)?(a.remove(H),T()):v(H)),a.setAttrib(H,"id",""),i.fire("NewBlock",{newBlock:H}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements(),f=u.getMoveCaretBeforeOnEnterElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(ee,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,h,p,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){p=t,t=t.nextSibling,r.remove(p);continue}h||(h=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(h,t),g=!0),p=t,t=t.nextSibling,h.appendChild(p)}else h=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(te,[z,y,_,$,k,U],function(e,t,n,r,i,o){function a(e){return e>0}function s(e){return 0>e}function l(e,n,r,i,o){var l=new t(e,i);if(s(n)){if(C(e)&&(e=l.prev(!0),r(e)))return e;for(;e=l.prev(o);)if(r(e))return e}if(a(n)){if(C(e)&&(e=l.next(!0),r(e)))return e;for(;e=l.next(o);)if(r(e))return e}return null}function c(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode)if(b(e))return e;return t}function u(e,t){for(;e&&e!=t;){if(x(e))return e;e=e.parentNode}return null}function d(e,t,n){return u(e.container(),n)==u(t.container(),n)}function f(e,t,n){return c(e.container(),n)==c(t.container(),n)}function h(e,t){var n,r;return t?(n=t.container(),r=t.offset(),E(n)?n.childNodes[r+e]:null):null}function p(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n}function m(e,t,n){return u(t,e)==u(n,e)}function g(e,t,n){var r,i;for(i=e?"previousSibling":"nextSibling";n&&n!=t;){if(r=n[i],w(r)&&(r=r[i]),C(r)){if(m(t,r,n))return r;break}if(_(r))break;n=n.parentNode}return null}function v(e,t,r){var o,a,s,l,c=N(g,!0,t),u=N(g,!1,t);if(a=r.startContainer,s=r.startOffset,i.isCaretContainerBlock(a)){if(E(a)||(a=a.parentNode),l=a.getAttribute("data-mce-caret"),"before"==l&&(o=a.nextSibling,C(o)))return S(o);if("after"==l&&(o=a.previousSibling,C(o)))return k(o)}if(!r.collapsed)return r;if(n.isText(a)){if(w(a)){if(1===e){if(o=u(a))return S(o);if(o=c(a))return k(o)}if(-1===e){if(o=c(a))return k(o);if(o=u(a))return S(o)}return r}if(i.endsWithCaretContainer(a)&&s>=a.data.length-1)return 1===e&&(o=u(a))?S(o):r;if(i.startsWithCaretContainer(a)&&1>=s)return-1===e&&(o=c(a))?k(o):r;if(s===a.data.length)return o=u(a),o?S(o):r;if(0===s)return o=c(a),o?k(o):r}return r}function y(e,t){return C(h(e,t))}var b=n.isContentEditableTrue,C=n.isContentEditableFalse,x=n.matchStyleValues("display","block table table-cell table-caption"),w=i.isCaretContainer,N=e.curry,E=n.isElement,_=o.isCaretCandidate,S=N(p,!0),k=N(p,!1);return{isForwards:a,isBackwards:s,findNode:l,getEditingHost:c,getParentBlock:u,isInSameBlock:d,isInSameEditingHost:f,isBeforeContentEditableFalse:N(y,0),isAfterContentEditableFalse:N(y,-1),normalizeRange:v}}),r(ne,[_,U,$,te,p,z],function(e,t,n,r,i,o){function a(e,t){for(var n=[];e&&e!=t;)n.push(e),e=e.parentNode;return n}function s(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null}function l(e,t){if(m(e)){if(v(t.previousSibling)&&!f(t.previousSibling))return n.before(t);if(f(t))return n(t,0)}if(g(e)){if(v(t.nextSibling)&&!f(t.nextSibling))return n.after(t);if(f(t))return n(t,t.data.length)}return g(e)?p(t)?n.before(t):n.after(t):n.before(t)}function c(t,i){var o;return e.isBr(t)?(o=u(1,n.after(t),i),o?!r.isInSameBlock(n.before(t),n.before(o),i):!1):!1}function u(e,t,p){var C,x,w,N,E,_,S;if(!h(p)||!t)return null;if(S=t,C=S.container(),x=S.offset(),f(C)){if(g(e)&&x>0)return n(C,--x);if(m(e)&&x<C.length)return n(C,++x);w=C}else{if(g(e)&&x>0&&(N=s(C,x-1),v(N)))return!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,E.data.length):n.after(E):f(N)?n(N,N.data.length):n.before(N);if(m(e)&&x<C.childNodes.length&&(N=s(C,x),v(N)))return c(N,p)?u(e,n.after(N),p):!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,0):n.before(E):f(N)?n(N,0):n.after(N);w=S.getNode()}return(m(e)&&S.isAtEnd()||g(e)&&S.isAtStart())&&(w=r.findNode(w,e,o.constant(!0),p,!0),b(w))?l(e,w):(N=r.findNode(w,e,b,p),_=i.last(i.filter(a(C,p),d)),!_||N&&_.contains(N)?N?l(e,N):null:S=m(e)?n.after(_):n.before(_))}var d=e.isContentEditableFalse,f=e.isText,h=e.isElement,p=e.isBr,m=r.isForwards,g=r.isBackwards,v=t.isCaretCandidate,y=t.isAtomic,b=t.isEditableCaretCandidate;return function(e){return{next:function(t){return u(1,t,e)},prev:function(t){return u(-1,t,e)}}}}),r(re,[m,ne,$],function(e,t,n){var r=function(e){var t=e.firstChild,n=e.lastChild;return t&&"meta"===t.name&&(t=t.next),n&&"mce_marker"===n.attr("id")&&(n=n.prev),t&&t===n?"ul"===t.name||"ol"===t.name:!1},i=function(e){var t=e.firstChild,n=e.lastChild;return t&&"META"===t.nodeName&&t.parentNode.removeChild(t),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),e},o=function(e,t,n){var r=t.serialize(n),o=e.createFragment(r);return i(o)},a=function(t){return e.grep(t.childNodes,function(e){return"LI"===e.nodeName})},s=function(e){return!e.firstChild},l=function(e){return e.length>0&&s(e[e.length-1])?e.slice(0,-1):e},c=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},u=function(e,t){return!!c(e,t)},d=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]},f=function(e,r){var i=n.before(e),o=new t(r),a=o.next(i);return a?a.toRange():null},h=function(e,r){var i=n.after(e),o=new t(r),a=o.prev(i);return a?a.toRange():null},p=function(t,n,r,i){var o=d(t,i),a=t.parentNode;return a.insertBefore(o[0],t),e.each(n,function(e){a.insertBefore(e,t)}),a.insertBefore(o[1],t),a.removeChild(t),h(n[n.length-1],r)},m=function(t,n,r){var i=t.parentNode;return e.each(n,function(e){i.insertBefore(e,t)}),f(t,r)},g=function(e,t,n,r){return r.insertAfter(t.reverse(),e),h(t[0],n)},v=function(e,r,i,s){var u=o(r,e,s),d=c(r,i.startContainer),f=l(a(u.firstChild)),h=1,v=2,y=r.getRoot(),b=function(e){var o=n.fromRangeStart(i),a=new t(r.getRoot()),s=e===h?a.prev(o):a.next(o);return s?c(r,s.getNode())!==d:!0};return b(h)?m(d,f,y):b(v)?g(d,f,y,r):p(d,f,y,i)};return{isListFragment:r,insertAtCaret:v,isParentBlockLi:u,trimListItems:l,listItems:a}}),r(ie,[d,m,P,ne,$,X,_,re],function(e,t,n,r,i,o,a,s){var l=a.matchNodeNames("td th"),c=function(a,c,u){function d(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=D.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i<r.length?e=e.replace(/ (<br>|)$/," "):t("nextSibling")||(e=e.replace(/( | )(<br>|)$/," "))),e}function f(){var e,t,n;e=D.getRng(!0),t=e.startContainer,n=e.startOffset,3==t.nodeType&&e.collapsed&&("\xa0"===t.data[n]?(t.deleteData(n,1),/[\u00a0| ]$/.test(c)||(c+=" ")):"\xa0"===t.data[n-1]&&(t.deleteData(n-1,1),/[\u00a0| ]$/.test(c)||(c=" "+c)))}function h(){if(A){var e=a.getBody(),n=new o(L);t.each(L.select("*[data-mce-fragment]"),function(t){for(var r=t.parentNode;r&&r!=e;r=r.parentNode)B[t.nodeName.toLowerCase()]&&n.compare(r,t)&&L.remove(t,!0)})}}function p(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}function m(e){t.each(e.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")})}function g(e){return!!e.getAttribute("data-mce-fragment")}function v(e){return e&&!a.schema.getShortEndedElements()[e.nodeName]}function y(t){function n(e){for(var t=a.getBody();e&&e!==t;e=e.parentNode)if("false"===a.dom.getContentEditable(e))return e;return null}function o(e){var t=i.fromRangeStart(e),n=new r(a.getBody());return t=n.next(t),t?t.toRange():void 0}var s,c,u;if(t){if(D.scrollIntoView(t),s=n(t))return L.remove(t),void D.select(s);S=L.createRng(),k=t.previousSibling,k&&3==k.nodeType?(S.setStart(k,k.nodeValue.length),e.ie||(T=t.nextSibling,T&&3==T.nodeType&&(k.appendData(T.data),T.parentNode.removeChild(T)))):(S.setStartBefore(t),S.setEndBefore(t)),c=L.getParent(t,L.isBlock),L.remove(t),c&&L.isEmpty(c)&&(a.$(c).empty(),S.setStart(c,0),S.setEnd(c,0),l(c)||g(c)||!(u=o(S))?L.add(c,L.create("br",{"data-mce-bogus":"1"})):(S=u,L.remove(c))),D.setRng(S)}}var b,C,x,w,N,E,_,S,k,T,R,A,B=a.schema.getTextInlineElements(),D=a.selection,L=a.dom;/^ | $/.test(c)&&(c=d(c)),b=a.parser,A=u.merge,C=new n({validate:a.settings.validate},a.schema),R='<span id="mce_marker" data-mce-type="bookmark">​</span>',E={content:c,format:"html",selection:!0},a.fire("BeforeSetContent",E),c=E.content,-1==c.indexOf("{$caret}")&&(c+="{$caret}"),c=c.replace(/\{\$caret\}/,R),S=D.getRng();var M=S.startContainer||(S.parentElement?S.parentElement():null),P=a.getBody();M===P&&D.isCollapsed()&&L.isBlock(P.firstChild)&&v(P.firstChild)&&L.isEmpty(P.firstChild)&&(S=L.createRng(),S.setStart(P.firstChild,0),S.setEnd(P.firstChild,0),D.setRng(S)),D.isCollapsed()||(a.selection.setRng(a.selection.getRng()),a.getDoc().execCommand("Delete",!1,null), f()),x=D.getNode();var O={context:x.nodeName.toLowerCase(),data:u.data};if(N=b.parse(c,O),u.paste===!0&&s.isListFragment(N)&&s.isParentBlockLi(L,x))return S=s.insertAtCaret(C,L,a.selection.getRng(!0),N),a.selection.setRng(S),void a.fire("SetContent",E);if(p(N),k=N.lastChild,"mce_marker"==k.attr("id"))for(_=k,k=k.prev;k;k=k.walk(!0))if(3==k.type||!L.isBlock(k.name)){a.schema.isValidChild(k.parent.name,"span")&&k.parent.insert(_,k,"br"===k.name);break}if(a._selectionOverrides.showBlockCaretContainer(x),O.invalid){for(D.setContent(R),x=D.getNode(),w=a.getBody(),9==x.nodeType?x=k=w:k=x;k!==w;)x=k,k=k.parentNode;c=x==w?w.innerHTML:L.getOuterHTML(x),c=C.serialize(b.parse(c.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return C.serialize(N)}))),x==w?L.setHTML(w,c):L.setOuterHTML(x,c)}else c=C.serialize(N),k=x.firstChild,T=x.lastChild,!k||k===T&&"BR"===k.nodeName?L.setHTML(x,c):D.setContent(c);h(),y(L.get("mce_marker")),m(a.getBody()),a.fire("SetContent",E),a.addVisual()},u=function(e){var n;return"string"!=typeof e?(n=t.extend({paste:e.paste,data:{paste:e.paste}},e),{content:e.content,details:n}):{content:e,details:{}}},d=function(e,t){var n=u(t);c(e,n.content,n.details)};return{insertAtCaret:d}}),r(oe,[d,m,T,y,ie],function(e,n,r,i,o){var a=n.each,s=n.extend,l=n.map,c=n.inArray,u=n.explode,d=e.ie&&e.ie<11,f=!0,h=!1;return function(n){function p(e,t,r,i){var o,s,l=0;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||i&&i.skip_focus||n.focus(),i=n.fire("BeforeExecCommand",{command:e,ui:t,value:r}),i.isDefaultPrevented())return!1;if(s=e.toLowerCase(),o=B.exec[s])return o(s,t,r),n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;if(a(n.plugins,function(i){return i.execCommand&&i.execCommand(e,t,r)?(n.fire("ExecCommand",{command:e,ui:t,value:r}),l=!0,!1):void 0}),l)return l;if(n.theme&&n.theme.execCommand&&n.theme.execCommand(e,t,r))return n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;try{l=n.getDoc().execCommand(e,t,r)}catch(c){}return l?(n.fire("ExecCommand",{command:e,ui:t,value:r}),!0):!1}function m(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.state[e])return t(e);try{return n.getDoc().queryCommandState(e)}catch(r){}return!1}}function g(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.value[e])return t(e);try{return n.getDoc().queryCommandValue(e)}catch(r){}}}function v(e,t){t=t||"exec",a(e,function(e,n){a(n.toLowerCase().split(","),function(n){B[t][n]=e})})}function y(e,t,r){e=e.toLowerCase(),B.exec[e]=function(e,i,o,a){return t.call(r||n,i,o,a)}}function b(e){if(e=e.toLowerCase(),B.exec[e])return!0;try{return n.getDoc().queryCommandSupported(e)}catch(t){}return!1}function C(e,t,r){e=e.toLowerCase(),B.state[e]=function(){return t.call(r||n)}}function x(e,t,r){e=e.toLowerCase(),B.value[e]=function(){return t.call(r||n)}}function w(e){return e=e.toLowerCase(),!!B.exec[e]}function N(e,r,i){return r===t&&(r=h),i===t&&(i=null),n.getDoc().execCommand(e,r,i)}function E(e){return A.match(e)}function _(e,r){A.toggle(e,r?{value:r}:t),n.nodeChanged()}function S(e){L=R.getBookmark(e)}function k(){R.moveToBookmark(L)}var T,R,A,B={state:{},exec:{},value:{}},D=n.settings,L;n.on("PreInit",function(){T=n.dom,R=n.selection,D=n.settings,A=n.formatter}),s(this,{execCommand:p,queryCommandState:m,queryCommandValue:g,queryCommandSupported:b,addCommands:v,addCommand:y,addQueryStateHandler:C,addQueryValueHandler:x,hasCustomCommand:w}),v({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(t){var r=n.getDoc(),i;try{N(t)}catch(o){i=f}if("paste"!==t||r.queryCommandEnabled(t)||(i=!0),i||!r.queryCommandSupported(t)){var a=n.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");e.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),n.notificationManager.open({text:a,type:"error"})}},unlink:function(){if(R.isCollapsed()){var e=R.getNode();return void("A"==e.tagName&&n.dom.remove(e,!0))}A.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"==t&&(t="justify"),a("left,center,right,justify".split(","),function(e){t!=e&&A.remove("align"+e)}),"none"!=t&&_("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;N(e),t=T.getParent(R.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(S(),T.split(n,t),k()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){_(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){_(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=u(D.font_size_style_values),r=u(D.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),_(e,n)},RemoveFormat:function(e){A.remove(e)},mceBlockQuote:function(){_("blockquote")},FormatBlock:function(e,t,n){return _(n||"p")},mceCleanup:function(){var e=R.getBookmark();n.setContent(n.getContent({cleanup:f}),{cleanup:f}),R.moveToBookmark(e)},mceRemoveNode:function(e,t,r){var i=r||R.getNode();i!=n.getBody()&&(S(),n.dom.remove(i,f),k())},mceSelectNodeDepth:function(e,t,r){var i=0;T.getParent(R.getNode(),function(e){return 1==e.nodeType&&i++==r?(R.select(e),h):void 0},n.getBody())},mceSelectNode:function(e,t,n){R.select(n)},mceInsertContent:function(e,t,r){o.insertAtCaret(n,r)},mceInsertRawHTML:function(e,t,r){R.setContent("tiny_mce_marker"),n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return r}))},mceToggleFormat:function(e,t,n){_(n)},mceSetContent:function(e,t,r){n.setContent(r)},"Indent,Outdent":function(e){var t,r,i;t=D.indentation,r=/[a-z%]+$/i.exec(t),t=parseInt(t,10),m("InsertUnorderedList")||m("InsertOrderedList")?N(e):(D.forced_root_block||T.getParent(R.getNode(),T.isBlock)||A.apply("div"),a(R.getSelectedBlocks(),function(o){if("false"!==T.getContentEditable(o)&&"LI"!=o.nodeName){var a=n.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==T.getStyle(o,"direction",!0)?"Right":"Left","outdent"==e?(i=Math.max(0,parseInt(o.style[a]||0,10)-t),T.setStyle(o,a,i?i+r:"")):(i=parseInt(o.style[a]||0,10)+t+r,T.setStyle(o,a,i))}}))},mceRepaint:function(){},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual,n.addVisual()},mceReplaceContent:function(e,t,r){n.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,R.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=T.getParent(R.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||A.remove("link"),n.href&&A.apply("link",n,r)},selectAll:function(){var e=T.getRoot(),t;R.getRng().setStart?(t=T.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),R.setRng(t)):(t=R.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){N("Delete");var e=n.getBody();T.isEmpty(e)&&(n.setContent(""),e.firstChild&&T.isBlock(e.firstChild)?n.selection.setCursorLocation(e.firstChild,0):n.selection.setCursorLocation(e,0))},mceNewDocument:function(){n.setContent("")},InsertLineBreak:function(e,t,o){function a(){for(var e=new i(m,v),t,r=n.schema.getNonEmptyElements();t=e.next();)if(r[t.nodeName.toLowerCase()]||t.length>0)return!0}var s=o,l,c,u,h=R.getRng(!0);new r(T).normalize(h);var p=h.startOffset,m=h.startContainer;if(1==m.nodeType&&m.hasChildNodes()){var g=p>m.childNodes.length-1;m=m.childNodes[Math.min(p,m.childNodes.length-1)]||m,p=g&&3==m.nodeType?m.nodeValue.length:0}var v=T.getParent(m,T.isBlock),y=v?v.nodeName.toUpperCase():"",b=v?T.getParent(v.parentNode,T.isBlock):null,C=b?b.nodeName.toUpperCase():"",x=s&&s.ctrlKey;"LI"!=C||x||(v=b,y=C),m&&3==m.nodeType&&p>=m.nodeValue.length&&(d||a()||(l=T.create("br"),h.insertNode(l),h.setStartAfter(l),h.setEndAfter(l),c=!0)),l=T.create("br"),h.insertNode(l);var w=T.doc.documentMode;return d&&"PRE"==y&&(!w||8>w)&&l.parentNode.insertBefore(T.doc.createTextNode("\r"),l),u=T.create("span",{}," "),l.parentNode.insertBefore(u,l),R.scrollIntoView(u),T.remove(u),c?(h.setStartBefore(l),h.setEndBefore(l)):(h.setStartAfter(l),h.setEndAfter(l)),R.setRng(h),n.undoManager.add(),f}}),v({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=R.isCollapsed()?[T.getParent(R.getNode(),T.isBlock)]:R.getSelectedBlocks(),r=l(n,function(e){return!!A.matchNode(e,t)});return-1!==c(r,f)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return E(e)},mceBlockQuote:function(){return E("blockquote")},Outdent:function(){var e;if(D.inline_styles){if((e=T.getParent(R.getStart(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f;if((e=T.getParent(R.getEnd(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f}return m("InsertUnorderedList")||m("InsertOrderedList")||!D.inline_styles&&!!T.getParent(R.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=T.getParent(R.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),v({"FontSize,FontName":function(e){var t=0,n;return(n=T.getParent(R.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),v({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}),r(ae,[m],function(e){function t(e,o){var a=this,s,l;if(e=r(e),o=a.settings=o||{},s=o.base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(a.source=e);var c=0===e.indexOf("//");0!==e.indexOf("/")||c||(e=(s?s.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(l=o.base_uri?o.base_uri.path:new t(location.href).directory,""===o.base_uri.protocol?e="//mce_host"+a.toAbsPath(l,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(s&&s.protocol||"http")+"://mce_host"+a.toAbsPath(l,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(i,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),a[t]=r}),s&&(a.protocol||(a.protocol=s.protocol),a.userInfo||(a.userInfo=s.userInfo),a.port||"mce_host"!==a.host||(a.port=s.port),a.host&&"mce_host"!==a.host||(a.host=s.host),a.source=""),c&&(a.protocol="")}var n=e.each,r=e.trim,i="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),o={ftp:21,http:80,https:443,mailto:25};return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(n&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=o[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.length<n.length)for(o=0,a=n.length;a>o;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}},t.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},t}),r(se,[m],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r=this;if(!o&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],"function"==typeof f&&c[d]?u[d]=s(d,f):u[d]=f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(le,[m],function(e){function t(t){function n(){return!1}function r(){return!0}function i(e,i){var o,s,l,c;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=u),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=r},i.stopPropagation=function(){i.isPropagationStopped=r},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=r},i.isDefaultPrevented=n,i.isPropagationStopped=n,i.isImmediatePropagationStopped=n),t.beforeFire&&t.beforeFire(i),o=d[e])for(s=0,l=o.length;l>s;s++){if(c=o[s],c.once&&a(e,c.func),i.isImmediatePropagationStopped())return i.stopPropagation(),i;if(c.func.call(u,i)===!1)return i.preventDefault(),i}return i}function o(t,r,i,o){var a,s,l;if(r===!1&&(r=n),r)for(r={func:r},o&&e.extend(r,o),s=t.toLowerCase().split(" "),l=s.length;l--;)t=s[l],a=d[t],a||(a=d[t]=[],f(t,!0)),i?a.unshift(r):a.push(r);return c}function a(e,t){var n,r,i,o,a;if(e)for(o=e.toLowerCase().split(" "),n=o.length;n--;){if(e=o[n],r=d[e],!e){for(i in d)f(i,!1),delete d[i];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),d[e]=r);else r.length=0;r.length||(f(e,!1),delete d[e])}}else{for(e in d)f(e,!1);d={}}return c}function s(e,t,n){return o(e,t,n,{once:!0})}function l(e){return e=e.toLowerCase(),!(!d[e]||0===d[e].length)}var c=this,u,d={},f;t=t||{},u=t.scope||c,f=t.toggleEvent||n,c.fire=i,c.on=o,c.off=a,c.once=s,c.has=l}var n=e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," ");return t.isNative=function(e){return!!n[e.toLowerCase()]},t}),r(ce,[],function(){function e(e){this.create=e.create}return e.create=function(t,n){return new e({create:function(e,r){function i(t){e.set(r,t.value)}function o(e){t.set(n,e.value)}var a;return e.on("change:"+r,o),t.on("change:"+n,i),a=e._bindings,a||(a=e._bindings=[],e.on("destroy",function(){for(var e=a.length;e--;)a[e]()})),a.push(function(){t.off("change:"+n,i)}),t.get(n)}})},e}),r(ue,[le],function(e){function t(t){return t._eventDispatcher||(t._eventDispatcher=new e({scope:t,toggleEvent:function(n,r){e.isNative(n)&&t.toggleNativeEvent&&t.toggleNativeEvent(n,r)}})),t._eventDispatcher}return{fire:function(e,n,r){var i=this;if(i.removed&&"remove"!==e)return n;if(n=t(i).fire(e,n,r),r!==!1&&i.parent)for(var o=i.parent();o&&!n.isPropagationStopped();)o.fire(e,n,!1),o=o.parent();return n},on:function(e,n,r){return t(this).on(e,n,r)},off:function(e,n){return t(this).off(e,n)},once:function(e,n){return t(this).once(e,n)},hasEventListeners:function(e){return t(this).has(e)}}}),r(de,[ce,ue,se,m],function(e,t,n,r){function i(e){return e.nodeType>0}function o(e,t){var n,a;if(e===t)return!0;if(null===e||null===t)return e===t;if("object"!=typeof e||"object"!=typeof t)return e===t;if(r.isArray(t)){if(e.length!==t.length)return!1;for(n=e.length;n--;)if(!o(e[n],t[n]))return!1}if(i(e)||i(t))return e===t;a={};for(n in t){if(!o(e[n],t[n]))return!1;a[n]=!0}for(n in e)if(!a[n]&&!o(e[n],t[n]))return!1;return!0}return n.extend({Mixins:[t],init:function(t){var n,r;t=t||{};for(n in t)r=t[n],r instanceof e&&(t[n]=r.create(this,n));this.data=t},set:function(t,n){var r,i,a=this.data[t];if(n instanceof e&&(n=n.create(this,t)),"object"==typeof t){for(r in t)this.set(r,t[r]);return this}return o(a,n)||(this.data[t]=n,i={target:this,name:t,value:n,oldValue:a},this.fire("change:"+t,i),this.fire("change",i)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(t){return e.create(this,t)},destroy:function(){this.fire("destroy")}})}),r(fe,[se],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.classes.contains(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.pseudo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a<n.length;a++)">"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,h,p;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,p=e,h=0,i=o-1;i>=0;i--)for(c=a[i];p;){if(c.pseudo)for(f=p.parent().items(),u=d=f.length;u--&&f[u]!==p;);for(s=0,l=c.length;l>s;s++)if(!c[s](p,u,d)){s=l+1;break}if(s===l){h++;break}if(i===o-1)break;p=p.parent()}if(h===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(he,[m,fe,se],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].classes.contains(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(e){return this.each(function(t){t.classes.add(e)})},removeClass:function(e){return this.each(function(t){t.classes.remove(e)})}},e.each("fire on off show hide append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(pe,[d,m,w],function(e,t,n){var r=0,i={id:function(){return"mceu_"+r++},create:function(e,r,i){var o=document.createElement(e);return n.DOM.setAttribs(o,r),"string"==typeof i?o.innerHTML=i:t.each(i,function(e){e.nodeType&&o.appendChild(e)}),o},createFragment:function(e){return n.DOM.createFragment(e)},getWindowSize:function(){return n.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return n.DOM.getPos(e,t||i.getContainer())},getContainer:function(){return e.container?e.container:document.body},getViewPort:function(e){return n.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return n.DOM.addClass(e,t)},removeClass:function(e,t){return n.DOM.removeClass(e,t)},hasClass:function(e,t){return n.DOM.hasClass(e,t)},toggleClass:function(e,t,r){return n.DOM.toggleClass(e,t,r)},css:function(e,t,r){return n.DOM.setStyle(e,t,r)},getRuntimeStyle:function(e,t){return n.DOM.getStyle(e,t,!0)},on:function(e,t,r,i){return n.DOM.bind(e,t,r,i)},off:function(e,t,r){return n.DOM.unbind(e,t,r)},fire:function(e,t,r){return n.DOM.fire(e,t,r)},innerHtml:function(e,t){n.DOM.setHTML(e,t)}};return i}),r(me,[],function(){return{parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}}}}),r(ge,[m],function(e){function t(){}function n(e){this.cls=[],this.cls._map={},this.onchange=e||t,this.prefix=""}return e.extend(n.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){for(var t=0;t<this.cls.length&&this.cls[t]!==e;t++);this.cls.splice(t,1),delete this.cls._map[e],this._change()}return this},toggle:function(e,t){var n=this.contains(e);return n!==t&&(n?this.remove(e):this.add(e),this._change()),this},contains:function(e){return!!this.cls._map[e]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),n.prototype.toString=function(){var e;if(this.clsValue)return this.clsValue;e="";for(var t=0;t<this.cls.length;t++)t>0&&(e+=" "),e+=this.prefix+this.cls[t];return e},n}),r(ve,[u],function(e){var t={},n;return{add:function(r){var i=r.parent();if(i){if(!i._layout||i._layout.isNative())return;t[i._id]||(t[i._id]=i),n||(n=!0,e.requestAnimationFrame(function(){var e,r;n=!1;for(e in t)r=t[e],r.state.get("rendered")&&r.reflow();t={}},document.body))}},remove:function(e){t[e._id]&&delete t[e._id]}}}),r(ye,[se,m,le,de,he,pe,g,me,ge,ve],function(e,t,n,r,i,o,a,s,l,c){function u(e){return e._eventDispatcher||(e._eventDispatcher=new n({scope:e,toggleEvent:function(t,r){r&&n.isNative(t)&&(e._nativeEvents||(e._nativeEvents={}),e._nativeEvents[t]=!0,e.state.get("rendered")&&d(e))}})),e._eventDispatcher}function d(e){function t(t){var n=e.getParentCtrl(t.target);n&&n.fire(t.type,t)}function n(){var e=c._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),c._lastHoverCtrl=null)}function r(t){var n=e.getParentCtrl(t.target),r=c._lastHoverCtrl,i=0,o,a,s;if(n!==r){if(c._lastHoverCtrl=n,a=n.parents().toArray().reverse(),a.push(n),r){for(s=r.parents().toArray().reverse(),s.push(r),i=0;i<s.length&&a[i]===s[i];i++);for(o=s.length-1;o>=i;o--)r=s[o],r.fire("mouseleave",{target:r.getEl()})}for(o=i;o<a.length;o++)n=a[o],n.fire("mouseenter",{target:n.getEl()})}}function i(t){t.preventDefault(),"mousewheel"==t.type?(t.deltaY=-1/40*t.wheelDelta,t.wheelDeltaX&&(t.deltaX=-1/40*t.wheelDeltaX)):(t.deltaX=0,t.deltaY=t.detail),t=e.fire("wheel",t)}var o,s,l,c,u,d;if(u=e._nativeEvents){for(l=e.parents().toArray(),l.unshift(e),o=0,s=l.length;!c&&s>o;o++)c=l[o]._eventsRoot;for(c||(c=l[l.length-1]||e),e._eventsRoot=c,s=o,o=0;s>o;o++)l[o]._eventsRoot=c;var p=c._delegates;p||(p=c._delegates={});for(d in u){if(!u)return!1;"wheel"!==d||h?("mouseenter"===d||"mouseleave"===d?c._hasMouseEnter||(a(c.getEl()).on("mouseleave",n).on("mouseover",r),c._hasMouseEnter=1):p[d]||(a(c.getEl()).on(d,t),p[d]=!0),u[d]=!1):f?a(e.getEl()).on("mousewheel",i):a(e.getEl()).on("DOMMouseScroll",i)}}}var f="onmousewheel"in document,h=!1,p="mce-",m,g=0,v={Statics:{classPrefix:p},isRtl:function(){return m.rtl},classPrefix:p,init:function(e){function n(e){var t;for(e=e.split(" "),t=0;t<e.length;t++)i.classes.add(e[t])}var i=this,o,c;i.settings=e=t.extend({},i.Defaults,e),i._id=e.id||"mceu_"+g++,i._aria={role:e.role},i._elmCache={},i.$=a,i.state=new r({visible:!0,active:!1,disabled:!1,value:""}),i.data=new r(e.data),i.classes=new l(function(){i.state.get("rendered")&&(i.getEl().className=this.toString())}),i.classes.prefix=i.classPrefix,o=e.classes,o&&(i.Defaults&&(c=i.Defaults.classes,c&&o!=c&&n(c)),n(o)),t.each("title text name visible disabled active value".split(" "),function(t){t in e&&i[t](e[t])}),i.on("click",function(){return i.disabled()?!1:void 0}),i.settings=e,i.borderBox=s.parseBox(e.border),i.paddingBox=s.parseBox(e.padding),i.marginBox=s.parseBox(e.margin),e.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){return o.getContainer()},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},initLayoutRect:function(){var e=this,t=e.settings,n,r,i=e.getEl(),a,l,c,u,d,f,h,p;n=e.borderBox=e.borderBox||s.measureBox(i,"border"),e.paddingBox=e.paddingBox||s.measureBox(i,"padding"),e.marginBox=e.marginBox||s.measureBox(i,"margin"),p=o.getSize(i),f=t.minWidth,h=t.minHeight,c=f||p.width,u=h||p.height,a=t.width,l=t.height,d=t.autoResize,d="undefined"!=typeof d?d:!a&&!l,a=a||c,l=l||u;var m=n.left+n.right,g=n.top+n.bottom,v=t.maxWidth||65535,y=t.maxHeight||65535;return e._layoutRect=r={x:t.x||0,y:t.y||0,w:a,h:l,deltaW:m,deltaH:g,contentW:a-m,contentH:l-g,innerW:a-m,innerH:l-g,startMinWidth:f||0,startMinHeight:h||0,minW:Math.min(c,v),minH:Math.min(u,y),maxW:v,maxH:y,autoResize:d,scrollW:0},e._lastLayoutRect={},r},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,l;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=i<n.minW?n.minW:i,i=i>n.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=i<n.minH?n.minH:i,i=i>n.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=i<n.minW-o?n.minW-o:i,i=i>n.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=i<n.minH-a?n.minH-a:i,i=i>n.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,r.x===n.x&&r.y===n.y&&r.w===n.w&&r.h===n.h||(l=m.repaintControls,l&&l.map&&!l.map[t._id]&&(l.push(t),l.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o,a,s,l,c,u;c=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,i=e._layoutRect,l=e._lastRepaintRect||{},o=e.borderBox,a=o.left+o.right,s=o.top+o.bottom,i.x!==l.x&&(t.left=c(i.x)+"px",l.x=i.x),i.y!==l.y&&(t.top=c(i.y)+"px",l.y=i.y),i.w!==l.w&&(u=c(i.w-a),t.width=(u>=0?u:0)+"px",l.w=i.w),i.h!==l.h&&(u=c(i.h-s),t.height=(u>=0?u:0)+"px",l.h=i.h),e._hasBody&&i.innerW!==l.innerW&&(u=c(i.innerW),r=e.getEl("body"),r&&(n=r.style,n.width=(u>=0?u:0)+"px"),l.innerW=i.innerW),e._hasBody&&i.innerH!==l.innerH&&(u=c(i.innerH),r=r||e.getEl("body"),r&&(n=n||r.style,n.height=(u>=0?u:0)+"px"),l.innerH=i.innerH),e._lastRepaintRect=l,e.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,o.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){function n(e){var t,n;return"string"!=typeof e?e:function(i){return t||r.parentsAndSelf().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t?t.call(n,i):(i.action=e,void this.fire("execute",i))}}var r=this;return u(r).on(e,n(t)),r},off:function(e,t){return u(this).off(e,t),this},fire:function(e,t,n){var r=this;if(t=t||{},t.control||(t.control=r),t=u(r).fire(e,t),n!==!1&&r.parent)for(var i=r.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return u(this).has(e)},parents:function(e){var t=this,n,r=new i;for(n=t.parent();n;n=n.parent())r.add(n);return e&&(r=r.filter(e)),r},parentsAndSelf:function(e){return new i(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=a("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return m.translate?m.translate(e):e},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),r,i; if(e.items){var o=e.items().toArray();for(i=o.length;i--;)o[i].remove()}n&&n.items&&(r=[],n.items().each(function(t){t!==e&&r.push(t)}),n.items().set(r),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&a(t).off();var s=e.getRoot().controlIdLookup;return s&&delete s[e._id],t&&t.parentNode&&t.parentNode.removeChild(t),e.state.set("rendered",!1),e.state.destroy(),e.fire("remove"),e},renderBefore:function(e){return a(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return a(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var e=this,t=e.settings,n,r,i,o,s;e.$el=a(e.getEl()),e.state.set("rendered",!0);for(o in t)0===o.indexOf("on")&&e.on(o.substr(2),t[o]);if(e._eventsRoot){for(i=e.parent();!s&&i;i=i.parent())s=i._eventsRoot;if(s)for(o in s._nativeEvents)e._nativeEvents[o]=!0}d(e),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e.settings.border&&(r=e.borderBox,e.$el.css({"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var u in e._aria)e.aria(u,e._aria[u]);e.state.get("visible")===!1&&(e.getEl().style.display="none"),e.bindStates(),e.state.on("change:visible",function(t){var n=t.value,r;e.state.get("rendered")&&(e.getEl().style.display=n===!1?"none":"",e.getEl().getBoundingClientRect()),r=e.parent(),r&&(r._lastRect=null),e.fire(n?"show":"hide"),c.add(e)}),e.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){c.remove(this);var e=this.parent();return e._layout&&!e._layout.isNative()&&e.reflow(),this}};return t.each("text title visible disabled active value".split(" "),function(e){v[e]=function(t){return 0===arguments.length?this.state.get(e):("undefined"!=typeof t&&this.state.set(e,t),this)}}),m=e.extend(v)}),r(be,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(Ce,[],function(){return function(e){function t(e){return e&&1===e.nodeType}function n(e){return e=e||C,t(e)?e.getAttribute("role"):null}function r(e){for(var t,r=e||C;r=r.parentNode;)if(t=n(r))return t}function i(e){var n=C;return t(n)?n.getAttribute("aria-"+e):void 0}function o(e){var t=e.tagName.toUpperCase();return"INPUT"==t||"TEXTAREA"==t||"SELECT"==t}function a(e){return o(e)&&!e.hidden?!0:!!/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(n(e))}function s(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){a(e)&&n.push(e);for(var r=0;r<e.childNodes.length;r++)t(e.childNodes[r])}}var n=[];return t(e||b.getEl()),n}function l(e){var t,n;e=e||x,n=e.parents().toArray(),n.unshift(e);for(var r=0;r<n.length&&(t=n[r],!t.settings.ariaRoot);r++);return t}function c(e){var t=l(e),n=s(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?u(t.lastAriaIndex,n):u(0,n)}function u(e,t){return 0>e?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function d(e,t){var n=-1,r=l();t=t||s(r.getEl());for(var i=0;i<t.length;i++)t[i]===C&&(n=i);n+=e,r.lastAriaIndex=u(n,t)}function f(){var e=r();"tablist"==e?d(-1,s(C.parentNode)):x.parent().submenu?v():d(-1)}function h(){var e=n(),t=r();"tablist"==t?d(1,s(C.parentNode)):"menuitem"==e&&"menu"==t&&i("haspopup")?y():d(1)}function p(){d(-1)}function m(){var e=n(),t=r();"menuitem"==e&&"menubar"==t?y():"button"==e&&i("haspopup")?y({key:"down"}):d(1)}function g(e){var t=r();if("tablist"==t){var n=s(x.getEl("body"))[0];n&&n.focus()}else d(e.shiftKey?-1:1)}function v(){x.fire("cancel")}function y(e){e=e||{},x.fire("click",{target:C,aria:e})}var b=e.root,C,x;try{C=document.activeElement}catch(w){C=document.body}return x=b.getParentCtrl(C),b.on("keydown",function(e){function t(e,t){o(C)||"slider"!==n(C)&&t(e)!==!1&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,f);break;case 39:t(e,h);break;case 38:t(e,p);break;case 40:t(e,m);break;case 27:v();break;case 14:case 13:case 32:t(e,y);break;case 9:g(e)!==!1&&e.preventDefault()}}),b.on("focusin",function(e){C=e.target,x=e.control}),{focusFirst:c}}}),r(xe,[ye,he,fe,be,Ce,m,g,ge,ve],function(e,t,n,r,i,o,a,s,l){var c={};return e.extend({init:function(e){var n=this;n._super(e),e=n.settings,e.fixed&&n.state.set("fixed",!0),n._items=new t,n.isRtl()&&n.classes.add("rtl"),n.bodyClasses=new s(function(){n.state.get("rendered")&&(n.getEl("body").className=this.toString())}),n.bodyClasses.prefix=n.classPrefix,n.classes.add("container"),n.bodyClasses.add("container-body"),e.containerCls&&n.classes.add(e.containerCls),n._layout=r.create((e.layout||"")+"layout"),n.settings.items?n.add(n.settings.items):n.add(n.render()),n._hasBody=!0},items:function(){return this._items},find:function(e){return e=c[e]=c[e]||new n(e),e.find(this)},add:function(e){var t=this;return t.items().add(t.create(e)).parent(t),t},focus:function(e){var t=this,n,r,i;return e&&(r=t.keyboardNav||t.parents().eq(-1)[0].keyboardNav)?void r.focusFirst(t):(i=t.find("*"),t.statusbar&&i.add(t.statusbar.items()),i.each(function(e){return e.settings.autofocus?(n=null,!1):void(e.canFocus&&(n=n||e))}),n&&n.focus(),t)},replace:function(e,t){for(var n,r=this.items(),i=r.length;i--;)if(r[i]===e){r[i]=t;break}i>=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,i,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r;t.parent(e),t.state.get("rendered")||(r=e.getEl("body"),r.hasChildNodes()&&n<=r.childNodes.length-1?a(r.childNodes[n]).before(t.renderHtml()):a(r).append(t.renderHtml()),t.postRender(),l.add(t))}),e._layout.applyClasses(e.items().filter(":visible")),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t<i.length-1&&(t+=1),t>=0&&t<i.length&&(o=i.slice(0,t).toArray(),a=i.slice(t).toArray(),i.set(o.concat(e,a))),r.renderNew()},fromJSON:function(e){var t=this;for(var n in e)t.find("#"+n).value(e[n]);return t},toJSON:function(){var e=this,t={};return e.find("*").each(function(e){var n=e.name(),r=e.value();n&&"undefined"!=typeof r&&(t[n]=r)}),t},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e.state.set("rendered",!0),e.settings.style&&e.$el.css(e.settings.style),e.settings.border&&(t=e.borderBox,e.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(l.remove(this),this.visible()){for(e.repaintControls=[],e.repaintControls.map={},this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(we,[g],function(e){function t(e){var t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}function n(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}return function(r,i){function o(){return s.getElementById(i.handle||r)}var a,s=i.document||document,l,c,u,d,f,h;i=i||{},c=function(r){var c=t(s),p,m;n(r),r.preventDefault(),l=r.button,p=o(),f=r.screenX,h=r.screenY,m=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,a=e("<div>").css({position:"absolute",top:0,left:0,width:c.width,height:c.height,zIndex:2147483647,opacity:1e-4,cursor:m}).appendTo(s.body),e(s).on("mousemove touchmove",d).on("mouseup touchend",u),i.start(r)},d=function(e){return n(e),e.button!==l?u(e):(e.deltaX=e.screenX-f,e.deltaY=e.screenY-h,e.preventDefault(),void i.drag(e))},u=function(t){n(t),e(s).off("mousemove touchmove",d).off("mouseup touchend",u),a.remove(),i.stop&&i.stop(t)},this.destroy=function(){e(o()).off()},e(o()).on("mousedown touchstart",c)}}),r(Ne,[g,we],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,h,p,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),e(i.getEl("absend")).css(y,i.layoutRect()[l]-1),!c)return void e(f).css("display","none");e(f).css("display","block"),d=i.getEl("body"),h=i.getEl("scroll"+t+"t"),p=d["client"+s]-2*o,p-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=p/m,v={},v[y]=d["offset"+a]+o,v[b]=p,e(f).css(v),v={},v[y]=d["scroll"+a]*g,v[b]=p*g,e(h).css(v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;e(i.getEl()).append('<div id="'+u+'" class="'+d+"scrollbar "+d+"scrollbar-"+n+'"><div id="'+u+'t" class="'+d+'scrollbar-thumb"></div></div>'),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e("#"+u).addClass(d+"active")},drag:function(e){var t,u,d,f,h=i.layoutRect();u=h.contentW>h.innerW,d=h.contentH>h.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e("#"+u).removeClass(d+"active")}})}i.classes.add("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e(i.getEl("body")).on("scroll",n)),n())}}}),r(Ee,[xe,Ne],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}})}),r(_e,[pe],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,h;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t.state.get("fixed")&&"static"==e.getRuntimeStyle(document.body,"position")&&(a-=f.x,s-=f.y),i=t.getEl(),h=e.getSize(i),l=h.width,c=h.height,h=e.getSize(n),u=h.width,d=h.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o<r.length;o++){var a=t(this,n,r[o]);if(this.state.get("fixed")){if(a.x>0&&a.x+a.w<i.w&&a.y>0&&a.y+a.h<i.h)return r[o]}else if(a.x>i.x&&a.x+a.w<i.w+i.x&&a.y>i.y&&a.y+a.h<i.h+i.y)return r[o]}return r[0]},moveRel:function(e,n){"string"!=typeof n&&(n=this.testMoveRel(e,n));var r=t(this,e,n);return this.moveTo(r.x,r.y)},moveBy:function(e,t){var n=this,r=n.layoutRect();return n.moveTo(r.x+e,r.y+t),n},moveTo:function(t,n){function r(e,t,n){return 0>e?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i.state.get("rendered")?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(Se,[pe],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(ke,[Ee,_e,Se,pe,g,u],function(e,t,n,r,i,o){function a(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}function s(e){for(var t=v.length;t--;){var n=v[t],r=n.getParentCtrl(e.target);if(n.settings.autohide){if(r&&(a(r,n)||n.parent()===r))continue;e=n.fire("autohide",{target:e.target}),e.isDefaultPrevented()||n.hide()}}}function l(){p||(p=function(e){2!=e.button&&s(e)},i(document).on("click touchstart",p))}function c(){m||(m=function(){var e;for(e=v.length;e--;)d(v[e])},i(window).on("scroll",m))}function u(){if(!g){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;g=function(){document.all&&t==e.clientWidth&&n==e.clientHeight||(t=e.clientWidth,n=e.clientHeight,C.hideAll())},i(window).on("resize",g)}}function d(e){function t(t,n){for(var r,i=0;i<v.length;i++)if(v[i]!=e)for(r=v[i].parent();r&&(r=r.parent());)r==e&&v[i].fixed(t).moveBy(0,n).repaint()}var n=r.getViewPort().y;e.settings.autofix&&(e.state.get("fixed")?e._autoFixY>n&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY<n&&(e.fixed(!0).layoutRect({y:0}).repaint(),t(!0,n-e._autoFixY))))}function f(e,t){var n,r=C.zIndex||65535,o;if(e)y.push(t);else for(n=y.length;n--;)y[n]===t&&y.splice(n,1);if(y.length)for(n=0;n<y.length;n++)y[n].modal&&(r++,o=y[n]),y[n].getEl().style.zIndex=r,y[n].zIndex=r,r++;var a=i("#"+t.classPrefix+"modal-block",t.getContainerElm())[0];o?i(a).css("z-index",o.zIndex-1):a&&(a.parentNode.removeChild(a),b=!1),C.currentZIndex=r}function h(e){var t;for(t=v.length;t--;)v[t]===e&&v.splice(t,1);for(t=y.length;t--;)y[t]===e&&y.splice(t,1)}var p,m,g,v=[],y=[],b,C=e.extend({Mixins:[t,n],init:function(e){var t=this;t._super(e),t._eventsRoot=t,t.classes.add("floatpanel"),e.autohide&&(l(),u(),v.push(t)),e.autofix&&(c(),t.on("move",function(){d(this)})),t.on("postrender show",function(e){if(e.control==t){var n,r=t.classPrefix;t.modal&&!b&&(n=i("#"+r+"modal-block",t.getContainerElm()),n[0]||(n=i('<div id="'+r+'modal-block" class="'+r+"reset "+r+'fade"></div>').appendTo(t.getContainerElm())),o.setTimeout(function(){n.addClass(r+"in"),i(t.getEl()).addClass(r+"in")}),b=!0),f(!0,t)}}),t.on("show",function(){t.parents().each(function(e){return e.state.get("fixed")?(t.fixed(!0),!1):void 0})}),e.popover&&(t._preBodyHtml='<div class="'+t.classPrefix+'arrow"></div>',t.classes.add("popover").add("bottom").add(t.isRtl()?"end":"start")),t.aria("label",e.ariaLabel),t.aria("labelledby",t._id),t.aria("describedby",t.describedBy||t._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!=e){if(t.state.get("rendered")){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e=this,t,n=e._super();for(t=v.length;t--&&v[t]!==e;);return-1===t&&v.push(e),n},hide:function(){return h(this),f(!1,this),this._super()},hideAll:function(){C.hideAll()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||(e.remove(),f(!1,e)),e},remove:function(){h(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return C.hideAll=function(){for(var e=v.length;e--;){var t=v[e];t&&t.settings.autohide&&(t.hide(),v.splice(e,1))}},C}),r(Te,[ke,Ee,pe,g,we,me,d,u],function(e,t,n,r,i,o,a,s){function l(e){var t="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0",n=r("meta[name=viewport]")[0],i;a.overrideViewPort!==!1&&(n||(n=document.createElement("meta"),n.setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),i=n.getAttribute("content"),i&&"undefined"!=typeof f&&(f=i),n.setAttribute("content",e?t:f))}function c(e){for(var t=0;t<d.length;t++)if(d[t]._fullscreen)return;r([document.documentElement,document.body]).removeClass(e+"fullscreen")}function u(){function e(){var e,t=n.getWindowSize(),r;for(e=0;e<d.length;e++)r=d[e].layoutRect(),d[e].moveTo(d[e].settings.x||Math.max(0,t.w/2-r.w/2),d[e].settings.y||Math.max(0,t.h/2-r.h/2))}if(!a.desktop){var t={w:window.innerWidth,h:window.innerHeight};s.setInterval(function(){var e=window.innerWidth,n=window.innerHeight;t.w==e&&t.h==n||(t={w:e,h:n},r(window).trigger("resize"))},100)}r(window).on("resize",e)}var d=[],f="",h=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var r=this;r._super(e),r.isRtl()&&r.classes.add("rtl"),r.classes.add("window"),r.bodyClasses.add("window-body"),r.state.set("fixed",!0),e.buttons&&(r.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:r.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),r.statusbar.classes.add("foot"),r.statusbar.parent(r)),r.on("click",function(e){var t=r.classPrefix+"close";(n.hasClass(e.target,t)||n.hasClass(e.target.parentNode,t))&&r.close()}),r.on("cancel",function(){r.close()}),r.aria("describedby",r.describedBy||r._id+"-none"),r.aria("label",e.title),r._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=e.settings.x||Math.max(0,a.w/2-t.w/2),t.y=e.settings.y||Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='<div id="'+n+'-head" class="'+r+'window-head"><div id="'+n+'-title" class="'+r+'title">'+e.encode(i.title)+'</div><div id="'+n+'-dragh" class="'+r+'dragh"></div><button type="button" class="'+r+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),i.url&&(s='<iframe src="'+i.url+'" tabindex="-1"></iframe>'),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.bodyClasses+'">'+s+"</div>"+a+"</div></div>"},fullscreen:function(e){var t=this,i=document.documentElement,a,l=t.classPrefix,c;if(e!=t._fullscreen)if(r(window).on("resize",function(){var e;if(t._fullscreen)if(a)t._timer||(t._timer=s.setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(a=!0)}}),c=t.layoutRect(),t._fullscreen=e,e){t._initial={x:c.x,y:c.y,w:c.w,h:c.h},t.borderBox=o.parseBox("0"),t.getEl("head").style.display="none",c.deltaH-=c.headerH+2,r([i,document.body]).addClass(l+"fullscreen"),t.classes.add("fullscreen");var u=n.getWindowSize();t.moveTo(0,0).resizeTo(u.w,u.h)}else t.borderBox=o.parseBox(t.settings.border),t.getEl("head").style.display="",c.deltaH+=c.headerH,r([i,document.body]).removeClass(l+"fullscreen"),t.classes.remove("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.classes.add("in"),e.fire("open")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()}),d.push(e),l(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t;for(e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),t=d.length;t--;)d[t]===e&&d.splice(t,1);l(d.length>0),c(e.classPrefix)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});return u(),h}),r(Re,[Te],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){function r(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),o(t)}}}var i,o=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:i=[r("Ok",!0,!0),r("Cancel",!1)];break;case t.YES_NO:case t.YES_NO_CANCEL:i=[r("Yes",1,!0),r("No",0)],n.buttons==t.YES_NO_CANCEL&&i.push(r("Cancel",-1));break;default:i=[r("Ok",!0,!0)]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:i,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){o(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(Ae,[Te,Re],function(e,t){return function(n){function r(){return s.length?s[s.length-1]:void 0}function i(e){n.fire("OpenWindow",{win:e})}function o(e){n.fire("CloseWindow",{win:e})}var a=this,s=[];a.windows=s,n.on("remove",function(){for(var e=s.length;e--;)s[e].close()}),a.open=function(t,r){var a;return n.editorManager.setActive(n),t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body,data:t.data,callbacks:t.commands}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){a.find("form")[0].submit()}},{text:"Cancel",onclick:function(){a.close()}}]),a=new e(t),s.push(a),a.on("close",function(){for(var e=s.length;e--;)s[e]===a&&s.splice(e,1);s.length||n.focus(),o(a)}),t.data&&a.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),a.features=t||{},a.params=r||{},1===s.length&&n.nodeChanged(),a=a.renderTo().reflow(),i(a),a},a.alert=function(e,r,a){var s;s=t.alert(e,function(){r?r.call(a||this):n.focus()}),s.on("close",function(){o(s)}),i(s)},a.confirm=function(e,n,r){var a;a=t.confirm(e,function(e){n.call(r||this,e)}),a.on("close",function(){o(a)}),i(a)},a.close=function(){r()&&r().close()},a.getParams=function(){return r()?r().params:null},a.setParams=function(e){r()&&(r().params=e)},a.getWindows=function(){return s}}}),r(Be,[ye,_e],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'" role="presentation"><div class="'+t+'tooltip-arrow"></div><div class="'+t+'tooltip-inner">'+e.encode(e.state.get("text"))+"</div></div>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)}),e._super()},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(De,[ye,Be],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.classes.toggle("tooltip-n","bc-tc"==i),r.classes.toggle("tooltip-nw","bc-tl"==i),r.classes.toggle("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){function e(e){n.aria("disabled",e),n.classes.toggle("disabled",e)}function t(e){n.aria("pressed",e),n.classes.toggle("active",e)}var n=this;return n.state.on("change:disabled",function(t){e(t.value)}),n.state.on("change:active",function(e){t(e.value)}),n.state.get("disabled")&&e(!0),n.state.get("active")&&t(!0),n._super()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(Le,[De],function(e){return e.extend({Defaults:{value:0},init:function(e){var t=this;t._super(e),t.classes.add("progress"),t.settings.filter||(t.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this,t=e._id,n=this.classPrefix;return'<div id="'+t+'" class="'+e.classes+'"><div class="'+n+'bar-container"><div class="'+n+'bar"></div></div><div class="'+n+'text">0%</div></div>'},postRender:function(){var e=this;return e._super(),e.value(e.settings.value),e},bindStates:function(){function e(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}var t=this;return t.state.on("change:value",function(t){e(t.value)}),e(t.state.get("value")),t._super()}})}),r(Me,[ye,_e,Le,u],function(e,t,n,r){return e.extend({Mixins:[t],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||e.timeout>0)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new n),t.on("click",function(e){-1!=e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e=this,t=e.classPrefix,n="",r="",i="",o="";return e.icon&&(n='<i class="'+t+"ico "+t+"i-"+e.icon+'"></i>'),e.color&&(o=' style="background-color: '+e.color+'"'),e.closeButton&&(r='<button type="button" class="'+t+'close" aria-hidden="true">\xd7</button>'),e.progressBar&&(i=e.progressBar.renderHtml()),'<div id="'+e._id+'" class="'+e.classes+'"'+o+' role="presentation">'+n+'<div class="'+t+'notification-inner">'+e.state.get("text")+"</div>"+i+r+"</div>"},postRender:function(){var e=this;return r.setTimeout(function(){e.$el.addClass(e.classPrefix+"in")}),e._super()},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().childNodes[1].innerHTML=t.value}),e.progressBar&&e.progressBar.bindStates(),e._super()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||e.remove(),e},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(Pe,[Me,u],function(e,t){return function(n){function r(){return l.length?l[l.length-1]:void 0}function i(){t.requestAnimationFrame(function(){o(),a()})}function o(){for(var e=0;e<l.length;e++)l[e].moveTo(0,0)}function a(){if(l.length>0){var e=l.slice(0,1)[0],t=n.inline?n.getElement():n.getContentAreaContainer();if(e.moveRel(t,"tc-tc"),l.length>1)for(var r=1;r<l.length;r++)l[r].moveRel(l[r-1].getEl(),"bc-tc")}}var s=this,l=[];s.notifications=l,n.on("remove",function(){for(var e=l.length;e--;)l[e].close()}),n.on("ResizeEditor",a),n.on("ResizeWindow",i),s.open=function(t){var r;return n.editorManager.setActive(n),r=new e(t),l.push(r),t.timeout>0&&(r.timer=setTimeout(function(){r.close()},t.timeout)),r.on("close",function(){var e=l.length;for(r.timer&&n.getWin().clearTimeout(r.timer);e--;)l[e]===r&&l.splice(e,1);a()}),r.renderTo(),a(),r},s.close=function(){r()&&r().close()},s.getNotifications=function(){return l},n.on("SkinLoaded",function(){var e=n.settings.service_message;e&&n.notificationManager.open({text:e,type:"warning",timeout:0,icon:""})})}}),r(Oe,[w],function(e){function t(t,n,r){for(var i=[];n&&n!=t;n=n.parentNode)i.push(e.nodeIndex(n,r));return i}function n(e,t){var n,r,i;for(r=e,n=t.length-1;n>=0;n--){if(i=r.childNodes,t[n]>i.length-1)return null;r=i[t[n]]}return r}return{create:t,resolve:n}}),r(He,[I,T,y,Oe,A,C,d,m,u,k,$,ne],function(e,t,n,r,i,o,a,s,l,c,u,d){return function(f){function h(e,t){try{f.getDoc().execCommand(e,!1,t)}catch(n){}}function p(){var e=f.getDoc().documentMode;return e?e:6}function m(e){return e.isDefaultPrevented()}function g(e){var t,n;e.dataTransfer&&(f.selection.isCollapsed()&&"IMG"==e.target.tagName&&re.select(e.target),t=f.selection.getContent(),t.length>0&&(n=ue+escape(f.id)+","+escape(t),e.dataTransfer.setData(de,n)))}function v(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(de),t&&t.indexOf(ue)>=0)?(t=t.substr(ue.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}function y(e){f.queryCommandSupported("mceInsertClipboardContent")?f.execCommand("mceInsertClipboardContent",!1,{content:e}):f.execCommand("mceInsertContent",!1,e)}function b(){function i(e){var t=C.schema.getBlockElements(),n=f.getBody();if("BR"!=e.nodeName)return!1;for(;e!=n&&!t[e.nodeName];e=e.parentNode)if(e.nextSibling)return!1;return!0}function o(e,t){var n;for(n=e.nextSibling;n&&n!=t;n=n.nextSibling)if((3!=n.nodeType||0!==Z.trim(n.data).length)&&n!==t)return!1;return n===t}function a(e,t,r){var o,a,s;for(s=C.schema.getNonEmptyElements(),o=new n(r||e,e);a=o[t?"next":"prev"]();){if(s[a.nodeName]&&!i(a))return a;if(3==a.nodeType&&a.data.length>0)return a}}function c(e){var n,r,i,o,s;if(!e.collapsed&&(n=C.getParent(t.getNode(e.startContainer,e.startOffset),C.isBlock), r=C.getParent(t.getNode(e.endContainer,e.endOffset),C.isBlock),s=f.schema.getTextBlockElements(),n!=r&&s[n.nodeName]&&s[r.nodeName]&&"false"!==C.getContentEditable(n)&&"false"!==C.getContentEditable(r)))return e.deleteContents(),i=a(n,!1),o=a(r,!0),C.isEmpty(r)||Z(n).append(r.childNodes),Z(r).remove(),i?1==i.nodeType?"BR"==i.nodeName?(e.setStartBefore(i),e.setEndBefore(i)):(e.setStartAfter(i),e.setEndAfter(i)):(e.setStart(i,i.data.length),e.setEnd(i,i.data.length)):o&&(1==o.nodeType?(e.setStartBefore(o),e.setEndBefore(o)):(e.setStart(o,0),e.setEnd(o,0))),x.setRng(e),!0}function u(e,n){var r,i,s,l,c,u;if(!e.collapsed)return e;if(c=e.startContainer,u=e.startOffset,3==c.nodeType)if(n){if(u<c.data.length)return e}else if(u>0)return e;if(r=t.getNode(e.startContainer,e.startOffset),s=C.getParent(r,C.isBlock),i=a(f.getBody(),n,r),l=C.getParent(i,C.isBlock),!r||!i)return e;if(l&&s!=l)if(n){if(!o(s,l))return e;1==r.nodeType?"BR"==r.nodeName?e.setStartBefore(r):e.setStartAfter(r):e.setStart(r,r.data.length),1==i.nodeType?e.setEnd(i,0):e.setEndBefore(i)}else{if(!o(l,s))return e;1==i.nodeType?"BR"==i.nodeName?e.setStartBefore(i):e.setStartAfter(i):e.setStart(i,i.data.length),1==r.nodeType?e.setEnd(r,0):e.setEndBefore(r)}return e}function d(e){var t=x.getRng();return t=u(t,e),c(t)?!0:void 0}function h(e,t){function n(e,n){return m=Z(n).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),l=e.cloneNode(!1),m=s.map(m,function(e){return e=e.cloneNode(!1),l.hasChildNodes()?(e.appendChild(l.firstChild),l.appendChild(e)):l.appendChild(e),l.appendChild(e),e}),m.length?(p=C.create("br"),m[0].appendChild(p),C.replace(l,e),t.setStartBefore(p),t.setEndBefore(p),f.selection.setRng(t),p):null}function i(e){return e&&f.schema.getTextBlockElements()[e.tagName]}var o,a,l,c,u,d,h,p,m;if(t.collapsed&&(d=t.startContainer,h=t.startOffset,a=C.getParent(d,C.isBlock),i(a)))if(1==d.nodeType){if(d=d.childNodes[h],d&&"BR"!=d.tagName)return;if(u=e?a.nextSibling:a.previousSibling,C.isEmpty(a)&&i(u)&&C.isEmpty(u)&&n(a,d))return C.remove(u),!0}else if(3==d.nodeType){if(o=r.create(a,d),c=a.cloneNode(!0),d=r.resolve(c,o),e){if(h>=d.data.length)return;d.deleteData(h,1)}else{if(0>=h)return;d.deleteData(h-1,1)}if(C.isEmpty(c))return n(a,d)}}function p(e){var t,n,r;d(e)||(s.each(f.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&f.dom.setAttrib(e,"style",f.dom.getAttrib(e,"style"))}),t=new w(function(){}),t.observe(f.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),f.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),n=f.selection.getRng(),r=n.startContainer.parentNode,s.each(t.takeRecords(),function(e){if(C.isChildOf(e.target,f.getBody())){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}s.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),C.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),f.selection.setRng(n))}})}}),t.disconnect(),s.each(f.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")}))}var b=f.getDoc(),C=f.dom,x=f.selection,w=window.MutationObserver,N,E;w||(N=!0,w=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMSubtreeModified",e,!1),r.removeEventListener("DOMNodeInsertedIntoDocument",e,!1),r.removeEventListener("DOMNodeInserted",e,!1),r.removeEventListener("DOMAttrModified",t,!1)},this.takeRecords=function(){return n}}),f.on("keydown",function(e){var t=e.keyCode==te,n=e.ctrlKey||e.metaKey;if(!m(e)&&(t||e.keyCode==ee)){var r=f.selection.getRng(),i=r.startContainer,o=r.startOffset;if(t&&e.shiftKey)return;if(h(t,r))return void e.preventDefault();if(!n&&r.collapsed&&3==i.nodeType&&(t?o<i.data.length:o>0))return;e.preventDefault(),n&&f.selection.getSel().modify("extend",t?"forward":"backward",e.metaKey?"lineboundary":"word"),p(t)}}),f.on("keypress",function(t){if(!m(t)&&!x.isCollapsed()&&t.charCode>31&&!e.metaKeyPressed(t)){var n,r,i,o,a,s;n=f.selection.getRng(),s=String.fromCharCode(t.charCode),t.preventDefault(),r=Z(n.startContainer).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),p(!0),r=r.filter(function(e,t){return!Z.contains(f.getBody(),t)}),r.length?(i=C.createFragment(),r.each(function(e,t){t=t.cloneNode(!1),i.hasChildNodes()?(t.appendChild(i.firstChild),i.appendChild(t)):(a=t,i.appendChild(t)),i.appendChild(t)}),a.appendChild(f.getDoc().createTextNode(s)),o=C.getParent(n.startContainer,C.isBlock),C.isEmpty(o)?Z(o).empty().append(i):n.insertNode(i),n.setStart(a.firstChild,1),n.setEnd(a.firstChild,1),f.selection.setRng(n)):f.selection.setContent(s)}}),f.addCommand("Delete",function(){p()}),f.addCommand("ForwardDelete",function(){p(!0)}),N||(f.on("dragstart",function(e){E=x.getRng(),g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);n&&(e.preventDefault(),l.setEditorTimeout(f,function(){var r=t.getCaretRangeFromPoint(e.x,e.y,b);E&&(x.setRng(E),E=null),p(),x.setRng(r),y(n.html)}))}}),f.on("cut",function(e){m(e)||!e.clipboardData||f.selection.isCollapsed()||(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",f.selection.getContent()),e.clipboardData.setData("text/plain",f.selection.getContent({format:"text"})),l.setEditorTimeout(f,function(){p(!0)}))}))}function C(){function e(e){var t=ne.create("body"),n=e.cloneContents();return t.appendChild(n),re.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(f.getBody()),t.compareRanges(n,r)}var i=e(n),o=ne.createRng();o.selectNode(f.getBody());var a=e(o);return i===a}f.on("keydown",function(e){var t=e.keyCode,r,i;if(!m(e)&&(t==te||t==ee)){if(r=f.selection.isCollapsed(),i=f.getBody(),r&&!ne.isEmpty(i))return;if(!r&&!n(f.selection.getRng()))return;e.preventDefault(),f.setContent(""),i.firstChild&&ne.isBlock(i.firstChild)?f.selection.setCursorLocation(i.firstChild,0):f.selection.setCursorLocation(i,0),f.nodeChanged()}})}function x(){f.shortcuts.add("meta+a",null,"SelectAll")}function w(){f.settings.content_editable||ne.bind(f.getDoc(),"mousedown mouseup",function(e){var t;if(e.target==f.getDoc().documentElement)if(t=re.getRng(),f.getBody().focus(),"mousedown"==e.type){if(c.isCaretContainer(t.startContainer))return;re.placeCaretAt(e.clientX,e.clientY)}else re.setRng(t)})}function N(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee){if(!f.getBody().getElementsByTagName("hr").length)return;if(re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return ne.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(ne.remove(n),e.preventDefault())}}})}function E(){window.Range.prototype.getClientRects||f.on("mousedown",function(e){if(!m(e)&&"HTML"===e.target.nodeName){var t=f.getBody();t.blur(),l.setEditorTimeout(f,function(){t.focus()})}})}function _(){f.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==ne.getContentEditableParent(t)&&(e.preventDefault(),re.getSel().setBaseAndExtent(t,0,t,1),f.nodeChanged()),"A"==t.nodeName&&ne.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),re.select(t))})}function S(){function e(){var e=ne.getAttribs(re.getStart().cloneNode(!1));return function(){var t=re.getStart();t!==f.getBody()&&(ne.setAttrib(t,"style",null),Q(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!re.isCollapsed()&&ne.getParent(re.getStart(),ne.isBlock)!=ne.getParent(re.getEnd(),ne.isBlock)}f.on("keypress",function(n){var r;return m(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),f.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),ne.bind(f.getDoc(),"cut",function(n){var r;!m(n)&&t()&&(r=e(),l.setEditorTimeout(f,function(){r()}))})}function k(){document.body.setAttribute("role","application")}function T(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee&&re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function R(){p()>7||(h("RespectVisibilityInDesign",!0),f.contentStyles.push(".mceHideBrInPre pre br {display: none}"),ne.addClass(f.getBody(),"mceHideBrInPre"),oe.addNodeFilter("pre",function(e){for(var t=e.length,n,r,o,a;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)o=n[r],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new i("#text",3),o,!0).value="\n"}),ae.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function A(){ne.bind(f.getBody(),"mouseup",function(){var e,t=re.getNode();"IMG"==t.nodeName&&((e=ne.getStyle(t,"width"))&&(ne.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"width","")),(e=ne.getStyle(t,"height"))&&(ne.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"height","")))})}function B(){f.on("keydown",function(t){var n,r,i,o,a;if(!m(t)&&t.keyCode==e.BACKSPACE&&(n=re.getRng(),r=n.startContainer,i=n.startOffset,o=ne.getRoot(),a=r,n.collapsed&&0===i)){for(;a&&a.parentNode&&a.parentNode.firstChild==a&&a.parentNode!=o;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(f.formatter.toggle("blockquote",null,a),n=ne.createRng(),n.setStart(r,0),n.setEnd(r,0),re.setRng(n))}})}function D(){function e(){K(),h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),ie.object_resizing||h("enableObjectResizing",!1)}ie.readonly||f.on("BeforeExecCommand MouseDown",e)}function L(){function e(){Q(ne.select("a"),function(e){var t=e.parentNode,n=ne.getRoot();if(t.lastChild===e){for(;t&&!ne.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}ne.add(t,"br",{"data-mce-bogus":1})}})}f.on("SetContent ExecCommand",function(t){"setcontent"!=t.type&&"mceInsertLink"!==t.command||e()})}function M(){ie.forced_root_block&&f.on("init",function(){h("DefaultParagraphSeparator",ie.forced_root_block)})}function P(){f.on("keydown",function(e){var t;m(e)||e.keyCode!=ee||(t=f.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),f.undoManager.beforeChange(),ne.remove(t.item(0)),f.undoManager.add()))})}function O(){var e;p()>=10&&(e="",Q("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),f.contentStyles.push(e+"{padding-right: 1px !important}"))}function H(){p()<9&&(oe.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),ae.addNodeFilter("noscript",function(e){for(var t=e.length,n,r,a;t--;)n=e[t],r=e[t].firstChild,r?r.value=o.decode(r.value):(a=n.attributes.map["data-mce-innertext"],a&&(n.attr("data-mce-innertext",null),r=new i("#text",3),r.value=a,r.raw=!0,n.append(r)))}))}function I(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),ne.unbind(r,"mouseup",n),ne.unbind(r,"mousemove",t),a=o=0}var r=ne.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,ne.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(ne.bind(r,"mouseup",n),ne.bind(r,"mousemove",t),ne.getRoot().focus(),a.select())}})}function F(){f.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||re.normalize()},!0)}function z(){f.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function U(){f.inline||f.on("keydown",function(){document.activeElement==document.body&&f.getWin().focus()})}function W(){f.inline||(f.contentStyles.push("body {min-height: 150px}"),f.on("click",function(e){var t;if("HTML"==e.target.nodeName){if(a.ie>11)return void f.getBody().focus();t=f.selection.getRng(),f.getBody().focus(),f.selection.setRng(t),f.selection.normalize(),f.nodeChanged()}}))}function V(){a.mac&&f.on("keydown",function(t){!e.metaKeyPressed(t)||t.shiftKey||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),f.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","lineboundary"))})}function $(){h("AutoUrlDetect",!1)}function q(){f.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),f.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function j(){f.on("init",function(){f.dom.bind(f.getBody(),"submit",function(e){e.preventDefault()})})}function Y(){oe.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}function X(){f.on("dragstart",function(e){g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);if(n&&n.id!=f.id){e.preventDefault();var r=t.getCaretRangeFromPoint(e.x,e.y,f.getDoc());re.setRng(r),y(n.html)}}})}function K(){var e,t;G()&&(e=f.getBody(),t=e.parentNode,t.removeChild(e),t.appendChild(e),e.focus())}function G(){var e;return se?(e=f.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}function J(){function t(e){var t=new d(e.getBody()),n=e.selection.getRng(),r=u.fromRangeStart(n),i=u.fromRangeEnd(n);return!e.selection.isCollapsed()&&!t.prev(r)&&!t.next(i)}f.on("keypress",function(n){!m(n)&&!re.isCollapsed()&&n.charCode>31&&!e.metaKeyPressed(n)&&t(f)&&(n.preventDefault(),f.setContent(String.fromCharCode(n.charCode)),f.selection.select(f.getBody(),!0),f.selection.collapse(!1),f.nodeChanged())}),f.on("keydown",function(e){var n=e.keyCode;m(e)||n!=te&&n!=ee||t(f)&&(e.preventDefault(),f.setContent(""),f.nodeChanged())})}var Q=s.each,Z=f.$,ee=e.BACKSPACE,te=e.DELETE,ne=f.dom,re=f.selection,ie=f.settings,oe=f.parser,ae=f.serializer,se=a.gecko,le=a.ie,ce=a.webkit,ue="data:text/mce-internal,",de=le?"Text":"URL";return B(),C(),a.windowsPhone||F(),ce&&(J(),b(),w(),_(),M(),j(),T(),Y(),a.iOS?(U(),W(),q()):x()),le&&a.ie<11&&(N(),k(),R(),A(),P(),O(),H(),I()),a.ie>=11&&(W(),T()),a.ie&&(x(),$(),X()),se&&(J(),N(),E(),S(),D(),L(),z(),V(),T()),{refreshContentEditable:K,isHidden:G}}}),r(Ie,[ue,w,m],function(e,t,n){function r(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=o.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()}function i(e,t){function n(e){return!e.hidden&&!e.readonly}var i=r(e,t),s;if(e.delegates||(e.delegates={}),!e.delegates[t])if(e.settings.event_root){if(a||(a={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&a){for(t in a)e.dom.unbind(r(e,t));a=null}})),a[t])return;s=function(r){for(var i=r.target,a=e.editorManager.editors,s=a.length;s--;){var l=a[s].getBody();(l===i||o.isChildOf(i,l))&&n(a[s])&&a[s].fire(t,r)}},a[t]=s,o.bind(i,t,s)}else s=function(r){n(e)&&e.fire(t,r)},o.bind(i,t,s),e.delegates[t]=s}var o=t.DOM,a,s={bindPendingEventDelegates:function(){var e=this;n.each(e._pendingNativeEvents,function(t){i(e,t)})},toggleNativeEvent:function(e,t){var n=this;"focus"!=e&&"blur"!=e&&(t?n.initialized?i(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(r(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e=this,t;if(e.delegates){for(t in e.delegates)e.dom.unbind(r(e,t),t,e.delegates[t]);delete e.delegates}e.inline||(e.getBody().onload=null,e.dom.unbind(e.getWin()),e.dom.unbind(e.getDoc())),e.dom.unbind(e.getBody()),e.dom.unbind(e.getContainer())}};return s=n.extend({},e,s)}),r(Fe,[],function(){function e(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}}function t(e){var t,n;return t=e.getBody(),n=function(t){e.dom.getParents(t.target,"a").length>0&&t.preventDefault()},e.dom.bind(t,"click",n),{unbind:function(){e.dom.unbind(t,"click",n)}}}function n(n,r){n._clickBlocker&&(n._clickBlocker.unbind(),n._clickBlocker=null),r?(n._clickBlocker=t(n),n.selection.controlSelection.hideResizeRect(),n.readonly=!0,n.getBody().contentEditable=!1):(n.readonly=!1,n.getBody().contentEditable=!0,e(n,"StyleWithCSS",!1),e(n,"enableInlineTableEditing",!1),e(n,"enableObjectResizing",!1),n.focus(),n.nodeChanged())}function r(e,t){var r=e.readonly?"readonly":"design";t!=r&&(e.initialized?n(e,"readonly"==t):e.on("init",function(){n(e,"readonly"==t)}),e.fire("SwitchMode",{mode:t}))}return{setMode:r}}),r(ze,[m,d],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122},o=e.makeMap("alt,ctrl,shift,meta,access");return function(a){function s(e){var a,s,l={};n(r(e,"+"),function(e){e in o?l[e]=!0:/^[0-9]{2,}$/.test(e)?l.keyCode=parseInt(e,10):(l.charCode=e.charCodeAt(0),l.keyCode=i[e]||e.toUpperCase().charCodeAt(0))}),a=[l.keyCode];for(s in o)l[s]?a.push(s):l[s]=!1;return l.id=a.join(","),l.access&&(l.alt=!0,t.mac?l.ctrl=!0:l.shift=!0),l.meta&&(t.mac?l.meta=!0:(l.ctrl=!0,l.meta=!1)),l}function l(t,n,i,o){var l;return l=e.map(r(t,">"),s),l[l.length-1]=e.extend(l[l.length-1],{func:i,scope:o||a}),e.extend(l[0],{desc:a.translate(n),subpatterns:l.slice(1)})}function c(e){return e.altKey||e.ctrlKey||e.metaKey}function u(e){return e.keyCode>=112&&e.keyCode<=123}function d(e,t){return t?t.ctrl!=e.ctrlKey||t.meta!=e.metaKey?!1:t.alt!=e.altKey||t.shift!=e.shiftKey?!1:e.keyCode==t.keyCode||e.charCode&&e.charCode==t.charCode?(e.preventDefault(),!0):!1:!1}function f(e){return e.func?e.func.call(e.scope):null}var h=this,p={},m=[];a.on("keyup keypress keydown",function(e){!c(e)&&!u(e)||e.isDefaultPrevented()||(n(p,function(t){return d(e,t)?(m=t.subpatterns.slice(0),"keydown"==e.type&&f(t),!0):void 0}),d(e,m[0])&&(1===m.length&&"keydown"==e.type&&f(m[0]),m.shift()))}),h.add=function(t,i,o,s){var c;return c=o,"string"==typeof o?o=function(){a.execCommand(c,!1,null)}:e.isArray(c)&&(o=function(){a.execCommand(c[0],c[1],c[2])}),n(r(e.trim(t.toLowerCase())),function(e){var t=l(e,i,o,s);p[t.id]=t}),!0},h.remove=function(e){var t=l(e);return p[t.id]?(delete p[t.id],!0):!1}}}),r(Ue,[c,m,z],function(e,t,n){return function(r,i){function o(e){var t,n;return n={"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"},t=n[e.blob().type.toLowerCase()]||"dat",e.id()+"."+t}function a(e,t){return e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t}function s(e){return{id:e.id,blob:e.blob,base64:e.base64,filename:n.constant(o(e))}}function l(e,t,n,r){var s,l;s=new XMLHttpRequest,s.open("POST",i.url),s.withCredentials=i.credentials,s.upload.onprogress=function(e){r(e.loaded/e.total*100)},s.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+s.status)},s.onload=function(){var e;return 200!=s.status?void n("HTTP Error: "+s.status):(e=JSON.parse(s.responseText),e&&"string"==typeof e.location?void t(a(i.basePath,e.location)):void n("Invalid JSON: "+s.responseText))},l=new FormData,l.append("file",e.blob(),o(e)),s.send(l)}function c(){return new e(function(e){e([])})}function u(e,t){return{url:t,blobInfo:e,status:!0}}function d(e,t){return{url:"",blobInfo:e,status:!1,error:t}}function f(e,n){t.each(y[e],function(e){e(n)}),delete y[e]}function h(t,n,i){return r.markPending(t.blobUri()),new e(function(e){var o,a,l=function(){};try{var c=function(){o&&(o.close(),a=l)},h=function(n){c(),r.markUploaded(t.blobUri(),n),f(t.blobUri(),u(t,n)),e(u(t,n))},p=function(){c(),r.removeFailed(t.blobUri()),f(t.blobUri(),d(t,p)),e(d(t,p))};a=function(e){0>e||e>100||(o||(o=i()),o.progressBar.value(e))},n(s(t),h,p,a)}catch(m){e(d(t,m.message))}})}function p(e){return e===l}function m(t){var n=t.blobUri();return new e(function(e){y[n]=y[n]||[],y[n].push(e)})}function g(n,o){return n=t.grep(n,function(e){return!r.isUploaded(e.blobUri())}),e.all(t.map(n,function(e){return r.isPending(e.blobUri())?m(e):h(e,i.handler,o)}))}function v(e,t){return!i.url&&p(i.handler)?c():g(e,t)}var y={};return i=t.extend({credentials:!1,handler:l},i),{upload:v}}}),r(We,[c],function(e){function t(t){return new e(function(e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="blob",n.onload=function(){200==this.status&&e(this.response)},n.send()})}function n(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}}function r(t){return new e(function(e){var r,i,o;t=n(t);try{r=atob(t.data)}catch(a){return void e(new Blob([]))}for(i=new Uint8Array(r.length),o=0;o<i.length;o++)i[o]=r.charCodeAt(o);e(new Blob([i],{type:t.type}))})}function i(e){return 0===e.indexOf("blob:")?t(e):0===e.indexOf("data:")?r(e):null}function o(t){return new e(function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)})}return{uriToBlob:i,blobToDataUri:o,parseDataUri:n}}),r(Ve,[c,p,z,We,d],function(e,t,n,r,i){var o=0;return function(a,s){function l(l,u){function d(e,t){var n,i;return 0===e.src.indexOf("blob:")?(i=s.getByUri(e.src),void(i&&t({image:e,blobInfo:i}))):(n=r.parseDataUri(e.src).data,i=s.findFirst(function(e){return e.base64()===n}),void(i?t({image:e,blobInfo:i}):r.uriToBlob(e.src).then(function(r){var i="blobid"+o++,a=s.create(i,r,n);s.add(a),t({image:e,blobInfo:a})})))}var f,h;return u||(u=n.constant(!0)),f=t.filter(l.getElementsByTagName("img"),function(e){var t=e.src;return i.fileApi?e.hasAttribute("data-mce-bogus")?!1:e.hasAttribute("data-mce-placeholder")?!1:t&&t!=i.transparentSrc?0===t.indexOf("blob:")?!a.isUploaded(t):0===t.indexOf("data:")?u(e):!1:!1:!1}),h=t.map(f,function(t){var n;return c[t.src]?new e(function(e){c[t.src].then(function(n){e({image:t,blobInfo:n.blobInfo})})}):(n=new e(function(e){d(t,e)}).then(function(e){return delete c[e.image.src],e})["catch"](function(e){return delete c[t.src],e}),c[t.src]=n,n)}),e.all(h)}var c={};return{findAll:l}}}),r($e,[p,z],function(e,t){return function(){function n(e,t,n){return{id:u(e),blob:u(t),base64:u(n),blobUri:u(URL.createObjectURL(t))}}function r(e){i(e.id())||c.push(e)}function i(e){return o(function(t){return t.id()===e})}function o(t){return e.filter(c,t)[0]}function a(e){return o(function(t){return t.blobUri()==e})}function s(t){c=e.filter(c,function(e){return e.blobUri()===t?(URL.revokeObjectURL(e.blobUri()),!1):!0})}function l(){e.each(c,function(e){URL.revokeObjectURL(e.blobUri())}),c=[]}var c=[],u=t.constant;return{create:n,add:r,get:i,getByUri:a,findFirst:o,removeByUri:s,destroy:l}}}),r(qe,[],function(){return function(){function e(e,t){return{status:e,resultUri:t}}function t(e){return e in d}function n(e){var t=d[e];return t?t.resultUri:null}function r(e){return t(e)?d[e].status===c:!1}function i(e){return t(e)?d[e].status===u:!1}function o(t){d[t]=e(c,null)}function a(t,n){d[t]=e(u,n)}function s(e){delete d[e]}function l(){d={}}var c=1,u=2,d={};return{hasBlobUri:t,getResultUri:n,isPending:r,isUploaded:i,markPending:o,markUploaded:a,removeFailed:s,destroy:l}}}),r(je,[p,Ue,Ve,$e,qe],function(e,t,n,r,i){return function(o){function a(e){return function(t){return o.selection?e(t):[]}}function s(e,t,n){var r=0;do r=e.indexOf(t,r),-1!==r&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1);while(-1!==r);return e}function l(e,t,n){return e=s(e,'src="'+t+'"','src="'+n+'"'),e=s(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')}function c(t,n){e.each(o.undoManager.data,function(e){e.content=l(e.content,t,n)})}function u(){return o.notificationManager.open({text:o.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}function d(e,t){y.removeByUri(e.src),c(e.src,t),o.$(e).attr({src:t,"data-mce-src":o.convertURL(t,"src")})}function f(n){return b||(b=new t(w,{url:x.images_upload_url,basePath:x.images_upload_base_path,credentials:x.images_upload_credentials,handler:x.images_upload_handler})),m().then(a(function(t){var r;return r=e.map(t,function(e){return e.blobInfo}),b.upload(r,u).then(a(function(r){return r=e.map(r,function(e,n){var r=t[n].image;return e.status&&o.settings.images_replace_blob_uris!==!1&&d(r,e.url),{element:r,status:e.status}}),n&&n(r),r}))}))}function h(e){return x.automatic_uploads!==!1?f(e):void 0}function p(e){return x.images_dataimg_filter?x.images_dataimg_filter(e):!0}function m(){return C||(C=new n(w,y)),C.findAll(o.getBody(),p).then(a(function(t){return e.each(t,function(e){c(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),t}))}function g(){y.destroy(),w.destroy(),C=b=null}function v(t){return t.replace(/src="(blob:[^"]+)"/g,function(t,n){var r=w.getResultUri(n);if(r)return'src="'+r+'"';var i=y.getByUri(n);return i||(i=e.reduce(o.editorManager.editors,function(e,t){return e||t.editorUpload.blobCache.getByUri(n)},null)),i?'src="data:'+i.blob().type+";base64,"+i.base64()+'"':t})}var y=new r,b,C,x=o.settings,w=new i;return o.on("setContent",function(){o.settings.automatic_uploads!==!1?h():m()}),o.on("RawSaveContent",function(e){e.content=v(e.content)}),o.on("getContent",function(e){e.source_view||"raw"==e.format||(e.content=v(e.content))}),o.on("PostRender",function(){o.parser.addNodeFilter("img",function(t){e.each(t,function(e){var t=e.attr("src");if(!y.getByUri(t)){var n=w.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:y,uploadImages:f,uploadImagesAuto:h,scanForImages:m,destroy:g}}}),r(Ye,[k,$,_,T,g,W,u],function(e,t,n,r,i,o,a){var s=n.isContentEditableFalse;return function(t,n){function r(e,n){var r=o.collapse(e.getBoundingClientRect(),n),i,a,s,l,c;return"BODY"==t.tagName?(i=t.ownerDocument.documentElement,a=t.scrollLeft||i.scrollLeft,s=t.scrollTop||i.scrollTop):(c=t.getBoundingClientRect(),a=t.scrollLeft-c.left,s=t.scrollTop-c.top),r.left+=a,r.right+=a,r.top+=s,r.bottom+=s,r.width=1,l=e.offsetWidth-e.clientWidth,l>0&&(n&&(l*=-1),r.left+=l,r.right+=l),r}function l(){var n,r,o,a,s;for(n=i("*[contentEditable=false]",t),a=0;a<n.length;a++)r=n[a],o=r.previousSibling,e.endsWithCaretContainer(o)&&(s=o.data,1==s.length?o.parentNode.removeChild(o):o.deleteData(s.length-1,1)),o=r.nextSibling,e.startsWithCaretContainer(o)&&(s=o.data,1==s.length?o.parentNode.removeChild(o):o.deleteData(0,1));return null}function c(o,a){var l,c,f;return u(),n(a)?(g=e.insertBlock("p",a,o),l=r(a,o),i(g).css("top",l.top),m=i('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(l).appendTo(t),o&&m.addClass("mce-visual-caret-before"),d(),c=a.ownerDocument.createRange(),f=g.firstChild,c.setStart(f,0),c.setEnd(f,1),c):(g=e.insertInline(a,o),c=a.ownerDocument.createRange(),s(g.nextSibling)?(c.setStart(g,0),c.setEnd(g,0)):(c.setStart(g,1),c.setEnd(g,1)),c)}function u(){l(),g&&(e.remove(g),g=null),m&&(m.remove(),m=null),clearInterval(p)}function d(){p=a.setInterval(function(){i("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden")},500)}function f(){a.clearInterval(p)}function h(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"}var p,m,g;return{show:c,hide:u,getCss:h,destroy:f}}}),r(Xe,[p,_,W],function(e,t,n){function r(i){function o(t){return e.map(t,function(e){return e=n.clone(e),e.node=i,e})}if(e.isArray(i))return e.reduce(i,function(e,t){return e.concat(r(t))},[]);if(t.isElement(i))return o(i.getClientRects());if(t.isText(i)){var a=i.ownerDocument.createRange();return a.setStart(i,0),a.setEnd(i,i.data.length),o(a.getClientRects())}}return{getClientRects:r}}),r(Ke,[z,p,Xe,U,te,ne,$,W],function(e,t,n,r,i,o,a,s){function l(e,t,n,o){for(;o=i.findNode(o,e,r.isEditableCaretCandidate,t);)if(n(o))return}function c(e,r,i,o,a,s){function c(o){var s,l,c;for(c=n.getClientRects(o),-1==e&&(c=c.reverse()),s=0;s<c.length;s++)if(l=c[s],!i(l,h)){if(f.length>0&&r(l,t.last(f))&&u++,l.line=u,a(l))return!0;f.push(l)}}var u=0,d,f=[],h;return(h=t.last(s.getClientRects()))?(d=s.getNode(),c(d),l(e,o,c,d),f):f}function u(e,t){return t.line>e}function d(e,t){return t.line===e}function f(e,n,r,i){function l(n){return 1==e?t.last(n.getClientRects()):t.last(n.getClientRects())}var c=new o(n),u,d,f,h,p=[],m=0,g,v;1==e?(u=c.next,d=s.isBelow,f=s.isAbove,h=a.after(i)):(u=c.prev,d=s.isAbove,f=s.isBelow,h=a.before(i)),v=l(h);do if(h.isVisible()&&(g=l(h),!f(g,v))){if(p.length>0&&d(g,t.last(p))&&m++,g=s.clone(g),g.position=h,g.line=m,r(g))return p;p.push(g)}while(h=u(h));return p}var h=e.curry,p=h(c,-1,s.isAbove,s.isBelow),m=h(c,1,s.isBelow,s.isAbove);return{upUntil:p,downUntil:m,positionsUntil:f,isAboveLine:h(u),isLine:h(d)}}),r(Ge,[z,p,_,Xe,W,te,U],function(e,t,n,r,i,o,a){function s(e,t){return Math.abs(e.left-t)}function l(e,t){return Math.abs(e.right-t)}function c(e,n){function r(e,t){return e>=t.left&&e<=t.right}return t.reduce(e,function(e,t){var i,o;return i=Math.min(s(e,n),l(e,n)),o=Math.min(s(t,n),l(t,n)),r(n,t)?t:r(n,e)?e:o==i&&m(t.node)?t:i>o?t:e})}function u(e,t,n,r){for(;r=g(r,e,a.isEditableCaretCandidate,t);)if(n(r))return}function d(e,n){function o(e,i){var o;return o=t.filter(r.getClientRects(i),function(t){return!e(t,n)}),a=a.concat(o),0===o.length}var a=[];return a.push(n),u(-1,e,v(o,i.isAbove),n.node),u(1,e,v(o,i.isBelow),n.node),a}function f(e){return t.filter(t.toArray(e.getElementsByTagName("*")),m)}function h(e,t){return{node:e.node,before:s(e,t)<l(e,t)}}function p(e,n,i){var o,a;return o=r.getClientRects(f(e)),o=t.filter(o,function(e){return i>=e.top&&i<=e.bottom}),a=c(o,n),a&&(a=c(d(e,a),n),a&&m(a.node))?h(a,n):null}var m=n.isContentEditableFalse,g=o.findNode,v=e.curry;return{findClosestClientRect:c,findLineNodeRects:d,closestCaret:p}}),r(Je,[],function(){var e=function(e){var t,n,r,i;return i=e.getBoundingClientRect(),t=e.ownerDocument,n=t.documentElement,r=t.defaultView,{top:i.top+r.pageYOffset-n.clientTop,left:i.left+r.pageXOffset-n.clientLeft}},t=function(t){return t.inline?e(t.getBody()):{left:0,top:0}},n=function(e){var t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}},r=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},i={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:i},i=function(t,n){if(n.target.ownerDocument!==t.getDoc()){var i=e(t.getContentAreaContainer()),o=r(t);return{left:n.pageX-i.left+o.left,top:n.pageY-i.top+o.top}}return{left:n.pageX,top:n.pageY}},o=function(e,t,n){return{pageX:n.left-e.left+t.left,pageY:n.top-e.top+t.top}},a=function(e,r){return o(t(e),n(e),i(e,r))};return{calc:a}}),r(Qe,[_,p,z,u,w,Je],function(e,t,n,r,i,o){var a=e.isContentEditableFalse,s=e.isContentEditableTrue,l=function(e){return a(e)},c=function(e,t,n){return t===n||e.dom.isChildOf(t,n)?!1:!a(t)},u=function(e){var t=e.cloneNode(!0);return t.removeAttribute("data-mce-selected"),t},d=function(e,t,n,r){var i=t.cloneNode(!0);e.dom.setStyles(i,{width:n,height:r}),e.dom.setAttrib(i,"data-mce-selected",null);var o=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(o,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(i,{margin:0,boxSizing:"border-box"}),o.appendChild(i),o},f=function(e,t){e.parentNode!==t&&t.appendChild(e)},h=function(e,t,n,r,i,o){var a=0,s=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>i&&(a=t.pageX+n-i), t.pageY+r>o&&(s=t.pageY+r-o),e.style.width=n-a+"px",e.style.height=r-s+"px"},p=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},m=function(e){return 0===e.button},g=function(e){return e.element},v=function(e,t){return{pageX:t.pageX-e.relX,pageY:t.pageY+5}},y=function(e,r){return function(i){if(m(i)){var o=t.find(r.dom.getParents(i.target),n.or(a,s));if(l(o)){var c=r.dom.getPos(o),u=r.getBody(),f=r.getDoc().documentElement;e.element=o,e.screenX=i.screenX,e.screenY=i.screenY,e.maxX=(r.inline?u.scrollWidth:f.offsetWidth)-2,e.maxY=(r.inline?u.scrollHeight:f.offsetHeight)-2,e.relX=i.pageX-c.x,e.relY=i.pageY-c.y,e.width=o.offsetWidth,e.height=o.offsetHeight,e.ghost=d(r,o,e.width,e.height)}}}},b=function(e,t){var n=r.throttle(function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n)},0);return function(r){var i=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(g(e)&&!e.dragging&&i>10){var a=t.fire("dragstart",{target:e.element});if(a.isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){var s=v(e,o.calc(t,r));f(e.ghost,t.getBody()),h(e.ghost,s,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY)}}},C=function(e,t){return function(n){if(e.dragging&&c(t,t.selection.getNode(),e.element)){var r=u(e.element),i=t.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});i.isDefaultPrevented()||(r=i.targetClone,t.undoManager.transact(function(){p(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret()}))}w(e)}},x=function(e,t){return function(){w(e),e.dragging&&t.fire("dragend")}},w=function(e){e.dragging=!1,e.element=null,p(e.ghost)},N=function(e){var t={},n,r,o,a,s,l;n=i.DOM,l=document,r=y(t,e),o=b(t,e),a=C(t,e),s=x(t,e),e.on("mousedown",r),e.on("mousemove",o),e.on("mouseup",a),n.bind(l,"mousemove",o),n.bind(l,"mouseup",s),e.on("remove",function(){n.unbind(l,"mousemove",o),n.unbind(l,"mouseup",s)})},E=function(e){e.on("drop",function(t){var n="undefined"!=typeof t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(a(n)||a(e.dom.getContentEditableParent(n)))&&t.preventDefault()})},_=function(e){N(e),E(e)};return{init:_}}),r(Ze,[d,ne,$,k,te,Ye,Ke,Ge,_,T,W,I,z,p,u,Qe,S],function(e,t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g){function v(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function y(c){function y(){var e=c.dom.get(le);return e?e.getElementsByTagName("*")[0]:e}function S(e){return c.dom.isBlock(e)}function k(e){e&&c.selection.setRng(e)}function T(){return c.selection.getRng()}function R(e,t){c.selection.scrollIntoView(e,t)}function A(e,t,n){var r;return r=c.fire("ShowCaret",{target:t,direction:e,before:n}),r.isDefaultPrevented()?null:(R(t,-1===e),se.show(n,t))}function B(e){var t;return se.hide(),t=c.fire("BeforeObjectSelected",{target:e}),t.isDefaultPrevented()?null:D(e)}function D(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}function L(e,t){var n=i.isInSameBlock(e,t);return!n&&l.isBr(e.getNode())?!0:n}function M(e,t){return t=i.normalizeRange(e,re,t),-1==e?n.fromRangeStart(t):n.fromRangeEnd(t)}function P(e){return r.isCaretContainerBlock(e.startContainer)}function O(e,t,n,r){var i,o,a,s;return!r.collapsed&&(i=_(r),x(i))?A(e,i,-1==e):(s=P(r),o=M(e,r),n(o)?B(o.getNode(-1==e)):(o=t(o))?n(o)?A(e,o.getNode(-1==e),1==e):(a=t(o),n(a)&&L(o,a)?A(e,a.getNode(-1==e),1==e):s?$(o.toRange()):null):s?r:null)}function H(e,t,n){var r,i,o,l,c,u,d,f,p;if(p=_(n),r=M(e,n),i=t(re,a.isAboveLine(1),r),o=h.filter(i,a.isLine(1)),c=h.last(r.getClientRects()),E(r)&&(p=r.getNode()),N(r)&&(p=r.getNode(!0)),!c)return null;if(u=c.left,l=s.findClosestClientRect(o,u),l&&x(l.node))return d=Math.abs(u-l.left),f=Math.abs(u-l.right),A(e,l.node,f>d);if(p){var m=a.positionsUntil(e,re,a.isAboveLine(1),p);if(l=s.findClosestClientRect(h.filter(m,a.isLine(1)),u))return $(l.position.toRange());if(l=h.last(h.filter(m,a.isLine(0))))return $(l.position.toRange())}}function I(t,r){function i(){var t=c.dom.create(c.settings.forced_root_block);return(!e.ie||e.ie>=11)&&(t.innerHTML='<br data-mce-bogus="1">'),t}var o,a,s;if(r.collapsed&&c.settings.forced_root_block){if(o=c.dom.getParent(r.startContainer,"PRE"),!o)return;a=1==t?oe(n.fromRangeStart(r)):ae(n.fromRangeStart(r)),a||(s=i(),1==t?c.$(o).after(s):c.$(o).before(s),c.selection.select(s,!0),c.selection.collapse())}}function F(e,t,n,r){var i;return(i=O(e,t,n,r))?i:(i=I(e,r),i?i:null)}function z(e,t,n){var r;return(r=H(e,t,n))?r:(r=I(e,n),r?r:null)}function U(){return ue("*[data-mce-caret]")[0]}function W(e){e=ue(e),e.attr("data-mce-caret")&&(se.hide(),e.removeAttr("data-mce-caret"),e.removeAttr("data-mce-bogus"),e.removeAttr("style"),k(T()),R(e[0]))}function V(e){var t,r;return e=i.normalizeRange(1,re,e),t=n.fromRangeStart(e),x(t.getNode())?A(1,t.getNode(),!t.isAtEnd()):x(t.getNode(!0))?A(1,t.getNode(!0),!1):(r=c.dom.getParent(t.getNode(),f.or(x,C)),x(r)?A(1,r,!1):(se.hide(),null))}function $(e){var t;return e&&e.collapsed?(t=V(e),t?t:e):e}function q(e){var t,i,o,a;return x(e)?(x(e.previousSibling)&&(o=e.previousSibling),i=ae(n.before(e)),i||(t=oe(n.after(e))),t&&w(t.getNode())&&(a=t.getNode()),r.remove(e.previousSibling),r.remove(e.nextSibling),c.dom.remove(e),ee(),c.dom.isEmpty(c.getBody())?(c.setContent(""),void c.focus()):o?n.after(o).toRange():a?n.before(a).toRange():i?i.toRange():t?t.toRange():null):null}function j(e){var t=c.schema.getTextBlockElements();return e.nodeName in t}function Y(e){return c.dom.isEmpty(e)}function X(e,t,r){var i=c.dom,o,a,s,l;if(o=i.getParent(t.getNode(),i.isBlock),a=i.getParent(r.getNode(),i.isBlock),-1===e){if(l=r.getNode(!0),N(r)&&S(l))return j(o)?(Y(o)&&i.remove(o),n.after(l).toRange()):q(r.getNode(!0))}else if(l=t.getNode(),E(t)&&S(l))return j(a)?(Y(a)&&i.remove(a),n.before(l).toRange()):q(t.getNode());if(o===a||!j(o)||!j(a))return null;for(;s=o.firstChild;)a.appendChild(s);return c.dom.remove(o),r.toRange()}function K(e,t,n,i){var o,a,s,l;return!i.collapsed&&(o=_(i),x(o))?$(q(o)):(a=M(e,i),n(a)&&r.isCaretContainerBlock(i.startContainer)?(l=-1==e?ie.prev(a):ie.next(a),l?$(l.toRange()):i):t(a)?$(q(a.getNode(-1==e))):(s=-1==e?ie.prev(a):ie.next(a),t(s)?-1===e?X(e,a,s):X(e,s,a):void 0))}function G(){function r(e,t){var n=t(T());n&&!e.isDefaultPrevented()&&(e.preventDefault(),k(n))}function i(e){for(var t=c.getBody();e&&e!=t;){if(C(e)||x(e))return e;e=e.parentNode}return null}function o(e,t,n){return n.collapsed?!1:h.reduce(n.getClientRects(),function(n,r){return n||u.containsXY(r,e,t)},!1)}function l(e){var t=!1;e.on("touchstart",function(){t=!1}),e.on("touchmove",function(){t=!0}),e.on("touchend",function(e){var n=i(e.target);x(n)?t||(e.preventDefault(),Z(B(n))):ee()})}function f(){var e,t=i(c.selection.getNode());C(t)&&S(t)&&c.dom.isEmpty(t)&&(e=c.dom.create("br",{"data-mce-bogus":"1"}),c.$(t).empty().append(e),c.selection.setRng(n.before(e).toRange()))}function g(e){var t=U();if(t)return"compositionstart"==e.type?(e.preventDefault(),e.stopPropagation(),void W(t)):void(" "!=t.innerHTML&&W(t))}function v(e){var t;switch(e.keyCode){case d.DELETE:t=f();break;case d.BACKSPACE:t=f()}t&&e.preventDefault()}var w=b(F,1,oe,E),_=b(F,-1,ae,N),R=b(K,1,E,N),D=b(K,-1,N,E),L=b(z,-1,a.upUntil),M=b(z,1,a.downUntil);c.on("mouseup",function(){var e=T();e.collapsed&&k(V(e))}),c.on("click",function(e){var t;t=i(e.target),t&&x(t)&&(e.preventDefault(),c.focus())});var P=function(e){var r=new t(e);if(!e.firstChild)return!1;var i=n.before(e.firstChild),o=r.next(i);return o&&!E(o)&&!N(o)},O=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n===r},H=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n&&!O(n,r)&&P(n)};l(c),c.on("mousedown",function(e){var t;if(t=i(e.target))x(t)?(e.preventDefault(),Z(B(t))):(ee(),o(e.clientX,e.clientY,c.selection.getRng())||c.selection.placeCaretAt(e.clientX,e.clientY));else{ee(),se.hide();var n=s.closestCaret(re,e.clientX,e.clientY);n&&(H(e.target,n.node)||(e.preventDefault(),c.getBody().focus(),k(A(1,n.node,n.before))))}}),c.on("keydown",function(e){if(!d.modifierPressed(e))switch(e.keyCode){case d.RIGHT:r(e,w);break;case d.DOWN:r(e,M);break;case d.LEFT:r(e,_);break;case d.UP:r(e,L);break;case d.DELETE:r(e,R);break;case d.BACKSPACE:r(e,D);break;default:x(c.selection.getNode())&&e.preventDefault()}}),c.on("keyup compositionstart",function(e){g(e),v(e)},!0),c.on("cut",function(){var e=c.selection.getNode();x(e)&&p.setEditorTimeout(c,function(){k($(q(e)))})}),c.on("getSelectionRange",function(e){var t=e.range;if(ce){if(!ce.parentNode)return void(ce=null);t=t.cloneRange(),t.selectNode(ce),e.range=t}}),c.on("setSelectionRange",function(e){var t;t=Z(e.range),t&&(e.range=t)}),c.on("focus",function(){p.setEditorTimeout(c,function(){c.selection.setRng($(c.selection.getRng()))},0)}),c.on("copy",function(t){var n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!e.ie){var r=y();r&&(t.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),m.init(c)}function J(){var e=c.contentStyles,t=".mce-content-body";e.push(se.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")}function Q(e){return r.isCaretContainer(e.startContainer)||r.isCaretContainer(e.endContainer)}function Z(t){var n,r=c.$,i=c.dom,o,a,s,l,u,d,f,h,p;if(!t)return ee(),null;if(t.collapsed){if(ee(),!Q(t)){if(f=M(1,t),x(f.getNode()))return A(1,f.getNode(),!f.isAtEnd());if(x(f.getNode(!0)))return A(1,f.getNode(!0),!1)}return null}return s=t.startContainer,l=t.startOffset,u=t.endOffset,3==s.nodeType&&0==l&&x(s.parentNode)&&(s=s.parentNode,l=i.nodeIndex(s),s=s.parentNode),1!=s.nodeType?(ee(),null):(u==l+1&&(n=s.childNodes[l]),x(n)?(h=p=n.cloneNode(!0),d=c.fire("ObjectSelected",{target:n,targetClone:h}),d.isDefaultPrevented()?(ee(),null):(h=d.targetClone,o=r("#"+le),0===o.length&&(o=r('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",le),o.appendTo(c.getBody())),t=c.dom.createRng(),h===p&&e.ie?(o.empty().append(g.ZWSP).append(h).append(g.ZWSP),t.setStart(o[0].firstChild,0),t.setEnd(o[0].lastChild,1)):(o.empty().append("\xa0").append(h).append("\xa0"),t.setStart(o[0].firstChild,1),t.setEnd(o[0].lastChild,0)),o.css({top:i.getPos(n,c.getBody()).y}),o[0].focus(),a=c.selection.getSel(),a.removeAllRanges(),a.addRange(t),c.$("*[data-mce-selected]").removeAttr("data-mce-selected"),n.setAttribute("data-mce-selected",1),ce=n,t)):(ee(),null))}function ee(){ce&&(ce.removeAttribute("data-mce-selected"),c.$("#"+le).remove(),ce=null)}function te(){se.destroy(),ce=null}function ne(){se.hide()}var re=c.getBody(),ie=new t(re),oe=b(v,ie.next),ae=b(v,ie.prev),se=new o(c.getBody(),S),le="sel-"+c.dom.uniqueId(),ce,ue=c.$;return e.ceFalse&&(G(),J()),{showBlockCaretContainer:W,hideFakeCaret:ne,destroy:te}}var b=f.curry,C=l.isContentEditableTrue,x=l.isContentEditableFalse,w=l.isElement,N=i.isAfterContentEditableFalse,E=i.isBeforeContentEditableFalse,_=c.getSelectedNode;return y}),r(et,[],function(){var e=0,t=function(){var e=function(){return Math.round(4294967295*Math.random()).toString(36)},t=(new Date).getTime();return"s"+t.toString(36)+e()+e()+e()},n=function(n){return n+e++ +t()};return{uuid:n}}),r(tt,[w,g,E,R,A,O,P,Y,J,Q,Z,ee,oe,ae,N,f,Ae,Pe,B,L,He,d,m,u,Ie,Fe,ze,je,Ze,et],function(e,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A){function B(e,t,i){var o=this,a,s,l;a=o.documentBaseUrl=i.documentBaseURL,s=i.baseURI,l=i.defaultSettings,t=P({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:a,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o,ie7_compat:!0},l,t),l&&l.external_plugins&&t.external_plugins&&(t.external_plugins=P({},l.external_plugins,t.external_plugins)),o.settings=t,r.language=t.language||"en",r.languageLoad=t.language_load,r.baseURL=i.baseURL,o.id=t.id=e,o.setDirty(!1),o.plugins={},o.documentBaseURI=new p(t.document_base_url||a,{base_uri:s}),o.baseURI=s,o.contentCSS=[],o.contentStyles=[],o.shortcuts=new k(o),o.loadedCSS={},o.editorCommands=new h(o),t.target&&(o.targetElm=t.target),o.suffix=i.suffix,o.editorManager=i,o.inline=t.inline,o.settings.content_editable=o.inline,t.cache_suffix&&(w.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),t.override_viewport===!1&&(w.overrideViewPort=!1),i.fire("SetupEditor",o),o.execCallback("setup",o),o.$=n.overrideDefaults(function(){return{context:o.inline?o.getBody():o.getDoc(),element:o.getBody()}})}var D=e.DOM,L=r.ThemeManager,M=r.PluginManager,P=N.extend,O=N.each,H=N.explode,I=N.inArray,F=N.trim,z=N.resolve,U=g.Event,W=w.gecko,V=w.ie;return B.prototype={render:function(){function e(){D.unbind(window,"ready",e),n.render()}function t(){var e=m.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!L.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",L.load(r.theme,t)}N.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),O(r.external_plugins,function(e,t){M.load(t,e),r.plugins+=" "+t}),O(r.plugins.split(/[ ,]/),function(e){if(e=F(e),e&&!M.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=M.dependencies(e);O(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=M.createUrl(t,e),M.load(e.resource,e)})}else M.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!U.domLoaded)return void D.bind(window,"ready",e);if(n.getElement()&&w.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||D.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(D.insertAfter(D.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},D.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.setDirty(!1),a._mceOldSubmit(a)})),n.windowManager=new v(n),n.notificationManager=new y(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=D.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),n.editorManager.add(n),t()}},init:function(){function e(n){var r=M.get(n),i,o;if(i=M.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=F(n),r&&-1===I(m,n)){if(O(M.dependencies(n),function(t){e(t)}),t.plugins[n])return;o=new r(t,i,t.$),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n))}}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,h,p,m=[];if(t.rtl=n.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(n.language),n.aria_label=n.aria_label||D.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=L.get(n.theme),t.theme=new c(t,L.urls[n.theme]),t.theme.init&&t.theme.init(t,L.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""),t.$)):t.theme=n.theme),O(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,h=/^[0-9\.]+(|px)$/i,h.test(""+i)&&(i=Math.max(parseInt(i,10),100)),h.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&O(H(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();if(t.iframeHTML=n.doctype+"<html><head>",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+='<base href="'+t.documentBaseURI.getURI()+'" />'),!w.caretAfter&&n.ie7_compat&&(t.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'),t.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',!/#$/.test(document.location.href))for(p=0;p<t.contentCSS.length;p++){var g=t.contentCSS[p];t.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+N._addCacheSuffix(g)+'" />',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),n.content_security_policy&&(t.iframeHTML+='<meta http-equiv="Content-Security-Policy" content="'+n.content_security_policy+'" />'),t.iframeHTML+='</head><body id="'+d+'" class="mce-content-body '+f+'" data-id="'+t.id+'"><br></body></html>';var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';document.domain!=location.hostname&&w.ie&&w.ie<12&&(u=v);var y=D.create("iframe",{id:t.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}});if(y.onload=function(){y.onload=null,t.fire("load")},D.setAttrib(y,"src",u||'javascript:""'),t.contentAreaContainer=l.iframeContainer,t.iframeElement=y,s=D.add(l.iframeContainer,y),V)try{t.getDoc()}catch(b){s.src=u=v}l.editorContainer&&(D.get(l.editorContainer).style.display=t.orgDisplay,t.hidden=D.isHidden(l.editorContainer)),t.getElement().style.display="none",D.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,r=n.settings,s=n.getElement(),h=n.getDoc(),p,m;r.inline||(n.getElement().style.visibility=n.orgVisibility),t||r.content_editable||(h.open(),h.write(n.iframeHTML),h.close()),r.content_editable&&(n.on("remove",function(){var e=this.getBody();D.removeClass(e,"mce-content-body"),D.removeClass(e,"mce-edit-focus"),D.setAttrib(e,"contentEditable",null)}),D.addClass(s,"mce-content-body"),n.contentDocument=h=r.content_document||document,n.contentWindow=r.content_window||window,n.bodyElement=s,r.content_document=r.content_window=null,r.root_name=s.nodeName.toLowerCase()),p=n.getBody(),p.disabled=!0,n.readonly=r.readonly,n.readonly||(n.inline&&"static"==D.getStyle(p,"position",!0)&&(p.style.position="relative"),p.contentEditable=n.getParam("content_editable_state",!0)),p.disabled=!1,n.editorUpload=new T(n),n.schema=new b(r),n.dom=new e(h,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:n.inline?n.getBody():null,collect:r.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new C(r,n.schema),n.parser.addAttributeFilter("src,href,style,tabindex",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)if(i=e[r],a=i.attr(t),s="data-mce-"+t,!i.attributes.map[s]){if(0===a.indexOf("data:")||0===a.indexOf("blob:"))continue;"style"===t?(a=o.serializeStyle(o.parseStyle(a),i.name),a.length||(a=null),i.attr(s,a),i.attr(t,a)):"tabindex"===t?(i.attr(s,a),i.attr(t,null)):i.attr(s,n.convertURL(a,t,i.name))}}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("type")||"no/type",0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,r,i=n.schema.getNonEmptyElements();t--;)r=e[t],r.isEmpty(i)&&(r.append(new o("br",1)).shortEnded=!0)}),n.serializer=new a(r,n),n.selection=new l(n.dom,n.getWin(),n.serializer,n),n.formatter=new c(n),n.undoManager=new u(n),n.forceBlocks=new f(n),n.enterKey=new d(n),n._nodeChangeDispatcher=new i(n),n._selectionOverrides=new R(n),n.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(h.body.spellcheck=!1,D.setAttrib(p,"spellcheck","false")),n.quirks=new x(n),n.fire("PostRender"),r.directionality&&(p.dir=r.directionality),r.nowrap&&(p.style.whiteSpace="nowrap"),r.protect&&n.on("BeforeSetContent",function(e){O(r.protect,function(t){e.content=e.content.replace(t,function(e){return"<!--mce:protected "+escape(e)+"-->"})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),r.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,n.bindPendingEventDelegates(),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.on("compositionstart compositionend",function(e){n.composing="compositionstart"===e.type}),n.contentStyles.length>0&&(m="",O(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),O(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),r.auto_focus&&E.setEditorTimeout(n,function(){var e;e=r.auto_focus===!0?n:n.editorManager.get(r.auto_focus),e.destroyed||e.focus()},100),s=h=p=null},focus:function(e){function t(e){return n.dom.getParent(e,function(e){return"true"===n.dom.getContentEditable(e)})}var n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l=n.getBody(),c;if(!e){if(o=r.getRng(),o.item&&(a=o.item(0)),n.quirks.refreshContentEditable(),c=t(r.getNode()),n.$.contains(l,c))return c.focus(),r.normalize(),void n.editorManager.setActive(n);if(i||(w.opera||n.getBody().focus(),n.getWin().focus()),W||i){if(l.setActive)try{l.setActive()}catch(u){l.focus()}else l.focus();i&&r.normalize()}a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())}n.editorManager.setActive(n)},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?z(r):0,n=z(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?(e=n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}),this.editorManager.translate(e)):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?O(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(e){e=e.split("="),e.length>1?i[F(e[0])]=F(e[1]):i[F(e[0])]=F(e)}):i=r,i):r},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addContextToolbar:function(e,t){var n=this,r;n.contextToolbars=n.contextToolbars||[],"string"==typeof e&&(r=e,e=function(e){return n.dom.is(e,r)}),n.contextToolbars.push({id:A.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable=!0:(D.show(e.getContainer()),D.hide(e.id)),e.load(),e.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(V&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e==e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(D.hide(e.getContainer()),D.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),"raw"==e.format&&t.fire("RawSaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=D.getParent(t.id,"form"))&&O(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&t.setDirty(!1),r},setContent:function(e,t){var n=this,r=n.getBody(),i,o;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(o=V&&11>V?"":'<br data-mce-bogus="1">',"TABLE"==r.nodeName?e="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(r.nodeName)&&(e="<li>"+o+"</li>"),i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=o,e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):V||e||(e='<br data-mce-bogus="1">'),n.dom.setHTML(r,e),n.fire("SetContent",t)):("raw"!==t.format&&(e=new s({validate:n.validate},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=F(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?t.serializer.getTrimmedContent():"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),"text"!=e.format?e.content=F(n):e.content=n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=P({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!=t&&this.fire("dirty")},setMode:function(e){S.setMode(this,e)},getContainer:function(){var e=this;return e.container||(e.container=D.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=D.get(this.id)),this.targetElm},getWin:function(){var e=this,t;return e.contentWindow||(t=e.iframeElement,t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),O(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||!n.hasVisual?i.removeClass(e,o):i.addClass(e,o));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&n.hasVisual?i.addClass(e,o):i.removeClass(e,o)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&D.remove(e.getElement().nextSibling),e.inline||(V&&10>V&&e.getDoc().execCommand("SelectAll",!1,null),D.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),D.remove(e.getContainer()),e._selectionOverrides.destroy(),e.editorUpload.destroy(),e.destroy())},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),D.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},P(B.prototype,_),B}),r(nt,[],function(){var e={},t="en";return{setCode:function(e){e&&(t=e,this.rtl=this.data[e]?"rtl"===this.data[e]._dir:!1)},getCode:function(){return t},rtl:!1,add:function(t,n){var r=e[t];r||(e[t]=r={});for(var i in n)r[i]=n[i];this.setCode(t)},translate:function(n){var r;if(r=e[t],r||(r={}),"undefined"==typeof n)return n;if("string"!=typeof n&&n.raw)return n.raw;if(n.push){var i=n.slice(1);n=(r[n[0]]||n[0]).replace(/\{([0-9]+)\}/g,function(e,t){return i[t]})}return(r[n]||n).replace(/{context:\w+}$/,"")},data:e}}),r(rt,[w,u,d],function(e,t,n){function r(e){function l(){try{return document.activeElement}catch(e){return document.body}}function c(e,t){if(t&&t.startContainer){if(!e.isChildOf(t.startContainer,e.getRoot())||!e.isChildOf(t.endContainer,e.getRoot()))return;return{startContainer:t.startContainer, startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset}}return t}function u(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function d(e){return!!s.getParent(e,r.isEditorUIElement)}function f(r){var f=r.editor;f.on("init",function(){(f.inline||n.ie)&&("onbeforedeactivate"in document&&n.ie<9?f.dom.bind(f.getBody(),"beforedeactivate",function(e){if(e.target==f.getBody())try{f.lastRng=f.selection.getRng()}catch(t){}}):f.on("nodechange mouseup keyup",function(e){var t=l();"nodechange"==e.type&&e.selectionChange||(t&&t.id==f.id+"_ifr"&&(t=f.getBody()),f.dom.isChildOf(t,f.getBody())&&(f.lastRng=f.selection.getRng()))}),n.webkit&&!i&&(i=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(f.lastRng=n)}},s.bind(document,"selectionchange",i)))}),f.on("setcontent",function(){f.lastRng=null}),f.on("mousedown",function(){f.selection.lastFocusBookmark=null}),f.on("focusin",function(){var t=e.focusedEditor,n;f.selection.lastFocusBookmark&&(n=u(f,f.selection.lastFocusBookmark),f.selection.lastFocusBookmark=null,f.selection.setRng(n)),t!=f&&(t&&t.fire("blur",{focusedEditor:f}),e.setActive(f),e.focusedEditor=f,f.fire("focus",{blurredEditor:t}),f.focus(!0)),f.lastRng=null}),f.on("focusout",function(){t.setEditorTimeout(f,function(){var t=e.focusedEditor;d(l())||t!=f||(f.fire("blur",{focusedEditor:null}),e.focusedEditor=null,f.selection&&(f.selection.lastFocusBookmark=null))})}),o||(o=function(t){var n=e.activeEditor,r;r=t.target,n&&r.ownerDocument==document&&(n.selection&&r!=n.getBody()&&(n.selection.lastFocusBookmark=c(n.dom,n.lastRng)),r==document.body||d(r)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},s.bind(document,"focusin",o)),f.inline&&!a&&(a=function(t){var n=e.activeEditor,r=n.dom;if(n.inline&&r&&!r.isChildOf(t.target,n.getBody())){var i=n.selection.getRng();i.collapsed||(n.lastRng=i)}},s.bind(document,"mouseup",a))}function h(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(s.unbind(document,"selectionchange",i),s.unbind(document,"focusin",o),s.unbind(document,"mouseup",a),i=o=a=null)}e.on("AddEditor",f),e.on("RemoveEditor",h)}var i,o,a,s=e.DOM;return r.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},r}),r(it,[tt,g,w,ae,d,m,c,ue,nt,rt],function(e,t,n,r,i,o,a,s,l,c){function u(e){g(C.editors,function(t){"scroll"===e.type?t.fire("ScrollWindow",e):t.fire("ResizeWindow",e)})}function d(e,n){n!==x&&(n?t(window).on("resize scroll",u):t(window).off("resize scroll",u),x=n)}function f(e){var t=C.editors,n;delete t[e.id];for(var r=0;r<t.length;r++)if(t[r]==e){t.splice(r,1),n=!0;break}return C.activeEditor==e&&(C.activeEditor=t[0]),C.focusedEditor==e&&(C.focusedEditor=null),n}function h(e){return e&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(f(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null),e}var p=n.DOM,m=o.explode,g=o.each,v=o.extend,y=0,b,C,x=!1;return C={$:t,majorVersion:"4",minorVersion:"4.3",releaseDate:"2016-09-01",editors:[],i18n:l,activeEditor:null,setup:function(){var e=this,t,n,i="",o,a;if(n=r.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/")),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else{for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){a=s[l].src;var u=a.substring(a.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(a)){-1!=u.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/"));break}}!t&&document.currentScript&&(a=document.currentScript.src,-1!=a.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/")))}e.baseURL=new r(n).toAbsolute(t),e.documentBaseURL=n,e.baseURI=new r(e.baseURL),e.suffix=i,e.focusManager=new c(e)},overrideDefaults:function(e){var t,n;t=e.base_url,t&&(this.baseURL=new r(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new r(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n),this.defaultSettings=e},init:function(n){function r(e,t){return e.inline&&t.tagName.toLowerCase()in C}function i(e,t){window.console&&!window.test&&window.console.log(e,t)}function s(e){var t=e.id;return t||(t=e.name,t=t&&!p.get(t)?e.name:p.uniqueId(),e.setAttribute("id",t)),t}function l(e){var t=n[e];if(t)return t.apply(f,Array.prototype.slice.call(arguments,2))}function c(e,t){return t.constructor===RegExp?t.test(e.className):p.hasClass(e,t)}function u(e){var t,n=[];if(e.types)return g(e.types,function(e){n=n.concat(p.select(e.selector))}),n;if(e.selector)return p.select(e.selector);if(e.target)return[e.target];switch(e.mode){case"exact":t=e.elements||"",t.length>0&&g(m(t),function(e){var t;(t=p.get(e))?n.push(t):g(document.forms,function(t){g(t.elements,function(t){t.name===e&&(e="mce_editor_"+y++,p.setAttrib(t,"id",e),n.push(t))})})});break;case"textareas":case"specific_textareas":g(p.select("textarea"),function(t){e.editor_deselector&&c(t,e.editor_deselector)||e.editor_selector&&!c(t,e.editor_selector)||n.push(t)})}return n}function d(){function a(t,n,r){var i=new e(t,n,f);m.push(i),i.on("init",function(){++c===y.length&&x(m)}),i.targetElm=i.targetElm||r,i.render()}var c=0,m=[],y;return p.unbind(window,"ready",d),l("onpageload"),y=t.unique(u(n)),n.types?void g(n.types,function(e){o.each(y,function(t){return p.is(t,e.selector)?(a(s(t),v({},n,e),t),!1):!0})}):(o.each(y,function(e){h(f.get(e.id))}),y=o.grep(y,function(e){return!f.get(e.id)}),void g(y,function(e){r(n,e)?i("Could not initialize inline editor on invalid inline target element",e):a(s(e),n,e)}))}var f=this,b,C;C=o.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var x=function(e){b=e};return f.settings=n,p.bind(window,"ready",d),new a(function(e){b?e(b):x=function(t){e(t)}})},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),d(n,!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),b||(b=function(){t.fire("BeforeUnload")},p.bind(window,"beforeunload",b)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void g(p.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(f(i)&&t.fire("RemoveEditor",{editor:i}),r.length||p.unbind(window,"beforeunload",b),i.remove(),d(r,r.length>0),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){g(this.editors,function(e){e.save()})},addI18n:function(e,t){l.add(e,t)},translate:function(e){return l.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},v(C,s),C.setup(),window.tinymce=window.tinyMCE=C,C}),r(ot,[it,m],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(n,r){"html4"===t.settings.schema&&e(r,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(at,[ue,m],function(e,t){var n={send:function(e){function r(){!e.async||4==i.readyState||o++>1e4?(e.success&&1e4>o&&200==i.status?e.success.call(e.success_scope,""+i.responseText,i,e):e.error&&e.error.call(e.error_scope,o>1e4?"TIMED_OUT":"GENERAL",i,e),i=null):setTimeout(r,10)}var i,o=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async!==!1,e.data=e.data||"",n.fire("beforeInitialize",{settings:e}),i=new XMLHttpRequest){if(i.overrideMimeType&&i.overrideMimeType(e.content_type),i.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(i.withCredentials=!0),e.content_type&&i.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&t.each(e.requestheaders,function(e){i.setRequestHeader(e.key,e.value)}),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i=n.fire("beforeSend",{xhr:i,settings:e}).xhr,i.send(e.data),!e.async)return r();setTimeout(r,10)}}};return t.extend(n,e),n}),r(st,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r<t.length;r++)i+=(r>0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(lt,[st,at,m],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(ct,[w],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(ut,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(dt,[w,f,N,E,m,d],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(ft,[se,m],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t=this,n=t.settings,r,i,o,a;r=n.firstControlClass,i=n.lastControlClass,e.each(function(e){e.classes.remove(r).remove(i).add(n.controlClass),e.visible()&&(o||(o=e),a=e)}),o&&o.classes.add(r),a&&a.classes.add(i)},renderHtml:function(e){var t=this,n="";return t.applyClasses(e.items()),e.items().each(function(e){n+=e.renderHtml()}),n},recalc:function(){},postRender:function(){},isNative:function(){return!1}})}),r(ht,[ft],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}})}),r(pt,[De],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t._super(e),e=t.settings,n=t.settings.size,t.on("click mousedown",function(e){e.preventDefault()}),t.on("touchstart",function(e){t.fire("click",e),e.preventDefault()}),e.subtype&&t.classes.add(e.subtype),n&&t.classes.add("btn-"+n),e.icon&&t.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e=this.getEl().firstChild,t;e&&(t=e.style,t.width=t.height="100%"),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("icon"),i,o=e.state.get("text"),a="";return i=e.settings.image,i?(r="none","string"!=typeof i&&(i=window.getSelection?i[0]:i[1]),i=" style=\"background-image: url('"+i+"')\""):i="",o&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(o)+"</span>"),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'<div id="'+t+'" class="'+e.classes+'" tabindex="-1" aria-labelledby="'+t+'"><button role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+i+"></i>":"")+a+"</button></div>"},bindStates:function(){function e(e){var i=n("span."+r,t.getEl());e?(i[0]||(n("button:first",t.getEl()).append('<span class="'+r+'"></span>'),i=n("span."+r,t.getEl())),i.html(t.encode(e))):i.remove(),t.classes.toggle("btn-has-text",!!e)}var t=this,n=t.$,r=t.classPrefix+"txt";return t.state.on("change:text",function(t){e(t.value)}),t.state.on("change:icon",function(n){var r=n.value,i=t.classPrefix;t.settings.icon=r,r=r?i+"ico "+i+"i-"+t.settings.icon:"";var o=t.getEl().firstChild,a=o.getElementsByTagName("i")[0];r?(a&&a==o.firstChild||(a=document.createElement("i"),o.insertBefore(a,o.firstChild)),a.className=r):a&&o.removeChild(a),e(t.state.get("text"))}),t._super()}})}),r(mt,[xe],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(gt,[De],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'" unselectable="on" aria-labelledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'label">'+e.encode(e.state.get("text"))+"</span></div>"},bindStates:function(){function e(e){t.classes.toggle("checked",e),t.aria("checked",e)}var t=this;return t.state.on("change:text",function(e){t.getEl("al").firstChild.data=t.translate(e.value)}),t.state.on("change:checked change:value",function(n){t.fire("change"),e(n.value)}),t.state.on("change:icon",function(e){var n=e.value,r=t.classPrefix;if("undefined"==typeof n)return t.settings.icon;t.settings.icon=n,n=n?r+"ico "+r+"i-"+t.settings.icon:"";var i=t.getEl().firstChild,o=i.getElementsByTagName("i")[0];n?(o&&o==i.firstChild||(o=document.createElement("i"),i.insertBefore(o,i.firstChild)),o.className=n):o&&i.removeChild(o)}),t.state.get("checked")&&e(!0),t._super()}})}),r(vt,[De,be,pe,g],function(e,t,n,r){return e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.classes.add("combobox"),t.subinput=!0,t.ariaTarget="inp",e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){var i=n.target,o=t.getEl();if(r.contains(o,i)||i==o)for(;i&&i!=o;)i.id&&-1!=i.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),i=i.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){var r=t.state.get("value"),i=t.getEl("inp").value;return e.preventDefault(),t.state.set("value",i),r!=i&&t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),t.on("keyup",function(e){"INPUT"==e.target.nodeName&&t.state.set("value",e.target.value)})},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),i=e.getEl("open"),o=e.layoutRect(),a,s;a=i?o.w-n.getSize(i).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(s=e.layoutRect().h-2+"px"),r(t.firstChild).css({width:a,lineHeight:s}),e._super(),e},postRender:function(){var e=this;return r(this.getEl("inp")).on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)}),e._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=e.state.get("value")||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e.state.get("text"),(o||a)&&(s='<div id="'+t+'-open" class="'+r+"btn "+r+'open" tabIndex="-1" role="button"><button id="'+t+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!=o?'<i class="'+o+'"></i>':'<i class="'+r+'caret"></i>')+(a?(o?" ":"")+a:"")+"</button></div>",e.classes.add("has-open")),'<div id="'+t+'" class="'+e.classes+'"><input id="'+t+'-inp" class="'+r+'textbox" value="'+e.encode(i,!1)+'" hidefocus="1"'+l+' placeholder="'+e.encode(n.placeholder)+'" />'+s+"</div>"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl("inp").value!=t.value&&(e.getEl("inp").value=t.value)}),e.state.on("change:disabled",function(t){e.getEl("inp").disabled=t.value}),e._super()},remove:function(){r(this.getEl("inp")).off(),this._super()}})}),r(yt,[vt],function(e){return e.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl().getElementsByTagName("i")[0];if(t)try{t.style.background=e}catch(n){}},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.state.get("rendered")&&e.repaintColor(t.value)}),e._super()}})}),r(bt,[pt,ke],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),r(Ct,[bt,w],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("text"),i=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",a="";return r&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(r)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(i?'<i class="'+i+'"'+o+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+a+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(xt,[],function(){function e(e){function i(e,i,o){var a,s,l,c,u,d;return a=0,s=0,l=0,e/=255,i/=255,o/=255,u=t(e,t(i,o)),d=n(e,n(i,o)),u==d?(l=u,{h:0,s:0,v:100*l}):(c=e==u?i-o:o==u?e-i:o-e,a=e==u?3:o==u?1:5,a=60*(a-c/(d-u)),s=(d-u)/d,l=d,{h:r(a),s:r(100*s),v:r(100*l)})}function o(e,i,o){var a,s,l,c;if(e=(parseInt(e,10)||0)%360,i=parseInt(i,10)/100,o=parseInt(o,10)/100,i=n(0,t(i,1)),o=n(0,t(o,1)),0===i)return void(d=f=h=r(255*o));switch(a=e/60,s=o*i,l=s*(1-Math.abs(a%2-1)),c=o-s,Math.floor(a)){case 0:d=s,f=l,h=0;break;case 1:d=l,f=s,h=0;break;case 2:d=0,f=s,h=l;break;case 3:d=0,f=l,h=s;break;case 4:d=l,f=0,h=s;break;case 5:d=s,f=0,h=l;break;default:d=f=h=0}d=r(255*(d+c)),f=r(255*(f+c)),h=r(255*(h+c))}function a(){function e(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+e(d)+e(f)+e(h)}function s(){return{r:d,g:f,b:h}}function l(){return i(d,f,h)}function c(e){var t;return"object"==typeof e?"r"in e?(d=e.r,f=e.g,h=e.b):"v"in e&&o(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(d=parseInt(t[1],10),f=parseInt(t[2],10),h=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(d=parseInt(t[1],16),f=parseInt(t[2],16),h=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(d=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16),h=parseInt(t[3]+t[3],16)),d=0>d?0:d>255?255:d,f=0>f?0:f>255?255:f,h=0>h?0:h>255?255:h,u}var u=this,d=0,f=0,h=0;e&&c(e),u.toRgb=s,u.toHsv=l,u.toHex=a,u.parse=c}var t=Math.min,n=Math.max,r=Math.round;return e}),r(wt,[De,we,pe,xt],function(e,t,n,r){return e.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){function e(e,t){var r=n.getPos(e),i,o;return i=t.pageX-r.x,o=t.pageY-r.y,i=Math.max(0,Math.min(i/e.clientWidth,1)),o=Math.max(0,Math.min(o/e.clientHeight,1)),{x:i,y:o}}function i(e,t){var i=(360-e.h)/360;n.css(d,{top:100*i+"%"}),t||n.css(h,{left:e.s+"%",top:100-e.v+"%"}),f.style.background=new r({s:100,v:100,h:e.h}).toHex(),s.color().parse({s:e.s,v:e.v,h:e.h})}function o(t){var n;n=e(f,t),c.s=100*n.x,c.v=100*(1-n.y),i(c),s.fire("change")}function a(t){var n;n=e(u,t),c=l.toHsv(),c.h=360*(1-n.y),i(c,!0),s.fire("change")}var s=this,l=s.color(),c,u,d,f,h;u=s.getEl("h"),d=s.getEl("hp"),f=s.getEl("sv"),h=s.getEl("svp"),s._repaint=function(){c=l.toHsv(),i(c)},s._super(),s._svdraghelper=new t(s._id+"-sv",{start:o,drag:o}),s._hdraghelper=new t(s._id+"-h",{start:a,drag:a}),s._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;return arguments.length?(t.color().parse(e),void(t._rendered&&t._repaint())):t.color().toHex()},color:function(){return this._color||(this._color=new r),this._color},renderHtml:function(){function e(){var e,t,n="",i,a;for(i="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",a=o.split(","),e=0,t=a.length-1;t>e;e++)n+='<div class="'+r+'colorpicker-h-chunk" style="height:'+100/t+"%;"+i+a[e]+",endColorstr="+a[e+1]+");-ms-"+i+a[e]+",endColorstr="+a[e+1]+')"></div>';return n}var t=this,n=t._id,r=t.classPrefix,i,o="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",a="background: -ms-linear-gradient(top,"+o+");background: linear-gradient(to bottom,"+o+");";return i='<div id="'+n+'-h" class="'+r+'colorpicker-h" style="'+a+'">'+e()+'<div id="'+n+'-hp" class="'+r+'colorpicker-h-marker"></div></div>','<div id="'+n+'" class="'+t.classes+'"><div id="'+n+'-sv" class="'+r+'colorpicker-sv"><div class="'+r+'colorpicker-overlay1"><div class="'+r+'colorpicker-overlay2"><div id="'+n+'-svp" class="'+r+'colorpicker-selector1"><div class="'+r+'colorpicker-selector2"></div></div></div></div></div>'+i+"</div>"}})}),r(Nt,[De],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.classes.add("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.row()[n],index:n})}),t.row(t.settings.row)},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){var e=this;return'<div id="'+e._id+'" class="'+e.classes+'">'+e._getDataPathHtml(e.state.get("row"))+"</div>"},bindStates:function(){var e=this;return e.state.on("change:row",function(t){e.innerHtml(e._getDataPathHtml(t.value))}),e._super()},_getDataPathHtml:function(e){var t=this,n=e||[],r,i,o="",a=t.classPrefix;for(r=0,i=n.length;i>r;r++)o+=(r>0?'<div class="'+a+'divider" aria-hidden="true"> '+t.settings.delimiter+" </div>":"")+'<div role="button" class="'+a+"path-item"+(r==i-1?" "+a+"last":"")+'" data-index="'+r+'" tabindex="-1" id="'+t._id+"-"+r+'" aria-level="'+r+'">'+n[r].name+"</div>";return o||(o='<div class="'+a+'path-item">\xa0</div>'),o}})}),r(Et,[Nt],function(e){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var t=this,n=t.settings.editor;return n.settings.elementpath!==!1&&(t.on("select",function(e){n.focus(),n.selection.select(this.row()[e.index].element),n.nodeChanged()}),n.on("nodeChange",function(r){for(var i=[],o=r.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=n.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});if(s.isDefaultPrevented()||i.push({name:s.name,element:o[a]}),s.isPropagationStopped())break}t.row(i)})),t._super()}})}),r(_t,[xe],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(St,[xe,_t,m],function(e,t,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,r=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),r.each(function(r){var i,o=r.settings.label;o&&(i=new t(n.extend({items:{type:"label",id:r._id+"-l",text:o,flex:0,forId:r._id,disabled:r.disabled()}},e.settings.formItemDefaults)),i.type="formitem",r.aria("labelledby",r._id+"-l"),"undefined"==typeof r.settings.flex&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.fromJSON(e.settings.data)},bindStates:function(){function e(){var e=0,n=[],r,i,o;if(t.settings.labelGapCalc!==!1)for(o="children"==t.settings.labelGapCalc?t.find("formitem"):t.items(),o.filter("formitem").each(function(t){var r=t.items()[0],i=r.getEl().clientWidth;e=i>e?i:e,n.push(r)}),i=t.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=e+i}var t=this;t._super(),t.on("show",e),e()}})}),r(kt,[St],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}})}),r(Tt,[vt,m],function(e,t){return e.extend({init:function(e){var n=this,r=tinymce.activeEditor,i=r.settings,o,a,s;e.spellcheck=!1,s=i.file_picker_types||i.file_browser_callback_types,s&&(s=t.makeMap(s,/[, ]/)),s&&!s[e.filetype]||(a=i.file_picker_callback,!a||s&&!s[e.filetype]?(a=i.file_browser_callback,!a||s&&!s[e.filetype]||(o=function(){a(n.getEl("inp").id,n.value(),e.filetype,window)})):o=function(){var i=n.fire("beforecall").meta;i=t.extend({filetype:e.filetype},i),a.call(r,function(e,t){n.value(e).fire("change",{meta:t})},n.value(),i)}),o&&(e.icon="browse",e.onaction=o),n._super(e)}})}),r(Rt,[ht],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(At,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v=[],y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F,z=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e.paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,"row-reversed"!=f&&"column-reverse"!=f||(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(S="y",E="h",_="minH",k="maxH",R="innerH",T="top",A="deltaH",B="contentH",O="left",M="w",D="x",L="innerW", P="minW",H="right",I="deltaW",F="contentW"):(S="x",E="w",_="minW",k="maxW",R="innerW",T="left",A="deltaW",B="contentW",O="top",M="h",D="y",L="innerH",P="minH",H="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],N=u=0,t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),m=h.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,p[k]&&v.push(h),p.flex=g),d-=p[_],y=o[O]+p[P]+o[H],y>N&&(N=y);if(x={},0>d?x[_]=i[_]-d+i[A]:x[_]=i[R]-d+i[A],x[P]=N+i[I],x[B]=i[R]-d,x[F]=N,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)h=v[t],p=h.layoutRect(),b=p[k],y=p[_]+p.flex*C,y>b?(d-=p[k]-p[_],u-=p.flex,p.flex=0,p.maxFlexSize=b):p.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[D]=o[O],t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),y=p.maxFlexSize||p[_],"center"===s?x[D]=Math.round(i[L]/2-p[M]/2):"stretch"===s?(x[M]=z(p[P]||0,i[L]-o[O]-o[H]),x[D]=o[O]):"end"===s&&(x[D]=i[L]-p[M]-o.top),p.flex>0&&(y+=p.flex*C),x[E]=y,x[S]=w,h.layoutRect(x),h.recalc&&h.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var W=e.parent();W&&(W._lastRect=null,W.recalc())}}})}),r(Bt,[ft],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}})}),r(Dt,[ye,De,ke,m,w,it,d],function(e,t,n,r,i,o,a){function s(e){e.settings.ui_container&&(a.container=i.DOM.select(e.settings.ui_container)[0])}function l(t){t.on("ScriptsLoaded",function(){t.rtl&&(e.rtl=!0)})}function c(e){function t(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;u(i.parents,function(e){return u(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function r(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function i(){function t(e){var n=[];if(e)return u(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=t(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a,o.cmd=e.cmd}n.push(o)}),n}function n(){var n;return n=t(e.settings.style_formats_merge?e.settings.style_formats?o.concat(e.settings.style_formats):o:e.settings.style_formats||o)}var r=0,i=[],o=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){u(i,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:n(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?e.formatter.getCssText(this.settings.format):void 0},onPostRender:function(){var t=this;t.parent().on("show",function(){var n,r;n=t.settings.format,n&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),r=t.settings.cmd,r&&t.active(e.queryCommandState(r))})},onclick:function(){this.settings.format&&l(this.settings.format),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}function o(t){return function(){var n=this;e.formatter?e.formatter.formatChanged(t,function(e){n.active(e)}):e.on("init",function(){e.formatter.formatChanged(t,function(e){n.active(e)})})}}function a(t){return function(){function n(){return e.undoManager?e.undoManager[t]():!1}var r=this;t="redo"==t?"hasRedo":"hasUndo",r.disabled(!n()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){r.disabled(e.readonly||!n())})}}function s(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function l(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var c;c=i(),u({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:o(n),onclick:function(){l(n)}})}),u({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),u({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:o(n)})}),e.addButton("undo",{tooltip:"Undo",onPostRender:a("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:a("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:s,cmd:"mceToggleVisualAid"}),e.addButton("remove",{tooltip:"Remove",icon:"remove",cmd:"Delete"}),u({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return u(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return u(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return u(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var u=r.each;o.on("AddEditor",function(e){var t=e.editor;l(t),c(t),s(t)}),e.translate=function(e){return o.translate(e)},t.tooltips=!a.iOS}),r(Lt,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E=[],_=[],S,k,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e.paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)_.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),S=c.minW,k=c.minH,E[d]=S>E[d]?S:E[d],_[f]=k>_[f]?k:_[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,N=0,f=0;n>f;f++)N+=_[f]+(f>0?b:0),R-=(f>0?b:0)+_[f];if(w+=g.left+g.right,N+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=N+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var D;D="start"==t.packV?0:R>0?Math.floor(R/n):0;var L=0,M=t.flexWidths;if(M)for(d=0;d<M.length;d++)L+=M[d];else L=r;var P=T/L;for(d=0;r>d;d++)E[d]+=M?M[d]*P:P;for(p=g.top,f=0;n>f;f++){for(h=g.left,s=_[f]+D,d=0;r>d&&(B=A?f*r+r-1-d:f*r+d,u=i[B],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(E[d],c.startMinWidth),c.x=h,c.y=p,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=h+a/2-c.w/2:"right"==v?c.x=h+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=p+s/2-c.h/2:"bottom"==v?c.y=p+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),h+=a+y,u.recalc&&u.recalc();p+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var O=e.parent();O&&(O._lastRect=null,O.recalc())}}})}),r(Mt,[De,u],function(e,t){return e.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,n){var r=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,n&&n()):t.setTimeout(function(){r.html(e)}),this}})}),r(Pt,[De],function(e){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("infobox"),t.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+e.encode(e.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+t+"ico "+t+'i-help"></i></button></div></div>'},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl("body").firstChild.data=e.encode(t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e.state.on("change:help",function(t){e.classes.toggle("has-help",t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ot,[De,pe],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.classes.add("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e=this,t,n,r=e.settings.forId;return!r&&(n=e.settings.forName)&&(t=e.getRoot().find("#"+n)[0],t&&(r=t._id)),r?'<label id="'+e._id+'" class="'+e.classes+'"'+(r?' for="'+r+'"':"")+">"+e.encode(e.state.get("text"))+"</label>":'<span id="'+e._id+'" class="'+e.classes+'">'+e.encode(e.state.get("text"))+"</span>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.innerHtml(e.encode(t.value)),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ht,[xe],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.classes.add("toolbar")},postRender:function(){var e=this;return e.items().each(function(e){e.classes.add("toolbar-item")}),e._super()}})}),r(It,[Ht],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(Ft,[pt,be,It],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(){var e=this,n;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(n=e.state.get("menu")||[],n.length?n={type:"menu",items:n}:n.type=n.type||"menu",n.renderTo?e.menu=n.parent(e).show().renderTo():e.menu=t.create(n).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon,o,a=e.state.get("text"),s="";return o=e.settings.image,o?(i="none","string"!=typeof o&&(o=window.getSelection?o[0]:o[1]),o=" style=\"background-image: url('"+o+"')\""):o="",a&&(e.classes.add("btn-has-text"),s='<span class="'+r+'txt">'+e.encode(a)+"</span>"),i=e.settings.icon?r+"ico "+r+"i-"+i:"",e.aria("role",e.parent()instanceof n?"menuitem":"button"),'<div id="'+t+'" class="'+e.classes+'" tabindex="-1" aria-labelledby="'+t+'"><button id="'+t+'-open" role="presentation" type="button" tabindex="-1">'+(i?'<i class="'+i+'"'+o+"></i>":"")+s+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});return i}),r(zt,[De,be,d,u],function(e,t,n,r){return e.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t=this,n;t._super(e),e=t.settings,t.classes.add("menu-item"),e.menu&&t.classes.add("menu-item-expand"),e.preview&&t.classes.add("menu-item-preview"),n=t.state.get("text"),"-"!==n&&"|"!==n||(t.classes.add("menu-item-sep"),t.aria("role","separator"),t.state.set("text","-")),e.selectable&&(t.aria("role","menuitemcheckbox"),t.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||t.classes.add("menu-item-normal"),t.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&t.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r,i=e.parent();if(i.items().each(function(t){t!==e&&t.hideMenu()}),n.menu){r=e.menu,r?r.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",i.settings.itemDefaults&&(r.itemDefaults=i.settings.itemDefaults),r=e.menu=t.create(r).parent(e).renderTo(),r.reflow(),r.on("cancel",function(t){t.stopPropagation(),e.focus(),r.hide()}),r.on("show hide",function(e){e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),r.on("hide",function(t){t.control===r&&e.classes.remove("selected")}),r.submenu=!0),r._parentMenu=i,r.classes.add("menu-sub");var o=r.testMoveRel(e.getEl(),e.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);r.moveRel(e.getEl(),o),r.rel=o,o="menu-sub-"+o,r.classes.remove(r._lastRel).add(o),r._lastRel=o,e.classes.add("selected"),e.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){function e(e){var t,r,i={};for(i=n.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)r=i[e[t].toLowerCase()],r&&(e[t]=r);return e.join("+")}var t=this,r=t._id,i=t.settings,o=t.classPrefix,a=t.encode(t.state.get("text")),s=t.settings.icon,l="",c=i.shortcut;return s&&t.parent().classes.add("menu-has-icons"),i.image&&(l=" style=\"background-image: url('"+i.image+"')\""),c&&(c=e(c)),s=o+"ico "+o+"i-"+(t.settings.icon||"none"),'<div id="'+r+'" class="'+t.classes+'" tabindex="-1">'+("-"!==a?'<i class="'+s+'"'+l+"></i>\xa0":"")+("-"!==a?'<span id="'+r+'-text" class="'+o+'text">'+a+"</span>":"")+(c?'<div id="'+r+'-shortcut" class="'+o+'menu-shortcut">'+c+"</div>":"")+(i.menu?'<div class="'+o+'caret"></div>':"")+"</div>"},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var i=e.getEl("text");i&&i.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),r.requestAnimationFrame(function(){e.parent().hideAll()})))}),e._super(),e},hover:function(){var e=this;return e.parent().items().each(function(e){e.classes.remove("selected")}),e.classes.toggle("selected",!0),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ut,[g,ye,u],function(e,t,n){return function(r,i){var o=this,a,s=t.classPrefix,l;o.show=function(t,c){function u(){a&&(e(r).append('<div class="'+s+"throbber"+(i?" "+s+"throbber-inline":"")+'"></div>'),c&&c())}return o.hide(),a=!0,t?l=n.setTimeout(u,t):u(),o},o.hide=function(){var e=r.lastChild;return n.clearTimeout(l),e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),a=!1,o}}}),r(Wt,[ke,zt,Ut,m],function(e,t,n,r){return e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var n=e.items,i=n.length;i--;)n[i]=r.extend({},e.itemDefaults,n[i]);t._super(e),t.classes.add("menu")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},load:function(){function e(){t.throbber&&(t.throbber.hide(),t.throbber=null)}var t=this,r,i;i=t.settings.itemsFactory,i&&(t.throbber||(t.throbber=new n(t.getEl("body"),!0),0===t.items().length?(t.throbber.show(),t.fire("loading")):t.throbber.show(100,function(){t.items().remove(),t.fire("loading")}),t.on("hide close",e)),t.requestTime=r=(new Date).getTime(),t.settings.itemsFactory(function(n){return 0===n.length?void t.hide():void(t.requestTime===r&&(t.getEl().style.width="",t.getEl("body").style.width="",e(),t.items().remove(),t.getEl("body").innerHTML="",t.add(n),t.renderNew(),t.fire("loaded")))}))},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.image||n.selectable?(e._hasIcons=!0,!1):void 0}),e.settings.itemsFactory&&e.on("postrender",function(){e.settings.itemsFactory&&e.load()}),e._super()}})}),r(Vt,[Ft,Wt],function(e,t){return e.extend({init:function(e){function t(r){for(var a=0;a<r.length;a++){if(i=r[a].selected||e.value===r[a].value)return o=o||r[a].text,n.state.set("value",r[a].value),!0;if(r[a].menu&&t(r[a].menu))return!0}}var n=this,r,i,o,a;n._super(e),e=n.settings,n._values=r=e.values,r&&("undefined"!=typeof e.value&&t(r),!i&&r.length>0&&(o=r[0].text,n.state.set("value",r[0].value)),n.state.set("menu",r)),n.state.set("text",e.text||o),n.classes.add("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.value()),a=r})},bindStates:function(){function e(e,n){e instanceof t&&e.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}function n(e,t){var r;if(e)for(var i=0;i<e.length;i++){if(e[i].value===t)return e[i];if(e[i].menu&&(r=n(e[i].menu,t)))return r}}var r=this;return r.on("show",function(t){e(t.control,r.value())}),r.state.on("change:value",function(e){var t=n(r.state.get("menu"),e.value);t?r.text(t.text):r.text(r.settings.text)}),r._super()}})}),r($t,[gt],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(qt,[De,we],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"==e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(jt,[De],function(e){function t(e){var t="";if(e)for(var n=0;n<e.length;n++)t+='<option value="'+e[n]+'">'+e[n]+"</option>";return t}return e.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var t=this;t._super(e),t.settings.size&&(t.size=t.settings.size),t.settings.options&&(t._options=t.settings.options),t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e=this,n,r="";return n=t(e._options),e.size&&(r=' size = "'+e.size+'"'),'<select id="'+e._id+'" class="'+e.classes+'"'+r+">"+n+"</select>"},bindStates:function(){var e=this;return e.state.on("change:options",function(n){e.getEl().innerHTML=t(n.value)}),e._super()}})}),r(Yt,[De,we,pe],function(e,t,n){function r(e,t,n){return t>e&&(e=t),e>n&&(e=n),e}function i(e,t,n){e.setAttribute("aria-"+t,n)}function o(e,t){var r,o,a,s,l,c;"v"==e.settings.orientation?(s="top",a="height",o="h"):(s="left",a="width",o="w"),c=e.getEl("handle"),r=(e.layoutRect()[o]||100)-n.getSize(c)[a],l=r*((t-e._minValue)/(e._maxValue-e._minValue))+"px",c.style[s]=l,c.style.height=e.layoutRect().h+"px",i(c,"valuenow",t),i(c,"valuetext",""+e.settings.previewFilter(t)),i(c,"valuemin",e._minValue),i(c,"valuemax",e._maxValue)}return e.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"==e.orientation&&t.classes.add("vertical"),t._minValue=e.minValue||0,t._maxValue=e.maxValue||100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'"><div id="'+t+'-handle" class="'+n+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){function e(e,t,n){return(n+e)/(t-e)}function i(e,t,n){return n*(t-e)-e}function o(t,n){function o(o){var a;a=s.value(),a=i(t,n,e(t,n,a)+.05*o),a=r(a,t,n),s.value(a),s.fire("dragstart",{value:a}),s.fire("drag",{value:a}),s.fire("dragend",{value:a})}s.on("keydown",function(e){switch(e.keyCode){case 37:case 38:o(-1);break;case 39:case 40:o(1)}})}function a(e,i,o){var a,l,c,p,m;s._dragHelper=new t(s._id,{handle:s._id+"-handle",start:function(e){a=e[u],l=parseInt(s.getEl("handle").style[d],10),c=(s.layoutRect()[h]||100)-n.getSize(o)[f],s.fire("dragstart",{value:m})},drag:function(t){var n=t[u]-a;p=r(l+n,0,c),o.style[d]=p+"px",m=e+p/c*(i-e),s.value(m),s.tooltip().text(""+s.settings.previewFilter(m)).show().moveRel(o,"bc tc"),s.fire("drag",{value:m})},stop:function(){s.tooltip().hide(),s.fire("dragend",{value:m})}})}var s=this,l,c,u,d,f,h;l=s._minValue,c=s._maxValue,"v"==s.settings.orientation?(u="screenY",d="top",f="height",h="h"):(u="screenX",d="left",f="width",h="w"),s._super(),o(l,c,s.getEl("handle")),a(l,c,s.getEl("handle"))},repaint:function(){this._super(),o(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){o(e,t.value)}),e._super()}})}),r(Xt,[De],function(e){return e.extend({renderHtml:function(){var e=this;return e.classes.add("spacer"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"></div>'}})}),r(Kt,[Ft,pe,g],function(e,t,n){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,r=e.getEl(),i=e.layoutRect(),o,a;return e._super(),o=r.firstChild,a=r.lastChild,n(o).css({width:i.w-t.getSize(a).width,height:i.h-2}),n(a).css({height:i.h-2}),e},activeMenu:function(e){var t=this;n(t.getEl().lastChild).toggleClass(t.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r,i=e.state.get("icon"),o=e.state.get("text"),a="";return r=e.settings.image,r?(i="none","string"!=typeof r&&(r=window.getSelection?r[0]:r[1]),r=" style=\"background-image: url('"+r+"')\""):r="",i=e.settings.icon?n+"ico "+n+"i-"+i:"",o&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(o)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(i?'<i class="'+i+'"'+r+"></i>":"")+a+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1">'+(e._menuBtnText?(i?"\xa0":"")+e._menuBtnText:"")+' <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void(t&&t.call(this,e));n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Gt,[Bt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}})}),r(Jt,[Ee,g,pe],function(e,t,n){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t(n).removeClass(this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t(n).addClass(this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='<div id="'+o+'" class="'+r+'tab" unselectable="on" role="tab" aria-controls="'+t._id+'" aria-selected="false" tabIndex="-1">'+e.encode(t.settings.title)+"</div>"}),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1"><div id="'+e._id+'-head" class="'+r+'tabs" role="tablist">'+n+'</div><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,t,r,i;r=n.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=n.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,t=e._super(),t.deltaH+=o,t.innerH=t.h-t.deltaH,t}})}),r(Qt,[De,m,pe],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("textbox"),e.multiline?t.classes.add("multiline"):(t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))}),t.on("keyup",function(e){t.state.set("value",e.target.value)}))},repaint:function(){var e=this,t,n,r,i,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e.borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,r=e.settings,i,o;return i={id:e._id,hidefocus:"1"},t.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){i[e]=r[e]}),e.disabled()&&(i.disabled="disabled"),r.subtype&&(i.type=r.subtype),o=n.create(r.multiline?"textarea":"input",i),o.value=e.state.get("value"),o.className=e.classes,o.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e.getEl().value=e.state.get("value"),e._super(),e.$el.on("change",function(t){ e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!=t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.value}),e._super()},remove:function(){this.$el.off(),this._super()}})}),r(Zt,[],function(){var e=this||window,t=function(){return e.tinymce};return"function"==typeof e.define&&(e.define.amd||e.define("ephox/tinymce",[],t)),{}}),a([l,c,u,d,f,h,m,g,v,y,C,w,N,E,T,A,B,D,L,M,P,O,I,F,j,Y,J,Q,oe,ae,se,le,ue,fe,he,ve,ye,be,Ce,xe,we,Ne,Ee,_e,Se,ke,Te,Re,Ae,Be,De,Le,Me,Pe,Ie,ze,tt,nt,rt,it,at,st,lt,ct,ut,dt,ft,ht,pt,mt,gt,vt,yt,bt,Ct,xt,wt,Nt,Et,_t,St,kt,Tt,Rt,At,Bt,Dt,Lt,Mt,Pt,Ot,Ht,It,Ft,zt,Ut,Wt,Vt,$t,qt,jt,Yt,Xt,Kt,Gt,Jt,Qt])}(this); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | jquery-1.10.2.min.js |
| Request Header - size: 509 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:05 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 273199 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 273,199 bytes. |
/*!
* jQuery JavaScript Library v1.10.2 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03T13:48Z */ (function( window, undefined ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; var // The deferred used on DOM ready readyList, // A central reference to the root jQuery(document) rootjQuery, // Support: IE<10 // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined` core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) location = window.location, document = window.document, docElem = document.documentElement, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // [[Class]] -> type pairs class2type = {}, // List of deleted data cache ids, so we can reuse them core_deletedIds = [], core_version = "1.10.2", // Save a reference to some core methods core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Used for matching numbers core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, // Used for splitting on whitespace core_rnotwhite = /\S+/g, // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }, // The ready event handler completed = function( event ) { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } }, // Clean-up method for dom ready events detach = function() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: core_version, constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return core_slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }, slice: function() { return this.pushStack( core_slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: core_push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger("ready").off("ready"); } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { if ( obj == null ) { return String( obj ); } return typeof obj === "object" || typeof obj === "function" ? class2type[ core_toString.call(obj) ] || "object" : typeof obj; }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if ( jQuery.support.ownLast ) { for ( key in obj ) { return core_hasOwn.call( obj, key ); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string parseHTML: function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }, parseJSON: function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } if ( data === null ) { return data; } if ( typeof data === "string" ) { // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); if ( data ) { // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } } } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Use native String.trim function wherever possible trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { core_push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( core_indexOf ) { return core_indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var l = second.length, i = first.length, j = 0; if ( typeof l === "number" ) { for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var retVal, ret = [], i = 0, length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return core_concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = core_slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); }, // A method for quickly swapping in/out CSS properties to get correct calculations. // Note: this method belongs to the css module but it's needed here for the support module. // If support gets modularized, this method should be moved back to the css module. swap: function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || type !== "function" && ( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj ); } // All jQuery objects should point back to these rootjQuery = jQuery(document); /*! * Sizzle CSS Selector Engine v1.10.2 * http://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03 */ (function( window, undefined ) { var i, support, cachedruns, Expr, getText, isXML, compile, outermostContext, sortInput, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), hasDuplicate = false, sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; return 0; } return 0; }, // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Prefer arguments quoted, // then not containing pseudos/brackets, // then attribute selectors/non-parenthetical expressions, // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rsibling = new RegExp( whitespace + "*[+~]" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : // BMP codepoint high < 0 ? String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( documentIsHTML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // QSA path if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { nid = old = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && context.parentNode || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key += " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = attrs.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Detect xml * @param {Element|Object} elem An element or a document */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; // Expose support vars for convenience support = Sizzle.support = {}; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.defaultView; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsHTML = !isXML( doc ); // Support: IE>8 // If iframe document is assigned to "document" variable and if iframe has been reloaded, // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 // IE6-8 do not support the defaultView property so parent will be undefined if ( parent && parent.attachEvent && parent !== parent.top ) { parent.attachEvent( "onbeforeunload", function() { setDocument(); }); } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) support.attributes = assert(function( div ) { div.className = "i"; return !div.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if getElementsByClassName can be trusted support.getElementsByClassName = assert(function( div ) { div.innerHTML = "<div class='a'></div><div class='a i'></div>"; // Support: Safari<4 // Catch class over-caching div.firstChild.className = "i"; // Support: Opera<10 // Catch gEBCN failure to find non-leading classes return div.getElementsByClassName("i").length === 2; }); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !doc.getElementsByName || !doc.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && documentIsHTML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select><option selected=''></option></select>"; // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Support: Opera 10-12/IE8 // ^= $= *= and empty values // Should not select anything // Support: Windows 8 Native Apps // The type attribute is restricted during .innerHTML assignment var input = doc.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "t", "" ); if ( div.querySelectorAll("[t^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = docElem.compareDocumentPosition ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); if ( compare ) { // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === doc || contains(preferredDoc, a) ) { return -1; } if ( b === doc || contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } // Not directly comparable, sort on existence of method return a.compareDocumentPosition ? -1 : 1; } : function( a, b ) { var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; // Parentless nodes are either documents or disconnected } else if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return doc; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [elem] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val === undefined ? support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null : val; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array for ( ; (node = elem[i]); i++ ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[5] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] && match[4] !== undefined ) { match[2] = match[4]; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( tokens = [] ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); } function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var data, cache, outerCache, dirkey = dirruns + " " + doneName; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { if ( (data = cache[1]) === true || data === cachedruns ) { return data === true; } } else { cache = outerCache[ dir ] = [ dirkey ]; cache[1] = matcher( elem, context, xml ) || cachedruns; if ( cache[1] === true ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // A counter to specify which element is currently being matched var matcherCachedRuns = 0, bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, expandContext ) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, // We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); if ( outermost ) { outermostContext = context !== document && context; cachedruns = matcherCachedRuns; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below for ( ; (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; cachedruns = ++matcherCachedRuns; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !group ) { group = tokenize( selector ); } i = group.length; while ( i-- ) { cached = matcherFromTokens( group[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); } return cached; }; function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function select( selector, context, results, seed ) { var i, tokens, token, type, find, match = tokenize( selector ); if ( !seed ) { // Try to minimize operations if there is only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && context.parentNode || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } } // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile( selector, match )( seed, context, !documentIsHTML, results, rsibling.test( selector ) ); return results; } // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Support: Chrome<14 // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( document.createElement("div") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert(function( div ) { div.innerHTML = "<input/>"; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert(function( div ) { return div.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return (val = elem.getAttributeNode( name )) && val.specified ? val.value : elem[ name ] === true ? name.toLowerCase() : null; } }); } jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })( window ); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; firingLength = 0; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( list && ( !fired || stack ) ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var action = tuple[ 0 ], fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = core_slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; if( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); jQuery.support = (function( support ) { var all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); // Setup div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // Finish early in limited (non-browser) environments all = div.getElementsByTagName("*") || []; a = div.getElementsByTagName("a")[ 0 ]; if ( !a || !a.style || !all.length ) { return support; } // First batch of tests select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px;float:left;opacity:.5"; // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) support.getSetAttribute = div.className !== "t"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName("tbody").length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !!div.getElementsByTagName("link").length; // Get the style information from getAttribute // (IE uses .cssText instead) support.style = /top/.test( a.getAttribute("style") ); // Make sure that URLs aren't manipulated // (IE normalizes it by default) support.hrefNormalized = a.getAttribute("href") === "/a"; // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 support.opacity = /^0.5/.test( a.style.opacity ); // Verify style float existence // (IE uses styleFloat instead of cssFloat) support.cssFloat = !!a.style.cssFloat; // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) support.checkOn = !!input.value; // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) support.optSelected = opt.selected; // Tests for enctype support on a form (#6743) support.enctype = !!document.createElement("form").enctype; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>"; // Will be defined later support.inlineBlockNeedsLayout = false; support.shrinkWrapBlocks = false; support.pixelPosition = false; support.deleteExpando = true; support.noCloneEvent = true; support.reliableMarginRight = true; support.boxSizingReliable = true; // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE<9 try { delete div.test; } catch( e ) { support.deleteExpando = false; } // Check if we can trust getAttribute("value") input = document.createElement("input"); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "checked", "t" ); input.setAttribute( "name", "t" ); fragment = document.createDocumentFragment(); fragment.appendChild( input ); // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) for ( i in { submit: true, change: true, focusin: true }) { div.setAttribute( eventName = "on" + i, "t" ); support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; } div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Support: IE<9 // Iteration over object's inherited properties before its own. for ( i in jQuery( support ) ) { break; } support.ownLast = i !== "0"; // Run tests that need a body at doc ready jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } container = document.createElement("div"); container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; body.appendChild( container ).appendChild( div ); // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; tds = div.getElementsByTagName("td"); tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Support: IE8 // Check if empty table cells still have offsetWidth/Height support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check box-sizing and margin behavior. div.innerHTML = ""; div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; // Workaround failing boxSizing test due to offsetWidth returning wrong value // with some non-1 values of body zoom, ticket #13543 jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { support.boxSizing = div.offsetWidth === 4; }); // Use window.getComputedStyle because jsdom on node.js will break without it. if ( window.getComputedStyle ) { support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right marginDiv = div.appendChild( document.createElement("div") ); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; support.reliableMarginRight = !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== core_strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Support: IE6 // Check if elements with layout shrink-wrap their children div.style.display = "block"; div.innerHTML = "<div></div>"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); if ( support.inlineBlockNeedsLayout ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); // Null elements to avoid leaks in IE container = div = tds = marginDiv = null; }); // Null elements to avoid leaks in IE all = select = fragment = opt = a = input = null; return support; })({}); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData( elem, name, data, pvt /* Internal Use Only */ ){ if ( !jQuery.acceptData( elem ) ) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( typeof name === "string" ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } i = name.length; while ( i-- ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if ( jQuery.support.deleteExpando || cache != cache.window ) { /* jshint eqeqeq: true */ delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "applet": true, "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { // Do not set data on non-element because it will not be cleared (#8335). if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { return false; } var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; // nodes accept data unless otherwise specified; rejection can be conditional return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); jQuery.fn.extend({ data: function( key, value ) { var attrs, name, data = null, i = 0, elem = this[0]; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attrs = elem.attributes; for ( ; i < attrs.length; i++ ) { name = attrs[i].name; if ( name.indexOf("data-") === 0 ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return arguments.length > 1 ? // Sets one value this.each(function() { jQuery.data( this, key, value ); }) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var nodeHook, boolHook, rclass = /[\t\r\n\f]/g, rreturn = /\r/g, rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, getSetInput = jQuery.support.input; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } elem.className = jQuery.trim( cur ); } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } elem.className = value ? jQuery.trim( cur ) : ""; } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value; if ( typeof stateVal === "boolean" && type === "string" ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), classNames = value.match( core_rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( type === core_strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; }, val: function( value ) { var ret, hooks, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map(val, function ( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { // Use proper attribute retrieval(#6932, #12072) var val = jQuery.find.attr( elem, "value" ); return val != null ? val : elem.text; } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) { optionSet = true; } } // force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return values; } } }, attr: function( elem, name, value ) { var hooks, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === core_strundefined ) { return jQuery.prop( elem, name, value ); } // All attributes are lowercase // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( core_rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( jQuery.expr.match.bool.test( name ) ) { // Set corresponding property to false if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { elem[ propName ] = false; // Support: IE<9 // Also clear defaultChecked/defaultSelected (if appropriate) } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, propFix: { "for": "htmlFor", "class": "className" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? ret : ( elem[ name ] = value ); } else { return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? ret : elem[ name ]; } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); return tabindex ? parseInt( tabindex, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1; } } } }); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr; jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? function( elem, name, isXML ) { var fn = jQuery.expr.attrHandle[ name ], ret = isXML ? undefined : /* jshint eqeqeq: false */ (jQuery.expr.attrHandle[ name ] = undefined) != getter( elem, name, isXML ) ? name.toLowerCase() : null; jQuery.expr.attrHandle[ name ] = fn; return ret; } : function( elem, name, isXML ) { return isXML ? undefined : elem[ jQuery.camelCase( "default-" + name ) ] ? name.toLowerCase() : null; }; }); // fix oldIE attroperties if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = { set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) return name === "value" || value === elem.getAttribute( name ) ? value : undefined; } }; jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = // Some attributes are constructed with empty-string values when not defined function( elem, name, isXML ) { var ret; return isXML ? undefined : (ret = elem.getAttributeNode( name )) && ret.value !== "" ? ret.value : null; }; jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return ret && ret.specified ? ret.value : undefined; }, set: nodeHook.set }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }; }); } // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }; } jQuery.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; }); // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }; if ( !jQuery.support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { // Support: Webkit // "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; }; } }); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = core_hasOwn.call( event, "type" ) ? event.type : event, namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Even when returnValue equals to undefined Firefox will still show alert if ( event.result !== undefined ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === core_strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); var isSimple = /^.[^:#\[\.,]*$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var i, ret = [], self = this, len = self.length; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector || [], true) ); }, filter: function( selector ) { return this.pushStack( winnow(this, selector || [], false) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)) ) { cur = ret.push( cur ); break; } } } return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( jQuery.unique(all) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { ret = jQuery.unique( ret ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } return this.pushStack( ret ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; })); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; }); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; }); } if ( typeof qualifier === "string" ) { if ( isSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, manipulation_rcheckableType = /^(?:checkbox|radio)$/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], area: [ 1, "<map>", "</map>" ], param: [ 1, "<object>", "</object>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } }); }, prepend: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } }); }, before: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { var elem, elems = selector ? jQuery.filter( selector, this ) : this, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var // Snapshot the DOM in case .domManip sweeps something relevant into its fragment args = jQuery.map( this, function( elem ) { return [ elem.nextSibling, elem.parentNode ]; }), i = 0; // Make the changes, replacing each context element with the new content this.domManip( arguments, function( elem ) { var next = args[ i++ ], parent = args[ i++ ]; if ( parent ) { // Don't use the snapshot next if it has moved (#13810) if ( next && next.parentNode !== parent ) { next = this.nextSibling; } jQuery( this ).remove(); parent.insertBefore( elem, next ); } // Allow new content to include elements from the context set }, true ); // Force removal if there was no new content (e.g., from empty arguments) return i ? this : this.remove(); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, callback, allowIntersection ) { // Flatten any nested arrays args = core_concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, self.html() ); } self.domManip( args, callback, allowIntersection ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Hope ajax is available... jQuery._evalUrl( node.src ); } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() core_push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( manipulation_rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !jQuery.support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== core_strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } core_deletedIds.push( id ); } } } } }, _evalUrl: function( url ) { return jQuery.ajax({ url: url, type: "GET", dataType: "script", async: false, global: false, "throws": true }); } }); jQuery.fn.extend({ wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); } }); var iframe, getStyles, curCSS, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, rposition = /^(top|right|bottom|left)$/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), elemdisplay = { BODY: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400 }, cssExpand = [ "Top", "Right", "Bottom", "Left" ], cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function isHidden( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); } } else { if ( !values[ index ] ) { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } jQuery.fn.extend({ css: function( name, value ) { return jQuery.access( this, function( elem, name, value ) { var len, styles, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { if ( typeof state === "boolean" ) { return state ? this.show() : this.hide(); } return this.each(function() { if ( isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "columnCount": true, "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; } }); // NOTE: we've included the "window" in window.getComputedStyle // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { getStyles = function( elem ) { return window.getComputedStyle( elem, null ); }; curCSS = function( elem, name, _computed ) { var width, minWidth, maxWidth, computed = _computed || getStyles( elem ), // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, style = elem.style; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, _computed ) { var left, rs, rsLeft, computed = _computed || getStyles( elem ), ret = computed ? computed[ name ] : undefined, style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } // Try to determine the default display value of an element function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>") .css( "cssText", "display:block !important" ) ).appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; doc.write("<!doctype html><html><body>"); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } // Called ONLY from within css_defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[0], "display" ); elem.remove(); return display; } jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } // These hooks cannot be added until DOM ready because the support test // for it is not run until after DOM ready jQuery(function() { if ( !jQuery.support.reliableMarginRight ) { jQuery.cssHooks.marginRight = { get: function( elem, computed ) { if ( computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } }; } // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = { get: function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } }; }); } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; jQuery.fn.extend({ serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function(){ // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; }) .filter(function(){ var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !manipulation_rcheckableType.test( type ) ); }) .map(function( i, elem ){ var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ){ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); //Serialize an array of form elements or a set of //key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; }); jQuery.fn.extend({ hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); } }); var // Document location ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat("*"); // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( (dataType = dataTypes[i++]) ) { // Prepend if requested if ( dataType[0] === "+" ) { dataType = dataType.slice( 1 ) || "*"; (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); // Otherwise append } else { (structure[ dataType ] = structure[ dataType ] || []).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } }); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, response, type, self = this, off = url.indexOf(" "); if ( off >= 0 ) { selector = url.slice( off, url.length ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax({ url: url, // if "type" variable is undefined, then "GET" method will be used type: type, dataType: "html", data: params }).done(function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); }).complete( callback && function( jqXHR, status ) { self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); }); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ jQuery.fn[ type ] = function( fn ){ return this.on( type, fn ); }; }); jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( (match = rheaders.exec( responseHeadersString )) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to fireGlobals = s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger("ajaxStart"); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) : // Otherwise add one to the end cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader("Last-Modified"); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader("etag"); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); } }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ url: url, type: method, dataType: type, data: data, success: callback }); }; }); /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s[ "throws" ] ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery("head")[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement("script"); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } }); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) ); this[ callback ] = true; return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always(function() { // Restore preexisting value window[ callbackName ] = overwritten; // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; }); // Delegate to script return "script"; } }); var xhrCallbacks, xhrSupported, xhrId = 0, // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject && function() { // Abort all pending requests var key; for ( key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } }; // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties xhrSupported = jQuery.ajaxSettings.xhr(); jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = jQuery.support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport(function( s ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !s.crossDomain || jQuery.support.cors ) { var callback; return { send: function( headers, complete ) { // Get a new xhr var handle, i, xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open( s.type, s.url, s.async, s.username, s.password ); } else { xhr.open( s.type, s.url, s.async ); } // Apply custom fields if provided if ( s.xhrFields ) { for ( i in s.xhrFields ) { xhr[ i ] = s.xhrFields[ i ]; } } // Override mime type if needed if ( s.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( s.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !s.crossDomain && !headers["X-Requested-With"] ) { headers["X-Requested-With"] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } } catch( err ) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( s.hasContent && s.data ) || null ); // Listener callback = function( _, isAbort ) { var status, responseHeaders, statusText, responses; // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; if ( xhrOnUnloadAbort ) { delete xhrCallbacks[ handle ]; } } // If it's an abort if ( isAbort ) { // Abort it manually if needed if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); // When requesting binary data, IE6-9 will throw an exception // on any attempt to access responseText (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && s.isLocal && !s.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } } catch( firefoxAccessException ) { if ( !isAbort ) { complete( -1, firefoxAccessException ); } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, responseHeaders ); } }; if ( !s.async ) { // if we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback setTimeout( callback ); } else { handle = ++xhrId; if ( xhrOnUnloadAbort ) { // Create the active xhrs callbacks list if needed // and attach the unload handler if ( !xhrCallbacks ) { xhrCallbacks = {}; jQuery( window ).unload( xhrOnUnloadAbort ); } // Add to list of active xhrs callbacks xhrCallbacks[ handle ] = callback; } xhr.onreadystatechange = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } }); } var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), rrun = /queueHooks$/, animationPrefilters = [ defaultPrefilter ], tweeners = { "*": [function( prop, value ) { var tween = this.createTween( prop, value ), target = tween.cur(), parts = rfxnum.exec( value ), unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) && rfxnum.exec( jQuery.css( tween.elem, prop ) ), scale = 1, maxIterations = 20; if ( start && start[ 3 ] !== unit ) { // Trust units reported by jQuery.css unit = unit || start[ 3 ]; // Make sure we update the tween properties later on parts = parts || []; // Iteratively approximate from a nonzero starting point start = +target || 1; do { // If previous iteration zeroed out, double until we get *something* // Use a string for doubling factor so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply start = start / scale; jQuery.style( tween.elem, prop, start + unit ); // Update scale, tolerating zero or NaN from tween.cur() // And breaking the loop if scale is unchanged or perfect, or if we've just had enough } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); } // Update tween properties if ( parts ) { start = tween.start = +start || +target || 0; tween.unit = unit; // If a +=/-= token was provided, we're doing a relative animation tween.end = parts[ 1 ] ? start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : +parts[ 2 ]; } return tween; }] }; // Animations created synchronously will run synchronously function createFxNow() { setTimeout(function() { fxNow = undefined; }); return ( fxNow = jQuery.now() ); } function createTween( value, prop, animation ) { var tween, collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( (tween = collection[ index ].call( animation, prop, value )) ) { // we're done with this property return tween; } } } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; }), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ]); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise({ elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {} }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // resolve when we played the last frame // otherwise, reject if ( gotoEnd ) { deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } }), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { return result; } } jQuery.map( props, createTween, animation ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue }) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } function propFilter( props, specialEasing ) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } jQuery.Animation = jQuery.extend( Animation, { tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.split(" "); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; tweeners[ prop ] = tweeners[ prop ] || []; tweeners[ prop ].unshift( callback ); } }, prefilter: function( callback, prepend ) { if ( prepend ) { animationPrefilters.unshift( callback ); } else { animationPrefilters.push( callback ); } } }); function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ var prop, value, toggle, tween, hooks, oldfire, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHidden( elem ), dataShow = jQuery._data( elem, "fxshow" ); // handle queue: false promises if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always(function() { // doing this makes sure that the complete handler will be called // before this completes anim.always(function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } }); }); } // height/width overflow pass if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated if ( jQuery.css( elem, "display" ) === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; } } } if ( opts.overflow ) { style.overflow = "hidden"; if ( !jQuery.support.shrinkWrapBlocks ) { anim.always(function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; }); } } // show/hide pass for ( prop in props ) { value = props[ prop ]; if ( rfxtypes.exec( value ) ) { delete props[ prop ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { continue; } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); } } if ( !jQuery.isEmptyObject( orig ) ) { if ( dataShow ) { if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } } else { dataShow = jQuery._data( elem, "fxshow", {} ); } // store state if its toggle - enables .stop().toggle() to "reverse" if ( toggle ) { dataShow.hidden = !hidden; } if ( hidden ) { jQuery( elem ).show(); } else { anim.done(function() { jQuery( elem ).hide(); }); } anim.done(function() { var prop; jQuery._removeData( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } }); for ( prop in orig ) { tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = tween.start; if ( hidden ) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } } } function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || "swing"; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; if ( tween.elem[ tween.prop ] != null && (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { return tween.elem[ tween.prop ]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Support: IE <=9 // Panic based approach to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; }); jQuery.fn.extend({ fadeTo: function( speed, to, easing, callback ) { // show any hidden elements after setting opacity to 0 return this.filter( isHidden ).css( "opacity", 0 ).show() // animate to the value specified .end().animate({ opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each(function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } }); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each(function() { var index, data = jQuery._data( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.stop ) { hooks.stop.call( this, true ); } // look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // turn off finishing flag delete data.finish; }); } }); // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth? 1 : 0; for( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p*Math.PI ) / 2; } }; jQuery.timers = []; jQuery.fx = Tween.prototype.init; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { if ( timer() && jQuery.timers.push( timer ) ) { jQuery.fx.start(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { clearInterval( timerId ); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Back Compat <1.8 extension point jQuery.fx.step = {}; if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } jQuery.fn.offset = function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== core_strundefined ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }; jQuery.offset = { setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || docElem; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || docElem; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return jQuery.access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return jQuery.access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; }); }); // Limit scope pollution from any deprecated API // (function() { // The number of elements contained in the matched element set jQuery.fn.size = function() { return this.length; }; jQuery.fn.andSelf = jQuery.fn.addBack; // })(); if ( typeof module === "object" && module && typeof module.exports === "object" ) { // Expose jQuery as module.exports in loaders that implement the Node // module pattern (including browserify). Do not create the global, since // the user will be storing it themselves locally, and globals are frowned // upon in the Node module world. module.exports = jQuery; } else { // Otherwise expose jQuery to the global object as usual window.jQuery = window.$ = jQuery; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. if ( typeof define === "function" && define.amd ) { define( "jquery", [], function () { return jQuery; } ); } } })( window ); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | /*! jQuery UI - v1.10.4 |
| Request Header - size: 519 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:05 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 228560 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 228,560 bytes. |
/*! jQuery UI - v1.10.4 - 2014-03-02
* http://jqueryui.com * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ (function(e,t){function i(t,i){var s,a,o,r=t.nodeName.toLowerCase();return"area"===r?(s=t.parentNode,a=s.name,t.href&&a&&"map"===s.nodeName.toLowerCase()?(o=e("img[usemap=#"+a+"]")[0],!!o&&n(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,a=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,n){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),n&&n.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var n,s,a=e(this[0]);a.length&&a[0]!==document;){if(n=a.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(s=parseInt(a.css("zIndex"),10),!isNaN(s)&&0!==s))return s;a=a.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){a.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),s=isNaN(n);return(s||n>=0)&&i(t,!s)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,n){function s(t,i,n,s){return e.each(a,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var a="Width"===n?["Left","Right"]:["Top","Bottom"],o=n.toLowerCase(),r={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(i){return i===t?r["inner"+n].call(this):this.each(function(){e(this).css(o,s(this,i)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?r["outer"+n].call(this,t):this.each(function(){e(this).css(o,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,n){var s,a=e.ui[t].prototype;for(s in n)a.plugins[s]=a.plugins[s]||[],a.plugins[s].push([i,n[s]])},call:function(e,t,i){var n,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(n=0;s.length>n;n++)e.options[s[n][0]]&&s[n][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[n]>0?!0:(t[n]=1,s=t[n]>0,t[n]=0,s)}})})(jQuery);(function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix||i:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})})(jQuery);(function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,l=Math.round,h=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:a?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var a,p,g,m,v,_,b=t(e.of),y=t.position.getWithinInfo(e.within),k=t.position.getScrollInfo(y),w=(e.collision||"flip").split(" "),D={};return _=n(b),b[0].preventDefault&&(e.at="left top"),p=_.width,g=_.height,m=_.offset,v=t.extend({},m),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=h.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=h.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),D[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=g:"center"===e.at[1]&&(v.top+=g/2),a=i(D.at,p,g),v.left+=a[0],v.top+=a[1],this.each(function(){var n,h,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),_=s(this,"marginTop"),x=u+f+s(this,"marginRight")+k.width,C=d+_+s(this,"marginBottom")+k.height,M=t.extend({},v),T=i(D.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?M.left-=u:"center"===e.my[0]&&(M.left-=u/2),"bottom"===e.my[1]?M.top-=d:"center"===e.my[1]&&(M.top-=d/2),M.left+=T[0],M.top+=T[1],t.support.offsetFractions||(M.left=l(M.left),M.top=l(M.top)),n={marginLeft:f,marginTop:_},t.each(["left","top"],function(i,s){t.ui.position[w[i]]&&t.ui.position[w[i]][s](M,{targetWidth:p,targetHeight:g,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:x,collisionHeight:C,offset:[a[0]+T[0],a[1]+T[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(h=function(t){var i=m.left-M.left,s=i+p-u,n=m.top-M.top,a=n+g-d,l={target:{element:b,left:m.left,top:m.top,width:p,height:g},element:{element:c,left:M.left,top:M.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(l.horizontal="center"),d>g&&g>r(n+a)&&(l.vertical="middle"),l.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,l)}),c.offset(t.extend(M,{using:h}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-o-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-o-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-o-a,t.top+p+f+g>c&&(0>s||r(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,t.top+p+f+g>u&&(i>0||u>r(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(t(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){t("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||t.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1):!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,t(document).width()-this.helperProportions.width-this.margins.left,(t(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(e){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=e.pageX,h=e.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(h=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,l=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("ui-draggable"),n=s.options,a=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,a))})},stop:function(e,i){var s=t(this).data("ui-draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("ui-draggable"),n=this;t.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&t.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("ui-draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("ui-draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:e.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-e.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:e.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(e.pageY-t(document).scrollTop()<s.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-s.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<s.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(e.pageX-t(document).scrollLeft()<s.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-s.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<s.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(){var e=t(this).data("ui-draggable"),i=e.options;e.snapElements=[],t(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=t(this),s=i.offset();this!==e.element[0]&&e.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(e,i){var s,n,a,o,r,l,h,c,u,d,p=t(this).data("ui-draggable"),g=p.options,f=g.snapTolerance,m=i.offset.left,_=m+p.helperProportions.width,v=i.offset.top,b=v+p.helperProportions.height;for(u=p.snapElements.length-1;u>=0;u--)r=p.snapElements[u].left,l=r+p.snapElements[u].width,h=p.snapElements[u].top,c=h+p.snapElements[u].height,r-f>_||m>l+f||h-f>b||v>c+f||!t.contains(p.snapElements[u].item.ownerDocument,p.snapElements[u].item)?(p.snapElements[u].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=!1):("inner"!==g.snapMode&&(s=f>=Math.abs(h-b),n=f>=Math.abs(c-v),a=f>=Math.abs(r-_),o=f>=Math.abs(l-m),s&&(i.position.top=p._convertPositionTo("relative",{top:h-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l}).left-p.margins.left)),d=s||n||a||o,"outer"!==g.snapMode&&(s=f>=Math.abs(h-v),n=f>=Math.abs(c-b),a=f>=Math.abs(r-m),o=f>=Math.abs(l-_),s&&(i.position.top=p._convertPositionTo("relative",{top:h,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[u].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=s||n||a||o||d)}}),t.ui.plugin.add("draggable","stack",{start:function(){var e,i=this.data("ui-draggable").options,s=t.makeArray(t(i.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(e=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(i){t(this).css("zIndex",e+i)}),this.css("zIndex",e+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}t.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],undefined):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},t.ui.ddmanager.droppables[i.scope]=t.ui.ddmanager.droppables[i.scope]||[],t.ui.ddmanager.droppables[i.scope].push(this),i.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(t,i,s){if(!i.offset)return!1;var n,a,o=(t.positionAbs||t.position.absolute).left,r=(t.positionAbs||t.position.absolute).top,l=o+t.helperProportions.width,h=r+t.helperProportions.height,c=i.offset.left,u=i.offset.top,d=c+i.proportions().width,p=u+i.proportions().height;switch(s){case"fit":return o>=c&&d>=l&&r>=u&&p>=h;case"intersect":return o+t.helperProportions.width/2>c&&d>l-t.helperProportions.width/2&&r+t.helperProportions.height/2>u&&p>h-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,a=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(a,u,i.proportions().height)&&e(n,c,i.proportions().width);case"touch":return(r>=u&&p>=r||h>=u&&p>=h||u>r&&h>p)&&(o>=c&&d>=o||l>=c&&d>=l||c>o&&l>d);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,a=t.ui.ddmanager.droppables[e.options.scope]||[],o=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||e&&!a[s].accept.call(a[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue t}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=t.ui.intersect(e,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return t.data(this,"ui-droppable").options.scope===n}),a.length&&(s=t.data(a[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}})(jQuery);(function(t){function e(t){return parseInt(t,10)||0}function i(t){return!isNaN(parseInt(t,10))}t.widget("ui.resizable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),a="ui-resizable-"+s,n=t("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,a;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=t(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,a),this._proportionallyResize()),t(this.handles[i]).length},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(t(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(t(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=e(this.helper.css("left")),n=e(this.helper.css("top")),o.containment&&(s+=t(o.containment).scrollLeft()||0,n+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(e){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,c=this.size.height,u=e.pageX-a.left||0,d=e.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[e,u,d]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==c&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||this._trigger("resize",e,this.ui()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&t.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,a=s?0:c.sizeDiff.width,o={width:c.helper.width()-a,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,h=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(o,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),i(t.left)&&(this.position.left=t.left),i(t.top)&&(this.position.top=t.top),i(t.height)&&(this.size.height=t.height),i(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,s=this.size,n=this.axis;return i(t.height)?t.width=t.height*this.aspectRatio:i(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(s.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(s.height-t.height),t.left=e.left+(s.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,s=this.axis,n=i(t.width)&&e.maxWidth&&e.maxWidth<t.width,a=i(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=i(t.width)&&e.minWidth&&e.minWidth>t.width,r=i(t.height)&&e.minHeight&&e.minHeight>t.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(s),u=/nw|ne|n/.test(s);return o&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),a&&(t.height=e.maxHeight),o&&c&&(t.left=h-e.minWidth),n&&c&&(t.left=h-e.maxWidth),r&&u&&(t.top=l-e.minHeight),a&&u&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var t,e,i,s,n,a=this.helper||this.element;for(t=0;this._proportionallyResizeElements.length>t;t++){if(n=this._proportionallyResizeElements[t],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],e=0;i.length>e;e++)this.borderDif[e]=(parseInt(i[e],10)||0)+(parseInt(s[e],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&t.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=t(this).data("ui-resizable"),c=l.options,u=l.element,d=c.containment,p=d instanceof t?d.get(0):/parent/.test(d)?u.parent().get(0):d;p&&(l.containerElement=t(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(i=t(p),s=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){s[t]=e(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=t.ui.hasScroll(p,"left")?p.scrollWidth:o,h=t.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(e){var i,s,n,a,o=t(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,c=o._aspectRatio||e.shiftKey,u={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-u.left),c&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),c&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-u.left:o.offset.left-u.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-u.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=Math.abs(o.parentData.left)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,c&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,c&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.containerOffset,n=e.containerPosition,a=e.containerElement,o=t(e.helper),r=o.offset(),h=o.outerWidth()-e.sizeDiff.width,l=o.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(a.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(a.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=function(e){t(e).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):t.each(i.alsoResize,function(t){s(t)})},resize:function(e,i){var s=t(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(a[e]=i||null)}),e.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size,n=e.originalSize,a=e.originalPosition,o=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&d>i.maxWidth,g=i.maxHeight&&p>i.maxHeight,m=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),v&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(o)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.top=a.top-u):/^(sw)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.left=a.left-c):(p-l>0?(e.size.height=p,e.position.top=a.top-u):(e.size.height=l,e.position.top=a.top+n.height-l),d-h>0?(e.size.width=d,e.position.left=a.left-c):(e.size.width=h,e.position.left=a.left+n.width-h))}})})(jQuery);(function(t){t.widget("ui.selectable",t.ui.mouse,{version:"1.10.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e=t(i.options.filter,i.element[0]),e.addClass("ui-selectee"),e.each(function(){var e=t(this),i=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:i.left,top:i.top,right:i.left+e.outerWidth(),bottom:i.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=t("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=e.pageX,l=e.pageY;return a>r&&(i=r,r=a,a=i),o>l&&(i=l,l=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:l-o}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),h=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?h=!(i.left>r||a>i.right||i.top>l||o>i.bottom):"fit"===n.tolerance&&(h=i.left>a&&r>i.right&&i.top>o&&l>i.bottom),h?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):undefined}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-t(document).scrollTop()<a.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-a.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<a.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+a.scrollSpeed)),e.pageX-t(document).scrollLeft()<a.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-a.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<a.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return n?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&s||"left"===o&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t("<td> </td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,o,a,r,h,l,c,u,d,p,f=null,g=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],g=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[g].containerCache.over||(this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1);else{for(a=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],o=this.items.length-1;o>=0;o--)t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))&&(u=this.items[o].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[o][l]-c)&&(d=!0,u+=this.items[o][l]),a>Math.abs(u-c)&&(a=Math.abs(u-c),r=this.items[o],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[g].element,!0),this._trigger("change",s,this._uiHash()),this.containers[g]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[g],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery);(function(e){var t=0,i={},a={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",a.height=a.paddingTop=a.paddingBottom=a.borderTopWidth=a.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.10.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e(),content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),undefined):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t),undefined)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,a=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:n=this.headers[(s+1)%a];break;case i.LEFT:case i.UP:n=this.headers[(s-1+a)%a];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:n=this.headers[0];break;case i.END:n=this.headers[a-1]}n&&(e(t.target).attr("tabIndex",-1),e(n).attr("tabIndex",0),n.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,a=this.options,s=a.heightStyle,n=this.element.parent(),r=this.accordionId="ui-accordion-"+(this.element.attr("id")||++t);this.active=this._findActive(a.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(t){var i=e(this),a=i.attr("id"),s=i.next(),n=s.attr("id");a||(a=r+"-header-"+t,i.attr("id",a)),n||(n=r+"-panel-"+t,s.attr("id",n)),i.attr("aria-controls",n),s.attr("aria-labelledby",a)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(a.event),"fill"===s?(i=n.height(),this.element.siblings(":visible").each(function(){var t=e(this),a=t.css("position");"absolute"!==a&&"fixed"!==a&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(i=0,this.headers.next().each(function(){i=Math.max(i,e(this).css("height","").height())}).height(i))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,a=this.active,s=e(t.currentTarget),n=s[0]===a[0],r=n&&i.collapsible,o=r?e():s.next(),h=a.next(),d={oldHeader:a,oldPanel:h,newHeader:r?e():s,newPanel:o};t.preventDefault(),n&&!i.collapsible||this._trigger("beforeActivate",t,d)===!1||(i.active=r?!1:this.headers.index(s),this.active=n?e():s,this._toggle(d),a.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&a.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),n||(s.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),s.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,a=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=a,this.options.animate?this._animate(i,a,t):(a.hide(),i.show(),this._toggleComplete(t)),a.attr({"aria-hidden":"true"}),a.prev().attr("aria-selected","false"),i.length&&a.length?a.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(e,t,s){var n,r,o,h=this,d=0,c=e.length&&(!t.length||e.index()<t.index()),l=this.options.animate||{},u=c&&l.down||l,v=function(){h._toggleComplete(s)};return"number"==typeof u&&(o=u),"string"==typeof u&&(r=u),r=r||u.easing||l.easing,o=o||u.duration||l.duration,t.length?e.length?(n=e.show().outerHeight(),t.animate(i,{duration:o,easing:r,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(a,{duration:o,easing:r,complete:v,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?d+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(n-t.outerHeight()-d),d=0)}}),undefined):t.animate(i,o,r,v):e.animate(a,o,r,v)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}})})(jQuery);(function(e){e.widget("ui.autocomplete",{version:"1.10.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,undefined;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),undefined):(this._searchTimeout(e),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(e),this._change(e),undefined)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:s})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):undefined},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<a>").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[e](t),undefined):(this.search(null,t),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.text(t))}})})(jQuery);(function(e){var t,i="ui-button ui-widget ui-state-default ui-corner-all",n="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",s=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},a=function(t){var i=t.name,n=t.form,s=e([]);return i&&(i=i.replace(/'/g,"\\'"),s=n?e(n).find("[name='"+i+"']"):e("[name='"+i+"']",t.ownerDocument).filter(function(){return!this.form})),s};e.widget("ui.button",{version:"1.10.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,s),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var n=this,o=this.options,r="checkbox"===this.type||"radio"===this.type,h=r?"":"ui-state-active";null===o.label&&(o.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(i).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){o.disabled||this===t&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){o.disabled||e(this).removeClass(h)}).bind("click"+this.eventNamespace,function(e){o.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),r&&this.element.bind("change"+this.eventNamespace,function(){n.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return o.disabled?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(o.disabled)return!1;e(this).addClass("ui-state-active"),n.buttonElement.attr("aria-pressed","true");var t=n.element[0];a(t).not(t).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return o.disabled?!1:(e(this).addClass("ui-state-active"),t=this,n.document.one("mouseup",function(){t=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return o.disabled?!1:(e(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(t){return o.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",o.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(i+" ui-state-active "+n).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.element.prop("disabled",!!t),t&&this.buttonElement.removeClass("ui-state-focus"),undefined):(this._resetButton(),undefined)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?a(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var t=this.buttonElement.removeClass(n),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,a=s.primary&&s.secondary,o=[];s.primary||s.secondary?(this.options.text&&o.push("ui-button-text-icon"+(a?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(o.push(a?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):o.push("ui-button-text-only"),t.addClass(o.join(" "))}}),e.widget("ui.buttonset",{version:"1.10.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(function(e,t){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all' style='display:none'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){e.datepicker._isDisabledDatepicker(n.inline?t.parent()[0]:n.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))})}function s(t,i){e.extend(t,i);for(var a in i)null==i[a]&&(t[a]=i[a]);return t}e.extend(e.ui,{datepicker:{version:"1.10.4"}});var n,r="datepicker";e.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return s(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var a,s,n;a=t.nodeName.toLowerCase(),s="div"===a||"span"===a,t.id||(this.uuid+=1,t.id="dp"+this.uuid),n=this._newInst(e(t),s),n.settings=e.extend({},i||{}),"input"===a?this._connectDatepicker(t,n):s&&this._inlineDatepicker(t,n)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var a=e(t);i.append=e([]),i.trigger=e([]),a.hasClass(this.markerClassName)||(this._attachments(a,i),a.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,r,i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var a,s,n,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=e("<span class='"+this._appendClass+"'>"+r+"</span>"),t[o?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),a=this._get(i,"showOn"),("focus"===a||"both"===a)&&t.focus(this._showDatepicker),("button"===a||"both"===a)&&(s=this._get(i,"buttonText"),n=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:n,alt:s,title:s}):e("<button type='button'></button>").addClass(this._triggerClass).html(n?e("<img/>").attr({src:n,alt:s,title:s}):s)),t[o?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,a,s,n=new Date(2009,11,20),r=this._get(e,"dateFormat");r.match(/[DM]/)&&(t=function(e){for(i=0,a=0,s=0;e.length>s;s++)e[s].length>i&&(i=e[s].length,a=s);return a},n.setMonth(t(this._get(e,r.match(/MM/)?"monthNames":"monthNamesShort"))),n.setDate(t(this._get(e,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-n.getDay())),e.input.attr("size",this._formatDate(e,n).length)}},_inlineDatepicker:function(t,i){var a=e(t);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(i.dpDiv),e.data(t,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,a,n,o){var u,c,h,l,d,p=this._dialogInst;return p||(this.uuid+=1,u="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+u+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},e.data(this._dialogInput[0],r,p)),s(p.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(c=document.documentElement.clientWidth,h=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[c/2-100+l,h/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(t){var i,a=e(t),s=e.data(t,r);a.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,r),"input"===i?(s.append.remove(),s.trigger.remove(),a.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&a.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().removeClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().addClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,a,n){var r,o,u,c,h=this._getInst(i);return 2===arguments.length&&"string"==typeof a?"defaults"===a?e.extend({},e.datepicker._defaults):h?"all"===a?e.extend({},h.settings):this._get(h,a):null:(r=a||{},"string"==typeof a&&(r={},r[a]=n),h&&(this._curInst===h&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),u=this._getMinMaxDate(h,"min"),c=this._getMinMaxDate(h,"max"),s(h.settings,r),null!==u&&r.dateFormat!==t&&r.minDate===t&&(h.settings.minDate=this._formatDate(h,u)),null!==c&&r.dateFormat!==t&&r.maxDate===t&&(h.settings.maxDate=this._formatDate(h,c)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(e(i),h),this._autoSize(h),this._setDate(h,o),this._updateAlternate(h),this._updateDatepicker(h)),t)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,a,s,n=e.datepicker._getInst(t.target),r=!0,o=n.dpDiv.is(".ui-datepicker-rtl");if(n._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),r=!1;break;case 13:return s=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",n.dpDiv),s[0]&&e.datepicker._selectDay(t.target,n.selectedMonth,n.selectedYear,s[0]),i=e.datepicker._get(n,"onSelect"),i?(a=e.datepicker._formatDate(n),i.apply(n.input?n.input[0]:null,[a,n])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?1:-1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?-1:1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),r=t.ctrlKey||t.metaKey;break;default:r=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(i){var a,s,n=e.datepicker._getInst(i.target);return e.datepicker._get(n,"constrainInput")?(a=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">s||!a||a.indexOf(s)>-1):t},_doKeyUp:function(t){var i,a=e.datepicker._getInst(t.target);if(a.input.val()!==a.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,e.datepicker._getFormatConfig(a)),i&&(e.datepicker._setDateFromField(a),e.datepicker._updateAlternate(a),e.datepicker._updateDatepicker(a))}catch(s){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,a,n,r,o,u,c;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),a=e.datepicker._get(i,"beforeShow"),n=a?a.apply(t,[t,i]):{},n!==!1&&(s(i.settings,n),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),r=!1,e(t).parents().each(function(){return r|="fixed"===e(this).css("position"),!r}),o={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),o=e.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(u=e.datepicker._get(i,"showAnim"),c=e.datepicker._get(i,"duration"),i.dpDiv.zIndex(e(t).zIndex()+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[u]?i.dpDiv.show(u,e.datepicker._get(i,"showOptions"),c):i.dpDiv[u||"show"](u?c:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,n=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,a=this._getNumberOfMonths(t),s=a[1],r=17;t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",r*s+"em"),t.dpDiv[(1!==a[0]||1!==a[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,a){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),r=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,u=document.documentElement.clientWidth+(a?0:e(document).scrollLeft()),c=document.documentElement.clientHeight+(a?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?s-r:0,i.left-=a&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=a&&i.top===t.input.offset().top+o?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+s>u&&u>s?Math.abs(i.left+s-u):0),i.top-=Math.min(i.top,i.top+n>c&&c>n?Math.abs(n+o):0),i},_findPos:function(t){for(var i,a=this._getInst(t),s=this._get(a,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[s?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,a,s,n,o=this._curInst;!o||t&&o!==e.data(t,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),a=this._get(o,"duration"),s=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),a,s):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?a:null,s),i||s(),this._datepickerShowing=!1,n=this._get(o,"onClose"),n&&n.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),a=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==a)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,a){var s=e(t),n=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(n,i+("M"===a?this._get(n,"showCurrentAtPos"):0),a),this._updateDatepicker(n))},_gotoToday:function(t){var i,a=e(t),s=this._getInst(a[0]);this._get(s,"gotoCurrent")&&s.currentDay?(s.selectedDay=s.currentDay,s.drawMonth=s.selectedMonth=s.currentMonth,s.drawYear=s.selectedYear=s.currentYear):(i=new Date,s.selectedDay=i.getDate(),s.drawMonth=s.selectedMonth=i.getMonth(),s.drawYear=s.selectedYear=i.getFullYear()),this._notifyChange(s),this._adjustDate(a)},_selectMonthYear:function(t,i,a){var s=e(t),n=this._getInst(s[0]);n["selected"+("M"===a?"Month":"Year")]=n["draw"+("M"===a?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(n),this._adjustDate(s)},_selectDay:function(t,i,a,s){var n,r=e(t);e(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(n=this._getInst(r[0]),n.selectedDay=n.currentDay=e("a",s).html(),n.selectedMonth=n.currentMonth=i,n.selectedYear=n.currentYear=a,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var a,s=e(t),n=this._getInst(s[0]);i=null!=i?i:this._formatDate(n),n.input&&n.input.val(i),this._updateAlternate(n),a=this._get(n,"onSelect"),a?a.apply(n.input?n.input[0]:null,[i,n]):n.input&&n.input.trigger("change"),n.inline?this._updateDatepicker(n):(this._hideDatepicker(),this._lastInput=n.input[0],"object"!=typeof n.input[0]&&n.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,a,s,n=this._get(t,"altField");n&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),a=this._getDate(t),s=this.formatDate(i,a,this._getFormatConfig(t)),e(n).each(function(){e(this).val(s)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(i,a,s){if(null==i||null==a)throw"Invalid arguments";if(a="object"==typeof a?""+a:a+"",""===a)return null;var n,r,o,u,c=0,h=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,l="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,p=(s?s.dayNames:null)||this._defaults.dayNames,g=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,m=(s?s.monthNames:null)||this._defaults.monthNames,f=-1,_=-1,v=-1,k=-1,y=!1,b=function(e){var t=i.length>n+1&&i.charAt(n+1)===e;return t&&n++,t},D=function(e){var t=b(e),i="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,s=RegExp("^\\d{1,"+i+"}"),n=a.substring(c).match(s);if(!n)throw"Missing number at position "+c;return c+=n[0].length,parseInt(n[0],10)},w=function(i,s,n){var r=-1,o=e.map(b(i)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,i){var s=i[1];return a.substr(c,s.length).toLowerCase()===s.toLowerCase()?(r=i[0],c+=s.length,!1):t}),-1!==r)return r+1;throw"Unknown name at position "+c},M=function(){if(a.charAt(c)!==i.charAt(n))throw"Unexpected literal at position "+c;c++};for(n=0;i.length>n;n++)if(y)"'"!==i.charAt(n)||b("'")?M():y=!1;else switch(i.charAt(n)){case"d":v=D("d");break;case"D":w("D",d,p);break;case"o":k=D("o");break;case"m":_=D("m");break;case"M":_=w("M",g,m);break;case"y":f=D("y");break;case"@":u=new Date(D("@")),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"!":u=new Date((D("!")-this._ticksTo1970)/1e4),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"'":b("'")?M():y=!0;break;default:M()}if(a.length>c&&(o=a.substr(c),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===f?f=(new Date).getFullYear():100>f&&(f+=(new Date).getFullYear()-(new Date).getFullYear()%100+(l>=f?0:-100)),k>-1)for(_=1,v=k;;){if(r=this._getDaysInMonth(f,_-1),r>=v)break;_++,v-=r}if(u=this._daylightSavingAdjust(new Date(f,_-1,v)),u.getFullYear()!==f||u.getMonth()+1!==_||u.getDate()!==v)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var a,s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,n=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,u=function(t){var i=e.length>a+1&&e.charAt(a+1)===t;return i&&a++,i},c=function(e,t,i){var a=""+t;if(u(e))for(;i>a.length;)a="0"+a;return a},h=function(e,t,i,a){return u(e)?a[t]:i[t]},l="",d=!1;if(t)for(a=0;e.length>a;a++)if(d)"'"!==e.charAt(a)||u("'")?l+=e.charAt(a):d=!1;else switch(e.charAt(a)){case"d":l+=c("d",t.getDate(),2);break;case"D":l+=h("D",t.getDay(),s,n);break;case"o":l+=c("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":l+=c("m",t.getMonth()+1,2);break;case"M":l+=h("M",t.getMonth(),r,o);break;case"y":l+=u("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=1e4*t.getTime()+this._ticksTo1970;break;case"'":u("'")?l+="'":d=!0;break;default:l+=e.charAt(a)}return l},_possibleChars:function(e){var t,i="",a=!1,s=function(i){var a=e.length>t+1&&e.charAt(t+1)===i;return a&&t++,a};for(t=0;e.length>t;t++)if(a)"'"!==e.charAt(t)||s("'")?i+=e.charAt(t):a=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":s("'")?i+="'":a=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,i){return e.settings[i]!==t?e.settings[i]:this._defaults[i]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),a=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),n=s,r=this._getFormatConfig(e);try{n=this.parseDate(i,a,r)||s}catch(o){a=t?"":a}e.selectedDay=n.getDate(),e.drawMonth=e.selectedMonth=n.getMonth(),e.drawYear=e.selectedYear=n.getFullYear(),e.currentDay=a?n.getDate():0,e.currentMonth=a?n.getMonth():0,e.currentYear=a?n.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,a){var s=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},n=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(a){}for(var s=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,n=s.getFullYear(),r=s.getMonth(),o=s.getDate(),u=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,c=u.exec(i);c;){switch(c[2]||"d"){case"d":case"D":o+=parseInt(c[1],10);break;case"w":case"W":o+=7*parseInt(c[1],10);break;case"m":case"M":r+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r));break;case"y":case"Y":n+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r))}c=u.exec(i)}return new Date(n,r,o)},r=null==i||""===i?a:"string"==typeof i?n(i):"number"==typeof i?isNaN(i)?a:s(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?a:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var a=!t,s=e.selectedMonth,n=e.selectedYear,r=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=r.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=r.getMonth(),e.drawYear=e.selectedYear=e.currentYear=r.getFullYear(),s===e.selectedMonth&&n===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(a?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),a="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(a,-i,"M")},next:function(){e.datepicker._adjustDate(a,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(a)},selectDay:function(){return e.datepicker._selectDay(a,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(a,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(a,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,a,s,n,r,o,u,c,h,l,d,p,g,m,f,_,v,k,y,b,D,w,M,C,x,I,N,T,A,E,S,Y,F,P,O,j,K,R,H=new Date,W=this._daylightSavingAdjust(new Date(H.getFullYear(),H.getMonth(),H.getDate())),L=this._get(e,"isRTL"),U=this._get(e,"showButtonPanel"),B=this._get(e,"hideIfNoPrevNext"),z=this._get(e,"navigationAsDateFormat"),q=this._getNumberOfMonths(e),G=this._get(e,"showCurrentAtPos"),J=this._get(e,"stepMonths"),Q=1!==q[0]||1!==q[1],V=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),$=this._getMinMaxDate(e,"min"),X=this._getMinMaxDate(e,"max"),Z=e.drawMonth-G,et=e.drawYear;if(0>Z&&(Z+=12,et--),X)for(t=this._daylightSavingAdjust(new Date(X.getFullYear(),X.getMonth()-q[0]*q[1]+1,X.getDate())),t=$&&$>t?$:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=z?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-J,1)),this._getFormatConfig(e)):i,a=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>":B?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>",s=this._get(e,"nextText"),s=z?this.formatDate(s,this._daylightSavingAdjust(new Date(et,Z+J,1)),this._getFormatConfig(e)):s,n=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>":B?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>",r=this._get(e,"currentText"),o=this._get(e,"gotoCurrent")&&e.currentDay?V:W,r=z?this.formatDate(r,o,this._getFormatConfig(e)):r,u=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",c=U?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(L?u:"")+(this._isInRange(e,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(L?"":u)+"</div>":"",h=parseInt(this._get(e,"firstDay"),10),h=isNaN(h)?0:h,l=this._get(e,"showWeek"),d=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),g=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),f=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),v=this._get(e,"selectOtherMonths"),k=this._getDefaultDate(e),y="",D=0;q[0]>D;D++){for(w="",this.maxRows=4,M=0;q[1]>M;M++){if(C=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),x=" ui-corner-all",I="",Q){if(I+="<div class='ui-datepicker-group",q[1]>1)switch(M){case 0:I+=" ui-datepicker-group-first",x=" ui-corner-"+(L?"right":"left");break;case q[1]-1:I+=" ui-datepicker-group-last",x=" ui-corner-"+(L?"left":"right");break;default:I+=" ui-datepicker-group-middle",x=""}I+="'>"}for(I+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+x+"'>"+(/all|left/.test(x)&&0===D?L?n:a:"")+(/all|right/.test(x)&&0===D?L?a:n:"")+this._generateMonthYearHeader(e,Z,et,$,X,D>0||M>0,g,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",N=l?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",b=0;7>b;b++)T=(b+h)%7,N+="<th"+((b+h+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[T]+"'>"+p[T]+"</span></th>";for(I+=N+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),E=(this._getFirstDayOfMonth(et,Z)-h+7)%7,S=Math.ceil((E+A)/7),Y=Q?this.maxRows>S?this.maxRows:S:S,this.maxRows=Y,F=this._daylightSavingAdjust(new Date(et,Z,1-E)),P=0;Y>P;P++){for(I+="<tr>",O=l?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(F)+"</td>":"",b=0;7>b;b++)j=f?f.apply(e.input?e.input[0]:null,[F]):[!0,""],K=F.getMonth()!==Z,R=K&&!v||!j[0]||$&&$>F||X&&F>X,O+="<td class='"+((b+h+6)%7>=5?" ui-datepicker-week-end":"")+(K?" ui-datepicker-other-month":"")+(F.getTime()===C.getTime()&&Z===e.selectedMonth&&e._keyEvent||k.getTime()===F.getTime()&&k.getTime()===C.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(K&&!_?"":" "+j[1]+(F.getTime()===V.getTime()?" "+this._currentClass:"")+(F.getTime()===W.getTime()?" ui-datepicker-today":""))+"'"+(K&&!_||!j[2]?"":" title='"+j[2].replace(/'/g,"'")+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+F.getMonth()+"' data-year='"+F.getFullYear()+"'")+">"+(K&&!_?" ":R?"<span class='ui-state-default'>"+F.getDate()+"</span>":"<a class='ui-state-default"+(F.getTime()===W.getTime()?" ui-state-highlight":"")+(F.getTime()===V.getTime()?" ui-state-active":"")+(K?" ui-priority-secondary":"")+"' href='#'>"+F.getDate()+"</a>")+"</td>",F.setDate(F.getDate()+1),F=this._daylightSavingAdjust(F);I+=O+"</tr>"}Z++,Z>11&&(Z=0,et++),I+="</tbody></table>"+(Q?"</div>"+(q[0]>0&&M===q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),w+=I}y+=w}return y+=c,e._keyEvent=!1,y},_generateMonthYearHeader:function(e,t,i,a,s,n,r,o){var u,c,h,l,d,p,g,m,f=this._get(e,"changeMonth"),_=this._get(e,"changeYear"),v=this._get(e,"showMonthAfterYear"),k="<div class='ui-datepicker-title'>",y="";if(n||!f)y+="<span class='ui-datepicker-month'>"+r[t]+"</span>";else{for(u=a&&a.getFullYear()===i,c=s&&s.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",h=0;12>h;h++)(!u||h>=a.getMonth())&&(!c||s.getMonth()>=h)&&(y+="<option value='"+h+"'"+(h===t?" selected='selected'":"")+">"+o[h]+"</option>");y+="</select>"}if(v||(k+=y+(!n&&f&&_?"":" ")),!e.yearshtml)if(e.yearshtml="",n||!_)k+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(l=this._get(e,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?d+parseInt(e,10):parseInt(e,10); return isNaN(t)?d:t},g=p(l[0]),m=Math.max(g,p(l[1]||"")),g=a?Math.max(g,a.getFullYear()):g,m=s?Math.min(m,s.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=g;g++)e.yearshtml+="<option value='"+g+"'"+(g===i?" selected='selected'":"")+">"+g+"</option>";e.yearshtml+="</select>",k+=e.yearshtml,e.yearshtml=null}return k+=this._get(e,"yearSuffix"),v&&(k+=(!n&&f&&_?"":" ")+y),k+="</div>"},_adjustInstDate:function(e,t,i){var a=e.drawYear+("Y"===i?t:0),s=e.drawMonth+("M"===i?t:0),n=Math.min(e.selectedDay,this._getDaysInMonth(a,s))+("D"===i?t:0),r=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(a,s,n)));e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),s=i&&i>t?i:t;return a&&s>a?a:s},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,a){var s=this._getNumberOfMonths(e),n=this._daylightSavingAdjust(new Date(i,a+(0>t?t:s[0]*s[1]),1));return 0>t&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(e,n)},_isInRange:function(e,t){var i,a,s=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),r=null,o=null,u=this._get(e,"yearRange");return u&&(i=u.split(":"),a=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=a),i[1].match(/[+\-].*/)&&(o+=a)),(!s||t.getTime()>=s.getTime())&&(!n||t.getTime()<=n.getTime())&&(!r||t.getFullYear()>=r)&&(!o||o>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,a){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var s=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(a,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),s,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new i,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.10.4"})(jQuery);(function(e){var t={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.10.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,a=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._destroyOverlay(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(s){}this._hide(this.uiDialog,this.options.hide,function(){a._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!t&&this._trigger("focus",e),i},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var e=this.element.find("[autofocus]");e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),undefined;if(t.keyCode===e.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),a=i.filter(":first"),s=i.filter(":last");t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==a[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(s.focus(1),t.preventDefault()):(a.focus(1),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html(" "),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(e.each(i,function(i,a){var s,n;a=e.isFunction(a)?{click:a,text:i}:a,a=e.extend({type:"button"},a),s=a.click,a.click=function(){s.apply(t.element[0],arguments)},n={icons:a.icons,text:a.showText},delete a.icons,delete a.showText,e("<button></button>",a).button(n).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,a=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(a,s){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",a,t(s))},drag:function(e,a){i._trigger("drag",e,t(a))},stop:function(s,n){a.position=[n.position.left-i.document.scrollLeft(),n.position.top-i.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",s,t(n))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,a=this.options,s=a.resizable,n=this.uiDialog.css("position"),r="string"==typeof s?s:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:a.maxWidth,maxHeight:a.maxHeight,minWidth:a.minWidth,minHeight:this._minHeight(),handles:r,start:function(a,s){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",a,t(s))},resize:function(e,a){i._trigger("resize",e,t(a))},stop:function(s,n){a.height=e(this).height(),a.width=e(this).width(),e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",s,t(n))}}).css("position",n)},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(a){var s=this,n=!1,r={};e.each(a,function(e,a){s._setOption(e,a),e in t&&(n=!0),e in i&&(r[e]=a)}),n&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",r)},_setOption:function(e,t){var i,a,s=this.uiDialog;"dialogClass"===e&&s.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=s.is(":data(ui-draggable)"),i&&!t&&s.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(a=s.is(":data(ui-resizable)"),a&&!t&&s.resizable("destroy"),a&&"string"==typeof t&&s.resizable("option","handles",t),a||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,a=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),a.minWidth>a.width&&(a.width=a.minWidth),e=this.uiDialog.css({height:"auto",width:a.width}).outerHeight(),t=Math.max(0,a.minHeight-e),i="number"==typeof a.maxHeight?Math.max(0,a.maxHeight-e):"none","auto"===a.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,a.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=this,i=this.widgetFullName;e.ui.dialog.overlayInstances||this._delay(function(){e.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(a){t._allowInteraction(a)||(a.preventDefault(),e(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),e.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(e.ui.dialog.overlayInstances--,e.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),e.ui.dialog.overlayInstances=0,e.uiBackCompat!==!1&&e.widget("ui.dialog",e.ui.dialog,{_position:function(){var t,i=this.options.position,a=[],s=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(a=i.split?i.split(" "):[i[0],i[1]],1===a.length&&(a[1]=a[0]),e.each(["left","top"],function(e,t){+a[e]===a[e]&&(s[e]=a[e],a[e]=t)}),i={my:a[0]+(0>s[0]?s[0]:"+"+s[0])+" "+a[1]+(0>s[1]?s[1]:"+"+s[1]),at:a.join(" ")}),i=e.extend({},e.ui.dialog.prototype.options.position,i)):i=e.ui.dialog.prototype.options.position,t=this.uiDialog.is(":visible"),t||this.uiDialog.show(),this.uiDialog.position(i),t||this.uiDialog.hide()}})})(jQuery);(function(t){t.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&t(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,l=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:l=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}l&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery);(function(t,e){t.widget("ui.progressbar",{version:"1.10.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})})(jQuery);(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,l,h,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-u.values(e));(n>i||n===i&&(e===u._lastChangedValue||u.values(e)===c.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),l=a.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-a.width()/2,top:e.pageY-l.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,l=this,h=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((l.values(s)-l._valueMin())/(l._valueMax()-l._valueMin())),u["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](u,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===s&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[h?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[h?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery);(function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>▲</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>▼</span>"+"</a>"},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})})(jQuery);(function(t,e){function i(){return++n}function s(t){return t=t.cloneNode(!1),t.hash.length>1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,c))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery);(function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.4",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=o),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function o(t){l.of=t,a.is(":hidden")||a.position(l)}var a,r,h,l=t.extend({},this.options.position);if(n){if(a=this._find(s),a.length)return a.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),a=this._tooltip(s),e(s,a.attr("id")),a.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:o}),o(i)):a.position(t.extend({of:s},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){a.is(":visible")&&(o(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:a}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(a)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),o.stop(!0),this._hide(o,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:o}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})})(jQuery);(function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),f(l,function(t,a){var o,r=a.re.exec(i),l=r&&a.parse(r),h=a.space||"rgba";return l?(o=s[h](l),s[c[h].cache]=o[c[h].cache],n=s._rgba=o._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,o,r,l){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,l],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof h?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if("alpha"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),a=c[n],o=0===this.alpha()?h("transparent"):this,r=o[a.cache]||a.to(o._rgba),l=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],h=s[a],c=u[n.type]||{};null!==h&&(null===o?l[a]=h:(c.mod&&(h-o>c.mod/2?o+=c.mod:o-h>c.mod/2&&(o-=c.mod)),l[a]=i((h-o)*e+o,n)))}),this[n](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),l=Math.min(s,n,a),h=r-l,c=r+l,u=.5*c;return e=l===r?0:s===r?60*(n-a)/h+360:n===r?60*(a-s)/h+120:60*(s-n)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[o]&&(this[o]=l(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=h(c(d)),n[o]=d,n):h(d)},f(a,function(e,i){h.fn[e]||(h.fn[e]=function(n){var a,o=t.type(n),l="alpha"===e?this._hsla?"hsla":"rgba":s,h=this[l](),c=h[i.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1))),h[i.idx]=n,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r="";if("transparent"!==n&&("string"!==t.type(n)||(a=s(n)))){if(n=h(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&o&&o.style;)try{r=t.css(o,"backgroundColor"),o=o.parentNode}catch(l){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},a=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var l=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",h=l.children?o.find("*").addBack():o;h=h.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+"Class"](e[i])})},a(),h=h.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),s=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,h.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return"boolean"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.4",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=""),t.css(s[a],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery);(function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var a,o,r,l=t(this),h=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(l,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",g=i.test(u),m={},v="show"===c;l.parent().is(".ui-effects-wrapper")?t.effects.save(l.parent(),h):t.effects.save(l,h),l.show(),a=t.effects.createWrapper(l).css({overflow:"hidden"}),o=a[p](),r=parseFloat(a.css(f))||0,m[p]=v?o:0,g||(l.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),m[f]=v?r:o+r),v&&(a.css(p,0),g||a.css(f,r+o)),a.animate(m,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&l.hide(),t.effects.restore(l,h),t.effects.removeWrapper(l),n()}})}})(jQuery);(function(t){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"effect"),h="hide"===l,c="show"===l,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||h?1:0),g=e.duration/f,m=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||h)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,g,m)),h&&(d/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m).animate(a,g,m),d=h?2*d:d/2;h&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m)),o.queue(function(){h&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}})(jQuery);(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"hide"),h="show"===l,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),h&&(n.css(d,0),n.css(p,a/2)),f[d]=h?a:0,f[p]=h?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){h||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(h,"pos"===c?-s:s),u[h]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),g||p.hide(),i()}var a,o,r,l,h,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),g="show"===f,m=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(a=0;u>a;a++)for(l=m.top+a*_,c=a-(u-1)/2,o=0;d>o;o++)r=m.left+o*v,h=o-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(g?h*v:0),top:l+(g?c*_:0),opacity:g?0:1}).animate({left:r+(g?0:h*v),top:l+(g?0:c*_),opacity:g?1:0},e.duration||500,e.easing,s)}})(jQuery);(function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}})(jQuery);(function(t){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),l="show"===r,h="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=l!==d,f=p?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[h?0:1]),l&&s.css(d?{height:0,width:c}:{height:c,width:0}),m[f[0]]=l?n[0]:c,v[f[1]]=l?n[1]:0,s.animate(m,g,e.easing).animate(v,g,e.easing,function(){h&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}})(jQuery);(function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}})(jQuery);(function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,l=o||"hide"===a,h=2*(e.times||5)+(l?1:0),c=e.duration/h,u=0,d=n.queue(),p=d.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;h>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,h+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?l:{height:l.height*r,width:l.width*r,outerHeight:l.outerHeight*r,outerWidth:l.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",l=e.origin,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=l||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:h),n.to={height:h.height*c.y,width:h.width*c.x,outerHeight:h.outerHeight*c.y,outerWidth:h.outerWidth*c.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(o,e.mode||"effect"),f=e.restore||"effect"!==p,g=e.scale||"both",m=e.origin||["middle","center"],v=o.css("position"),_=f?r:l,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===p?(o.from=e.to||b,o.to=e.from||s):(o.from=e.from||("show"===p?b:s),o.to=e.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===g||"both"===g)&&(a.from.y!==a.to.y&&(_=_.concat(u),o.from=t.effects.setTransition(o,u,a.from.y,o.from),o.to=t.effects.setTransition(o,u,a.to.y,o.to)),a.from.x!==a.to.x&&(_=_.concat(d),o.from=t.effects.setTransition(o,d,a.from.x,o.from),o.to=t.effects.setTransition(o,d,a.to.x,o.to))),("content"===g||"both"===g)&&a.from.y!==a.to.y&&(_=_.concat(c).concat(h),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),t.effects.save(o,_),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(n=t.effects.getBaseline(m,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===g||"both"===g)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),h=r.concat(u).concat(d),o.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,h),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,u,a.from.y,i.from),i.to=t.effects.setTransition(i,u,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,d,a.from.x,i.from),i.to=t.effects.setTransition(i,d,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,h)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),t.effects.restore(o,_),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",l=e.distance||20,h=e.times||3,c=2*h+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},g={},m={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+l,g[d]=(p?"+=":"-=")+2*l,m[d]=(p?"-=":"+=")+2*l,n.animate(f,u,e.easing),s=1;h>s;s++)n.animate(g,u,e.easing).animate(m,u,e.easing);n.animate(g,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(h,c?isNaN(s)?"-"+s:-s:s),u[h]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,l=a?o.scrollLeft():0,h=n.offset(),c={top:h.top-r,left:h.left-l,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-l,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}})(jQuery); |
| Instances | 3 |
| Solution |
Please upgrade to the latest version of jquery-ui.
|
| Reference |
https://bugs.jqueryui.com/ticket/15284
https://github.com/jquery/jquery-ui/security/advisories/GHSA-gpqq-952q-5327 https://nvd.nist.gov/vuln/detail/CVE-2021-41184 https://nvd.nist.gov/vuln/detail/CVE-2021-41183 https://github.com/jquery/jquery-ui/security/advisories/GHSA-9gj3-hwp5-pmwc https://nvd.nist.gov/vuln/detail/CVE-2021-41182 |
| Tags |
OWASP_2017_A09
OWASP_2021_A06 |
| CWE Id | 829 |
| WASC Id | |
| Plugin Id | 10003 |
|
Low |
Absence of Anti-CSRF Tokens |
|---|---|
| Description |
No Anti-CSRF tokens were found in a HTML submission form.
A cross-site request forgery is an attack that involves forcing a victim to send an HTTP request to a target destination without their knowledge or intent in order to perform an action as the victim. The underlying cause is application functionality using predictable URL/form actions in a repeatable way. The nature of the attack is that CSRF exploits the trust that a web site has for a user. By contrast, cross-site scripting (XSS) exploits the trust that a user has for a web site. Like XSS, CSRF attacks are not necessarily cross-site, but they can be. Cross-site request forgery is also known as CSRF, XSRF, one-click attack, session riding, confused deputy, and sea surf.
CSRF attacks are effective in a number of situations, including:
* The victim has an active session on the target site.
* The victim is authenticated via HTTP auth on the target site.
* The victim is on the same local network as the target site.
CSRF has primarily been used to perform an action against a target site using the victim's privileges, but recent techniques have been discovered to disclose information by gaining access to the response. The risk of information disclosure is dramatically increased when the target site is vulnerable to XSS, because XSS can be used as a platform for CSRF, allowing the attack to operate within the bounds of the same-origin policy.
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | <form name='myform' id='myform' method='post'> |
| Request Header - size: 234 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php HTTP/1.1
Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 19,386 bytes. |
<style type="text/css">
.div_border_front2 table:nth-child(2) input[type="button"] { color: #fff; background: #627d4d; } #forgot { color: ; } .applist_gradient { background: #627d4d; } .head_title { color: #fff; } .head_title, .apptitle { text-transform: uppercase; } .head_title1, .apptitle1 { text-transform: uppercase; } .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header { background: #627d4d; } .ui-widget-header { background: #627d4d !important; color: #fff; } .ui-dialog .ui-dialog-buttonpane button { color: #fff; } header#header,.theme_header { background: #627d4d !important; } /*header#header2 { background: #627d4d; }*/ ._program li { color: #fff; } .button1 { color: #fff; background: #627d4d; } ._figure span:first-child { color: #fff; } #hris_sub_container ul figure { background: #627d4d; } .dc_empstatico { color: ; /* colored */ } .dbg_empstatico { background: #627d4d; /* colored */ } ::-webkit-scrollbar { background: #627d4d; } ::-webkit-scrollbar-thumb { background: #627d4d; } #hris_sub_container header { color: ; /* colored */ } .gp, .ui-widget-header, .fc-day-header, { background: #627d4d; } .ui-widget-header, .fc-day-header { color : white !important;; } </style><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "/strict.dtd"> <html> <head> <title>WEBTEMPLATE</title> <link REL="SHORTCUT ICON" HREF="./images/lst_logo.ico" /> <link href='../css/applist.css' media='screen' type='text/css' /> <!-- include a theme, can be included into the core instead of 2 separate files --> <link rel="stylesheet" href="lib/alertify/css/themes/bootstrap.min.css" /> <link rel="stylesheet" href="./css/modified_layout.css" type="text/css" media="screen" /> <link rel='stylesheet' type='text/css' media='screen' href='./css/layout.css'/> </head> <body> <form name='myform' id='myform' method='post'> <link rel='stylesheet' type='text/css' href='css/login.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_view.css?v=20220209161346' /><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/layout.css?v=20220209161346' /><script type='text/javascript' src='javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='lib/pager.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/pager.css?v=20220209161346' /><script type='text/javascript' src='lib/alertify/alertify.min.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_page.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/applist.css?v=20220209161346' /> <!-- <link rel="stylesheet" type="text/css" href="css/login_page.css"> --> <input name='xpage_uri' id='xpage_uri'> <input name='xpage_dir' id='xpage_dir'> <input name='txt_action' id='txt_action'> <input name='txtappcde' id='txtappcde'> <input name='txtoutsource' id='txtoutsource'> <input id='seccode_validated' value=""> <input id="gl_comcde" name="gl_comcde" value="ATESTWEBTKM"> <!-- <input type="hidden" id="tmp_redirect_path" name="tmp_redirect_path"> --> <!-- <input type="hidden" id="tmp_appcde" name="tmp_appcde"> --> <style type="text/css"> .seccode_continue:hover { color: white; background-color: #1947D1 !important; border: 0; } .seccode_continue { background-color: #335CD6 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; /* border-radius: .3em; */ width: auto; min-width: 70px; } .seccode_cancel:hover { color: white; background-color: #990000 !important; border: 0; } .seccode_cancel { /* border-radius: .3em; */ background-color: #aa4935 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; width: 70px; /*margin-right: 3px;*/ } </style> <script type='text/javascript'> //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "WEBAPP"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function() {}; jQuery(document).ready(function() { if (jQuery('#seccode_validated').val() == 0 && jQuery('#seccode_validated').val() != '') { alertify.alert('Accesing any programs must start here.'); } jQuery('#seccode_diag').dialog({ title: "Security Code", resizable: false, autoOpen: false, height: 'auto', width: 'auto', position: { my: "center", at: "center", of: window }, modal: true, open: function() { jQuery('body').css('overflow', 'hidden'); jQuery('.ui-button-icon-primary.ui-icon.ui-icon-closethick').closest('button').remove(); jQuery(this).closest('.ui-dialog').find('.seccode_cancel').focus(); }, close: function() { jQuery('body').css('overflow', 'auto'); }, buttons: [{ text: "Continue", "class": 'seccode_continue', click: function() { val_seccode_path(jQuery('#seccode_diag').find('#seccode_path')); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { jQuery('#seccode_diag').dialog('close'); } }, ] }); jQuery('#diag_subsidiary').dialog({ title: 'Select Subsidiary', width: 500, height: 'auto', draggable: false, resizable: false, autoOpen: false, modal: true, open: function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [{ text: "Proceed", "class": 'seccode_continue', click: function() { update_pay_subdrycde_link($(this).find('#pay_subdrycde').val()); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { $(this).dialog('close'); } }, ] }); }) function val_blank_session() { alertify.alert('You must login first.', function() { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) // window.open('login_view.php', '_self'); }) } function val_seccode(xloc, xcde) { var xdata = "event_action=val_seccode"; xdata += "&xloc=" + xloc; xdata += "&xcde=" + xcde; xdata += "&" + jQuery('#myform *').serialize(); return jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata }); } function val_seccode_path(selectObj) { var xdata = "event_action=val_seccode_path"; xdata += "&apploc=" + selectObj.val(); xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { if (xret.bridge_found) { // document.forms.myform.txtappcde.value=selectObj.find("option:selected").data('appcde'); document.forms.myform.action = selectObj.val(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { alertify.alert(selectObj.find(':selected').text(), xret.bridge_found_msg); } } }); } function open_seccode_diag() { var xdata = "event_action=validate_comcde"; xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { jQuery('#seccode_diag').dialog('open'); } }); } function transaction_click(xappcde, xloc, obj) { // alert(xappcde,xloc,obj); document.forms.myform.action = xloc; document.forms.myform.txtappcde.value = xappcde; if (jQuery(obj).hasClass('show_sub_diag') || xappcde == "PAY") { var xdata = "event_action=get_user_subdry&xappcde=" + xappcde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { $.unblockUI(); console.log(response) if (response.pass == true) { if (response.show_diag == true && response.has_access == true) { var subdry_note = "Payroll"; if(xappcde == "PAY_OUTSRC") { subdry_note = "Payroll Out Sourcing"; } jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); // jQuery('#diag_subsidiary').find('#subdry_note').html(subdry_note); jQuery('#diag_subsidiary').dialog('open'); } else if (response.show_diag == false && response.has_access == true) { blockui(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); update_pay_subdrycde_link($('#pay_subdrycde').val()); } } else { alertify.alert('You must have a subsidiary access to use the payroll program.'); } } }); } else { blockui(); //20190311 donita //add check update structure // if(xappcde != "PAY_OUTSRC" || xappcde != "PAY") // { update_empstatus(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action = "admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); // } // else // { // document.forms.myform.method='POST'; // document.forms.myform.target = '_self'; // document.forms.myform.submit(); // } } } function update_empstatus(subdrycde="") { var xdata= "event_action=update_empstatus&subdrycde="+subdrycde; jQuery.ajax({ type : 'post', data : xdata, url : 'login_applist_ajax.php', success : function (xretobj) { } }); } function logout_click() { alertify.confirm('Are you sure you want to logout?', function() { blockui(); var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) } }); }); } function update_pay_subdrycde_link(xsubdrycde) { blockui(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { var xappcde = $('#txtappcde').val(); var xdata = "event_action=update_pay_subdrycde_link&xappcde=" + xappcde; xdata += "&subdrycde=" + xsubdrycde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { jQuery('#diag_subsidiary').dialog('close'); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } }); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action="admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); } function admin_click(xloc) { document.forms.myform.action = xloc; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } function getclientdir(){ var xparams = 'txt_action=getclientdir'; return jQuery.ajax({ dataType: 'json', type: 'post', data: xparams, url : 'login_validate_redirect.php' }) } </script> <style> footer { width: 580px; margin: 0 auto 50px; } footer .ftr_con { margin: 20px auto 0; } footer .ftr_con p { text-align: center; } .appgrp { margin-top: 20px; display: flex; justify-content: center; align-items: center; } </style> <!-- <form id="myform"> </form> --> <div class='applist_body' align='center'> <div class='applist_all'> <div class="logo"> <img src='img/lst.png' style="width: 100%;height: 100%;"> </div> <table border='0' align='center'> <tr> <td align='center'> <table class='applist_table'> <tr> <td align='right' colspan='10'> <span class='applist_logout' onclick='logout_click()'><b>LOGOUT</b></span> </td> </tr> <tr> <td colspan='10'> <hr> </td> </tr> <tr> <td style='white-space:nowrap;' align='center'> <div class="appgrp"> <div class='applist_button' onclick="admin_click('admin/main.php')"> <div class='applist_gradient'> <img class='applist_button_img' src='images/admin.png'> </div> <div class='admin_label'> <p>Admin</p> </div> </div> <div class="applist_button show_sub_diag" onclick='transaction_click("PAY","payroll/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/PAY.png' ></div><div class='admin_label'><p>Payroll</p></div></div><div class="applist_button " onclick='transaction_click("HR","hris/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/hr_0.png' ></div><div class='admin_label'><p>Human Resource Information System</p></div></div><div class="applist_button " onclick='transaction_click("TKM","tkm/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/clock.png' ></div><div class='admin_label'><p>Time Keeping Management</p></div></div> </div> </td> </tr> </table> </td> </tr> <tr style="height:50px;"> <td colspan="100"></td> </tr> <tr> <td colspan="10" align="center"> <input type="button" class="print" onclick="open_seccode_diag()" value="Enter Security Code"> </td> </tr> </table> </div> </div> <br> <br> <br> <div id="seccode_diag" style="display: none;"> <table><tr><td style="width:110px;">Select Program</td><td><select class="input" style="margin-right:10px;" id="seccode_path"><option value="payroll/bridge/">Payroll</option><option value="hris/bridge/">Human Resource Information System</option><option value="tkm/bridge/">Time Keeping Management</option></select></td></tr></table></div> <div id="diag_subsidiary" style="display:none;"> <table style="width:100%"> <!-- <tr> <td colspan="100"><i>Note: Only subsidiaries with <i id="subdry_note"></i> database connection setup.</i></td> </tr> --> <tr> <td><b>Subsidiary</b></td> <td><select id="pay_subdrycde" name="pay_subdrycde" class="input"></select></td> </tr> </table> </div> <!-- <footer> <div class="ftr_con" style='font-size:11px;width:60%'> <p>Copyright © 2015, LEE Systems Technology Ventures</p> <p align='right' style='padding-right : 18px;font-size : 11px;font-weight : bold;'>IP Details : 10.0.0.18</p> </div> </footer> --> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | <form name="myform" id="myform" action="" method="POST"> |
| Request Header - size: 222 bytes. |
GET http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php HTTP/1.1
Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,055 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=UTF-8 |
| Response Body - size: 34,194 bytes. |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "/strict.dtd">
<html> <head> <title>LST</title> <link REL="SHORTCUT ICON" HREF="images/lst_logo.ico"> <style type="text/css"> html{ font-family: Arial, Helvetica, sans-serif; height: 100%; } a{ text-decoration: none; } .applist_body{ background : white; height: 500px; } .applist_all{ height : 100%; display: inline-block; } .div_applist_header{ vertical-align :middle; height : 50px; } .applist_button_border{ height : 60%; /*border: 2px outset #f2f0f0;*/ padding : 20px; border-top-left-radius:7em; border-top-right-radius:0em; border-bottom-right-radius:7em; border-bottom-left-radius:0em; display: inline-block; /*background : #e5e3e3;8*/ border-top-style:solid; border-top-width:15px; border-top-color:#003300; border-left-style:solid; border-left-width:1px; border-left-color:#003300; border-right-style:solid; border-right-width:30px; border-right-color:#006633; border-bottom-style:solid; border-bottom-width:1px; border-bottom-color:#006633; } .applist_button{ /*margin-right: auto;*/ /*padding : 5px;*/ /*background: #ffffff;*/ /* for non-css3 browsers */ /*background: #627d4d;*/ /*background: #fe941b;*/ /*-webkit-border-radius: 6px;*/ /*-moz-border-radius: 6px;*/ /*border-radius: 8px;*/ /* border:1px inset;*/ display:inline-block; width : 120px; height : 170px; cursor : pointer; /*box-shadow: 0 2px 4px rgba(0,0,0,0.5);*/ transition: all 0.15s linear; overflow: hidden; } .applist_logout{ background: transparent; /* for non-css3 browsers */ cursor : pointer; font-family : Arial; } .applist_table{ width:800px; height:100px; } .applist_table td{ padding : 0px; } .applist_gradient{ /* filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#ffffff'); /* for IE */ /* background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#fff)); /* for webkit browsers */ /* background: -moz-linear-gradient(top, #ccc, #fff); /* for firefox 3.6+ */ /*height: 100%;*/ width: 100px; height: 100px; display: flex; justify-content: center; align-items: center; border-radius: 50%; } .applist_button_img{ width : 60px; height : 60px; margin: 10px auto 10px; transition: all 0.2s; /*transform: scale(0.75);*/ } .applist_button:hover{ /*box-shadow: 0 3px 20px rgba(0,0,0,0.4), 0 7px 13px rgba(0,0,0,0.2);*/ opacity: 0.8; } .applist_button:hover img { transform: rotateY(180deg); /*-webkit-filter: blur(0.05em);*/ } .applist_logout:hover{ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; cursor : pointer; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .applist_circle { position: absolute; margin-top:-30px; margin-left:-20%; width: 300px; height: 300px; -moz-border-radius: 500px; -webkit-border-radius: 500px; border-radius: 500px; border-top: #383838 20px solid; border-right: #383838 20px solid; border-bottom: #383838 20px solid; border-left: #383838 20px solid; background:#484848 ; } .applist_footer{ font-family:"Verdana", verdana, sans-serif; font-size:15px; font-weight:bold; } .admin_label { width: 100%; height: calc(100% - 120px); background: #fff; /*border-bottom: 1px solid #627d4d;*/ z-index: 10; display: flex; } .admin_label p { /*margin: 13px auto 0;*/ margin: 0 auto; /*padding: 10px;*/ white-space: normal; font-size: 13px; align-self: center; } :root { --cuscol: #87c43e; --progh: 50px; --footer: 50px; --navtop: 2vh; /*--max: 100%;*/ } * { margin: 0; padding: 0; box-sizing: border-box; font-size: 13px; font-family: 'Calibri'; } img { /* width: var(--max); height: var(--max); object-fit: contain; */ } select, input, button { outline: none; } ._textbox { border: 1px solid transparent; border-bottom: 1px solid #ccc; padding: 8px 10px; background: transparent; } .prog { width: 100vw; height: var(--progh); /*margin-top: var(--navtop);*/ margin: calc(var(--navtop) - 1vh) auto var(--navtop); /*position: fixed;*/ /*top: 1vh;*/ display: flex; justify-content: center; } .prog .progicon { width: var(--progh); height: var(--progh); margin: 0 15px; border-radius: 50%; /*border: 1px solid #ccc;*/ box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.3); /*overflow: hidden;*/ } .progicon .label { text-align: center; display: block; width: 100%; height: 30px; display: flex; justify-content: center; align-items: center; } .progicon .label span { font-size: 10px; } .loginwrapper { width: 100%; margin-top:1rem; /* height: calc(100vh - (var(--navtop) + (var(--progh)*1.5) + var(--footer))); */ position: relative; padding: 0 15vw; display: flex; flex-direction: column; justify-content: space-between; align-items: center; /* flex-wrap: wrap; */ } .loginwrapper > div { width: calc(100% / 2); display: flex; justify-content: center; align-items: center; } .left { flex-direction: column; display: none; } .right{ margin: auto; } .logo { /* width: 400px; height: 160px; */ /* margin: 20px auto; */ /*border: 1px solid #000;*/ } .companyname { color: var(--cuscol); font-size: 25px; } .logincontainer { width: 350px; background: #fff; padding: 2rem; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 2px 1px rgba(0,0,0,0.1); } .logincred { width: var(--max); margin: 40px 0 25px; } .top header { font-size: 28px; } .inputwrapper { width: var(--max); height: auto; display: flex; align-items: center; margin: 35px 0; position: relative; } .inputwrapper input, .inputwrapper select { width: var(--max); z-index: 2; padding: 8px 1px; font-weight: bold; } .inputwrapper span { display: block; width: var(--max); position: absolute; z-index: 1; color: #999; transition: all 0.3s; } .inputwrapper .underline { position: absolute; bottom: -1px; left: 0; width: var(--max); height: 1px; background: #87c43e; transition: transform 0.3s, opacity 0.1s; transform: scaleX(0); opacity: 0; } .inputwrapper .underline.full { transform: scaleX(1); opacity: 1; } .btngrp { display: flex; justify-content: space-between; align-items: center; } .loginbtn, .loginbtn * { cursor: pointer; } .loginbtn { position: relative; overflow: hidden; background: var(--cuscol); } .loginbtn input { width: 100px; padding: 6px 0; color: #fff; border: none; background: transparent; position: relative; z-index: 2; } .licagrmnt { color: #0c56f5b1; /* font-weight: bold; */ cursor: pointer; } .licagrmnt_container { position: absolute; top: 0; left: 0; /* width: 100vw; height: 100vh; */ padding: 0 25vw; background: #fff; /* background: rgb(114, 114, 114); */ z-index: 100; /* overflow-y: auto; */ /* overflow-y: scroll; */ counter-reset: x; display: flex; flex-direction: column; } .licagrmnt_container > header { /*position: absolute;*/ /*top: 0; left: 0;*/ width: 100%; height: auto; font-size: 25px; padding: 10px 0 15px; font-weight: bold; text-align: center; border-bottom: 1px solid #ccc ; /* display: flex; justify-content: center; align-items: center; */ } .licagrmnt_container article { overflow: scroll; width: 100%; scroll-behavior: smooth; padding: 15px 0 100px; } .licagrmnt_container article::-webkit-scrollbar{ overflow: hidden; } .licagrmnt_container article .xcount::before { counter-increment: x; content: counter(x) '. '; } .licagrmnt_container article section { margin-bottom: 40px; } .licagrmnt_container article section > label { font-weight: bold; font-size: 20px; margin-bottom: 15px; display: block; } .licagrmnt_container article section p { text-indent: calc(20px * 2); line-height: 1.4; margin-bottom: 15px; } .licagrmnt_container article section p, .licagrmnt_container article section li { text-align: justify; } .licagrmnt_container article section strong { text-align: center; } .licagrmnt_container article section ul.circle { list-style-type: circle; padding: 0 0 0 20px; } .licagrmnt_container > div { position: fixed; bottom: 0; left: 0; width: 100%; height: 50px; background: #fff; display: flex; justify-content: center; align-items: center; } .licagrmnt_container > div:after { /*content: '';*/ width: 100vw; height: 70px; background: linear-gradient(transparent, rgba(0,0,0,0.5)); position: absolute; z-index: -1; } .closebtn { width: 60px; height: 60px; border-radius: 50%; position: absolute; bottom: 7vh; display: flex; justify-content: center; align-items: center; cursor: pointer; background: #fff; transition: all 0.3s; } .closebtn svg { /*width: 100%; height: 100%;*/ transform: scale(0.4); stroke: #000; stroke-width: 3; transition: all 0.3s; } .closebtn:hover { background: #87c43e; } .closebtn:hover svg { stroke: #fff; } footer { /* margin-top: 120px; */ width: 100%; height: var(--footer); /*position: fixed;*/ /*bottom: 0; left: 0;*/ display: flex; justify-content: center; align-items: center; background: transparent; } .inputwrapper span.inputfocus { transform: translate(-35px, -25px) scale(0.8); font-weight: bold; /* color: var(--cuscol); */ } .explode { display: block; position: absolute; background: hsl(90, 53%, 40%); /* background: hsl(216, 53%, 40%); */ border-radius: var(--max); transform: scale(0); z-index: 1; } .explode.animate { animation: explodeAnimate 0.65s linear; } @keyframes explodeAnimate { 100% {opacity: 0; transform: scale(2.5);} } ._fadeout { opacity: 0; } ._strtoupper { text-transform: uppercase; } @media only screen and (max-width: 1024px) { .licagrmnt_container { padding: 0 15vw; } .licagrmnt_container header { padding: 5px 0 10px; } } @media only screen and (max-width: 850px) { .loginwrapper { align-items: center; flex-direction: column; height: auto; padding: 0; } .left { margin: 4vh 0; } .loginwrapper > div { width: calc((100% / 3) * 2); } .logo { width: 300px; height: 120px; } footer { margin-top: 6vh; } .licagrmnt_container { padding: 0 5vw; } .licagrmnt_container header { padding: 2px 0 5px; } } @media only screen and (max-width: 600px) { .companyname { display: none; } } @media only screen and (max-width: 480px) { .loginwrapper > div { width: calc((100% / 7) * 6); } } .table_disp{ font-family: arial; font-size: 12px; border: 1px; border-collapse: collapse; cursor: pointer; } .table_disp th{ background-color: #bdbdbd; color: black; height:30px; } .table_disp tbody tr:hover{ background-color:silver; } #login_frame{ border: 1px solid #696; padding: 60px 0; text-align: center; width: 400px; -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 10px; -webkit-box-shadow: #666 0px 2px 3px; -moz-box-shadow: #666 0px 2px 3px; box-shadow: #666 0px 2px 3px; background : white; behavior: url(./css/PIE.htc); } .gp{ width : 80%; } #login_frame table{ align-items : center; } .div_border_back{ /*border: 0px solid gainsboro;*/ /*background : #204f1e;*/ width : 350px; height : 280px; /*-webkit-border-radius: 8px;*/ /*-moz-border-radius: 8px;*/ /*border-radius: 10px;*/ -webkit-box-shadow: #666 0px 3px 10px; -moz-box-shadow: #666 0px 3px 10px; box-shadow: #666 0px 3px 10px; } .div_border_front1{ background : #3a6f8f; width : 100%; height : 4%; -webkit-border-top-left-radius: 8px; -moz-border-top-left-radius: 8px; border-top-left-radius: 10px; -webkit-border-top-right-radius: 8px; -moz-border-top-right-radius: 8px; border-top-right-radius: 10px; } .div_border_front2{ /*background : white;*/ width : 100%; height : 96%; -webkit-border-bottom-left-radius: 6px; -moz-border-bottom-left-radius: 6px; border-bottom-left-radius: 8px; -webkit-border-bottom-right-radius: 6px; -moz-border-bottom-right-radius: 6px; border-bottom-right-radius: 8px; } .gp{ width : 96%; border : solid 1px rgba(98, 125, 77, 0.5) !important; margin-bottom: 15px; } .sublabel{ color : #555555; } .headlabel{ color : #555555; } :root { --cuscol: #052b00; --progh: 50px; --footer: 50px; --navtop: 2vh; --max: 100%; } .licagrmnt { /* color: var(--cuscol); */ } /* .inputwrapper .underline { background-color: var(--cuscol); } */ * { font-family: unset; } .div_version{ display: flex; justify-content: flex-end; } .tbl_versions, .tbl_versions td, .tbl_versions th { border: 1px solid #ddd; text-align: left; } .tbl_versions { border-collapse: collapse; width: 100%; } .tbl_versions th, .tbl_versions td { padding: 5px; } </style> <script type="text/javascript" src="jquery-1.10.2.min.js"></script> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon"> <link rel="icon" href="img/favicon.ico" type="image/x-icon"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <!-- <link rel="stylesheet" type="text/css" href="css/login_page.css"> --> </head> <body> <!-- <div class="prog"> </div> --> <div class="loginwrapper"> <div class="left"> <div class="logo"> <img src="lst.png"> </div> </div> <div class="right"> <!-- <form name="myform" id="myform" action="https://www.lstviweb.com/online/redfiel/login.php" method="POST"> --> <form name="myform" id="myform" action="" method="POST"> <div class="logincontainer"> <div class="top"> <header>Login</header> <span>Please enter a valid USER ID and Password</span> </div> <div class="logincred"> <div class="inputgrp"> <div class="inputwrapper"> <input type="text" name="dsply_gl_comcde" id="dsply_gl_comcde" class="_textbox _strtoupper" autocomplete="off" value=''> <input name="gl_comcde" id="gl_comcde" class="_textbox _strtoupper" autocomplete="off" value=''> <span class="inputfocus">Company ID</span> <div class="underline full"></div> </div> <div class="inputwrapper"> <input type="text" name="txtusrcde" id="txtusrcde" class="_textbox _strtoupper" autocomplete="off"> <span>User ID</span> <div class="underline"></div> </div> <div class="inputwrapper"> <input type="password" name="txtusrpwd" id="txtusrpwd" class="_textbox"> <span>Password</span> <div class="underline"></div> </div> <div class="inputwrapper"> <span style="text-align: center;"> <label style="color: red;" id="lbl_valmsg"> </label> </span> </div> </div> <div class="btngrp"> <div> <span id="forgot" onclick="forgot_password()" style="cursor: pointer;">Forgot Password ?</span> </div> <div class="loginbtn"> <!-- <input type="button" id="loginBtn" name="" class="" onclick="login_click();" value="Login"> --> <input type="button" id="loginBtn" name="" class="" value="Login"> </div> </div> </div> <div class=""> <p>By using this program you agree to the terms and conditions of the <span class="licagrmnt">license agreement</span>.</p> </div> <div style="padding: 5px;"> <div style="float: left; cursor: pointer;"> <!-- <span onclick="view_versions()"><u>versions</u></span> --> </div> <div style="float: right;"> <!-- <span>v</span> --> </div> </div> </div> <input name="browser" id="browser" value=""> <input name="module" id="module" value=""> <input name="txt_event" id="txt_event" value=""> <input name="txt_url" id="txt_url" value=""> </form> </div> <footer> <span>Copyright © 2021 LEE Systems Technology Ventures Inc</span> </footer> <div class="licagrmnt_container" style=" width:100vw; display:none;"> <header>SOFTWARE LICENSE AGREEMENT FOR LEE SYSTEMS TECHNOLOGY VENTURES INCORPORATED SOFTWARE</header> <article> <section> <label> License Agreement </label> <p> You should carefully read the following terms and conditions before using this software. This Lee Systems Technology Ventures Incorporated Software License Agreement ("SLA") is a legal agreement between you (either an individual or a single entity) and Lee Systems Technology Ventures Incorporated for this Software product which will be referred in this agreement as the "SOFTWARE". Unless you have a different license agreement signed by Lee Systems Technology Ventures, your use of this software indicates your acceptance of this license agreement and warranty. <strong>IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, DO NOT USE THE SOFTWARE</strong>. </p> </section> <section> <label> Governing Law </label> <p> You should carefully read the following terms and conditions before using this software. This Lee Systems Technology Ventures Incorporated Software License Agreement ("SLA") is a legal agreement between you (either an individual or a single entity) and Lee Systems Technology Ventures Incorporated for this Software product which will be referred in this agreement as the "SOFTWARE". Unless you have a different license agreement signed by Lee Systems Technology Ventures, your use of this software indicates your acceptance of this license agreement and warranty. <strong>IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, DO NOT USE THE SOFTWARE</strong>. </p> <p> This agreement shall be governed by the laws of the Republic of the Philippines. </p> </section> <section> <label> SOFTWARE PRODUCT LICENSE </label> <p> The software product is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The software is licensed, NOT SOLD. </p> </section> <section> <label> Use and Registration </label> <p> This is not a free software. You agree to register this software in the website of Lee Systems Technology Ventures (www.lstventures.com). </p> </section> <section> <label class="xcount"> GRANT OF LICENSE. This SLA grants you the following rights: </label> <p> Lee Systems Technology Ventures grants you as an individual , a personal, non-exclusive license to use the software product. You may install and use one copy of the software on a single computer. You may also store or install a copy of the Software Product, such as a network server or back-up disk, used only for the said purpose. A license for the software product may not be shared or used concurrently on different computers. </p> </section> <section> <label class="xcount"> DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS. </label> <p> <ul class="circle"> <li> Not for Resale nor Sublease. you may not resell, sublease or otherwise transfer for value, the software product. </li> <li> You acknowledge that Lee Systems Technology Ventures Software contains proprietary and confidential information that is protected by applicable intellectual property and other laws. Except as expressly permitted herein, you agree not to copy, modify, rent, lease, loan, sell, distribute or create derivative works based on this Software, in whole or in part. </li> <li> You agree not to translate, reverse engineer, decompile, disassemble or make derivative works from this software. You agree not to modify this Software in any manner or form, or to use modified versions of this Software including (without limitation) for the purpose of obtaining unauthorized access to the data and unlimited use of this program. </li> <li> Separation of Components. The software product is licensed as a single product. Its component parts may not be separated for use on more than one computer. </li> <li> Lee Systems Technology Ventures is not responsible for obtaining and maintaining the computer equipment and accessories used by the Software. </li> </ul> </p> </section> <section> <label class="xcount"> UPGRADES OR MODIFICATIONS </label> <p> If the software is upgraded or modified, you must be properly licensed to use a product identified by Lee Systems Technology Ventures as being eligible for the upgrade/modified in order to use the software. You may use the resulting upgraded/modified product only in accordance with the terms of this SLA. If the software is an upgrade/modified of a component of a package of software programs that you licensed as a single product, the software may be used and transferred only as part of that single product package and may not be separated for use on more than one computer. </p> </section> <section> <label class="xcount"> COPYRIGHT & INTELLECTUAL PROPERTY </label> <p> Republic Act No. 8293. All title and copyrights in and to the software products (including but not limited to any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the software), the accompanying printed materials, and any copies of the software are owned by Lee Systems Technology Ventures or its suppliers. All title and intellectual property rights in and to the content which may be accessed through use of the Software Product is the property of the respective content owners and may be protected by applicable copyright or other intellectual laws and treaties. The software is protected by copyright laws and international treaty provisions. Therefore, you must treat the software like any other copyrighted material except that you may install the software on a single computer provided you keep the original solely for backup or archival purposes. You may not copy the printed materials accompanying the software. </p> </section> <section> <label class="xcount"> LIMITED WARRANTY </label> <p> The Software is provided "AS IS" and without warranties as to performance or merchantability or any other warranties whether expressed or implied. </p> </section> <section> <strong> <p> LEE SYSTEMS TECHNOLOGY VENTURES INCORPORATED ENTIRE LIABILITY TO YOU AND YOUR EXCLUSIVE REMEDY SHALL BE THE REPLACEMENT OF ANY DEFECTIVE MEDIA(SUCH AS CD-ROM) RETURNED BY YOU TO LEE SYSTEMS TECHNOLOGY WITH PROOF OF PURCHASE DURING THE 30-DAY LIMITED WARRANTY PERIOD. IN NO EVENT SHALL THE LIABILITY OF LEE SYSTEMS TECHNOLOGY ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE EXCEED THE FEE PAID BY YOU FOR THIS LICENSE. </p> <p> NO OTHER WARRANTIES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, LEE SYSTEMS TECHNOLOGY VENTURES AND ITS REFERRALS DISCLAIM ALL WARRANTIES AND CONDITIONS, WHETHER EXPRESS OR IMPLIED, STATUTORY OR OTHERWISE, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY , FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE PRODUCT, AND THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES. LEE SYSTEMS DISCLAIMS ANY WARRANTY AS TO THE PERFORMANCE OF THE SOFTWARE OR AS TO THE RESULTS THAT MAY BE OBTAINED BY USING THE SOFTWARE. THE ENTIRE RISK AS TO THE INSTALLATION, QUALITY, USE AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. IN NO EVENT SHALL LEE SYSTEMS TECHNOLOGY VENTURES OR ITS STAFF, REFERRALS AND REPRESENTATIVES BE LIABLE FOR ANY SPECIAL, INCIDENTAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER ( INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE PRODUCT OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF LEE SYSTEMS TECHNOLOGY VENTURES HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. LEE SYSTEMS TECHNOLOGY GRANTS NO WARRANTY AND SHALL HAVE NO LIABILITY WHATSOEVER BEYOND THE 30 DAY PERIOD WARRANTY. </p> </strong> </section> </article> <div> <div class="closebtn"> <svg height="50" width="50"> <line x1="0" y1="0" x2="50" y2="50"/> <line x1="50" y1="0" x2="0" y2="50"/> Sorry, your browser does not support inline SVG. </svg> </div> <span>Lee Systems Technology Ventures</span> </div> </div> </div> <script type="text/javascript"> window.onload = () => { const username = document.getElementById('txtusrcde'); const password = document.getElementById('txtusrpwd'); const companyid = document.getElementById('gl_comcde'); const display_companyid = document.getElementById('dsply_gl_comcde'); const errorMsg = document.getElementById("lbl_valmsg"); const loginBtn = document.getElementById('loginBtn'); const forgotBtn = document.getElementById('forgot'); // console.log(username) // username.addEventListener('change', () => console.log(username.value)) // password.addEventListener('change', () => console.log(password.value)) display_companyid.focus() loginBtn.addEventListener('click', () => login()); forgotBtn.addEventListener('click', () => forgot_password()) //window listener window.addEventListener('keydown', (e) => { if(e.ctrlKey == true && e.keyCode == 122 ){ let mainprogdir = 'https://vps1.lstventures.com/online/onedb/webapp/'; window.open(mainprogdir+'lstv_params.php', '_blank'); } else if(e.keyCode == 13){ login(); console.log(e) } }) function login(){ var xparams = jQuery('#myform *').serialize(); xparams += "&event_action=login"; $.ajax({ dataType: "json", type: "post", url: "login_ajax.php", data: xparams, success : function (xretobj) { if (xretobj.bool == false) { errorMsg.innerText = 'Contact LSTV Inc. for assistance'; } else { errorMsg.innerText = '' if(display_companyid.value == ''){ // console.log(errorMsg) display_companyid.focus(); errorMsg.innerText = 'Company ID should not be empty'; } else if( username.value == ''){ // console.log(errorMsg) username.focus() errorMsg.innerText = 'User ID should not be empty' } else if( password.value == '' ){ // console.log(errorMsg) password.focus() errorMsg.innerText = 'Password should not be empty' } else{ loginBtn.disabled = true; loginBtn.value = "Please wait..."; var mainprogdir = xretobj.mainprogdir; // var mainprogdir = ''; var mainpage = 'http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php?'; var dbprefix = ''; document.getElementById("gl_comcde").value = dbprefix+dsply_gl_comcde.value; // Add the DB Prefix in Company ID // document.getElementById("gl_comcde").value = dsply_gl_comcde.value; // Add the DB Prefix in Company ID document.forms.myform.txt_event.value= 'login'; document.forms.myform.txt_url.value= mainpage; document.forms.myform.action= mainprogdir+'login_validate.php'; document.forms.myform.method='post'; document.forms.myform.target='_self'; document.forms.myform.submit(); } } } }) } function forgot_password(){ var xparams = jQuery('#myform *').serialize(); xparams += "&event_action=login"; $.ajax({ dataType: "json", type: "post", url: "login_ajax.php", data: xparams, success : function (xretobj) { if (xretobj.bool == false) { errorMsg.innerText = 'Contact LSTV Inc. for assistance'; } else { // let mainprogdir = ''; // var dbprefix = ''; var dbprefix = ""; var mainprogdir = xretobj.mainprogdir; document.getElementById("gl_comcde").value = dbprefix+dsply_gl_comcde.value; // Add the DB Prefix in Company ID document.forms.myform.action = mainprogdir+'login_forgot.php'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } } }); } } $(function() { // ripple click for buttons var explode, xpld, m, x, y; $('.loginbtn').each(function() { $(this).click(function(e) { $(this).find('.explode').length == 0 ? $(this).prepend('<span class=\'explode\'></span>') : ''; xpld = $(this).find('.explode'); xpld.removeClass('animate'); !xpld.height() && !xpld.width() ? m = Math.max($(this).outerWidth(), $(this).outerHeight()) : ''; xpld.css({ height: m, width: m }); x = e.pageX - $(this).offset().left - xpld.width() / 2; y = e.pageY - $(this).offset().top - xpld.height() / 2; // console.log(e); $(this).find('.explode').css({ top: y + 'px', left: x + 'px' }).addClass('animate'); }) }); // ends here // transition of placeholder up to the top of input text box and effects of underline located aat the bottom of the input tag. $('.inputwrapper').each(function() { var input = $(this).find('input').val(); if (input != "") { $(this).find('input').siblings('span').addClass('inputfocus'); $(this).find('input').siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); } $(this).find('input').on({ focus: function() { $(this).siblings('span').addClass('inputfocus'); $(this).siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); }, blur: function() { if ($(this).val() != '') { $(this).siblings('span').addClass('inputfocus'); $(this).siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); } else { $(this).siblings('span').removeClass('inputfocus'); $(this).siblings('.underline').removeClass('full'); } } }) }); // ends here // show the licence agreement $('.licagrmnt').click(function() { $('.licagrmnt_container').fadeIn(); }); // ends here // close the licence agreement $('.closebtn').click(function() { $(this).parents('.licagrmnt_container').fadeOut(); }) $('body').on('keydown', function(e) { var esc = e.which || e.keyCode; esc == 27 ? $('.licagrmnt_container').fadeOut() : ''; }) $('.licagrmnt_container').fadeOut() // ends here // alert($(window).width()+' x '+$(window).height()); }); </script> </body> <html> |
| Instances | 3 |
| Solution |
Phase: Architecture and Design
Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
For example, use anti-CSRF packages such as the OWASP CSRFGuard.
Phase: Implementation
Ensure that your application is free of cross-site scripting issues, because most CSRF defenses can be bypassed using attacker-controlled script.
Phase: Architecture and Design
Generate a unique nonce for each form, place the nonce into the form, and verify the nonce upon receipt of the form. Be sure that the nonce is not predictable (CWE-330).
Note that this can be bypassed using XSS.
Identify especially dangerous operations. When the user performs a dangerous operation, send a separate confirmation request to ensure that the user intended to perform that operation.
Note that this can be bypassed using XSS.
Use the ESAPI Session Management control.
This control includes a component for CSRF.
Do not use the GET method for any request that triggers a state change.
Phase: Implementation
Check the HTTP Referer header to see if the request originated from an expected page. This could break legitimate functionality, because users or proxies may have disabled sending the Referer for privacy reasons.
|
| Reference |
http://projects.webappsec.org/Cross-Site-Request-Forgery
http://cwe.mitre.org/data/definitions/352.html |
| Tags |
OWASP_2021_A01
WSTG-v42-SESS-05 OWASP_2017_A05 |
| CWE Id | 352 |
| WASC Id | 9 |
| Plugin Id | 10202 |
|
Low |
Dangerous JS Functions |
|---|---|
| Description |
A dangerous JS function seems to be in use that would leave the site vulnerable.
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/jquery.tablesorter.min.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | eval |
| Request Header - size: 504 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/jquery.tablesorter.min.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 16520 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 16,520 bytes. |
(function($){$.extend({tablesorter:new
function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}if(table.tBodies.length==0)return;var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter);}else if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter);}if(!p){p=detectParserForColumn(table,rows,-1,i);}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n";}list.push(p);}}if(table.config.debug){log(parsersDebug);}return list;};function detectParserForColumn(table,rows,rowIndex,cellIndex){var l=parsers.length,node=false,nodeValue=false,keepLooking=true;while(nodeValue==''&&keepLooking){rowIndex++;if(rows[rowIndex]){node=getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex);nodeValue=trimAndGetNodeText(table.config,node);if(table.config.debug){log('Checking if value was empty on row:'+rowIndex);}}else{keepLooking=false;}}for(var i=1;i<l;i++){if(parsers[i].is(nodeValue,table,node)){return parsers[i];}}return parsers[0];}function getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex){return rows[rowIndex].cells[cellIndex];}function trimAndGetNodeText(config,node){return $.trim(getElementText(config,node));}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i];}}return false;}function buildCache(table){if(table.config.debug){var cacheTime=new Date();}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=$(table.tBodies[0].rows[i]),cols=[];if(c.hasClass(table.config.cssChildRow)){cache.row[cache.row.length-1]=cache.row[cache.row.length-1].add(c);continue;}cache.row.push(c);for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c[0].cells[j]),table,c[0].cells[j]));}cols.push(cache.normalized.length);cache.normalized.push(cols);cols=null;};if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime);}return cache;};function getElementText(config,node){var text="";if(!node)return"";if(!config.supportsTextContent)config.supportsTextContent=node.textContent||false;if(config.textExtraction=="simple"){if(config.supportsTextContent){text=node.textContent;}else{if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){text=node.childNodes[0].innerHTML;}else{text=node.innerHTML;}}}else{if(typeof(config.textExtraction)=="function"){text=config.textExtraction(node);}else{text=$(node).text();}}return text;}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){var pos=n[i][checkCell];rows.push(r[pos]);if(!table.config.appender){var l=r[pos].length;for(var j=0;j<l;j++){tableBody[0].appendChild(r[pos][j]);}}}if(table.config.appender){table.config.appender(table,rows);}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime);}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd");},0);};function buildHeaders(table){if(table.config.debug){var time=new Date();}var meta=($.metadata)?true:false;var header_index=computeTableHeaderCellIndexes(table);$tableHeaders=$(table.config.selectorHeaders,table).each(function(index){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(table.config.sortInitialOrder);this.count=this.order;if(checkHeaderMetadata(this)||checkHeaderOptions(table,index))this.sortDisabled=true;if(checkHeaderOptionsSortingLocked(table,index))this.order=this.lockedOrder=checkHeaderOptionsSortingLocked(table,index);if(!this.sortDisabled){var $th=$(this).addClass(table.config.cssHeader);if(table.config.onRenderHeader)table.config.onRenderHeader.apply($th);}table.config.headerList[index]=this;});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders);}return $tableHeaders;};function computeTableHeaderCellIndexes(t){var matrix=[];var lookup={};var thead=t.getElementsByTagName('THEAD')[0];var trs=thead.getElementsByTagName('TR');for(var i=0;i<trs.length;i++){var cells=trs[i].cells;for(var j=0;j<cells.length;j++){var c=cells[j];var rowIndex=c.parentNode.rowIndex;var cellId=rowIndex+"-"+c.cellIndex;var rowSpan=c.rowSpan||1;var colSpan=c.colSpan||1 var firstAvailCol;if(typeof(matrix[rowIndex])=="undefined"){matrix[rowIndex]=[];}for(var k=0;k<matrix[rowIndex].length+1;k++){if(typeof(matrix[rowIndex][k])=="undefined"){firstAvailCol=k;break;}}lookup[cellId]=firstAvailCol;for(var k=rowIndex;k<rowIndex+rowSpan;k++){if(typeof(matrix[k])=="undefined"){matrix[k]=[];}var matrixrow=matrix[k];for(var l=firstAvailCol;l<firstAvailCol+colSpan;l++){matrixrow[l]="x";}}}}return lookup;}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function checkHeaderOptionsSortingLocked(table,i){if((table.config.headers[i])&&(table.config.headers[i].lockedOrder))return table.config.headers[i].lockedOrder;return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table);}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i];}}};function formatSortingOrder(v){if(typeof(v)!="Number"){return(v.toLowerCase()=="desc")?1:0;}else{return(v==1)?1:0;}}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true;}}return false;}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this);}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]]);}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$('<colgroup>');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('<col>').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++;}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date();}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(table.config.parsers[c].type=="text")?((order==0)?makeSortFunction("text","asc",c):makeSortFunction("text","desc",c)):((order==0)?makeSortFunction("numeric","asc",c):makeSortFunction("numeric","desc",c));var e="e"+i;dynamicExp+="var "+e+" = "+s;dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { ";}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; ";}dynamicExp+="return 0; ";dynamicExp+="}; ";if(table.config.debug){benchmark("Evaling expression:"+dynamicExp,new Date());}eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime);}return cache;};function makeSortFunction(type,direction,index){var a="a["+index+"]",b="b["+index+"]";if(type=='text'&&direction=='asc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+a+" < "+b+") ? -1 : 1 )));";}else if(type=='text'&&direction=='desc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+b+" < "+a+") ? -1 : 1 )));";}else if(type=='numeric'&&direction=='asc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+a+" - "+b+"));";}else if(type=='numeric'&&direction=='desc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+b+" - "+a+"));";}};function makeSortText(i){return"((a["+i+"] < b["+i+"]) ? -1 : ((a["+i+"] > b["+i+"]) ? 1 : 0));";};function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));";};function makeSortNumeric(i){return"a["+i+"]-b["+i+"];";};function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];";};function sortText(a,b){if(table.config.sortLocaleCompare)return a.localeCompare(b);return((a<b)?-1:((a>b)?1:0));};function sortTextDesc(a,b){if(table.config.sortLocaleCompare)return b.localeCompare(a);return((b<a)?-1:((b>a)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder)this.order=this.lockedOrder;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j]);}}}config.sortList.push([i,this.order]);}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2;}}}else{config.sortList.push([i,this.order]);}};setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache));},1);return false;}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false;}});$this.bind("update",function(){var me=this;setTimeout(function(){me.config.parsers=buildParserCache(me,$headers);cache=buildCache(me);},1);}).bind("updateCell",function(e,cell){var config=this.config;var pos=[(cell.parentNode.rowIndex-1),cell.cellIndex];cache.normalized[pos[0]][pos[1]]=config.parsers[pos[1]].format(getElementText(config,cell),cell);}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache));}).bind("appendCache",function(){appendToTable(this,cache);}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this);}).bind("applyWidgets",function(){applyWidget(this);});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist;}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false;}}if(a){parsers.push(parser);};};this.addWidget=function(widget){widgets.push(widget);};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i;};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i;};this.isDigit=function(s,config){return/^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g,'')));};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild)this.removeChild(this.firstChild);}empty.apply(table.tBodies[0]);}else{table.tBodies[0].innerHTML="";}};}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true;},format:function(s){return $.trim(s.toLocaleLowerCase());},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c);},format:function(s){return $.tablesorter.formatFloat(s);},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s);},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g),""));},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item;}else{r+=item;}}return $.tablesorter.formatFloat(r);},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s);},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0");},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s));},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");}else if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");}else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");}return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime());},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false;},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(cell).metadata()[p];},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date();}var $tr,row=-1,odd;$("tr:visible",table.tBodies[0]).each(function(i){$tr=$(this);if(!$tr.hasClass(table.config.cssChildRow))row++;odd=(row%2==0);$tr.removeClass(table.config.widgetZebra.css[odd?0:1]).addClass(table.config.widgetZebra.css[odd?1:0])});if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time);}}});})(jQuery); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | eval |
| Request Header - size: 509 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:05 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 273199 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 273,199 bytes. |
/*!
* jQuery JavaScript Library v1.10.2 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03T13:48Z */ (function( window, undefined ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; var // The deferred used on DOM ready readyList, // A central reference to the root jQuery(document) rootjQuery, // Support: IE<10 // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined` core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) location = window.location, document = window.document, docElem = document.documentElement, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // [[Class]] -> type pairs class2type = {}, // List of deleted data cache ids, so we can reuse them core_deletedIds = [], core_version = "1.10.2", // Save a reference to some core methods core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Used for matching numbers core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, // Used for splitting on whitespace core_rnotwhite = /\S+/g, // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }, // The ready event handler completed = function( event ) { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } }, // Clean-up method for dom ready events detach = function() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: core_version, constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return core_slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }, slice: function() { return this.pushStack( core_slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: core_push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger("ready").off("ready"); } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { if ( obj == null ) { return String( obj ); } return typeof obj === "object" || typeof obj === "function" ? class2type[ core_toString.call(obj) ] || "object" : typeof obj; }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if ( jQuery.support.ownLast ) { for ( key in obj ) { return core_hasOwn.call( obj, key ); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string parseHTML: function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }, parseJSON: function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } if ( data === null ) { return data; } if ( typeof data === "string" ) { // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); if ( data ) { // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } } } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Use native String.trim function wherever possible trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { core_push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( core_indexOf ) { return core_indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var l = second.length, i = first.length, j = 0; if ( typeof l === "number" ) { for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var retVal, ret = [], i = 0, length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return core_concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = core_slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); }, // A method for quickly swapping in/out CSS properties to get correct calculations. // Note: this method belongs to the css module but it's needed here for the support module. // If support gets modularized, this method should be moved back to the css module. swap: function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || type !== "function" && ( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj ); } // All jQuery objects should point back to these rootjQuery = jQuery(document); /*! * Sizzle CSS Selector Engine v1.10.2 * http://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03 */ (function( window, undefined ) { var i, support, cachedruns, Expr, getText, isXML, compile, outermostContext, sortInput, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), hasDuplicate = false, sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; return 0; } return 0; }, // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Prefer arguments quoted, // then not containing pseudos/brackets, // then attribute selectors/non-parenthetical expressions, // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rsibling = new RegExp( whitespace + "*[+~]" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : // BMP codepoint high < 0 ? String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( documentIsHTML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // QSA path if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { nid = old = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && context.parentNode || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key += " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = attrs.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Detect xml * @param {Element|Object} elem An element or a document */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; // Expose support vars for convenience support = Sizzle.support = {}; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.defaultView; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsHTML = !isXML( doc ); // Support: IE>8 // If iframe document is assigned to "document" variable and if iframe has been reloaded, // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 // IE6-8 do not support the defaultView property so parent will be undefined if ( parent && parent.attachEvent && parent !== parent.top ) { parent.attachEvent( "onbeforeunload", function() { setDocument(); }); } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) support.attributes = assert(function( div ) { div.className = "i"; return !div.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if getElementsByClassName can be trusted support.getElementsByClassName = assert(function( div ) { div.innerHTML = "<div class='a'></div><div class='a i'></div>"; // Support: Safari<4 // Catch class over-caching div.firstChild.className = "i"; // Support: Opera<10 // Catch gEBCN failure to find non-leading classes return div.getElementsByClassName("i").length === 2; }); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !doc.getElementsByName || !doc.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && documentIsHTML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select><option selected=''></option></select>"; // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Support: Opera 10-12/IE8 // ^= $= *= and empty values // Should not select anything // Support: Windows 8 Native Apps // The type attribute is restricted during .innerHTML assignment var input = doc.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "t", "" ); if ( div.querySelectorAll("[t^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = docElem.compareDocumentPosition ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); if ( compare ) { // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === doc || contains(preferredDoc, a) ) { return -1; } if ( b === doc || contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } // Not directly comparable, sort on existence of method return a.compareDocumentPosition ? -1 : 1; } : function( a, b ) { var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; // Parentless nodes are either documents or disconnected } else if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return doc; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [elem] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val === undefined ? support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null : val; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array for ( ; (node = elem[i]); i++ ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[5] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] && match[4] !== undefined ) { match[2] = match[4]; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( tokens = [] ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); } function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var data, cache, outerCache, dirkey = dirruns + " " + doneName; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { if ( (data = cache[1]) === true || data === cachedruns ) { return data === true; } } else { cache = outerCache[ dir ] = [ dirkey ]; cache[1] = matcher( elem, context, xml ) || cachedruns; if ( cache[1] === true ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // A counter to specify which element is currently being matched var matcherCachedRuns = 0, bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, expandContext ) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, // We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); if ( outermost ) { outermostContext = context !== document && context; cachedruns = matcherCachedRuns; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below for ( ; (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; cachedruns = ++matcherCachedRuns; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !group ) { group = tokenize( selector ); } i = group.length; while ( i-- ) { cached = matcherFromTokens( group[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); } return cached; }; function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function select( selector, context, results, seed ) { var i, tokens, token, type, find, match = tokenize( selector ); if ( !seed ) { // Try to minimize operations if there is only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && context.parentNode || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } } // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile( selector, match )( seed, context, !documentIsHTML, results, rsibling.test( selector ) ); return results; } // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Support: Chrome<14 // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( document.createElement("div") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert(function( div ) { div.innerHTML = "<input/>"; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert(function( div ) { return div.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return (val = elem.getAttributeNode( name )) && val.specified ? val.value : elem[ name ] === true ? name.toLowerCase() : null; } }); } jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })( window ); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; firingLength = 0; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( list && ( !fired || stack ) ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var action = tuple[ 0 ], fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = core_slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; if( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); jQuery.support = (function( support ) { var all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); // Setup div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // Finish early in limited (non-browser) environments all = div.getElementsByTagName("*") || []; a = div.getElementsByTagName("a")[ 0 ]; if ( !a || !a.style || !all.length ) { return support; } // First batch of tests select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px;float:left;opacity:.5"; // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) support.getSetAttribute = div.className !== "t"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName("tbody").length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !!div.getElementsByTagName("link").length; // Get the style information from getAttribute // (IE uses .cssText instead) support.style = /top/.test( a.getAttribute("style") ); // Make sure that URLs aren't manipulated // (IE normalizes it by default) support.hrefNormalized = a.getAttribute("href") === "/a"; // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 support.opacity = /^0.5/.test( a.style.opacity ); // Verify style float existence // (IE uses styleFloat instead of cssFloat) support.cssFloat = !!a.style.cssFloat; // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) support.checkOn = !!input.value; // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) support.optSelected = opt.selected; // Tests for enctype support on a form (#6743) support.enctype = !!document.createElement("form").enctype; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>"; // Will be defined later support.inlineBlockNeedsLayout = false; support.shrinkWrapBlocks = false; support.pixelPosition = false; support.deleteExpando = true; support.noCloneEvent = true; support.reliableMarginRight = true; support.boxSizingReliable = true; // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE<9 try { delete div.test; } catch( e ) { support.deleteExpando = false; } // Check if we can trust getAttribute("value") input = document.createElement("input"); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "checked", "t" ); input.setAttribute( "name", "t" ); fragment = document.createDocumentFragment(); fragment.appendChild( input ); // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) for ( i in { submit: true, change: true, focusin: true }) { div.setAttribute( eventName = "on" + i, "t" ); support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; } div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Support: IE<9 // Iteration over object's inherited properties before its own. for ( i in jQuery( support ) ) { break; } support.ownLast = i !== "0"; // Run tests that need a body at doc ready jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } container = document.createElement("div"); container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; body.appendChild( container ).appendChild( div ); // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; tds = div.getElementsByTagName("td"); tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Support: IE8 // Check if empty table cells still have offsetWidth/Height support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check box-sizing and margin behavior. div.innerHTML = ""; div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; // Workaround failing boxSizing test due to offsetWidth returning wrong value // with some non-1 values of body zoom, ticket #13543 jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { support.boxSizing = div.offsetWidth === 4; }); // Use window.getComputedStyle because jsdom on node.js will break without it. if ( window.getComputedStyle ) { support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right marginDiv = div.appendChild( document.createElement("div") ); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; support.reliableMarginRight = !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== core_strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Support: IE6 // Check if elements with layout shrink-wrap their children div.style.display = "block"; div.innerHTML = "<div></div>"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); if ( support.inlineBlockNeedsLayout ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); // Null elements to avoid leaks in IE container = div = tds = marginDiv = null; }); // Null elements to avoid leaks in IE all = select = fragment = opt = a = input = null; return support; })({}); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData( elem, name, data, pvt /* Internal Use Only */ ){ if ( !jQuery.acceptData( elem ) ) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( typeof name === "string" ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } i = name.length; while ( i-- ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if ( jQuery.support.deleteExpando || cache != cache.window ) { /* jshint eqeqeq: true */ delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "applet": true, "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { // Do not set data on non-element because it will not be cleared (#8335). if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { return false; } var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; // nodes accept data unless otherwise specified; rejection can be conditional return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); jQuery.fn.extend({ data: function( key, value ) { var attrs, name, data = null, i = 0, elem = this[0]; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attrs = elem.attributes; for ( ; i < attrs.length; i++ ) { name = attrs[i].name; if ( name.indexOf("data-") === 0 ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return arguments.length > 1 ? // Sets one value this.each(function() { jQuery.data( this, key, value ); }) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var nodeHook, boolHook, rclass = /[\t\r\n\f]/g, rreturn = /\r/g, rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, getSetInput = jQuery.support.input; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } elem.className = jQuery.trim( cur ); } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } elem.className = value ? jQuery.trim( cur ) : ""; } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value; if ( typeof stateVal === "boolean" && type === "string" ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), classNames = value.match( core_rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( type === core_strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; }, val: function( value ) { var ret, hooks, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map(val, function ( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { // Use proper attribute retrieval(#6932, #12072) var val = jQuery.find.attr( elem, "value" ); return val != null ? val : elem.text; } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) { optionSet = true; } } // force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return values; } } }, attr: function( elem, name, value ) { var hooks, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === core_strundefined ) { return jQuery.prop( elem, name, value ); } // All attributes are lowercase // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( core_rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( jQuery.expr.match.bool.test( name ) ) { // Set corresponding property to false if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { elem[ propName ] = false; // Support: IE<9 // Also clear defaultChecked/defaultSelected (if appropriate) } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, propFix: { "for": "htmlFor", "class": "className" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? ret : ( elem[ name ] = value ); } else { return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? ret : elem[ name ]; } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); return tabindex ? parseInt( tabindex, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1; } } } }); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr; jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? function( elem, name, isXML ) { var fn = jQuery.expr.attrHandle[ name ], ret = isXML ? undefined : /* jshint eqeqeq: false */ (jQuery.expr.attrHandle[ name ] = undefined) != getter( elem, name, isXML ) ? name.toLowerCase() : null; jQuery.expr.attrHandle[ name ] = fn; return ret; } : function( elem, name, isXML ) { return isXML ? undefined : elem[ jQuery.camelCase( "default-" + name ) ] ? name.toLowerCase() : null; }; }); // fix oldIE attroperties if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = { set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) return name === "value" || value === elem.getAttribute( name ) ? value : undefined; } }; jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = // Some attributes are constructed with empty-string values when not defined function( elem, name, isXML ) { var ret; return isXML ? undefined : (ret = elem.getAttributeNode( name )) && ret.value !== "" ? ret.value : null; }; jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return ret && ret.specified ? ret.value : undefined; }, set: nodeHook.set }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }; }); } // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }; } jQuery.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; }); // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }; if ( !jQuery.support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { // Support: Webkit // "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; }; } }); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = core_hasOwn.call( event, "type" ) ? event.type : event, namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Even when returnValue equals to undefined Firefox will still show alert if ( event.result !== undefined ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === core_strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); var isSimple = /^.[^:#\[\.,]*$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var i, ret = [], self = this, len = self.length; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector || [], true) ); }, filter: function( selector ) { return this.pushStack( winnow(this, selector || [], false) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)) ) { cur = ret.push( cur ); break; } } } return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( jQuery.unique(all) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { ret = jQuery.unique( ret ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } return this.pushStack( ret ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; })); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; }); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; }); } if ( typeof qualifier === "string" ) { if ( isSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, manipulation_rcheckableType = /^(?:checkbox|radio)$/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], area: [ 1, "<map>", "</map>" ], param: [ 1, "<object>", "</object>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } }); }, prepend: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } }); }, before: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { var elem, elems = selector ? jQuery.filter( selector, this ) : this, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var // Snapshot the DOM in case .domManip sweeps something relevant into its fragment args = jQuery.map( this, function( elem ) { return [ elem.nextSibling, elem.parentNode ]; }), i = 0; // Make the changes, replacing each context element with the new content this.domManip( arguments, function( elem ) { var next = args[ i++ ], parent = args[ i++ ]; if ( parent ) { // Don't use the snapshot next if it has moved (#13810) if ( next && next.parentNode !== parent ) { next = this.nextSibling; } jQuery( this ).remove(); parent.insertBefore( elem, next ); } // Allow new content to include elements from the context set }, true ); // Force removal if there was no new content (e.g., from empty arguments) return i ? this : this.remove(); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, callback, allowIntersection ) { // Flatten any nested arrays args = core_concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, self.html() ); } self.domManip( args, callback, allowIntersection ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Hope ajax is available... jQuery._evalUrl( node.src ); } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() core_push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( manipulation_rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !jQuery.support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== core_strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } core_deletedIds.push( id ); } } } } }, _evalUrl: function( url ) { return jQuery.ajax({ url: url, type: "GET", dataType: "script", async: false, global: false, "throws": true }); } }); jQuery.fn.extend({ wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); } }); var iframe, getStyles, curCSS, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, rposition = /^(top|right|bottom|left)$/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), elemdisplay = { BODY: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400 }, cssExpand = [ "Top", "Right", "Bottom", "Left" ], cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function isHidden( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); } } else { if ( !values[ index ] ) { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } jQuery.fn.extend({ css: function( name, value ) { return jQuery.access( this, function( elem, name, value ) { var len, styles, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { if ( typeof state === "boolean" ) { return state ? this.show() : this.hide(); } return this.each(function() { if ( isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "columnCount": true, "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; } }); // NOTE: we've included the "window" in window.getComputedStyle // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { getStyles = function( elem ) { return window.getComputedStyle( elem, null ); }; curCSS = function( elem, name, _computed ) { var width, minWidth, maxWidth, computed = _computed || getStyles( elem ), // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, style = elem.style; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, _computed ) { var left, rs, rsLeft, computed = _computed || getStyles( elem ), ret = computed ? computed[ name ] : undefined, style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } // Try to determine the default display value of an element function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>") .css( "cssText", "display:block !important" ) ).appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; doc.write("<!doctype html><html><body>"); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } // Called ONLY from within css_defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[0], "display" ); elem.remove(); return display; } jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } // These hooks cannot be added until DOM ready because the support test // for it is not run until after DOM ready jQuery(function() { if ( !jQuery.support.reliableMarginRight ) { jQuery.cssHooks.marginRight = { get: function( elem, computed ) { if ( computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } }; } // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = { get: function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } }; }); } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; jQuery.fn.extend({ serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function(){ // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; }) .filter(function(){ var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !manipulation_rcheckableType.test( type ) ); }) .map(function( i, elem ){ var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ){ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); //Serialize an array of form elements or a set of //key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; }); jQuery.fn.extend({ hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); } }); var // Document location ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat("*"); // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( (dataType = dataTypes[i++]) ) { // Prepend if requested if ( dataType[0] === "+" ) { dataType = dataType.slice( 1 ) || "*"; (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); // Otherwise append } else { (structure[ dataType ] = structure[ dataType ] || []).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } }); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, response, type, self = this, off = url.indexOf(" "); if ( off >= 0 ) { selector = url.slice( off, url.length ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax({ url: url, // if "type" variable is undefined, then "GET" method will be used type: type, dataType: "html", data: params }).done(function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); }).complete( callback && function( jqXHR, status ) { self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); }); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ jQuery.fn[ type ] = function( fn ){ return this.on( type, fn ); }; }); jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( (match = rheaders.exec( responseHeadersString )) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to fireGlobals = s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger("ajaxStart"); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) : // Otherwise add one to the end cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader("Last-Modified"); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader("etag"); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); } }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ url: url, type: method, dataType: type, data: data, success: callback }); }; }); /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s[ "throws" ] ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery("head")[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement("script"); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } }); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) ); this[ callback ] = true; return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always(function() { // Restore preexisting value window[ callbackName ] = overwritten; // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; }); // Delegate to script return "script"; } }); var xhrCallbacks, xhrSupported, xhrId = 0, // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject && function() { // Abort all pending requests var key; for ( key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } }; // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties xhrSupported = jQuery.ajaxSettings.xhr(); jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = jQuery.support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport(function( s ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !s.crossDomain || jQuery.support.cors ) { var callback; return { send: function( headers, complete ) { // Get a new xhr var handle, i, xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open( s.type, s.url, s.async, s.username, s.password ); } else { xhr.open( s.type, s.url, s.async ); } // Apply custom fields if provided if ( s.xhrFields ) { for ( i in s.xhrFields ) { xhr[ i ] = s.xhrFields[ i ]; } } // Override mime type if needed if ( s.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( s.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !s.crossDomain && !headers["X-Requested-With"] ) { headers["X-Requested-With"] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } } catch( err ) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( s.hasContent && s.data ) || null ); // Listener callback = function( _, isAbort ) { var status, responseHeaders, statusText, responses; // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; if ( xhrOnUnloadAbort ) { delete xhrCallbacks[ handle ]; } } // If it's an abort if ( isAbort ) { // Abort it manually if needed if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); // When requesting binary data, IE6-9 will throw an exception // on any attempt to access responseText (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && s.isLocal && !s.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } } catch( firefoxAccessException ) { if ( !isAbort ) { complete( -1, firefoxAccessException ); } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, responseHeaders ); } }; if ( !s.async ) { // if we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback setTimeout( callback ); } else { handle = ++xhrId; if ( xhrOnUnloadAbort ) { // Create the active xhrs callbacks list if needed // and attach the unload handler if ( !xhrCallbacks ) { xhrCallbacks = {}; jQuery( window ).unload( xhrOnUnloadAbort ); } // Add to list of active xhrs callbacks xhrCallbacks[ handle ] = callback; } xhr.onreadystatechange = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } }); } var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), rrun = /queueHooks$/, animationPrefilters = [ defaultPrefilter ], tweeners = { "*": [function( prop, value ) { var tween = this.createTween( prop, value ), target = tween.cur(), parts = rfxnum.exec( value ), unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) && rfxnum.exec( jQuery.css( tween.elem, prop ) ), scale = 1, maxIterations = 20; if ( start && start[ 3 ] !== unit ) { // Trust units reported by jQuery.css unit = unit || start[ 3 ]; // Make sure we update the tween properties later on parts = parts || []; // Iteratively approximate from a nonzero starting point start = +target || 1; do { // If previous iteration zeroed out, double until we get *something* // Use a string for doubling factor so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply start = start / scale; jQuery.style( tween.elem, prop, start + unit ); // Update scale, tolerating zero or NaN from tween.cur() // And breaking the loop if scale is unchanged or perfect, or if we've just had enough } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); } // Update tween properties if ( parts ) { start = tween.start = +start || +target || 0; tween.unit = unit; // If a +=/-= token was provided, we're doing a relative animation tween.end = parts[ 1 ] ? start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : +parts[ 2 ]; } return tween; }] }; // Animations created synchronously will run synchronously function createFxNow() { setTimeout(function() { fxNow = undefined; }); return ( fxNow = jQuery.now() ); } function createTween( value, prop, animation ) { var tween, collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( (tween = collection[ index ].call( animation, prop, value )) ) { // we're done with this property return tween; } } } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; }), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ]); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise({ elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {} }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // resolve when we played the last frame // otherwise, reject if ( gotoEnd ) { deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } }), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { return result; } } jQuery.map( props, createTween, animation ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue }) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } function propFilter( props, specialEasing ) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } jQuery.Animation = jQuery.extend( Animation, { tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.split(" "); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; tweeners[ prop ] = tweeners[ prop ] || []; tweeners[ prop ].unshift( callback ); } }, prefilter: function( callback, prepend ) { if ( prepend ) { animationPrefilters.unshift( callback ); } else { animationPrefilters.push( callback ); } } }); function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ var prop, value, toggle, tween, hooks, oldfire, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHidden( elem ), dataShow = jQuery._data( elem, "fxshow" ); // handle queue: false promises if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always(function() { // doing this makes sure that the complete handler will be called // before this completes anim.always(function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } }); }); } // height/width overflow pass if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated if ( jQuery.css( elem, "display" ) === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; } } } if ( opts.overflow ) { style.overflow = "hidden"; if ( !jQuery.support.shrinkWrapBlocks ) { anim.always(function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; }); } } // show/hide pass for ( prop in props ) { value = props[ prop ]; if ( rfxtypes.exec( value ) ) { delete props[ prop ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { continue; } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); } } if ( !jQuery.isEmptyObject( orig ) ) { if ( dataShow ) { if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } } else { dataShow = jQuery._data( elem, "fxshow", {} ); } // store state if its toggle - enables .stop().toggle() to "reverse" if ( toggle ) { dataShow.hidden = !hidden; } if ( hidden ) { jQuery( elem ).show(); } else { anim.done(function() { jQuery( elem ).hide(); }); } anim.done(function() { var prop; jQuery._removeData( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } }); for ( prop in orig ) { tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = tween.start; if ( hidden ) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } } } function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || "swing"; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; if ( tween.elem[ tween.prop ] != null && (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { return tween.elem[ tween.prop ]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Support: IE <=9 // Panic based approach to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; }); jQuery.fn.extend({ fadeTo: function( speed, to, easing, callback ) { // show any hidden elements after setting opacity to 0 return this.filter( isHidden ).css( "opacity", 0 ).show() // animate to the value specified .end().animate({ opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each(function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } }); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each(function() { var index, data = jQuery._data( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.stop ) { hooks.stop.call( this, true ); } // look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // turn off finishing flag delete data.finish; }); } }); // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth? 1 : 0; for( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p*Math.PI ) / 2; } }; jQuery.timers = []; jQuery.fx = Tween.prototype.init; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { if ( timer() && jQuery.timers.push( timer ) ) { jQuery.fx.start(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { clearInterval( timerId ); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Back Compat <1.8 extension point jQuery.fx.step = {}; if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } jQuery.fn.offset = function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== core_strundefined ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }; jQuery.offset = { setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || docElem; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || docElem; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return jQuery.access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return jQuery.access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; }); }); // Limit scope pollution from any deprecated API // (function() { // The number of elements contained in the matched element set jQuery.fn.size = function() { return this.length; }; jQuery.fn.andSelf = jQuery.fn.addBack; // })(); if ( typeof module === "object" && module && typeof module.exports === "object" ) { // Expose jQuery as module.exports in loaders that implement the Node // module pattern (including browserify). Do not create the global, since // the user will be storing it themselves locally, and globals are frowned // upon in the Node module world. module.exports = jQuery; } else { // Otherwise expose jQuery to the global object as usual window.jQuery = window.$ = jQuery; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. if ( typeof define === "function" && define.amd ) { define( "jquery", [], function () { return jQuery; } ); } } })( window ); |
| Instances | 2 |
| Solution |
See the references for security advice on the use of these functions.
|
| Reference | https://angular.io/guide/security |
| Tags |
WSTG-v42-CLNT-02
OWASP_2021_A04 |
| CWE Id | 749 |
| WASC Id | |
| Plugin Id | 10110 |
|
Low |
Permissions Policy Header Not Set |
|---|---|
| Description |
Permissions Policy Header is an added layer of security that helps to restrict from unauthorized access or usage of browser/client features by web resources. This policy ensures the user privacy by limiting or specifying the features of the browsers can be used by the web resources. Permissions Policy provides a set of standard HTTP headers that allow website owners to limit which features of browsers can be used by the page such as camera, microphone, location, full screen etc.
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/class/lstv_pager.js?v=20220224185611 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 492 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/class/lstv_pager.js?v=20220224185611 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Thu, 24 Feb 2022 10:56:11 GMT Accept-Ranges: bytes Content-Length: 50267 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 50,267 bytes. |
var fields = jQuery('#pager_fields').val().split(',');
var headers = jQuery('#pager_headers').val().split(','); var table = jQuery('#pager_table').val(); var table_id = jQuery('#pager_table_id').val(); var xlink_id = jQuery('#pager_xlink').val(); var xfield = jQuery('#pager_xfield').val(); var xtitle = jQuery('#pager_title').val(); var xusedscascde = jQuery('#usedscascde').val(); var xtable_code = jQuery('#table_code').val(); var xtable_desc = jQuery('#table_desc').val(); var xmodal_width = jQuery('#modal_width').val(); var xmodal_height = jQuery('#modal_height').val(); var xhovering_type = jQuery('#hovering_type').val(); var xserver = jQuery('#server').val(); var xpager_link_id_hash = jQuery('#pager_link_id_hash').val(); var totalpages = jQuery('#pager_totalpages').val(); var page = jQuery('#pager_page').val(); var pager_keys = new Array(); jQuery(document).ready(function(){ checkpage(); jQuery('#txtchk').click(function(){ document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='post'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('.datepicker').datepicker(); jQuery('ul.ui-autocomplete').css('z-index',1100); jQuery('.dia_fld').dbFldLen({ link_hash_id: xpager_link_id_hash, tablename: table, ajaxPage:'db_field_length_checker_ajax.php' }); jQuery('#div_pager').on('click','#datatable .pager_thead .header_sort',function() { jQuery('#header_sort').val(jQuery(this).data('header_field_column')); if(jQuery(this).find('.header_sort_asc').length>0) { jQuery('#header_sort_by').val('DESC'); } else { jQuery('#header_sort_by').val('ASC'); } //20191118 justine set after sorting go to first page // document.forms.myform.action= xserver; // document.forms.myform.method='post'; // document.forms.myform.target='_self'; // document.forms.myform.submit(); jQuery('#pager_first').click(); }); jQuery('#pager_print_export').on('change','.pager_print_expt_col_sort_sel',function() { jQuery('.pager_print_expt_col_sort_sel').find('option').show(); jQuery('.pager_print_expt_col_sort_sel').each(function() { var this_val = jQuery(this).val(); if(this_val!="") { jQuery('.pager_print_expt_col_sort_sel').not(this).find('option[value="'+this_val+'"]').hide(); } }); }); jQuery('#div_pager #datatable tbody tr:eq(0) td').each(function(key,val){ pager_keys[pager_keys.length] = jQuery(val).attr('id'); }); jQuery('#pager_modal input[type=checkbox]').each(function(key,val){ jQuery(this).click(function(){ var xbool = jQuery(this).prop('checked'); var xid = jQuery(this).attr('id'); if(xbool == true){ jQuery('#checkbox_'+xid).val('1'); } else{ jQuery('#checkbox_'+xid).val('0'); } }); }); jQuery('#pager_copy_diag').dialog({ title:'Copy to Other ' + jQuery("#hr_mode").val(), width: 800, height: 600, draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function(){jQuery('.ui-dialog-titlebar-close').hide();}, buttons:[ { text:"Copy", class:"save", click:function() { pager_copy_diag_result(); } }, { text:"Cancel", class:"exit", click:function() { jQuery(this).dialog('close'); location.reload(); } } ] }); jQuery('#pager_copy_diag').on('click','.pager_freeze_tbl .tbody .td',function(e) { if(jQuery(this).find('.pager_copy_chkbox').length==0) { jQuery(this).closest('.tr').find('.pager_copy_chkbox').prop('checked',!jQuery(this).closest('.tr').find('.pager_copy_chkbox').is(':checked')).change(); } }) jQuery('#pager_copy_diag').on('change','.pager_freeze_tbl .tbody .td .pager_copy_chkbox',function(e) { if(jQuery(this).is(':checked')) { jQuery(this).closest('.tr').find('.td').addClass('td_pager_copy_candidate'); } else { jQuery(this).closest('.tr').find('.td').removeClass('td_pager_copy_candidate'); } }) jQuery('#pager_copy_diag').on('click','.pager_copy_all_chkbox',function() { jQuery('#pager_copy_diag .pager_freeze_tbl .tbody .tr').find('.pager_copy_chkbox:not(:disabled)').prop('checked',jQuery(this).is(':checked')).change(); }) jQuery('#pager_copy_diag').on('change','.pager_copy_subdryfrom',function() { jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option").show(); if(jQuery('#pager_copy_diag').find('.pager_copy_subdryto').val()==jQuery(this).val()) { jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option[value!='"+jQuery(this).val()+"']").prop('selected',true); } jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option[value='"+jQuery(this).val()+"']").hide(); reload_pager_copy_diag_result(); }) jQuery('#pager_copy_diag').on('change','.pager_copy_subdryto',function() { jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option").show(); if(jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').val()==jQuery(this).val()) { jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option[value!='"+jQuery(this).val()+"']").prop('selected',true); } jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option[value='"+jQuery(this).val()+"']").hide(); reload_pager_copy_diag_result(); }) if(xhovering_type == 'click'){ jQuery('#div_pager #datatable .pager_tbody .pager_tr').each(function(key,val){ jQuery(val).click(function(){ jQuery('#div_pager #datatable .pager_tbody .pager_tr').removeClass('pager-active'); jQuery(this).addClass('pager-active'); var active_id = jQuery(this).attr('id'); jQuery('#pager_active_id').val(active_id); for(var i=0;i<pager_keys.length;i++){ var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); jQuery('#pager_'+pager_keys[i]).val(dataval); } }); }); } else{ // console.log(jQuery('#div_pager #datatable .pager_tbody .pager_tr').length); jQuery('#div_pager').on('mouseover','#datatable .pager_tbody .pager_tr',function() { var active_id = jQuery(this).attr('id'); // console.log('hovertblasdsadasda',active_id); jQuery('#pager_active_id').val(active_id); for(var i=0;i<pager_keys.length;i++) { var dataval = jQuery(this).find('#'+pager_keys[i]).attr('value'); jQuery('#pager_'+pager_keys[i]).val(dataval); } }) // jQuery('#div_pager #datatable .pager_tbody .pager_tr').each(function(key,val){ // jQuery(val).hover(function(){ // console.log(val); // }); // }); } // init_datatable_freezetable(); }) jQuery(window).load(function() { init_datatable_freezetable(); }) function checkselval(obj) { var selval = jQuery(obj).val(); jQuery(".pager_print_expt_col_sort_sel").addClass("checkselval"); jQuery(obj).removeClass("checkselval"); jQuery('.checkselval').each(function(){ if(jQuery(this).val() == selval && jQuery(this).val() != "" ) { alertify.alert("Column No. already selected.",function(){ jQuery(obj).val(""); }); } }); jQuery(".pager_print_expt_col_sort_sel").removeClass("checkselval"); } function init_datatable_freezetable() { var header_width = []; var action_header_index=null; jQuery('#div_pager #datatable th:visible').each(function(index,value) { if(jQuery(this).hasClass('header_action')) { action_header_index=index; } header_width.push(jQuery(this).data('header_width')); }); if(action_header_index!=null) { jQuery('#div_pager ').find('table tbody tr').each(function() { jQuery(this).find('td:visible').eq(action_header_index).addClass('pager_action_btn_container'); }); // console.log(action_header_index); jQuery('#div_pager #datatable').lst_freeze_table({ column_width:header_width, // left_fixed_column_index:[1], right_fixed_column_index:[action_header_index], tbl_max_width: "auto", tbl_max_height: "auto" }); } else { jQuery('#div_pager #datatable').lst_freeze_table({ column_width:header_width, // left_fixed_column_index:[1], // right_fixed_column_index:[action_header_index], tbl_max_width: "auto", tbl_max_height: "auto" }); } } function reload_pager_copy_diag_result() { if(jQuery('#pager_copy_diag').find('.pager_copy_subdryto').val()!='') { blockui(); var xdata = ""; xdata+="&"+jQuery('#pager_copy_diag .pager_copy_subdry').serialize(); xdata+="&pager_event_action=reload_pager_copy_diag_result"; xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&headers="+headers; xdata+="&pager_xlink="+xlink_id; xdata+="&fieldname="+xfield; xdata+="&xusedscascde="+xusedscascde; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); jQuery('#pager_copy_diag #pager_freeze_tbl_container').empty() jQuery('#pager_copy_diag #pager_freeze_tbl_container').html(response.content); jQuery('#pager_copy_diag #pager_freeze_tbl_container .pager_freeze_tbl').lst_freeze_table({ column_width:response.column_width, left_fixed_column_index:[0], tbl_max_width: 770, tbl_max_height: 350 }); } }); } } function pager_copy_diag_result() { if(jQuery('#pager_copy_diag .pager_copy_chkbox:checked').length > 0) { alertify.confirm('Continue copying selected records ? ',function() { blockui(); var xdata = ""; xdata+="&"+jQuery('#pager_copy_diag *').serialize(); xdata+="&pager_event_action=pager_copy_diag_result"; xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&headers="+headers; xdata+="&pager_xlink="+xlink_id; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); alertify.alert(response.msg,function() { reload_pager_copy_diag_result(); }) } }); },function() { }) } else { alertify.alert('Please select record(s) to copy.') } } function pager_open_subdry_copy_diag() { jQuery('#pager_copy_diag').dialog('open'); jQuery('#pager_copy_diag .pager_copy_subdryfrom option:first').prop('selected',true); jQuery('#pager_copy_diag .pager_copy_subdryto option:first').prop('selected',true); jQuery('#pager_copy_diag .pager_copy_subdryfrom').change(); } function clear_searchbox() { jQuery('#pager_search_input').val(''); } function addRow() { isValid = true; jQuery('#pager_modal .required:visible').removeClass('input_hasErr'); jQuery('#pager_modal .required:visible').each(function() { if (jQuery(this).val() == '') { isValid = false; jQuery(this).addClass('input_hasErr'); } else //20191113 donita { var xval = jQuery(this).val(); xval = xval.trim(); jQuery(this).val(xval); if(xval == "") { jQuery(this).addClass('input_hasErr'); isValid = false; } } }); if(isValid) { var modalfield_tablecde = jQuery('#modalField_'+xtable_code); var modalfield_tabledsc = jQuery('#modalField_'+xtable_desc); if(xusedscascde == 1) { // console.log('passxuseddscascde',filter_syspar_code_regex(modalfield_tabledsc.val())); if(filter_syspar_code_regex(modalfield_tabledsc.val())!="") { modalfield_tablecde.val(filter_syspar_code_regex(modalfield_tabledsc.val())); } else { alertify.alert('Description must contain atleast 1 alphanumeric ( A-Z , 0-9 ) character. '); return; } } blockui(); var xdata = ""; xdata+=jQuery('#pager_modal *').serialize(); xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=add"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery('#pager_modal').find('input:checkbox:not(:checked)').each(function() { xdata+="&"+jQuery(this).attr('name')+"="+jQuery(this).data('unchecked_value'); }) console.log(xdata); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response){ $.unblockUI(); if(response.bool) { jQuery('#pager_modal').dialog('close'); } alertify.alert(response.msg,function(){ if(response.bool) { jQuery('#pager_modal').dialog('close'); //20191118 justine set after adding go to first page // pager_reload(); jQuery('#pager_first').click(); } else{ if(response.msg == "Please fill required field(s).") { var arr = response.flds; for(var x=0; x<arr.length; x++) { jQuery('#modalField_'+arr[x]).val(""); jQuery('#modalField_'+arr[x]).addClass('input_hasErr'); } } } }); } }); } else { alertify.alert('Please fill required field(s)').set({'closable':false,'modal':true}); } } function updateRow(recid) { isValid = true; jQuery('#pager_modal .required:visible').removeClass('input_hasErr'); jQuery('#pager_modal .required:visible').each(function() { if (jQuery(this).val() == '') { isValid = false; jQuery(this).addClass('input_hasErr'); } else //20191113 donita { var xval = jQuery(this).val(); xval = xval.trim(); jQuery(this).val(xval); if(xval == "") { jQuery(this).addClass('input_hasErr'); isValid = false; } } }); if(isValid) { var modalfield_tablecde = jQuery("#modalField_"+xtable_code); var modalfield_tabledsc = jQuery("#modalField_"+xtable_desc); if(xusedscascde == 1) { if(filter_syspar_code_regex(modalfield_tabledsc.val())!="") { modalfield_tablecde.val(filter_syspar_code_regex(modalfield_tabledsc.val())); } else { alertify.alert('Description must contain atleast 1 alphanumeric ( A-Z , 0-9 ) character. '); return; } } blockui(); if(xtitle == "Leaves File") { jQuery('#pager_modal').find('input[id*="modalField_"]').prop('disabled',false); } var xdata = ""; xdata+=jQuery('#pager_modal *').serialize(); xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&recid="+encodeURIComponent(recid); xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=update"; xdata+="&fieldname="+xfield; xdata+="&headers="+headers; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery('#pager_modal').find('input:checkbox:not(:checked)').each(function() { xdata+="&"+jQuery(this).attr('name')+"="+jQuery(this).data('unchecked_value'); }) jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response){ $.unblockUI(); if(response.bool) { jQuery('#pager_modal').dialog('close'); } alertify.alert(response.msg,function(){ if(response.bool) { pager_reload(); } else{ if(response.msg == "Please fill required field(s).") { var arr = response.flds; for(var x=0; x<arr.length; x++) { jQuery('#modalField_'+arr[x]).val(""); jQuery('#modalField_'+arr[x]).addClass('input_hasErr'); } } else if(response.leave_logs != "" && xtitle == "Leaves File") { document.forms.myform.action = 'mf_leave_xpt.php'; document.forms.myform.target = '_blank'; document.forms.method = 'POST'; document.forms.myform.leave_logs.value = response.leave_logs; document.forms.myform.txt_leavesdesc.value = jQuery('#modalField_leavesdesc').val(); document.forms.myform.submit(); } } }); } }); } else { alertify.alert('Please fill required field(s)').set({'closable':false,'modal':true}); } } function modPagerBtn(par) { if(par=='add') { var xfunc = 'addRow()'; var xtitle = 'Save'; } else if(par=='edit') { var xfunc = 'updateRow()'; var xtitle = 'Save'; } jQuery('.ui-dialog .ui-dialog-buttonpane .ui-button').remove(); // mica change button to input type button or button type button // var btn = "<button role='button' class='save' style='height:30px;' onclick='"+xfunc+"'>"+xtitle+"</button>"; // btn += "<button role='button' class='exit' style='height:30px;' onclick='closePagerModal()'>Close</button>"; var btn = "<input type=\"button\" class=\"save\" style=\"height:30px;\" onclick=\""+xfunc+"\" value=\""+xtitle+"\">"; btn += "<input type=\"button\" class=\"exit\" style=\"height:30px;\" onclick=\"closePagerModal()\" value=\"Close\">"; jQuery('.ui-dialog-buttonset').append(btn); } function closePagerModal() { jQuery('#div_pager #datatable tr').removeClass('action_btn_selected_row'); jQuery('#pager_modal').dialog('close'); } function add_item(){ var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&event_action=has_edo"; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { jQuery('#pager_modal').find('input,textarea,select').prop('disabled',false); jQuery('#pager_modal input:text').val(''); jQuery('#pager_modal input:checkbox').prop('checked',false); jQuery('#pager_modal .required').removeClass('input_hasErr'); if(xtitle == "Leaves File") { jQuery('#modalField_is_edo').prop('disabled',xret); } jQuery('#pager_modal').dialog({ title:'Add', width: xmodal_width, height: xmodal_height, draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function(){jQuery('.ui-dialog-titlebar-close').hide();}, buttons:[ { text:"Save", class:"save", id:"btn_diag_save", click:function() { addRow(); } }, { text:"Cancel", class:"exit", id:"btn_diag_cancel", click:function() { jQuery(this).dialog('close'); } } ] }).dialog('open'); jQuery('#modalField_subdrycde').change(); //20190314 donita } }) } function edit_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery('#pager_modal .required').removeClass('input_hasErr'); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } // console.log(recid); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&event_action=view"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); // console.log(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { $.each(xret.rs,function(key,xretDataval) { // console.log(xretDataval); // console.log(key); // var hidden_type = jQuery(xretDataval).find('#modalField_'+key).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(xretDataval).find('#'+key).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery('#modalField_'+key).prop('checked',true); // jQuery('#checkbox_modalField_'+key).val('1'); // } // else // { // jQuery('#checkbox_modalField_'+key).val('0'); // } // } // else // { // var dataval = jQuery(xretDataval).find('#'+key).attr('value'); if(jQuery('#modalField_'+key).is(':checkbox')) { jQuery('#modalField_'+key).prop('checked',false); if(jQuery('#modalField_'+key).data('checked_value')==xretDataval) { jQuery('#modalField_'+key).prop('checked',true); } } else { jQuery('#modalField_'+key).val(xretDataval); } // } }); jQuery('#pager_modal').find('input,textarea,select').prop('disabled',false); if(xtitle == "Leaves File") { $.each(xret.is_disabled,function(key,xretDataval) { jQuery('#modalField_'+key).prop('disabled',xretDataval); }); jQuery('#pager_modal').find('input#modalField_withoutpay').prop('disabled',true); } //jQuery('#pager_modal').find('#modalField_subdrycde').prop('readonly','readonly'); jQuery('#pager_modal').dialog({ title:'Edit', width: xmodal_width, height: xmodal_height, appendTo:'#div_pager', draggable:true, resizable:false, autoOpen:false, modal:true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [ { "text":"Save", "class":"save", "id": "btn_diag_save", "click":function() { updateRow(recid); } }, { "text":"Close", "class":"exit", "id": "btn_diag_close", "click":function() { jQuery(this).dialog('close'); // jQuery(this).remove(); } } ] }).dialog('open'); jQuery('#modalField_subdrycde').change(); //20190314 donita } }) // var clonedPagerModal = jQuery('#pager_modal').clone(); // var action_btn_selected_row=''; // jQuery('#div_pager #datatable tbody tr').each(function(key,val){ // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var hidden_type = jQuery(val).find('#'+pager_keys[i]).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('1'); // } // else // { // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('0'); // } // } // else // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).is(':checkbox')) // { // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).data('checked_value')==dataval) // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // } // } // else // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).val(dataval); // } // } // } // } // }); // modPagerBtn('edit'); } function pager_view_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery('#pager_modal .required').removeClass('input_hasErr'); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } // console.log(recid); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&event_action=view"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); // console.log(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { $.each(xret.rs,function(key,xretDataval) { if(jQuery('#modalField_'+key).is(':checkbox')) { jQuery('#modalField_'+key).prop('checked',!true); if(jQuery('#modalField_'+key).data('checked_value')==xretDataval) { jQuery('#modalField_'+key).prop('checked',true); } } else { jQuery('#modalField_'+key).val(xretDataval); } }); jQuery('#pager_modal').find('input,textarea,select').prop('disabled',true); jQuery('#pager_modal').dialog({ title:'View', width: xmodal_width, height: xmodal_height, appendTo:'#div_pager', draggable:true, resizable:false, autoOpen:false, modal:true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [ { "text":"Close", "class":"exit", "id":"btn_diag_close", "click":function() { jQuery(this).dialog('close'); // jQuery(this).remove(); } } ] }).dialog('open'); } }) // var clonedPagerModal = jQuery('#pager_modal').clone(); // var action_btn_selected_row=''; // jQuery('#div_pager #datatable tbody tr').each(function(key,val){ // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var hidden_type = jQuery(val).find('#'+pager_keys[i]).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('1'); // } // else // { // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('0'); // } // } // else // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).is(':checkbox')) // { // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).data('checked_value')==dataval) // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // } // } // else // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).val(dataval); // } // } // } // } // }); } function delete_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } var action_btn_selected_row=''; //tinamaan to // jQuery('#div_pager #datatable tbody tr').each(function(key,val) // { // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // jQuery('#modalField_'+pager_keys[i]).val(dataval); // } // } // }); // console.log('???',jQuery('#div_pager #datatable .tbody .tr#'+active_id)); jQuery('#div_pager #datatable .tbody .tr#'+active_id).addClass('action_btn_selected_row'); action_btn_selected_row = jQuery('#div_pager #datatable .tbody .tr#'+active_id); for(var i=0;i<pager_keys.length;i++) { var val = jQuery('#div_pager #datatable .tbody .tr[id="'+active_id+'"]').get(0); // get the DOM element var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); jQuery('#modalField_'+pager_keys[i]).val(dataval); // console.log("out",jQuery('#modalField_'+pager_keys[i]).val(dataval)); } jQuery('#pager_modal').hide(); var xparams = ""; var xretmsg = ""; xparams += "&headers="+headers; xparams += "&title="+xtitle; xparams += "&table="+table; xparams += "&recid="+encodeURIComponent(recid); xparams += "&table_id="+table_id; xparams += "&fields="+fields; xparams += "&pager_xlink="+xlink_id; xparams += "&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); jQuery.ajax({ dataType:'json', data : xparams, url : 'class/pager_item_dedector.php', type: 'post', success : function (xretobj){ xretmsg = xretobj.msg; alertify.confirm('Delete "<b>'+xtitle+'</b> (' + xretmsg + ')" Record ?',function() { blockui(); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=delete"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); alertify.alert(response.msg+' (' + xretmsg + ').',function() { if(response.bool) { // 20191118 justine set after delete go to firt page // jQuery('#pager_first').click(); pager_reload(); } }); } }); },function() { action_btn_selected_row.removeClass('action_btn_selected_row'); }); } }); } function checkpage() { if(parseInt(page) == 1) { jQuery('#pager_first').prop("disabled",true); jQuery('#pager_prev').prop("disabled",true); } else { jQuery('#pager_first').prop("disabled",false); jQuery('#pager_prev').prop("disabled",false); } if(parseInt(page) > parseInt(totalpages)) { page = parseInt(jQuery('#pager_page').val()) - 1; console.log("in"); // return false; document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); } } jQuery('#pager_selector').change(function(){ document.forms.myform.pager_page.value=this.value; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_limiter').change(function(){ document.forms.myform.pager_page.value='1'; document.forms.myform.pager_limit.value=this.value; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_next').click(function(){ if(page == totalpages){ page = totalpages; } else{ page = parseInt(jQuery('#pager_page').val()) + 1; } document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_prev').click(function(){ if(page == 1){ page = 1; } else{ page = parseInt(jQuery('#pager_page').val()) - 1; } document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_first').click(function(){ document.forms.myform.pager_page.value=1; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_last').click(function(){ document.forms.myform.pager_page.value=totalpages; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_search_btn').click(function(){ document.forms.myform.pager_page.value=1; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); //enable pressing enter on pager_search to submit jQuery('#pager_search_input').on('keypress', function (event) { if(event.which === 13){ jQuery('#pager_search_btn').click(); } }); function pager_reload() { document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); } function print_item() { jQuery('#print_layout_container').show(); jQuery('#pager_print_export').dialog({ title:"Print "+xtitle, width: '650', height: 'auto', draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); jQuery('#pager_print_export .pager_print_expt_col_sort_sel').val('').change(); jQuery('#pager_print_export .pager_print_expt_input_text').val(''); }, buttons: [ { "text":"Print Preview", "class":"print", "id": "btn_diag_print", "click":function() { document.forms.myform.action='mf_print.php'; document.forms.myform.method='POST'; document.forms.myform.target='_blank'; document.forms.myform.submit(); } }, { "text":"Cancel", "class":"exit", "id": "btn_diag_cancel", "click":function() { jQuery(this).dialog("close"); } } ] }).dialog('open'); } function export_item() { jQuery('#print_layout_container').hide(); jQuery('#pager_print_export').dialog({ title:"Export "+xtitle, width: '650', height: 'auto', draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); jQuery('#pager_print_export .pager_print_expt_col_sort_sel').val('').change(); jQuery('#pager_print_export .pager_print_expt_input_text').val(''); }, buttons: [ { "text":"Export", "class":"print", "id": "btn_diag_export", "click":function() { document.forms.myform.action='mf_export.php'; document.forms.myform.method='POST'; document.forms.myform.target='_blank'; document.forms.myform.submit(); } }, { "text":"Cancel", "id": "btn_diag_cancel", "class":"exit", "click":function() { jQuery(this).dialog("close"); } } ] }).dialog('open'); } function pager_check_all(obj) { var ischecked = jQuery(obj).prop('checked'); if(ischecked) { jQuery('.pager_checker_body').prop('checked',true); } else { jQuery('.pager_checker_body').prop('checked',false); } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function prevent_space(evt) { if(evt.which == 32) { evt.returnValue = false; } } //20191107 donita bak org // function paste_syspar_regex(evt) // { // evt.preventDefault(); // evt.returnValue = false; // var text = null; // if (window.clipboardData) // text = window.clipboardData.getData("Text"); // else if (evt && evt.clipboardData) // text = evt.clipboardData.getData("Text"); // var validate_spechar = jQuery('#pager_spechar').val(); // validate_spechar = validate_spechar.split(""); // validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; // var regex = new RegExp(validate_spechar,'mg'); // if( regex.test(text) ) // { // alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() // { // evt.target.value = text.replace(regex, ""); // // console.log(evt.target,text.replace(regex, "")); // },function() // { // }) // } // else // { // evt.target.value = text // } // } //prevent bypass of maxlength and pasting on disabled input function paste_syspar_regex(evt) { evt.preventDefault(); evt.returnValue = false; // console.log("pass") // console.log("1") // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val()+"<>"; validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery("#"+evt.target.id).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr.substring(0, xmaxlen); //20191107 donita // console.log(evt.target.id); if(jQuery("#"+evt.target.id).prop('disabled') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // disallow_tag("") // alert("1") // console.log("11") //20191106 donita newstr = evt.target.value; //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); //end trimstr = evt.target.value+newstr.substring(0, xmaxlen); evt.target.value = trimstr; // console.log(evt.target,text.replace(regex, "")); },function() { }) } else { evt.target.value = text //20191106 donita newstr = evt.target.value; trimstr = newstr.substring(0, xmaxlen); evt.target.value = trimstr; } } } function filter_syspar_code_regex(val_with_spechar) { var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); return val_with_spechar.replace(regex, ""); } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/custom_modal.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 494 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/custom_modal.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,143 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 1986 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 1,986 bytes. |
function modPagerBtn2(par,funcname,title,modalid,clsefunc)
{ var mid = modalid; if(par=='add') { var xfunc = funcname; var xtitle = title; } else if(par=='edit') { var xfunc = funcname; var xtitle = title; } if(clsefunc == '') { var closefunc = "closePagerModal2('"+mid+"')"; } else { var closefunc = clsefunc; } jQuery('.ui-dialog '+modalid).next('.ui-dialog-buttonpane').find('.ui-dialog-buttonset button').remove(); var btn = "<button role='button' class='save' style='height:30px;' onclick='"+xfunc+"'>"+xtitle+"</button>"; btn += "<button role='button' class='exit' style='height:30px;' onclick="+closefunc+">Close</button>"; jQuery('.ui-dialog '+modalid).next('.ui-dialog-buttonpane').find('.ui-dialog-buttonset').append(btn); } function closePagerModal2(modalid) { jQuery(modalid).dialog('close'); } function custom_closebutton(modalid) { var closefunc = "close_custombutton('"+modalid+"')"; jQuery('.ui-dialog '+modalid).next('.ui-dialog-buttonpane').find('.ui-dialog-buttonset button').remove(); var btn = "<button role='button' class='exit' style='height:30px;' onclick="+closefunc+">Close</button>"; jQuery('.ui-dialog '+modalid).next('.ui-dialog-buttonpane').find('.ui-dialog-buttonset').append(btn); } function custom_closebutton2(modalid) { var closefunc = "close_custombutton2('"+modalid+"')"; jQuery('.ui-dialog '+modalid).next('.ui-dialog-buttonpane').find('.ui-dialog-buttonset button').remove(); var btn = "<button role='button' class='exit' style='height:30px;' onclick="+closefunc+">Close</button>"; jQuery('.ui-dialog '+modalid).next('.ui-dialog-buttonpane').find('.ui-dialog-buttonset').append(btn); } function close_custombutton(modalid) { // console.log(modalid); jQuery(modalid).dialog('close'); jQuery(modalid).html(""); } function close_custombutton2(modalid) { // console.log(modalid); jQuery(modalid).dialog('close'); } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 529 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,143 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 2897 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 2,897 bytes. |
(function( $ )
{ $.fn.dbFldLen=function(options) { var opts = $.extend( {}, $.fn.dbFldLen.defaults, options ); var ajax_json={}; var input_json=[]; var input_overwrite_length=[]; var custom_input=[]; var plugin_objects = this; this.each(function(index) { var input=$(this); var overwrite_length = input.data('overwrite_length') == undefined ? '' : input.data('overwrite_length'); if(!input.hasClass('dbflc_processed')) { if(overwrite_length!='') { input_overwrite_length.push( { index : index, maxlen:overwrite_length }) } else { input_json.push( { input_index:index, field_name:input.data('db_col') }) } } }); ajax_json.input_params = input_json; ajax_json.tablename = opts.tablename; ajax_json.link_id = opts.link_id; ajax_json.link_hash_id = opts.link_hash_id; $.ajax({ type: "POST", url: opts.ajaxPage, data: ajax_json, dataType: "json", success: function(xret) { plugin_objects.each(function(index) { var input = jQuery(this); if(xret != null && xret.length > 0) { if(typeof xret[index] !== 'undefined') { $.fn.dbFldLen.initInput(input,xret[index].maxlen); } } else { if(typeof input_overwrite_length[index] !== 'undefined') { $.fn.dbFldLen.initInput(input,input_overwrite_length[index].maxlen); } } }); } }); // return } $.fn.dbFldLen.initInput = function(input,maxlen) { input.attr('maxlength',maxlen); input.wrap('<div class="dbflc_container dbflc_tooltip"></div>'); var tmp_span=jQuery("<div class=\"dbflc_span_container\">"+ "<div class=\"dbflc_span_wrapper\">"+ "<img class=\"callout-tooltip\" src=\"../images/callout-tooltip.gif\" />"+ "<strong>Max length</strong>"+ "<span>Up to "+maxlen+" character(s) only.</span>"+ "</div>"+ "</div>"); input.closest('.dbflc_container.dbflc_tooltip').append(tmp_span); input.removeAttr('data-db_col'); // var dbflc_span=input.nextAll('.dbflc_span'); var dbflc_span_container=input.closest('.dbflc_container').find('.dbflc_span_container'); input.keypress(function() { if($(this).val().length==maxlen) { dbflc_span_container.show(); } else { dbflc_span_container.hide(); } }).keyup(function(e) { if(e.keyCode==8) { input.keypress(); } }).hover(function() { //mousein input.keypress(); },function() { //mouseout dbflc_span_container.hide(); }).focus(function() { //focus input.keypress(); }).blur(function() { //blur dbflc_span_container.hide(); }) }; $.fn.dbFldLen.defaults = { link_id:'', link_hash_id:'', tablename:'', dbname:'' // ,ajaxPage:'db_field_length_checker_ajax.php' }; }( jQuery )); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/greaterdate_function.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 502 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/greaterdate_function.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,143 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:05 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 2104 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 2,104 bytes. |
//check_greaterdate( greaterdate , smallerdate )
function check_greaterdate( xcurdte , xdeldte ) { var xmsg = false; var separators = '-'; var currentElement = ""; var includeEmpties; var fixedExplode1 = new Array(1); var fixedExplode2= new Array(1); var count=0; separators = new String(separators) /*var brokenstring=xdeldte.split(� �); alert(brokenstring); return false;*/ separators = " :-:/"; //current date for(x=0; x < xcurdte.length; x++) { char = xcurdte.charAt(x); if(separators.indexOf(char) != -1) { if ( ( (includeEmpties <= 0) || (includeEmpties == false)) && (currentElement == "")) { } else { fixedExplode1[count] = currentElement; count++; currentElement = ""; } } else { currentElement += char; } } fixedExplode1[count] = currentElement; currentElement = ''; //delivery date count=0; for(x=0; x < xdeldte.length; x++) { char = xdeldte.charAt(x); if(separators.indexOf(char) != -1) { if ( ( (includeEmpties <= 0) || (includeEmpties == false)) && (currentElement == "")) { } else { fixedExplode2[count] = currentElement; count++; currentElement = ""; } } else { currentElement += char; } } fixedExplode2[count] = currentElement; // alert(fixedExplode1[2]); //year // alert(fixedExplode1[1]); //day // alert(fixedExplode1[0]); //month if( parseInt(fixedExplode1[2],'10') < parseInt(fixedExplode2[2],'10') ) { xmsg = false; } else if( parseInt(fixedExplode1[2],'10') == parseInt(fixedExplode2[2],'10') ) { if( parseInt(fixedExplode1[0],'10') < parseInt(fixedExplode2[0],'10') ) { xmsg = false; } else if( parseInt(fixedExplode1[0],'10') == parseInt(fixedExplode2[0],'10') ) { if( parseInt(fixedExplode1[1],'10') < parseInt(fixedExplode2[1],'10') ) { xmsg = false; } // else if( parseInt(fixedExplode1[1],'10') == parseInt(fixedExplode2[1],'10') ) // { // xmsg = false; // } else { xmsg = true; } } else { xmsg = true; } } else { xmsg = true; } return xmsg; } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/jquery.blockUI.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 496 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/jquery.blockUI.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:05 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 20322 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 20,322 bytes. |
/*!
* jQuery blockUI plugin * Version 2.70.0-2014.11.23 * Requires jQuery v1.7 or later * * Examples at: http://malsup.com/jquery/block/ * Copyright (c) 2007-2013 M. Alsup * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Thanks to Amir-Hossein Sobhi for some excellent contributions! */ ;(function() { /*jshint eqeqeq:false curly:false latedef:false */ "use strict"; function setup($) { $.fn._fadeIn = $.fn.fadeIn; var noOp = $.noop || function() {}; // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle // confusing userAgent strings on Vista) var msie = /MSIE/.test(navigator.userAgent); var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent); var mode = document.documentMode || 0; var setExpr = $.isFunction( document.createElement('div').style.setExpression ); // global $ methods for blocking/unblocking the entire page $.blockUI = function(opts) { install(window, opts); }; $.unblockUI = function(opts) { remove(window, opts); }; // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl) $.growlUI = function(title, message, timeout, onClose) { var $m = $('<div class="growlUI"></div>'); if (title) $m.append('<h1>'+title+'</h1>'); if (message) $m.append('<h2>'+message+'</h2>'); if (timeout === undefined) timeout = 3000; // Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications var callBlock = function(opts) { opts = opts || {}; $.blockUI({ message: $m, fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700, fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000, timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout, centerY: false, showOverlay: false, onUnblock: onClose, css: $.blockUI.defaults.growlCSS }); }; callBlock(); var nonmousedOpacity = $m.css('opacity'); $m.mouseover(function() { callBlock({ fadeIn: 0, timeout: 30000 }); var displayBlock = $('.blockMsg'); displayBlock.stop(); // cancel fadeout if it has started displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency }).mouseout(function() { $('.blockMsg').fadeOut(1000); }); // End konapun additions }; // plugin method for blocking element content $.fn.block = function(opts) { if ( this[0] === window ) { $.blockUI( opts ); return this; } var fullOpts = $.extend({}, $.blockUI.defaults, opts || {}); this.each(function() { var $el = $(this); if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked')) return; $el.unblock({ fadeOut: 0 }); }); return this.each(function() { if ($.css(this,'position') == 'static') { this.style.position = 'relative'; $(this).data('blockUI.static', true); } this.style.zoom = 1; // force 'hasLayout' in ie install(this, opts); }); }; // plugin method for unblocking element content $.fn.unblock = function(opts) { if ( this[0] === window ) { $.unblockUI( opts ); return this; } return this.each(function() { remove(this, opts); }); }; $.blockUI.version = 2.70; // 2nd generation blocking at no extra cost! // override these in your code to change the default behavior and style $.blockUI.defaults = { // message displayed when blocking (use null for no message) message: '<h1>Please wait...</h1>', title: null, // title string; only used when theme == true draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded) theme: false, // set to true to use with jQuery UI themes // styles for the message when blocking; if you wish to disable // these and use an external stylesheet then do this in your code: // $.blockUI.defaults.css = {}; css: { padding: 0, margin: 0, width: '30%', top: '40%', left: '35%', textAlign: 'center', color: '#000', border: '3px solid #aaa', backgroundColor:'#fff', cursor: 'wait' }, // minimal style set used when themes are used themedCSS: { width: '30%', top: '40%', left: '35%' }, // styles for the overlay overlayCSS: { backgroundColor: '#000', opacity: 0.6, cursor: 'wait' }, // style to replace wait cursor before unblocking to correct issue // of lingering wait cursor cursorReset: 'default', // styles applied when using $.growlUI growlCSS: { width: '350px', top: '10px', left: '', right: '10px', border: 'none', padding: '5px', opacity: 0.6, cursor: 'default', color: '#fff', backgroundColor: '#000', '-webkit-border-radius':'10px', '-moz-border-radius': '10px', 'border-radius': '10px' }, // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w // (hat tip to Jorge H. N. de Vasconcelos) /*jshint scripturl:true */ iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank', // force usage of iframe in non-IE browsers (handy for blocking applets) forceIframe: false, // z-index for the blocking overlay baseZ: 1000, // set these to true to have the message automatically centered centerX: true, // <-- only effects element blocking (page block controlled via css above) centerY: true, // allow body element to be stetched in ie6; this makes blocking look better // on "short" pages. disable if you wish to prevent changes to the body height allowBodyStretch: true, // enable if you want key and mouse events to be disabled for content that is blocked bindEvents: true, // be default blockUI will supress tab navigation from leaving blocking content // (if bindEvents is true) constrainTabKey: true, // fadeIn time in millis; set to 0 to disable fadeIn on block fadeIn: 200, // fadeOut time in millis; set to 0 to disable fadeOut on unblock fadeOut: 400, // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock timeout: 0, // disable if you don't want to show the overlay showOverlay: true, // if true, focus will be placed in the first available input field when // page blocking focusInput: true, // elements that can receive focus focusableElements: ':input:enabled:visible', // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity) // no longer needed in 2012 // applyPlatformOpacityRules: true, // callback method invoked when fadeIn has completed and blocking message is visible onBlock: null, // callback method invoked when unblocking has completed; the callback is // passed the element that has been unblocked (which is the window object for page // blocks) and the options that were passed to the unblock call: // onUnblock(element, options) onUnblock: null, // callback method invoked when the overlay area is clicked. // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used. onOverlayClick: null, // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493 quirksmodeOffsetHack: 4, // class name of the message block blockMsgClass: 'blockMsg', // if it is already blocked, then ignore it (don't unblock and reblock) ignoreIfBlocked: false }; // private data and functions follow... var pageBlock = null; var pageBlockEls = []; function install(el, opts) { var css, themedCSS; var full = (el == window); var msg = (opts && opts.message !== undefined ? opts.message : undefined); opts = $.extend({}, $.blockUI.defaults, opts || {}); if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked')) return; opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {}); css = $.extend({}, $.blockUI.defaults.css, opts.css || {}); if (opts.onOverlayClick) opts.overlayCSS.cursor = 'pointer'; themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {}); msg = msg === undefined ? opts.message : msg; // remove the current block (if there is one) if (full && pageBlock) remove(window, {fadeOut:0}); // if an existing element is being used as the blocking content then we capture // its current place in the DOM (and current display style) so we can restore // it when we unblock if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) { var node = msg.jquery ? msg[0] : msg; var data = {}; $(el).data('blockUI.history', data); data.el = node; data.parent = node.parentNode; data.display = node.style.display; data.position = node.style.position; if (data.parent) data.parent.removeChild(node); } $(el).data('blockUI.onUnblock', opts.onUnblock); var z = opts.baseZ; // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform; // layer1 is the iframe layer which is used to supress bleed through of underlying content // layer2 is the overlay layer which has opacity and a wait cursor (by default) // layer3 is the message content that is displayed while blocking var lyr1, lyr2, lyr3, s; if (msie || opts.forceIframe) lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>'); else lyr1 = $('<div class="blockUI" style="display:none"></div>'); if (opts.theme) lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>'); else lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'); if (opts.theme && full) { s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">'; if ( opts.title ) { s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>'; } s += '<div class="ui-widget-content ui-dialog-content"></div>'; s += '</div>'; } else if (opts.theme) { s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">'; if ( opts.title ) { s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>'; } s += '<div class="ui-widget-content ui-dialog-content"></div>'; s += '</div>'; } else if (full) { s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>'; } else { s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>'; } lyr3 = $(s); // if we have a message, style it if (msg) { if (opts.theme) { lyr3.css(themedCSS); lyr3.addClass('ui-widget-content'); } else lyr3.css(css); } // style the overlay if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/) lyr2.css(opts.overlayCSS); lyr2.css('position', full ? 'fixed' : 'absolute'); // make iframe layer transparent in IE if (msie || opts.forceIframe) lyr1.css('opacity',0.0); //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el); var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el); $.each(layers, function() { this.appendTo($par); }); if (opts.theme && opts.draggable && $.fn.draggable) { lyr3.draggable({ handle: '.ui-dialog-titlebar', cancel: 'li' }); } // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling) var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0); if (ie6 || expr) { // give body 100% height if (full && opts.allowBodyStretch && $.support.boxModel) $('html,body').css('height','100%'); // fix ie6 issue when blocked element has a border width if ((ie6 || !$.support.boxModel) && !full) { var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth'); var fixT = t ? '(0 - '+t+')' : 0; var fixL = l ? '(0 - '+l+')' : 0; } // simulate fixed position $.each(layers, function(i,o) { var s = o[0].style; s.position = 'absolute'; if (i < 2) { if (full) s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"'); else s.setExpression('height','this.parentNode.offsetHeight + "px"'); if (full) s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'); else s.setExpression('width','this.parentNode.offsetWidth + "px"'); if (fixL) s.setExpression('left', fixL); if (fixT) s.setExpression('top', fixT); } else if (opts.centerY) { if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); s.marginTop = 0; } else if (!opts.centerY && full) { var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0; var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"'; s.setExpression('top',expression); } }); } // show the message if (msg) { if (opts.theme) lyr3.find('.ui-widget-content').append(msg); else lyr3.append(msg); if (msg.jquery || msg.nodeType) $(msg).show(); } if ((msie || opts.forceIframe) && opts.showOverlay) lyr1.show(); // opacity is zero if (opts.fadeIn) { var cb = opts.onBlock ? opts.onBlock : noOp; var cb1 = (opts.showOverlay && !msg) ? cb : noOp; var cb2 = msg ? cb : noOp; if (opts.showOverlay) lyr2._fadeIn(opts.fadeIn, cb1); if (msg) lyr3._fadeIn(opts.fadeIn, cb2); } else { if (opts.showOverlay) lyr2.show(); if (msg) lyr3.show(); if (opts.onBlock) opts.onBlock.bind(lyr3)(); } // bind key and mouse events bind(1, el, opts); if (full) { pageBlock = lyr3[0]; pageBlockEls = $(opts.focusableElements,pageBlock); if (opts.focusInput) setTimeout(focus, 20); } else center(lyr3[0], opts.centerX, opts.centerY); if (opts.timeout) { // auto-unblock var to = setTimeout(function() { if (full) $.unblockUI(opts); else $(el).unblock(opts); }, opts.timeout); $(el).data('blockUI.timeout', to); } } // remove the block function remove(el, opts) { var count; var full = (el == window); var $el = $(el); var data = $el.data('blockUI.history'); var to = $el.data('blockUI.timeout'); if (to) { clearTimeout(to); $el.removeData('blockUI.timeout'); } opts = $.extend({}, $.blockUI.defaults, opts || {}); bind(0, el, opts); // unbind events if (opts.onUnblock === null) { opts.onUnblock = $el.data('blockUI.onUnblock'); $el.removeData('blockUI.onUnblock'); } var els; if (full) // crazy selector to handle odd field errors in ie6/7 els = $('body').children().filter('.blockUI').add('body > .blockUI'); else els = $el.find('>.blockUI'); // fix cursor issue if ( opts.cursorReset ) { if ( els.length > 1 ) els[1].style.cursor = opts.cursorReset; if ( els.length > 2 ) els[2].style.cursor = opts.cursorReset; } if (full) pageBlock = pageBlockEls = null; if (opts.fadeOut) { count = els.length; els.stop().fadeOut(opts.fadeOut, function() { if ( --count === 0) reset(els,data,opts,el); }); } else reset(els, data, opts, el); } // move blocking element back into the DOM where it started function reset(els,data,opts,el) { var $el = $(el); if ( $el.data('blockUI.isBlocked') ) return; els.each(function(i,o) { // remove via DOM calls so we don't lose event handlers if (this.parentNode) this.parentNode.removeChild(this); }); if (data && data.el) { data.el.style.display = data.display; data.el.style.position = data.position; data.el.style.cursor = 'default'; // #59 if (data.parent) data.parent.appendChild(data.el); $el.removeData('blockUI.history'); } if ($el.data('blockUI.static')) { $el.css('position', 'static'); // #22 } if (typeof opts.onUnblock == 'function') opts.onUnblock(el,opts); // fix issue in Safari 6 where block artifacts remain until reflow var body = $(document.body), w = body.width(), cssW = body[0].style.width; body.width(w-1).width(w); body[0].style.width = cssW; } // bind/unbind the handler function bind(b, el, opts) { var full = el == window, $el = $(el); // don't bother unbinding if there is nothing to unbind if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked'))) return; $el.data('blockUI.isBlocked', b); // don't bind events when overlay is not in use or if bindEvents is false if (!full || !opts.bindEvents || (b && !opts.showOverlay)) return; // bind anchors and inputs for mouse and key events var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove'; if (b) $(document).bind(events, opts, handler); else $(document).unbind(events, handler); // former impl... // var $e = $('a,:input'); // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler); } // event handler to suppress keyboard/mouse events when blocking function handler(e) { // allow tab navigation (conditionally) if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) { if (pageBlock && e.data.constrainTabKey) { var els = pageBlockEls; var fwd = !e.shiftKey && e.target === els[els.length-1]; var back = e.shiftKey && e.target === els[0]; if (fwd || back) { setTimeout(function(){focus(back);},10); return false; } } } var opts = e.data; var target = $(e.target); if (target.hasClass('blockOverlay') && opts.onOverlayClick) opts.onOverlayClick(e); // allow events within the message content if (target.parents('div.' + opts.blockMsgClass).length > 0) return true; // allow events for content that is not being blocked return target.parents().children().filter('div.blockUI').length === 0; } function focus(back) { if (!pageBlockEls) return; var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0]; if (e) e.focus(); } function center(el, x, y) { var p = el.parentNode, s = el.style; var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth'); var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth'); if (x) s.left = l > 0 ? (l+'px') : '0'; if (y) s.top = t > 0 ? (t+'px') : '0'; } function sz(el, p) { return parseInt($.css(el,p),10)||0; } } /*global define:true */ if (typeof define === 'function' && define.amd && define.amd.jQuery) { define(['jquery'], setup); } else { setup(jQuery); } })(); function blockui() { $.blockUI({ css: { border: 'none', padding: '15px', backgroundColor: '#000000', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', opacity: 1, color: '#E8E8E8' } }); } function unblockui() { $.unblockUI(); } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/jquery.equalHeight.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 500 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/jquery.equalHeight.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,142 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 655 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 655 bytes. |
// make sure the $ is pointing to JQuery and not some other library
(function($){ // add a new method to JQuery $.fn.equalHeight = function() { // find the tallest height in the collection // that was passed in (.column) tallest = 0; this.each(function(){ thisHeight = $(this).height(); if( thisHeight > tallest) tallest = thisHeight; }); // set each items height to use the tallest value found this.each(function(){ $(this).height(tallest); }); } })(jQuery); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/jquery.inputmask.bundle.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 505 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/jquery.inputmask.bundle.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 146513 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 146,513 bytes. |
/*!
* jquery.inputmask.bundle * http://github.com/RobinHerbots/jquery.inputmask * Copyright (c) 2010 - 2015 Robin Herbots * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) * Version: 3.1.62 */ !function($) { function isInputEventSupported(eventName) { var el = document.createElement("input"), evName = "on" + eventName, isSupported = evName in el; return isSupported || (el.setAttribute(evName, "return;"), isSupported = "function" == typeof el[evName]), el = null, isSupported; } function isInputTypeSupported(inputType) { var isSupported = "text" == inputType || "tel" == inputType; if (!isSupported) { var el = document.createElement("input"); el.setAttribute("type", inputType), isSupported = "text" === el.type, el = null; } return isSupported; } function resolveAlias(aliasStr, options, opts) { var aliasDefinition = opts.aliases[aliasStr]; return aliasDefinition ? (aliasDefinition.alias && resolveAlias(aliasDefinition.alias, void 0, opts), $.extend(!0, opts, aliasDefinition), $.extend(!0, opts, options), !0) : !1; } function generateMaskSet(opts, nocache) { function analyseMask(mask) { function maskToken(isGroup, isOptional, isQuantifier, isAlternator) { this.matches = [], this.isGroup = isGroup || !1, this.isOptional = isOptional || !1, this.isQuantifier = isQuantifier || !1, this.isAlternator = isAlternator || !1, this.quantifier = { min: 1, max: 1 }; } function insertTestDefinition(mtoken, element, position) { var maskdef = opts.definitions[element], newBlockMarker = 0 == mtoken.matches.length; if (position = void 0 != position ? position : mtoken.matches.length, maskdef && !escaped) { maskdef.placeholder = $.isFunction(maskdef.placeholder) ? maskdef.placeholder.call(this, opts) : maskdef.placeholder; for (var prevalidators = maskdef.prevalidator, prevalidatorsL = prevalidators ? prevalidators.length : 0, i = 1; i < maskdef.cardinality; i++) { var prevalidator = prevalidatorsL >= i ? prevalidators[i - 1] : [], validator = prevalidator.validator, cardinality = prevalidator.cardinality; mtoken.matches.splice(position++, 0, { fn: validator ? "string" == typeof validator ? new RegExp(validator) : new function() { this.test = validator; }() : new RegExp("."), cardinality: cardinality ? cardinality : 1, optionality: mtoken.isOptional, newBlockMarker: newBlockMarker, casing: maskdef.casing, def: maskdef.definitionSymbol || element, placeholder: maskdef.placeholder, mask: element }); } mtoken.matches.splice(position++, 0, { fn: maskdef.validator ? "string" == typeof maskdef.validator ? new RegExp(maskdef.validator) : new function() { this.test = maskdef.validator; }() : new RegExp("."), cardinality: maskdef.cardinality, optionality: mtoken.isOptional, newBlockMarker: newBlockMarker, casing: maskdef.casing, def: maskdef.definitionSymbol || element, placeholder: maskdef.placeholder, mask: element }); } else mtoken.matches.splice(position++, 0, { fn: null, cardinality: 0, optionality: mtoken.isOptional, newBlockMarker: newBlockMarker, casing: null, def: element, placeholder: void 0, mask: element }), escaped = !1; } for (var match, m, openingToken, currentOpeningToken, alternator, lastMatch, tokenizer = /(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?\})\??|[^.?*+^${[]()|\\]+|./g, escaped = !1, currentToken = new maskToken(), openenings = [], maskTokens = []; match = tokenizer.exec(mask); ) switch (m = match[0], m.charAt(0)) { case opts.optionalmarker.end: case opts.groupmarker.end: if (openingToken = openenings.pop(), openenings.length > 0) { if (currentOpeningToken = openenings[openenings.length - 1], currentOpeningToken.matches.push(openingToken), currentOpeningToken.isAlternator) { alternator = openenings.pop(); for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1; openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1], currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator); } } else currentToken.matches.push(openingToken); break; case opts.optionalmarker.start: openenings.push(new maskToken(!1, !0)); break; case opts.groupmarker.start: openenings.push(new maskToken(!0)); break; case opts.quantifiermarker.start: var quantifier = new maskToken(!1, !1, !0); m = m.replace(/[{}]/g, ""); var mq = m.split(","), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = 1 == mq.length ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]); if (("*" == mq1 || "+" == mq1) && (mq0 = "*" == mq1 ? 0 : 1), quantifier.quantifier = { min: mq0, max: mq1 }, openenings.length > 0) { var matches = openenings[openenings.length - 1].matches; if (match = matches.pop(), !match.isGroup) { var groupToken = new maskToken(!0); groupToken.matches.push(match), match = groupToken; } matches.push(match), matches.push(quantifier); } else { if (match = currentToken.matches.pop(), !match.isGroup) { var groupToken = new maskToken(!0); groupToken.matches.push(match), match = groupToken; } currentToken.matches.push(match), currentToken.matches.push(quantifier); } break; case opts.escapeChar: escaped = !0; break; case opts.alternatormarker: openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1], lastMatch = currentOpeningToken.matches.pop()) : lastMatch = currentToken.matches.pop(), lastMatch.isAlternator ? openenings.push(lastMatch) : (alternator = new maskToken(!1, !1, !1, !0), alternator.matches.push(lastMatch), openenings.push(alternator)); break; default: if (openenings.length > 0) { if (currentOpeningToken = openenings[openenings.length - 1], currentOpeningToken.matches.length > 0 && !currentOpeningToken.isAlternator && (lastMatch = currentOpeningToken.matches[currentOpeningToken.matches.length - 1], lastMatch.isGroup && (lastMatch.isGroup = !1, insertTestDefinition(lastMatch, opts.groupmarker.start, 0), insertTestDefinition(lastMatch, opts.groupmarker.end))), insertTestDefinition(currentOpeningToken, m), currentOpeningToken.isAlternator) { alternator = openenings.pop(); for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1; openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1], currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator); } } else currentToken.matches.length > 0 && (lastMatch = currentToken.matches[currentToken.matches.length - 1], lastMatch.isGroup && (lastMatch.isGroup = !1, insertTestDefinition(lastMatch, opts.groupmarker.start, 0), insertTestDefinition(lastMatch, opts.groupmarker.end))), insertTestDefinition(currentToken, m); } return currentToken.matches.length > 0 && (lastMatch = currentToken.matches[currentToken.matches.length - 1], lastMatch.isGroup && (lastMatch.isGroup = !1, insertTestDefinition(lastMatch, opts.groupmarker.start, 0), insertTestDefinition(lastMatch, opts.groupmarker.end)), maskTokens.push(currentToken)), maskTokens; } function generateMask(mask, metadata) { if (void 0 == mask || "" == mask) return void 0; if (1 == mask.length && 0 == opts.greedy && 0 != opts.repeat && (opts.placeholder = ""), opts.repeat > 0 || "*" == opts.repeat || "+" == opts.repeat) { var repeatStart = "*" == opts.repeat ? 0 : "+" == opts.repeat ? 1 : opts.repeat; mask = opts.groupmarker.start + mask + opts.groupmarker.end + opts.quantifiermarker.start + repeatStart + "," + opts.repeat + opts.quantifiermarker.end; } var masksetDefinition; return void 0 == $.inputmask.masksCache[mask] || nocache === !0 ? (masksetDefinition = { mask: mask, maskToken: analyseMask(mask), validPositions: {}, _buffer: void 0, buffer: void 0, tests: {}, metadata: metadata }, nocache !== !0 && ($.inputmask.masksCache[mask] = masksetDefinition)) : masksetDefinition = $.extend(!0, {}, $.inputmask.masksCache[mask]), masksetDefinition; } function preProcessMask(mask) { if (mask = mask.toString(), opts.numericInput) { mask = mask.split("").reverse(); for (var ndx = 0; ndx < mask.length; ndx++) mask[ndx] == opts.optionalmarker.start ? mask[ndx] = opts.optionalmarker.end : mask[ndx] == opts.optionalmarker.end ? mask[ndx] = opts.optionalmarker.start : mask[ndx] == opts.groupmarker.start ? mask[ndx] = opts.groupmarker.end : mask[ndx] == opts.groupmarker.end && (mask[ndx] = opts.groupmarker.start); mask = mask.join(""); } return mask; } var ms = void 0; if ($.isFunction(opts.mask) && (opts.mask = opts.mask.call(this, opts)), $.isArray(opts.mask)) { if (opts.mask.length > 1) { opts.keepStatic = void 0 == opts.keepStatic ? !0 : opts.keepStatic; var altMask = "("; return $.each(opts.mask, function(ndx, msk) { altMask.length > 1 && (altMask += ")|("), altMask += preProcessMask(void 0 == msk.mask || $.isFunction(msk.mask) ? msk : msk.mask); }), altMask += ")", generateMask(altMask, opts.mask); } opts.mask = opts.mask.pop(); } return opts.mask && (ms = void 0 == opts.mask.mask || $.isFunction(opts.mask.mask) ? generateMask(preProcessMask(opts.mask), opts.mask) : generateMask(preProcessMask(opts.mask.mask), opts.mask)), ms; } function maskScope(actionObj, maskset, opts) { function getMaskTemplate(baseOnInput, minimalPos, includeInput) { minimalPos = minimalPos || 0; var ndxIntlzr, test, testPos, maskTemplate = [], pos = 0; do { if (baseOnInput === !0 && getMaskSet().validPositions[pos]) { var validPos = getMaskSet().validPositions[pos]; test = validPos.match, ndxIntlzr = validPos.locator.slice(), maskTemplate.push(includeInput === !0 ? validPos.input : getPlaceholder(pos, test)); } else testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), test = testPos.match, ndxIntlzr = testPos.locator.slice(), maskTemplate.push(getPlaceholder(pos, test)); pos++; } while ((void 0 == maxLength || maxLength > pos - 1) && null != test.fn || null == test.fn && "" != test.def || minimalPos >= pos); return maskTemplate.pop(), maskTemplate; } function getMaskSet() { return maskset; } function resetMaskSet(soft) { var maskset = getMaskSet(); maskset.buffer = void 0, maskset.tests = {}, soft !== !0 && (maskset._buffer = void 0, maskset.validPositions = {}, maskset.p = 0); } function getLastValidPosition(closestTo, strict) { var maskset = getMaskSet(), lastValidPosition = -1, valids = maskset.validPositions; void 0 == closestTo && (closestTo = -1); var before = lastValidPosition, after = lastValidPosition; for (var posNdx in valids) { var psNdx = parseInt(posNdx); valids[psNdx] && (strict || null != valids[psNdx].match.fn) && (closestTo >= psNdx && (before = psNdx), psNdx >= closestTo && (after = psNdx)); } return lastValidPosition = -1 != before && closestTo - before > 1 || closestTo > after ? before : after; } function setValidPosition(pos, validTest, fromSetValid) { if (opts.insertMode && void 0 != getMaskSet().validPositions[pos] && void 0 == fromSetValid) { var i, positionsClone = $.extend(!0, {}, getMaskSet().validPositions), lvp = getLastValidPosition(); for (i = pos; lvp >= i; i++) delete getMaskSet().validPositions[i]; getMaskSet().validPositions[pos] = validTest; var j, valid = !0, vps = getMaskSet().validPositions; for (i = j = pos; lvp >= i; i++) { var t = positionsClone[i]; if (void 0 != t) for (var posMatch = j; posMatch < getMaskLength() && (null == t.match.fn && vps[i] && (vps[i].match.optionalQuantifier === !0 || vps[i].match.optionality === !0) || null != t.match.fn); ) { if (null == t.match.fn || !opts.keepStatic && vps[i] && (void 0 != vps[i + 1] && getTests(i + 1, vps[i].locator.slice(), i).length > 1 || void 0 != vps[i].alternation) ? posMatch++ : posMatch = seekNext(j), positionCanMatchDefinition(posMatch, t.match.def)) { valid = isValid(posMatch, t.input, !0, !0) !== !1, j = posMatch; break; } valid = null == t.match.fn; } if (!valid) break; } if (!valid) return getMaskSet().validPositions = $.extend(!0, {}, positionsClone), !1; } else getMaskSet().validPositions[pos] = validTest; return !0; } function stripValidPositions(start, end, nocheck, strict) { var i, startPos = start; getMaskSet().p = start, void 0 != getMaskSet().validPositions[start] && getMaskSet().validPositions[start].input == opts.radixPoint && (end++, startPos++); for (i = startPos; end > i; i++) void 0 != getMaskSet().validPositions[i] && (nocheck === !0 || 0 != opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts)) && delete getMaskSet().validPositions[i]; for (resetMaskSet(!0), i = startPos + 1; i <= getLastValidPosition(); ) { for (;void 0 != getMaskSet().validPositions[startPos]; ) startPos++; var s = getMaskSet().validPositions[startPos]; startPos > i && (i = startPos + 1); var t = getMaskSet().validPositions[i]; void 0 != t && void 0 == s ? (positionCanMatchDefinition(startPos, t.match.def) && isValid(startPos, t.input, !0) !== !1 && (delete getMaskSet().validPositions[i], i++), startPos++) : i++; } var lvp = getLastValidPosition(), ml = getMaskLength(); for (lvp >= start && void 0 != getMaskSet().validPositions[lvp] && getMaskSet().validPositions[lvp].input == opts.radixPoint && delete getMaskSet().validPositions[lvp], i = lvp + 1; ml >= i; i++) getMaskSet().validPositions[i] && delete getMaskSet().validPositions[i]; resetMaskSet(!0); } function getTestTemplate(pos, ndxIntlzr, tstPs) { var testPos = getMaskSet().validPositions[pos]; if (void 0 == testPos) for (var testPositions = getTests(pos, ndxIntlzr, tstPs), lvp = getLastValidPosition(), lvTest = getMaskSet().validPositions[lvp] || getTests(0, void 0, void 0)[0], lvTestAltArr = void 0 != lvTest.alternation ? lvTest.locator[lvTest.alternation].toString().split(",") : [], ndx = 0; ndx < testPositions.length && (testPos = testPositions[ndx], !(testPos.match && (opts.greedy && testPos.match.optionalQuantifier !== !0 || (testPos.match.optionality === !1 || testPos.match.newBlockMarker === !1) && testPos.match.optionalQuantifier !== !0) && (void 0 == lvTest.alternation || void 0 != testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAltArr)))); ndx++) ; return testPos; } function getTest(pos) { return getMaskSet().validPositions[pos] ? getMaskSet().validPositions[pos].match : getTests(pos)[0].match; } function positionCanMatchDefinition(pos, def) { for (var valid = !1, tests = getTests(pos), tndx = 0; tndx < tests.length; tndx++) if (tests[tndx].match && tests[tndx].match.def == def) { valid = !0; break; } return valid; } function getTests(pos, ndxIntlzr, tstPs, cacheable) { function ResolveTestFromToken(maskToken, ndxInitializer, loopNdx, quantifierRecurse) { function handleMatch(match, loopNdx, quantifierRecurse) { if (testPos > 1e4) return alert("jquery.inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. " + getMaskSet().mask), !0; if (testPos == pos && void 0 == match.matches) return matches.push({ match: match, locator: loopNdx.reverse() }), !0; if (void 0 != match.matches) { if (match.isGroup && quantifierRecurse !== !0) { if (match = handleMatch(maskToken.matches[tndx + 1], loopNdx)) return !0; } else if (match.isOptional) { var optionalToken = match; if (match = ResolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse)) { var latestMatch = matches[matches.length - 1].match, isFirstMatch = 0 == $.inArray(latestMatch, optionalToken.matches); if (!isFirstMatch) return !0; insertStop = !0, testPos = pos; } } else if (match.isAlternator) { var maltMatches, alternateToken = match, malternateMatches = [], currentMatches = matches.slice(), loopNdxCnt = loopNdx.length, altIndex = ndxInitializer.length > 0 ? ndxInitializer.shift() : -1; if (-1 == altIndex || "string" == typeof altIndex) { var altIndexArr, currentPos = testPos, ndxInitializerClone = ndxInitializer.slice(); "string" == typeof altIndex && (altIndexArr = altIndex.split(",")); for (var amndx = 0; amndx < alternateToken.matches.length; amndx++) { matches = [], match = handleMatch(alternateToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse) || match, maltMatches = matches.slice(), testPos = currentPos, matches = []; for (var i = 0; i < ndxInitializerClone.length; i++) ndxInitializer[i] = ndxInitializerClone[i]; for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) { var altMatch = maltMatches[ndx1]; altMatch.alternation = loopNdxCnt; for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) { var altMatch2 = malternateMatches[ndx2]; if (altMatch.match.mask == altMatch2.match.mask && ("string" != typeof altIndex || -1 != $.inArray(altMatch.locator[loopNdxCnt].toString(), altIndexArr))) { maltMatches.splice(ndx1, 1), altMatch2.locator[loopNdxCnt] = altMatch2.locator[loopNdxCnt] + "," + altMatch.locator[loopNdxCnt], altMatch2.alternation = loopNdxCnt; break; } } } malternateMatches = malternateMatches.concat(maltMatches); } "string" == typeof altIndex && (malternateMatches = $.map(malternateMatches, function(lmnt, ndx) { if (isFinite(ndx)) { var mamatch, altLocArr = lmnt.locator[loopNdxCnt].toString().split(","); lmnt.locator[loopNdxCnt] = void 0, lmnt.alternation = void 0; for (var alndx = 0; alndx < altLocArr.length; alndx++) mamatch = -1 != $.inArray(altLocArr[alndx], altIndexArr), mamatch && (void 0 != lmnt.locator[loopNdxCnt] ? (lmnt.locator[loopNdxCnt] += ",", lmnt.locator[loopNdxCnt] += altLocArr[alndx]) : lmnt.locator[loopNdxCnt] = parseInt(altLocArr[alndx]), lmnt.alternation = loopNdxCnt); if (void 0 != lmnt.locator[loopNdxCnt]) return lmnt; } })), matches = currentMatches.concat(malternateMatches), testPos = pos, insertStop = !0; } else match = handleMatch(alternateToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse); if (match) return !0; } else if (match.isQuantifier && quantifierRecurse !== !0) for (var qt = match, qndx = ndxInitializer.length > 0 && quantifierRecurse !== !0 ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && pos >= testPos; qndx++) { var tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1]; if (match = handleMatch(tokenGroup, [ qndx ].concat(loopNdx), !0)) { var latestMatch = matches[matches.length - 1].match; latestMatch.optionalQuantifier = qndx > qt.quantifier.min - 1; var isFirstMatch = 0 == $.inArray(latestMatch, tokenGroup.matches); if (isFirstMatch) { if (qndx > qt.quantifier.min - 1) { insertStop = !0, testPos = pos; break; } return !0; } return !0; } } else if (match = ResolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse)) return !0; } else testPos++; } for (var tndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; tndx < maskToken.matches.length; tndx++) if (maskToken.matches[tndx].isQuantifier !== !0) { var match = handleMatch(maskToken.matches[tndx], [ tndx ].concat(loopNdx), quantifierRecurse); if (match && testPos == pos) return match; if (testPos > pos) break; } } var maskTokens = getMaskSet().maskToken, testPos = ndxIntlzr ? tstPs : 0, ndxInitializer = ndxIntlzr || [ 0 ], matches = [], insertStop = !1; if (void 0 == ndxIntlzr) { for (var test, previousPos = pos - 1; void 0 == (test = getMaskSet().validPositions[previousPos]) && previousPos > -1; ) previousPos--; if (void 0 != test && previousPos > -1) testPos = previousPos, ndxInitializer = test.locator.slice(); else { for (previousPos = pos - 1; void 0 == (test = getMaskSet().tests[previousPos]) && previousPos > -1; ) previousPos--; void 0 != test && previousPos > -1 && (testPos = previousPos, ndxInitializer = test[0].locator.slice()); } } for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) { var match = ResolveTestFromToken(maskTokens[mtndx], ndxInitializer, [ mtndx ]); if (match && testPos == pos || testPos > pos) break; } return (0 == matches.length || insertStop) && matches.push({ match: { fn: null, cardinality: 0, optionality: !0, casing: null, def: "" }, locator: [] }), getMaskSet().tests[pos] = $.extend(!0, [], matches), getMaskSet().tests[pos]; } function getBufferTemplate() { return void 0 == getMaskSet()._buffer && (getMaskSet()._buffer = getMaskTemplate(!1, 1)), getMaskSet()._buffer; } function getBuffer() { return void 0 == getMaskSet().buffer && (getMaskSet().buffer = getMaskTemplate(!0, getLastValidPosition(), !0)), getMaskSet().buffer; } function refreshFromBuffer(start, end, buffer) { if (buffer = buffer || getBuffer().slice(), start === !0) resetMaskSet(), start = 0, end = buffer.length; else for (var i = start; end > i; i++) delete getMaskSet().validPositions[i], delete getMaskSet().tests[i]; for (var i = start; end > i; i++) buffer[i] != opts.skipOptionalPartCharacter && isValid(i, buffer[i], !0, !0); } function casing(elem, test) { switch (test.casing) { case "upper": elem = elem.toUpperCase(); break; case "lower": elem = elem.toLowerCase(); } return elem; } function checkAlternationMatch(altArr1, altArr2) { for (var altArrC = opts.greedy ? altArr2 : altArr2.slice(0, 1), isMatch = !1, alndx = 0; alndx < altArr1.length; alndx++) if (-1 != $.inArray(altArr1[alndx], altArrC)) { isMatch = !0; break; } return isMatch; } function isValid(pos, c, strict, fromSetValid) { function _isValid(position, c, strict, fromSetValid) { var rslt = !1; return $.each(getTests(position), function(ndx, tst) { for (var test = tst.match, loopend = c ? 1 : 0, chrs = "", i = (getBuffer(), test.cardinality); i > loopend; i--) chrs += getBufferElement(position - (i - 1)); if (c && (chrs += c), rslt = null != test.fn ? test.fn.test(chrs, getMaskSet(), position, strict, opts) : c != test.def && c != opts.skipOptionalPartCharacter || "" == test.def ? !1 : { c: test.def, pos: position }, rslt !== !1) { var elem = void 0 != rslt.c ? rslt.c : c; elem = elem == opts.skipOptionalPartCharacter && null === test.fn ? test.def : elem; var validatedPos = position, possibleModifiedBuffer = getBuffer(); if (void 0 != rslt.remove && ($.isArray(rslt.remove) || (rslt.remove = [ rslt.remove ]), $.each(rslt.remove.sort(function(a, b) { return b - a; }), function(ndx, lmnt) { stripValidPositions(lmnt, lmnt + 1, !0); })), void 0 != rslt.insert && ($.isArray(rslt.insert) || (rslt.insert = [ rslt.insert ]), $.each(rslt.insert.sort(function(a, b) { return a - b; }), function(ndx, lmnt) { isValid(lmnt.pos, lmnt.c, !0); })), rslt.refreshFromBuffer) { var refresh = rslt.refreshFromBuffer; if (strict = !0, refreshFromBuffer(refresh === !0 ? refresh : refresh.start, refresh.end, possibleModifiedBuffer), void 0 == rslt.pos && void 0 == rslt.c) return rslt.pos = getLastValidPosition(), !1; if (validatedPos = void 0 != rslt.pos ? rslt.pos : position, validatedPos != position) return rslt = $.extend(rslt, isValid(validatedPos, elem, !0)), !1; } else if (rslt !== !0 && void 0 != rslt.pos && rslt.pos != position && (validatedPos = rslt.pos, refreshFromBuffer(position, validatedPos), validatedPos != position)) return rslt = $.extend(rslt, isValid(validatedPos, elem, !0)), !1; return 1 != rslt && void 0 == rslt.pos && void 0 == rslt.c ? !1 : (ndx > 0 && resetMaskSet(!0), setValidPosition(validatedPos, $.extend({}, tst, { input: casing(elem, test) }), fromSetValid) || (rslt = !1), !1); } }), rslt; } function alternate(pos, c, strict, fromSetValid) { var lastAlt, alternation, isValidRslt, altPos, validPsClone = $.extend(!0, {}, getMaskSet().validPositions); for (lastAlt = getLastValidPosition(); lastAlt >= 0; lastAlt--) if (altPos = getMaskSet().validPositions[lastAlt], altPos && void 0 != altPos.alternation && altPos.locator[altPos.alternation].length > 1) { alternation = getMaskSet().validPositions[lastAlt].alternation; break; } if (void 0 != alternation) for (var decisionPos in getMaskSet().validPositions) if (altPos = getMaskSet().validPositions[decisionPos], parseInt(decisionPos) > parseInt(lastAlt) && altPos.alternation) { for (var decisionTaker = altPos.locator[alternation], altNdxs = getMaskSet().validPositions[lastAlt].locator[alternation].toString().split(","), mndx = 0; mndx < altNdxs.length; mndx++) if (decisionTaker < altNdxs[mndx]) { for (var possibilityPos, possibilities, dp = decisionPos - 1; dp >= 0; dp--) if (possibilityPos = getMaskSet().validPositions[dp], void 0 != possibilityPos) { possibilities = possibilityPos.locator[alternation], possibilityPos.locator[alternation] = parseInt(altNdxs[mndx]); break; } if (decisionTaker != possibilityPos.locator[alternation]) { for (var validInputs = [], i = decisionPos; i < getLastValidPosition() + 1; i++) { var validPos = getMaskSet().validPositions[i]; validPos && null != validPos.match.fn && validInputs.push(validPos.input), delete getMaskSet().validPositions[i], delete getMaskSet().tests[i]; } for (resetMaskSet(!0), opts.keepStatic = !opts.keepStatic, isValidRslt = !0; validInputs.length > 0; ) { var input = validInputs.shift(); if (input != opts.skipOptionalPartCharacter && !(isValidRslt = isValid(getLastValidPosition() + 1, input, !1, !0))) break; } if (possibilityPos.alternation = alternation, possibilityPos.locator[alternation] = possibilities, isValidRslt && (isValidRslt = isValid(pos, c, strict, fromSetValid)), opts.keepStatic = !opts.keepStatic, isValidRslt) return isValidRslt; resetMaskSet(), getMaskSet().validPositions = $.extend(!0, {}, validPsClone); } } break; } return !1; } function trackbackAlternations(originalPos, newPos) { for (var vp = getMaskSet().validPositions[newPos], targetLocator = vp.locator, tll = targetLocator.length, ps = originalPos; newPos > ps; ps++) if (!isMask(ps)) { var tests = getTests(ps), bestMatch = tests[0], equality = -1; $.each(tests, function(ndx, tst) { for (var i = 0; tll > i; i++) tst.locator[i] && checkAlternationMatch(tst.locator[i].toString().split(","), targetLocator[i].toString().split(",")) && i > equality && (equality = i, bestMatch = tst); }), setValidPosition(ps, $.extend({}, bestMatch, { input: bestMatch.match.def }), !0); } } strict = strict === !0; for (var buffer = getBuffer(), pndx = pos - 1; pndx > -1 && !getMaskSet().validPositions[pndx]; pndx--) ; for (pndx++; pos > pndx; pndx++) void 0 == getMaskSet().validPositions[pndx] && ((!isMask(pndx) || buffer[pndx] != getPlaceholder(pndx)) && getTests(pndx).length > 1 || buffer[pndx] == opts.radixPoint || "0" == buffer[pndx] && $.inArray(opts.radixPoint, buffer) < pndx) && _isValid(pndx, buffer[pndx], !0); var maskPos = pos, result = !1, positionsClone = $.extend(!0, {}, getMaskSet().validPositions); if (maskPos < getMaskLength() && (result = _isValid(maskPos, c, strict, fromSetValid), (!strict || fromSetValid) && result === !1)) { var currentPosValid = getMaskSet().validPositions[maskPos]; if (!currentPosValid || null != currentPosValid.match.fn || currentPosValid.match.def != c && c != opts.skipOptionalPartCharacter) { if ((opts.insertMode || void 0 == getMaskSet().validPositions[seekNext(maskPos)]) && !isMask(maskPos)) for (var nPos = maskPos + 1, snPos = seekNext(maskPos); snPos >= nPos; nPos++) if (result = _isValid(nPos, c, strict, fromSetValid), result !== !1) { trackbackAlternations(maskPos, nPos), maskPos = nPos; break; } } else result = { caret: seekNext(maskPos) }; } if (result === !1 && opts.keepStatic && isComplete(buffer) && (result = alternate(pos, c, strict, fromSetValid)), result === !0 && (result = { pos: maskPos }), $.isFunction(opts.postValidation) && 0 != result && !strict) { resetMaskSet(!0); var postValidResult = opts.postValidation(getBuffer(), opts); if (!postValidResult) return resetMaskSet(!0), getMaskSet().validPositions = $.extend(!0, {}, positionsClone), !1; } return result; } function isMask(pos) { var test = getTest(pos); if (null != test.fn) return test.fn; if (!opts.keepStatic && void 0 == getMaskSet().validPositions[pos]) { for (var tests = getTests(pos), staticAlternations = !0, i = 0; i < tests.length; i++) if ("" != tests[i].match.def && (null !== tests[i].match.fn || void 0 == tests[i].alternation || tests[i].locator[tests[i].alternation].length > 1)) { staticAlternations = !1; break; } return staticAlternations; } return !1; } function getMaskLength() { var maskLength; maxLength = $el.prop("maxLength"), -1 == maxLength && (maxLength = void 0); var pos, lvp = getLastValidPosition(), testPos = getMaskSet().validPositions[lvp], ndxIntlzr = void 0 != testPos ? testPos.locator.slice() : void 0; for (pos = lvp + 1; void 0 == testPos || null != testPos.match.fn || null == testPos.match.fn && "" != testPos.match.def; pos++) testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), ndxIntlzr = testPos.locator.slice(); var lastTest = getTest(pos - 1); return maskLength = "" != lastTest.def ? pos : pos - 1, void 0 == maxLength || maxLength > maskLength ? maskLength : maxLength; } function seekNext(pos) { var maskL = getMaskLength(); if (pos >= maskL) return maskL; for (var position = pos; ++position < maskL && !isMask(position) && (opts.nojumps !== !0 || opts.nojumpsThreshold > position); ) ; return position; } function seekPrevious(pos) { var position = pos; if (0 >= position) return 0; for (;--position > 0 && !isMask(position); ) ; return position; } function getBufferElement(position) { return void 0 == getMaskSet().validPositions[position] ? getPlaceholder(position) : getMaskSet().validPositions[position].input; } function writeBuffer(input, buffer, caretPos, event, triggerInputEvent) { if (event && $.isFunction(opts.onBeforeWrite)) { var result = opts.onBeforeWrite.call(input, event, buffer, caretPos, opts); if (result) { if (result.refreshFromBuffer) { var refresh = result.refreshFromBuffer; refreshFromBuffer(refresh === !0 ? refresh : refresh.start, refresh.end, result.buffer), resetMaskSet(!0), buffer = getBuffer(); } caretPos = result.caret || caretPos; } } input._valueSet(buffer.join("")), void 0 != caretPos && caret(input, caretPos), triggerInputEvent === !0 && (skipInputEvent = !0, $(input).trigger("input")); } function getPlaceholder(pos, test) { if (test = test || getTest(pos), void 0 != test.placeholder) return test.placeholder; if (null == test.fn) { if (!opts.keepStatic && void 0 == getMaskSet().validPositions[pos]) { for (var tests = getTests(pos), staticAlternations = !0, i = 0; i < tests.length; i++) if ("" != tests[i].match.def && (null !== tests[i].match.fn || void 0 == tests[i].alternation || tests[i].locator[tests[i].alternation].length > 1)) { staticAlternations = !1; break; } if (staticAlternations) return opts.placeholder.charAt(pos % opts.placeholder.length); } return test.def; } return opts.placeholder.charAt(pos % opts.placeholder.length); } function checkVal(input, writeOut, strict, nptvl) { function isTemplateMatch() { var isMatch = !1, charCodeNdx = getBufferTemplate().slice(initialNdx, seekNext(initialNdx)).join("").indexOf(charCodes); if (-1 != charCodeNdx && !isMask(initialNdx)) { isMatch = !0; for (var bufferTemplateArr = getBufferTemplate().slice(initialNdx, initialNdx + charCodeNdx), i = 0; i < bufferTemplateArr.length; i++) if (" " != bufferTemplateArr[i]) { isMatch = !1; break; } } return isMatch; } var inputValue = void 0 != nptvl ? nptvl.slice() : input._valueGet().split(""), charCodes = "", initialNdx = 0; if (resetMaskSet(), getMaskSet().p = seekNext(-1), writeOut && input._valueSet(""), !strict) { var staticInput = getBufferTemplate().slice(0, seekNext(-1)).join(""), matches = inputValue.join("").match(new RegExp(escapeRegex(staticInput), "g")); matches && matches.length > 0 && (inputValue.splice(0, matches.length * staticInput.length), initialNdx = seekNext(initialNdx)); } $.each(inputValue, function(ndx, charCode) { var keypress = $.Event("keypress"); keypress.which = charCode.charCodeAt(0), charCodes += charCode; var lvp = getLastValidPosition(void 0, !0), lvTest = getMaskSet().validPositions[lvp], nextTest = getTestTemplate(lvp + 1, lvTest ? lvTest.locator.slice() : void 0, lvp); if (!isTemplateMatch() || strict) { var pos = strict ? ndx : null == nextTest.match.fn && nextTest.match.optionality && lvp + 1 < getMaskSet().p ? lvp + 1 : getMaskSet().p; keypressEvent.call(input, keypress, !0, !1, strict, pos), initialNdx = pos + 1, charCodes = ""; } else keypressEvent.call(input, keypress, !0, !1, !0, lvp + 1); }), writeOut && writeBuffer(input, getBuffer(), $(input).is(":focus") ? seekNext(getLastValidPosition(0)) : void 0, $.Event("checkval")); } function escapeRegex(str) { return $.inputmask.escapeRegex(str); } function unmaskedvalue($input) { if ($input.data("_inputmask") && !$input.hasClass("hasDatepicker")) { var umValue = [], vps = getMaskSet().validPositions; for (var pndx in vps) vps[pndx].match && null != vps[pndx].match.fn && umValue.push(vps[pndx].input); var unmaskedValue = (isRTL ? umValue.reverse() : umValue).join(""), bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join(""); return $.isFunction(opts.onUnMask) && (unmaskedValue = opts.onUnMask.call($input, bufferValue, unmaskedValue, opts) || unmaskedValue), unmaskedValue; } return $input[0]._valueGet(); } function TranslatePosition(pos) { if (isRTL && "number" == typeof pos && (!opts.greedy || "" != opts.placeholder)) { var bffrLght = getBuffer().length; pos = bffrLght - pos; } return pos; } function caret(input, begin, end) { var range, npt = input.jquery && input.length > 0 ? input[0] : input; if ("number" != typeof begin) return npt.setSelectionRange ? (begin = npt.selectionStart, end = npt.selectionEnd) : window.getSelection ? (range = window.getSelection().getRangeAt(0), range.commonAncestorContainer.parentNode == npt && (begin = range.startOffset, end = range.endOffset)) : document.selection && document.selection.createRange && (range = document.selection.createRange(), begin = 0 - range.duplicate().moveStart("character", -1e5), end = begin + range.text.length), { begin: TranslatePosition(begin), end: TranslatePosition(end) }; if (begin = TranslatePosition(begin), end = TranslatePosition(end), end = "number" == typeof end ? end : begin, $(npt).is(":visible")) { var scrollCalc = $(npt).css("font-size").replace("px", "") * end; if (npt.scrollLeft = scrollCalc > npt.scrollWidth ? scrollCalc : 0, androidchrome || 0 != opts.insertMode || begin != end || end++, npt.setSelectionRange) npt.selectionStart = begin, npt.selectionEnd = end; else if (window.getSelection) { range = document.createRange(), range.setStart(npt.firstChild, begin < npt._valueGet().length ? begin : npt._valueGet().length), range.setEnd(npt.firstChild, end < npt._valueGet().length ? end : npt._valueGet().length), range.collapse(!0); var sel = window.getSelection(); sel.removeAllRanges(), sel.addRange(range); } else npt.createTextRange && (range = npt.createTextRange(), range.collapse(!0), range.moveEnd("character", end), range.moveStart("character", begin), range.select()); } } function determineLastRequiredPosition(returnDefinition) { var pos, testPos, buffer = getBuffer(), bl = buffer.length, lvp = getLastValidPosition(), positions = {}, lvTest = getMaskSet().validPositions[lvp], ndxIntlzr = void 0 != lvTest ? lvTest.locator.slice() : void 0; for (pos = lvp + 1; pos < buffer.length; pos++) testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), ndxIntlzr = testPos.locator.slice(), positions[pos] = $.extend(!0, {}, testPos); var lvTestAlt = lvTest && void 0 != lvTest.alternation ? lvTest.locator[lvTest.alternation] : void 0; for (pos = bl - 1; pos > lvp && (testPos = positions[pos].match, (testPos.optionality || testPos.optionalQuantifier || lvTestAlt && lvTestAlt != positions[pos].locator[lvTest.alternation]) && buffer[pos] == getPlaceholder(pos, testPos)); pos--) bl--; return returnDefinition ? { l: bl, def: positions[bl] ? positions[bl].match : void 0 } : bl; } function clearOptionalTail(buffer) { for (var rl = determineLastRequiredPosition(), lmib = buffer.length - 1; lmib > rl && !isMask(lmib); lmib--) ; return buffer.splice(rl, lmib + 1 - rl), buffer; } function isComplete(buffer) { if ($.isFunction(opts.isComplete)) return opts.isComplete.call($el, buffer, opts); if ("*" == opts.repeat) return void 0; { var complete = !1, lrp = determineLastRequiredPosition(!0), aml = seekPrevious(lrp.l); getLastValidPosition(); } if (void 0 == lrp.def || lrp.def.newBlockMarker || lrp.def.optionality || lrp.def.optionalQuantifier) { complete = !0; for (var i = 0; aml >= i; i++) { var mask = isMask(i), test = getTest(i); if (mask && void 0 == getMaskSet().validPositions[i] && test.optionality !== !0 && test.optionalQuantifier !== !0 || !mask && buffer[i] != getPlaceholder(i)) { complete = !1; break; } } } return complete; } function isSelection(begin, end) { return isRTL ? begin - end > 1 || begin - end == 1 && opts.insertMode : end - begin > 1 || end - begin == 1 && opts.insertMode; } function installEventRuler(npt) { var events = $._data(npt).events, inComposition = !1; $.each(events, function(eventType, eventHandlers) { $.each(eventHandlers, function(ndx, eventHandler) { if ("inputmask" == eventHandler.namespace && "setvalue" != eventHandler.type) { var handler = eventHandler.handler; eventHandler.handler = function(e) { if (!this.disabled && (!this.readOnly || "keydown" == e.type && e.ctrlKey && 67 == e.keyCode)) { switch (e.type) { case "input": if (skipInputEvent === !0 || inComposition === !0) return skipInputEvent = !1, e.preventDefault(); break; case "keydown": skipKeyPressEvent = !1, inComposition = !1; break; case "keypress": if (skipKeyPressEvent === !0) return e.preventDefault(); skipKeyPressEvent = !0; break; case "compositionstart": inComposition = !0; break; case "compositionupdate": skipInputEvent = !0; break; case "compositionend": inComposition = !1; } return handler.apply(this, arguments); } e.preventDefault(); }; } }); }); } function patchValueProperty(npt) { function PatchValhook(type) { if (void 0 == $.valHooks[type] || 1 != $.valHooks[type].inputmaskpatch) { var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) { return elem.value; }, valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) { return elem.value = value, elem; }; $.valHooks[type] = { get: function(elem) { var $elem = $(elem); if ($elem.data("_inputmask")) { if ($elem.data("_inputmask").opts.autoUnmask) return $elem.inputmask("unmaskedvalue"); var result = valhookGet(elem), inputData = $elem.data("_inputmask"), maskset = inputData.maskset, bufferTemplate = maskset._buffer; return bufferTemplate = bufferTemplate ? bufferTemplate.join("") : "", result != bufferTemplate ? result : ""; } return valhookGet(elem); }, set: function(elem, value) { var result, $elem = $(elem), inputData = $elem.data("_inputmask"); return result = valhookSet(elem, value), inputData && $elem.triggerHandler("setvalue.inputmask"), result; }, inputmaskpatch: !0 }; } } function getter() { var $self = $(this), inputData = $(this).data("_inputmask"); return inputData ? inputData.opts.autoUnmask ? $self.inputmask("unmaskedvalue") : valueGet.call(this) != getBufferTemplate().join("") ? valueGet.call(this) : "" : valueGet.call(this); } function setter(value) { var inputData = $(this).data("_inputmask"); valueSet.call(this, value), inputData && $(this).triggerHandler("setvalue.inputmask"); } function InstallNativeValueSetFallback(npt) { $(npt).bind("mouseenter.inputmask", function() { var $input = $(this), input = this, value = input._valueGet(); "" != value && value != getBuffer().join("") && $input.triggerHandler("setvalue.inputmask"); }); //!! the bound handlers are executed in the order they where bound var events = $._data(npt).events, handlers = events.mouseover; if (handlers) { for (var ourHandler = handlers[handlers.length - 1], i = handlers.length - 1; i > 0; i--) handlers[i] = handlers[i - 1]; handlers[0] = ourHandler; } } var valueGet, valueSet; if (!npt._valueGet) { var valueProperty; Object.getOwnPropertyDescriptor && void 0 == npt.value ? (valueGet = function() { return this.textContent; }, valueSet = function(value) { this.textContent = value; }, Object.defineProperty(npt, "value", { get: getter, set: setter })) : ((valueProperty = Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(npt, "value")) && valueProperty.configurable, document.__lookupGetter__ && npt.__lookupGetter__("value") ? (valueGet = npt.__lookupGetter__("value"), valueSet = npt.__lookupSetter__("value"), npt.__defineGetter__("value", getter), npt.__defineSetter__("value", setter)) : (valueGet = function() { return npt.value; }, valueSet = function(value) { npt.value = value; }, PatchValhook(npt.type), InstallNativeValueSetFallback(npt))), npt._valueGet = function(overruleRTL) { return isRTL && overruleRTL !== !0 ? valueGet.call(this).split("").reverse().join("") : valueGet.call(this); }, npt._valueSet = function(value) { valueSet.call(this, isRTL ? value.split("").reverse().join("") : value); }; } } function handleRemove(input, k, pos, strict) { function generalize() { if (opts.keepStatic) { resetMaskSet(!0); var lastAlt, validInputs = [], positionsClone = $.extend(!0, {}, getMaskSet().validPositions); for (lastAlt = getLastValidPosition(); lastAlt >= 0; lastAlt--) { var validPos = getMaskSet().validPositions[lastAlt]; if (validPos) { if (void 0 != validPos.alternation && validPos.locator[validPos.alternation] == getTestTemplate(lastAlt).locator[validPos.alternation]) break; null != validPos.match.fn && validInputs.push(validPos.input), delete getMaskSet().validPositions[lastAlt]; } } if (lastAlt > 0) for (;validInputs.length > 0; ) { getMaskSet().p = seekNext(getLastValidPosition()); var keypress = $.Event("keypress"); keypress.which = validInputs.pop().charCodeAt(0), keypressEvent.call(input, keypress, !0, !1, !1, getMaskSet().p); } else getMaskSet().validPositions = $.extend(!0, {}, positionsClone); } } if ((opts.numericInput || isRTL) && (k == $.inputmask.keyCode.BACKSPACE ? k = $.inputmask.keyCode.DELETE : k == $.inputmask.keyCode.DELETE && (k = $.inputmask.keyCode.BACKSPACE), isRTL)) { var pend = pos.end; pos.end = pos.begin, pos.begin = pend; } if (k == $.inputmask.keyCode.BACKSPACE && (pos.end - pos.begin < 1 || 0 == opts.insertMode) ? pos.begin = seekPrevious(pos.begin) : k == $.inputmask.keyCode.DELETE && pos.begin == pos.end && (pos.end = isMask(pos.end) ? pos.end + 1 : seekNext(pos.end) + 1), stripValidPositions(pos.begin, pos.end, !1, strict), strict !== !0) { generalize(); var lvp = getLastValidPosition(pos.begin); lvp < pos.begin ? (-1 == lvp && resetMaskSet(), getMaskSet().p = seekNext(lvp)) : getMaskSet().p = pos.begin; } } function keydownEvent(e) { var input = this, $input = $(input), k = e.keyCode, pos = caret(input); k == $.inputmask.keyCode.BACKSPACE || k == $.inputmask.keyCode.DELETE || iphone && 127 == k || e.ctrlKey && 88 == k && !isInputEventSupported("cut") ? (e.preventDefault(), 88 == k && (undoValue = getBuffer().join("")), handleRemove(input, k, pos), writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue != getBuffer().join("")), input._valueGet() == getBufferTemplate().join("") ? $input.trigger("cleared") : isComplete(getBuffer()) === !0 && $input.trigger("complete"), opts.showTooltip && $input.prop("title", getMaskSet().mask)) : k == $.inputmask.keyCode.END || k == $.inputmask.keyCode.PAGE_DOWN ? setTimeout(function() { var caretPos = seekNext(getLastValidPosition()); opts.insertMode || caretPos != getMaskLength() || e.shiftKey || caretPos--, caret(input, e.shiftKey ? pos.begin : caretPos, caretPos); }, 0) : k == $.inputmask.keyCode.HOME && !e.shiftKey || k == $.inputmask.keyCode.PAGE_UP ? caret(input, 0, e.shiftKey ? pos.begin : 0) : (opts.undoOnEscape && k == $.inputmask.keyCode.ESCAPE || 90 == k && e.ctrlKey) && e.altKey !== !0 ? (checkVal(input, !0, !1, undoValue.split("")), $input.click()) : k != $.inputmask.keyCode.INSERT || e.shiftKey || e.ctrlKey ? 0 != opts.insertMode || e.shiftKey || (k == $.inputmask.keyCode.RIGHT ? setTimeout(function() { var caretPos = caret(input); caret(input, caretPos.begin); }, 0) : k == $.inputmask.keyCode.LEFT && setTimeout(function() { var caretPos = caret(input); caret(input, isRTL ? caretPos.begin + 1 : caretPos.begin - 1); }, 0)) : (opts.insertMode = !opts.insertMode, caret(input, opts.insertMode || pos.begin != getMaskLength() ? pos.begin : pos.begin - 1)), opts.onKeyDown.call(this, e, getBuffer(), caret(input).begin, opts), ignorable = -1 != $.inArray(k, opts.ignorables); } function keypressEvent(e, checkval, writeOut, strict, ndx) { var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode; if (!(checkval === !0 || e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable)) return !0; if (k) { 46 == k && 0 == e.shiftKey && "," == opts.radixPoint && (k = 44); var forwardPosition, pos = checkval ? { begin: ndx, end: ndx } : caret(input), c = String.fromCharCode(k), isSlctn = isSelection(pos.begin, pos.end); isSlctn && (getMaskSet().undoPositions = $.extend(!0, {}, getMaskSet().validPositions), handleRemove(input, $.inputmask.keyCode.DELETE, pos, !0), pos.begin = getMaskSet().p, opts.insertMode || (opts.insertMode = !opts.insertMode, setValidPosition(pos.begin, strict), opts.insertMode = !opts.insertMode), isSlctn = !opts.multi), getMaskSet().writeOutBuffer = !0; var p = isRTL && !isSlctn ? pos.end : pos.begin, valResult = isValid(p, c, strict); if (valResult !== !1) { if (valResult !== !0 && (p = void 0 != valResult.pos ? valResult.pos : p, c = void 0 != valResult.c ? valResult.c : c), resetMaskSet(!0), void 0 != valResult.caret) forwardPosition = valResult.caret; else { var vps = getMaskSet().validPositions; forwardPosition = !opts.keepStatic && (void 0 != vps[p + 1] && getTests(p + 1, vps[p].locator.slice(), p).length > 1 || void 0 != vps[p].alternation) ? p + 1 : seekNext(p); } getMaskSet().p = forwardPosition; } if (writeOut !== !1) { var self = this; if (setTimeout(function() { opts.onKeyValidation.call(self, valResult, opts); }, 0), getMaskSet().writeOutBuffer && valResult !== !1) { var buffer = getBuffer(); writeBuffer(input, buffer, checkval ? void 0 : opts.numericInput ? seekPrevious(forwardPosition) : forwardPosition, e, checkval !== !0), checkval !== !0 && setTimeout(function() { isComplete(buffer) === !0 && $input.trigger("complete"); }, 0); } else isSlctn && (getMaskSet().buffer = void 0, getMaskSet().validPositions = getMaskSet().undoPositions); } else isSlctn && (getMaskSet().buffer = void 0, getMaskSet().validPositions = getMaskSet().undoPositions); if (opts.showTooltip && $input.prop("title", getMaskSet().mask), checkval && $.isFunction(opts.onBeforeWrite)) { var result = opts.onBeforeWrite.call(this, e, getBuffer(), forwardPosition, opts); if (result && result.refreshFromBuffer) { var refresh = result.refreshFromBuffer; refreshFromBuffer(refresh === !0 ? refresh : refresh.start, refresh.end, result.buffer), resetMaskSet(!0), result.caret && (getMaskSet().p = result.caret); } } e.preventDefault(); } } function pasteEvent(e) { var input = this, $input = $(input), inputValue = input._valueGet(!0), caretPos = caret(input); if ("propertychange" == e.type && input._valueGet().length <= getMaskLength()) return !0; if ("paste" == e.type) { var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length); valueBeforeCaret == getBufferTemplate().slice(0, caretPos.begin).join("") && (valueBeforeCaret = ""), valueAfterCaret == getBufferTemplate().slice(caretPos.end).join("") && (valueAfterCaret = ""), window.clipboardData && window.clipboardData.getData ? inputValue = valueBeforeCaret + window.clipboardData.getData("Text") + valueAfterCaret : e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData && (inputValue = valueBeforeCaret + e.originalEvent.clipboardData.getData("text/plain") + valueAfterCaret); } var pasteValue = inputValue; if ($.isFunction(opts.onBeforePaste)) { if (pasteValue = opts.onBeforePaste.call(input, inputValue, opts), pasteValue === !1) return e.preventDefault(), !1; pasteValue || (pasteValue = inputValue); } return checkVal(input, !0, !1, isRTL ? pasteValue.split("").reverse() : pasteValue.split("")), $input.click(), isComplete(getBuffer()) === !0 && $input.trigger("complete"), !1; } function inputFallBackEvent(e) { var input = this; checkVal(input, !0, !1), isComplete(getBuffer()) === !0 && $(input).trigger("complete"), e.preventDefault(); } function compositionStartEvent(e) { var input = this; undoValue = getBuffer().join(""), ("" == compositionData || 0 != e.originalEvent.data.indexOf(compositionData)) && (compositionCaretPos = caret(input)); } function compositionUpdateEvent(e) { var input = this, caretPos = compositionCaretPos || caret(input); 0 == e.originalEvent.data.indexOf(compositionData) && (resetMaskSet(), caretPos = { begin: 0, end: 0 }); var newData = e.originalEvent.data; caret(input, caretPos.begin, caretPos.end); for (var i = 0; i < newData.length; i++) { var keypress = $.Event("keypress"); keypress.which = newData.charCodeAt(i), skipKeyPressEvent = !1, ignorable = !1, keypressEvent.call(input, keypress); } setTimeout(function() { var forwardPosition = getMaskSet().p; writeBuffer(input, getBuffer(), opts.numericInput ? seekPrevious(forwardPosition) : forwardPosition); }, 0), compositionData = e.originalEvent.data; } function compositionEndEvent() {} function mask(el) { if ($el = $(el), $el.is(":input") && isInputTypeSupported($el.attr("type")) || el.isContentEditable || $el.is("div")) { if ($el.data("_inputmask", { maskset: maskset, opts: opts, isRTL: !1 }), opts.showTooltip && $el.prop("title", getMaskSet().mask), ("rtl" == el.dir || opts.rightAlign) && $el.css("text-align", "right"), "rtl" == el.dir || opts.numericInput) { el.dir = "ltr", $el.removeAttr("dir"); var inputData = $el.data("_inputmask"); inputData.isRTL = !0, $el.data("_inputmask", inputData), isRTL = !0; } $el.unbind(".inputmask"), ($el.is(":input") || el.isContentEditable) && ($el.closest("form").bind("submit", function() { undoValue != getBuffer().join("") && $el.change(), $el[0]._valueGet && $el[0]._valueGet() == getBufferTemplate().join("") && $el[0]._valueSet(""), opts.removeMaskOnSubmit && $el.inputmask("remove"); }).bind("reset", function() { setTimeout(function() { $el.triggerHandler("setvalue.inputmask"); }, 0); }), $el.bind("mouseenter.inputmask", function() { var $input = $(this), input = this; !$input.is(":focus") && opts.showMaskOnHover && input._valueGet() != getBuffer().join("") && writeBuffer(input, getBuffer()); }).bind("blur.inputmask", function(e) { var $input = $(this), input = this; if ($input.data("_inputmask")) { var nptValue = input._valueGet(), buffer = getBuffer().slice(); firstClick = !0, undoValue != buffer.join("") && setTimeout(function() { $input.change(), undoValue = buffer.join(""); }, 0), "" != nptValue && (opts.clearMaskOnLostFocus && (nptValue == getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer)), isComplete(buffer) === !1 && ($input.trigger("incomplete"), opts.clearIncomplete && (resetMaskSet(), buffer = opts.clearMaskOnLostFocus ? [] : getBufferTemplate().slice())), writeBuffer(input, buffer, void 0, e)); } }).bind("focus.inputmask", function() { var input = ($(this), this), nptValue = input._valueGet(); opts.showMaskOnFocus && (!opts.showMaskOnHover || opts.showMaskOnHover && "" == nptValue) && input._valueGet() != getBuffer().join("") && writeBuffer(input, getBuffer(), seekNext(getLastValidPosition())), undoValue = getBuffer().join(""); }).bind("mouseleave.inputmask", function() { var $input = $(this), input = this; if (opts.clearMaskOnLostFocus) { var buffer = getBuffer().slice(), nptValue = input._valueGet(); $input.is(":focus") || nptValue == $input.attr("placeholder") || "" == nptValue || (nptValue == getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer), writeBuffer(input, buffer)); } }).bind("click.inputmask", function() { var $input = $(this), input = this; if ($input.is(":focus")) { var selectedCaret = caret(input); if (selectedCaret.begin == selectedCaret.end) if (opts.radixFocus && "" != opts.radixPoint && -1 != $.inArray(opts.radixPoint, getBuffer()) && (firstClick || getBuffer().join("") == getBufferTemplate().join(""))) caret(input, $.inArray(opts.radixPoint, getBuffer())), firstClick = !1; else { var clickPosition = isRTL ? TranslatePosition(selectedCaret.begin) : selectedCaret.begin, lastPosition = seekNext(getLastValidPosition(clickPosition)); lastPosition > clickPosition ? caret(input, isMask(clickPosition) ? clickPosition : seekNext(clickPosition)) : caret(input, lastPosition); } } }).bind("dblclick.inputmask", function() { var input = this; setTimeout(function() { caret(input, 0, seekNext(getLastValidPosition())); }, 0); }).bind(PasteEventType + ".inputmask dragdrop.inputmask drop.inputmask", pasteEvent).bind("cut.inputmask", function(e) { skipInputEvent = !0; var input = this, $input = $(input), pos = caret(input); handleRemove(input, $.inputmask.keyCode.DELETE, pos), writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue != getBuffer().join("")), input._valueGet() == getBufferTemplate().join("") && $input.trigger("cleared"), opts.showTooltip && $input.prop("title", getMaskSet().mask); }).bind("complete.inputmask", opts.oncomplete).bind("incomplete.inputmask", opts.onincomplete).bind("cleared.inputmask", opts.oncleared), $el.bind("keydown.inputmask", keydownEvent).bind("keypress.inputmask", keypressEvent), androidfirefox || $el.bind("compositionstart.inputmask", compositionStartEvent).bind("compositionupdate.inputmask", compositionUpdateEvent).bind("compositionend.inputmask", compositionEndEvent), "paste" === PasteEventType && $el.bind("input.inputmask", inputFallBackEvent)), $el.bind("setvalue.inputmask", function() { var input = this, value = input._valueGet(); input._valueSet($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(input, value, opts) || value : value), checkVal(input, !0, !1), undoValue = getBuffer().join(""), (opts.clearMaskOnLostFocus || opts.clearIncomplete) && input._valueGet() == getBufferTemplate().join("") && input._valueSet(""); }), patchValueProperty(el); var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(el, el._valueGet(), opts) || el._valueGet() : el._valueGet(); checkVal(el, !0, !1, initialValue.split("")); var buffer = getBuffer().slice(); undoValue = buffer.join(""); var activeElement; try { activeElement = document.activeElement; } catch (e) {} isComplete(buffer) === !1 && opts.clearIncomplete && resetMaskSet(), opts.clearMaskOnLostFocus && (buffer.join("") == getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer)), writeBuffer(el, buffer), activeElement === el && caret(el, seekNext(getLastValidPosition())), installEventRuler(el); } } var undoValue, compositionCaretPos, compositionData, $el, maxLength, isRTL = !1, skipKeyPressEvent = !1, skipInputEvent = !1, ignorable = !1, firstClick = !0; if (void 0 != actionObj) switch (actionObj.action) { case "isComplete": return $el = $(actionObj.el), maskset = $el.data("_inputmask").maskset, opts = $el.data("_inputmask").opts, isComplete(actionObj.buffer); case "unmaskedvalue": return $el = actionObj.$input, maskset = $el.data("_inputmask").maskset, opts = $el.data("_inputmask").opts, isRTL = actionObj.$input.data("_inputmask").isRTL, unmaskedvalue(actionObj.$input); case "mask": undoValue = getBuffer().join(""), mask(actionObj.el); break; case "format": $el = $({}), $el.data("_inputmask", { maskset: maskset, opts: opts, isRTL: opts.numericInput }), opts.numericInput && (isRTL = !0); var valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call($el, actionObj.value, opts) || actionObj.value : actionObj.value).split(""); return checkVal($el, !1, !1, isRTL ? valueBuffer.reverse() : valueBuffer), $.isFunction(opts.onBeforeWrite) && opts.onBeforeWrite.call(this, void 0, getBuffer(), 0, opts), actionObj.metadata ? { value: isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""), metadata: $el.inputmask("getmetadata") } : isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""); case "isValid": $el = $({}), $el.data("_inputmask", { maskset: maskset, opts: opts, isRTL: opts.numericInput }), opts.numericInput && (isRTL = !0); var valueBuffer = actionObj.value.split(""); checkVal($el, !1, !0, isRTL ? valueBuffer.reverse() : valueBuffer); for (var buffer = getBuffer(), rl = determineLastRequiredPosition(), lmib = buffer.length - 1; lmib > rl && !isMask(lmib); lmib--) ; return buffer.splice(rl, lmib + 1 - rl), isComplete(buffer) && actionObj.value == buffer.join(""); case "getemptymask": return $el = $(actionObj.el), maskset = $el.data("_inputmask").maskset, opts = $el.data("_inputmask").opts, getBufferTemplate(); case "remove": var el = actionObj.el; $el = $(el), maskset = $el.data("_inputmask").maskset, opts = $el.data("_inputmask").opts, el._valueSet(unmaskedvalue($el)), $el.unbind(".inputmask"), $el.removeData("_inputmask"); var valueProperty; Object.getOwnPropertyDescriptor && (valueProperty = Object.getOwnPropertyDescriptor(el, "value")), valueProperty && valueProperty.get ? el._valueGet && Object.defineProperty(el, "value", { get: el._valueGet, set: el._valueSet }) : document.__lookupGetter__ && el.__lookupGetter__("value") && el._valueGet && (el.__defineGetter__("value", el._valueGet), el.__defineSetter__("value", el._valueSet)); try { delete el._valueGet, delete el._valueSet; } catch (e) { el._valueGet = void 0, el._valueSet = void 0; } break; case "getmetadata": if ($el = $(actionObj.el), maskset = $el.data("_inputmask").maskset, opts = $el.data("_inputmask").opts, $.isArray(maskset.metadata)) { for (var alternation, lvp = getLastValidPosition(), firstAlt = lvp; firstAlt >= 0; firstAlt--) if (getMaskSet().validPositions[firstAlt] && void 0 != getMaskSet().validPositions[firstAlt].alternation) { alternation = getMaskSet().validPositions[firstAlt].alternation; break; } return void 0 != alternation ? maskset.metadata[getMaskSet().validPositions[lvp].locator[alternation]] : maskset.metadata[0]; } return maskset.metadata; } } if (void 0 === $.fn.inputmask) { var ua = navigator.userAgent, iphone = null !== ua.match(new RegExp("iphone", "i")), androidchrome = (null !== ua.match(new RegExp("android.*safari.*", "i")), null !== ua.match(new RegExp("android.*chrome.*", "i"))), androidfirefox = null !== ua.match(new RegExp("android.*firefox.*", "i")), PasteEventType = (/Kindle/i.test(ua) || /Silk/i.test(ua) || /KFTT/i.test(ua) || /KFOT/i.test(ua) || /KFJWA/i.test(ua) || /KFJWI/i.test(ua) || /KFSOWI/i.test(ua) || /KFTHWA/i.test(ua) || /KFTHWI/i.test(ua) || /KFAPWA/i.test(ua) || /KFAPWI/i.test(ua), isInputEventSupported("paste") ? "paste" : isInputEventSupported("input") ? "input" : "propertychange"); $.inputmask = { defaults: { placeholder: "_", optionalmarker: { start: "[", end: "]" }, quantifiermarker: { start: "{", end: "}" }, groupmarker: { start: "(", end: ")" }, alternatormarker: "|", escapeChar: "\\", mask: null, oncomplete: $.noop, onincomplete: $.noop, oncleared: $.noop, repeat: 0, greedy: !0, autoUnmask: !1, removeMaskOnSubmit: !1, clearMaskOnLostFocus: !0, insertMode: !0, clearIncomplete: !1, aliases: {}, alias: null, onKeyDown: $.noop, onBeforeMask: void 0, onBeforePaste: void 0, onBeforeWrite: void 0, onUnMask: void 0, showMaskOnFocus: !0, showMaskOnHover: !0, onKeyValidation: $.noop, skipOptionalPartCharacter: " ", showTooltip: !1, numericInput: !1, rightAlign: !1, undoOnEscape: !0, radixPoint: "", radixFocus: !1, nojumps: !1, nojumpsThreshold: 0, keepStatic: void 0, definitions: { "9": { validator: "[0-9]", cardinality: 1, definitionSymbol: "*" }, a: { validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]", cardinality: 1, definitionSymbol: "*" }, "*": { validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]", cardinality: 1 } }, ignorables: [ 8, 9, 13, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123 ], isComplete: void 0, canClearPosition: $.noop, postValidation: void 0 }, keyCode: { ALT: 18, BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, COMMAND: 91, COMMAND_LEFT: 91, COMMAND_RIGHT: 93, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, MENU: 93, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38, WINDOWS: 91 }, masksCache: {}, escapeRegex: function(str) { var specials = [ "/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^" ]; return str.replace(new RegExp("(\\" + specials.join("|\\") + ")", "gim"), "\\$1"); }, format: function(value, options, metadata) { var opts = $.extend(!0, {}, $.inputmask.defaults, options); return resolveAlias(opts.alias, options, opts), maskScope({ action: "format", value: value, metadata: metadata }, generateMaskSet(opts, options && void 0 !== options.definitions), opts); }, isValid: function(value, options) { var opts = $.extend(!0, {}, $.inputmask.defaults, options); return resolveAlias(opts.alias, options, opts), maskScope({ action: "isValid", value: value }, generateMaskSet(opts, options && void 0 !== options.definitions), opts); } }, $.fn.inputmask = function(fn, options) { function importAttributeOptions(npt, opts, importedOptionsContainer) { var $npt = $(npt); $npt.data("inputmask-alias") && resolveAlias($npt.data("inputmask-alias"), $.extend(!0, {}, opts), opts); for (var option in opts) { var optionData = $npt.data("inputmask-" + option.toLowerCase()); void 0 != optionData && ("mask" == option && 0 == optionData.indexOf("[") ? (opts[option] = optionData.replace(/[\s[\]]/g, "").split("','"), opts[option][0] = opts[option][0].replace("'", ""), opts[option][opts[option].length - 1] = opts[option][opts[option].length - 1].replace("'", "")) : opts[option] = "boolean" == typeof optionData ? optionData : optionData.toString(), importedOptionsContainer && (importedOptionsContainer[option] = opts[option])); } return opts; } var maskset, opts = $.extend(!0, {}, $.inputmask.defaults, options); if ("string" == typeof fn) switch (fn) { case "mask": return resolveAlias(opts.alias, options, opts), this.each(function() { return importAttributeOptions(this, opts), maskset = generateMaskSet(opts, options && void 0 !== options.definitions), void 0 == maskset ? this : void maskScope({ action: "mask", el: this }, maskset, opts); }); case "unmaskedvalue": var $input = $(this); return $input.data("_inputmask") ? maskScope({ action: "unmaskedvalue", $input: $input }) : $input.val(); case "remove": return this.each(function() { var $input = $(this); $input.data("_inputmask") && maskScope({ action: "remove", el: this }); }); case "getemptymask": return this.data("_inputmask") ? maskScope({ action: "getemptymask", el: this }) : ""; case "hasMaskedValue": return this.data("_inputmask") ? !this.data("_inputmask").opts.autoUnmask : !1; case "isComplete": return this.data("_inputmask") ? maskScope({ action: "isComplete", buffer: this[0]._valueGet().split(""), el: this }) : !0; case "getmetadata": return this.data("_inputmask") ? maskScope({ action: "getmetadata", el: this }) : void 0; default: return resolveAlias(opts.alias, options, opts), resolveAlias(fn, options, opts) || (opts.mask = fn), this.each(function() { return importAttributeOptions(this, opts), maskset = generateMaskSet(opts, options && void 0 !== options.definitions), void 0 == maskset ? this : void maskScope({ action: "mask", el: this }, maskset, opts); }); } else { if ("object" == typeof fn) return opts = $.extend(!0, {}, $.inputmask.defaults, fn), resolveAlias(opts.alias, fn, opts), this.each(function() { return importAttributeOptions(this, opts), maskset = generateMaskSet(opts, fn && void 0 !== fn.definitions), void 0 == maskset ? this : void maskScope({ action: "mask", el: this }, maskset, opts); }); if (void 0 == fn) return this.each(function() { var attrOptions = $(this).attr("data-inputmask"); if (attrOptions && "" != attrOptions) try { attrOptions = attrOptions.replace(new RegExp("'", "g"), '"'); var dataoptions = $.parseJSON("{" + attrOptions + "}"); $.extend(!0, dataoptions, options), opts = $.extend(!0, {}, $.inputmask.defaults, dataoptions), opts = importAttributeOptions(this, opts), resolveAlias(opts.alias, dataoptions, opts), opts.alias = void 0, $(this).inputmask("mask", opts); } catch (ex) {} if ($(this).attr("data-inputmask-mask") || $(this).attr("data-inputmask-alias")) { opts = $.extend(!0, {}, $.inputmask.defaults, {}); var dataOptions = {}; opts = importAttributeOptions(this, opts, dataOptions), resolveAlias(opts.alias, dataOptions, opts), opts.alias = void 0, $(this).inputmask("mask", opts); } }); } }; } return $.fn.inputmask; }(jQuery), function($) { return $.extend($.inputmask.defaults.definitions, { h: { validator: "[01][0-9]|2[0-3]", cardinality: 2, prevalidator: [ { validator: "[0-2]", cardinality: 1 } ] }, s: { validator: "[0-5][0-9]", cardinality: 2, prevalidator: [ { validator: "[0-5]", cardinality: 1 } ] }, d: { validator: "0[1-9]|[12][0-9]|3[01]", cardinality: 2, prevalidator: [ { validator: "[0-3]", cardinality: 1 } ] }, m: { validator: "0[1-9]|1[012]", cardinality: 2, prevalidator: [ { validator: "[01]", cardinality: 1 } ] }, y: { validator: "(19|20)\\d{2}", cardinality: 4, prevalidator: [ { validator: "[12]", cardinality: 1 }, { validator: "(19|20)", cardinality: 2 }, { validator: "(19|20)\\d", cardinality: 3 } ] } }), $.extend($.inputmask.defaults.aliases, { "dd/mm/yyyy": { mask: "1/2/y", placeholder: "dd/mm/yyyy", regex: { val1pre: new RegExp("[0-3]"), val1: new RegExp("0[1-9]|[12][0-9]|3[01]"), val2pre: function(separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|[12][0-9]|3[01])" + escapedSeparator + "[01])"); }, val2: function(separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|[12][0-9])" + escapedSeparator + "(0[1-9]|1[012]))|(30" + escapedSeparator + "(0[13-9]|1[012]))|(31" + escapedSeparator + "(0[13578]|1[02]))"); } }, leapday: "29/02/", separator: "/", yearrange: { minyear: 1900, maxyear: 2099 }, isInYearRange: function(chrs, minyear, maxyear) { if (isNaN(chrs)) return !1; var enteredyear = parseInt(chrs.concat(minyear.toString().slice(chrs.length))), enteredyear2 = parseInt(chrs.concat(maxyear.toString().slice(chrs.length))); return (isNaN(enteredyear) ? !1 : enteredyear >= minyear && maxyear >= enteredyear) || (isNaN(enteredyear2) ? !1 : enteredyear2 >= minyear && maxyear >= enteredyear2); }, determinebaseyear: function(minyear, maxyear, hint) { var currentyear = new Date().getFullYear(); if (minyear > currentyear) return minyear; if (currentyear > maxyear) { for (var maxYearPrefix = maxyear.toString().slice(0, 2), maxYearPostfix = maxyear.toString().slice(2, 4); maxYearPrefix + hint > maxyear; ) maxYearPrefix--; var maxxYear = maxYearPrefix + maxYearPostfix; return minyear > maxxYear ? minyear : maxxYear; } return currentyear; }, onKeyDown: function(e) { var $input = $(this); if (e.ctrlKey && e.keyCode == $.inputmask.keyCode.RIGHT) { var today = new Date(); $input.val(today.getDate().toString() + (today.getMonth() + 1).toString() + today.getFullYear().toString()), $input.triggerHandler("setvalue.inputmask"); } }, getFrontValue: function(mask, buffer, opts) { for (var start = 0, length = 0, i = 0; i < mask.length && "2" != mask.charAt(i); i++) { var definition = opts.definitions[mask.charAt(i)]; definition ? (start += length, length = definition.cardinality) : length++; } return buffer.join("").substr(start, length); }, definitions: { "1": { validator: function(chrs, maskset, pos, strict, opts) { var isValid = opts.regex.val1.test(chrs); return strict || isValid || chrs.charAt(1) != opts.separator && -1 == "-./".indexOf(chrs.charAt(1)) || !(isValid = opts.regex.val1.test("0" + chrs.charAt(0))) ? isValid : (maskset.buffer[pos - 1] = "0", { refreshFromBuffer: { start: pos - 1, end: pos }, pos: pos, c: chrs.charAt(0) }); }, cardinality: 2, prevalidator: [ { validator: function(chrs, maskset, pos, strict, opts) { var pchrs = chrs; isNaN(maskset.buffer[pos + 1]) || (pchrs += maskset.buffer[pos + 1]); var isValid = 1 == pchrs.length ? opts.regex.val1pre.test(pchrs) : opts.regex.val1.test(pchrs); if (!strict && !isValid) { if (isValid = opts.regex.val1.test(chrs + "0")) return maskset.buffer[pos] = chrs, maskset.buffer[++pos] = "0", { pos: pos, c: "0" }; if (isValid = opts.regex.val1.test("0" + chrs)) return maskset.buffer[pos] = "0", pos++, { pos: pos }; } return isValid; }, cardinality: 1 } ] }, "2": { validator: function(chrs, maskset, pos, strict, opts) { var frontValue = opts.getFrontValue(maskset.mask, maskset.buffer, opts); -1 != frontValue.indexOf(opts.placeholder[0]) && (frontValue = "01" + opts.separator); var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs); if (!strict && !isValid && (chrs.charAt(1) == opts.separator || -1 != "-./".indexOf(chrs.charAt(1))) && (isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0)))) return maskset.buffer[pos - 1] = "0", { refreshFromBuffer: { start: pos - 1, end: pos }, pos: pos, c: chrs.charAt(0) }; if (opts.mask.indexOf("2") == opts.mask.length - 1 && isValid) { var dayMonthValue = maskset.buffer.join("").substr(4, 4) + chrs; if (dayMonthValue != opts.leapday) return !0; var year = parseInt(maskset.buffer.join("").substr(0, 4), 10); return year % 4 === 0 ? year % 100 === 0 ? year % 400 === 0 ? !0 : !1 : !0 : !1; } return isValid; }, cardinality: 2, prevalidator: [ { validator: function(chrs, maskset, pos, strict, opts) { isNaN(maskset.buffer[pos + 1]) || (chrs += maskset.buffer[pos + 1]); var frontValue = opts.getFrontValue(maskset.mask, maskset.buffer, opts); -1 != frontValue.indexOf(opts.placeholder[0]) && (frontValue = "01" + opts.separator); var isValid = 1 == chrs.length ? opts.regex.val2pre(opts.separator).test(frontValue + chrs) : opts.regex.val2(opts.separator).test(frontValue + chrs); return strict || isValid || !(isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs)) ? isValid : (maskset.buffer[pos] = "0", pos++, { pos: pos }); }, cardinality: 1 } ] }, y: { validator: function(chrs, maskset, pos, strict, opts) { if (opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) { var dayMonthValue = maskset.buffer.join("").substr(0, 6); if (dayMonthValue != opts.leapday) return !0; var year = parseInt(chrs, 10); return year % 4 === 0 ? year % 100 === 0 ? year % 400 === 0 ? !0 : !1 : !0 : !1; } return !1; }, cardinality: 4, prevalidator: [ { validator: function(chrs, maskset, pos, strict, opts) { var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear); if (!strict && !isValid) { var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + "0").toString().slice(0, 1); if (isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(0), { pos: pos }; if (yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + "0").toString().slice(0, 2), isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(0), maskset.buffer[pos++] = yearPrefix.charAt(1), { pos: pos }; } return isValid; }, cardinality: 1 }, { validator: function(chrs, maskset, pos, strict, opts) { var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear); if (!strict && !isValid) { var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2); if (isValid = opts.isInYearRange(chrs[0] + yearPrefix[1] + chrs[1], opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(1), { pos: pos }; if (yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2), opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) { var dayMonthValue = maskset.buffer.join("").substr(0, 6); if (dayMonthValue != opts.leapday) isValid = !0; else { var year = parseInt(chrs, 10); isValid = year % 4 === 0 ? year % 100 === 0 ? year % 400 === 0 ? !0 : !1 : !0 : !1; } } else isValid = !1; if (isValid) return maskset.buffer[pos - 1] = yearPrefix.charAt(0), maskset.buffer[pos++] = yearPrefix.charAt(1), maskset.buffer[pos++] = chrs.charAt(0), { refreshFromBuffer: { start: pos - 3, end: pos }, pos: pos }; } return isValid; }, cardinality: 2 }, { validator: function(chrs, maskset, pos, strict, opts) { return opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear); }, cardinality: 3 } ] } }, insertMode: !1, autoUnmask: !1 }, "mm/dd/yyyy": { placeholder: "mm/dd/yyyy", alias: "dd/mm/yyyy", regex: { val2pre: function(separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[13-9]|1[012])" + escapedSeparator + "[0-3])|(02" + escapedSeparator + "[0-2])"); }, val2: function(separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + escapedSeparator + "30)|((0[13578]|1[02])" + escapedSeparator + "31)"); }, val1pre: new RegExp("[01]"), val1: new RegExp("0[1-9]|1[012]") }, leapday: "02/29/", onKeyDown: function(e) { var $input = $(this); if (e.ctrlKey && e.keyCode == $.inputmask.keyCode.RIGHT) { var today = new Date(); $input.val((today.getMonth() + 1).toString() + today.getDate().toString() + today.getFullYear().toString()), $input.triggerHandler("setvalue.inputmask"); } } }, "yyyy/mm/dd": { mask: "y/1/2", placeholder: "yyyy/mm/dd", alias: "mm/dd/yyyy", leapday: "/02/29", onKeyDown: function(e) { var $input = $(this); if (e.ctrlKey && e.keyCode == $.inputmask.keyCode.RIGHT) { var today = new Date(); $input.val(today.getFullYear().toString() + (today.getMonth() + 1).toString() + today.getDate().toString()), $input.triggerHandler("setvalue.inputmask"); } } }, "dd.mm.yyyy": { mask: "1.2.y", placeholder: "dd.mm.yyyy", leapday: "29.02.", separator: ".", alias: "dd/mm/yyyy" }, "dd-mm-yyyy": { mask: "1-2-y", placeholder: "dd-mm-yyyy", leapday: "29-02-", separator: "-", alias: "dd/mm/yyyy" }, "mm.dd.yyyy": { mask: "1.2.y", placeholder: "mm.dd.yyyy", leapday: "02.29.", separator: ".", alias: "mm/dd/yyyy" }, "mm-dd-yyyy": { mask: "1-2-y", placeholder: "mm-dd-yyyy", leapday: "02-29-", separator: "-", alias: "mm/dd/yyyy" }, "yyyy.mm.dd": { mask: "y.1.2", placeholder: "yyyy.mm.dd", leapday: ".02.29", separator: ".", alias: "yyyy/mm/dd" }, "yyyy-mm-dd": { mask: "y-1-2", placeholder: "yyyy-mm-dd", leapday: "-02-29", separator: "-", alias: "yyyy/mm/dd" }, datetime: { mask: "1/2/y h:s", placeholder: "dd/mm/yyyy hh:mm", alias: "dd/mm/yyyy", regex: { hrspre: new RegExp("[012]"), hrs24: new RegExp("2[0-4]|1[3-9]"), hrs: new RegExp("[01][0-9]|2[0-4]"), ampm: new RegExp("^[a|p|A|P][m|M]"), mspre: new RegExp("[0-5]"), ms: new RegExp("[0-5][0-9]") }, timeseparator: ":", hourFormat: "24", definitions: { h: { validator: function(chrs, maskset, pos, strict, opts) { if ("24" == opts.hourFormat && 24 == parseInt(chrs, 10)) return maskset.buffer[pos - 1] = "0", maskset.buffer[pos] = "0", { refreshFromBuffer: { start: pos - 1, end: pos }, c: "0" }; var isValid = opts.regex.hrs.test(chrs); if (!strict && !isValid && (chrs.charAt(1) == opts.timeseparator || -1 != "-.:".indexOf(chrs.charAt(1))) && (isValid = opts.regex.hrs.test("0" + chrs.charAt(0)))) return maskset.buffer[pos - 1] = "0", maskset.buffer[pos] = chrs.charAt(0), pos++, { refreshFromBuffer: { start: pos - 2, end: pos }, pos: pos, c: opts.timeseparator }; if (isValid && "24" !== opts.hourFormat && opts.regex.hrs24.test(chrs)) { var tmp = parseInt(chrs, 10); return 24 == tmp ? (maskset.buffer[pos + 5] = "a", maskset.buffer[pos + 6] = "m") : (maskset.buffer[pos + 5] = "p", maskset.buffer[pos + 6] = "m"), tmp -= 12, 10 > tmp ? (maskset.buffer[pos] = tmp.toString(), maskset.buffer[pos - 1] = "0") : (maskset.buffer[pos] = tmp.toString().charAt(1), maskset.buffer[pos - 1] = tmp.toString().charAt(0)), { refreshFromBuffer: { start: pos - 1, end: pos + 6 }, c: maskset.buffer[pos] }; } return isValid; }, cardinality: 2, prevalidator: [ { validator: function(chrs, maskset, pos, strict, opts) { var isValid = opts.regex.hrspre.test(chrs); return strict || isValid || !(isValid = opts.regex.hrs.test("0" + chrs)) ? isValid : (maskset.buffer[pos] = "0", pos++, { pos: pos }); }, cardinality: 1 } ] }, s: { validator: "[0-5][0-9]", cardinality: 2, prevalidator: [ { validator: function(chrs, maskset, pos, strict, opts) { var isValid = opts.regex.mspre.test(chrs); return strict || isValid || !(isValid = opts.regex.ms.test("0" + chrs)) ? isValid : (maskset.buffer[pos] = "0", pos++, { pos: pos }); }, cardinality: 1 } ] }, t: { validator: function(chrs, maskset, pos, strict, opts) { return opts.regex.ampm.test(chrs + "m"); }, casing: "lower", cardinality: 1 } }, insertMode: !1, autoUnmask: !1 }, datetime12: { mask: "1/2/y h:s t\\m", placeholder: "dd/mm/yyyy hh:mm xm", alias: "datetime", hourFormat: "12" }, "hh:mm t": { mask: "h:s t\\m", placeholder: "hh:mm xm", alias: "datetime", hourFormat: "12" }, "h:s t": { mask: "h:s t\\m", placeholder: "hh:mm xm", alias: "datetime", hourFormat: "12" }, "hh:mm:ss": { mask: "h:s:s", placeholder: "hh:mm:ss", alias: "datetime", autoUnmask: !1 }, "hh:mm": { mask: "h:s", placeholder: "hh:mm", alias: "datetime", autoUnmask: !1 }, date: { alias: "dd/mm/yyyy" }, "mm/yyyy": { mask: "1/y", placeholder: "mm/yyyy", leapday: "donotuse", separator: "/", alias: "mm/dd/yyyy" } }), $.fn.inputmask; }(jQuery), function($) { return $.extend($.inputmask.defaults.definitions, { A: { validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]", cardinality: 1, casing: "upper" }, "#": { validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]", cardinality: 1, casing: "upper" } }), $.extend($.inputmask.defaults.aliases, { url: { mask: "ir", placeholder: "", separator: "", defaultPrefix: "http://", regex: { urlpre1: new RegExp("[fh]"), urlpre2: new RegExp("(ft|ht)"), urlpre3: new RegExp("(ftp|htt)"), urlpre4: new RegExp("(ftp:|http|ftps)"), urlpre5: new RegExp("(ftp:/|ftps:|http:|https)"), urlpre6: new RegExp("(ftp://|ftps:/|http:/|https:)"), urlpre7: new RegExp("(ftp://|ftps://|http://|https:/)"), urlpre8: new RegExp("(ftp://|ftps://|http://|https://)") }, definitions: { i: { validator: function() { return !0; }, cardinality: 8, prevalidator: function() { for (var result = [], prefixLimit = 8, i = 0; prefixLimit > i; i++) result[i] = function() { var j = i; return { validator: function(chrs, maskset, pos, strict, opts) { if (opts.regex["urlpre" + (j + 1)]) { var k, tmp = chrs; j + 1 - chrs.length > 0 && (tmp = maskset.buffer.join("").substring(0, j + 1 - chrs.length) + "" + tmp); var isValid = opts.regex["urlpre" + (j + 1)].test(tmp); if (!strict && !isValid) { for (pos -= j, k = 0; k < opts.defaultPrefix.length; k++) maskset.buffer[pos] = opts.defaultPrefix[k], pos++; for (k = 0; k < tmp.length - 1; k++) maskset.buffer[pos] = tmp[k], pos++; return { pos: pos }; } return isValid; } return !1; }, cardinality: j }; }(); return result; }() }, r: { validator: ".", cardinality: 50 } }, insertMode: !1, autoUnmask: !1 }, ip: { mask: "i[i[i]].i[i[i]].i[i[i]].i[i[i]]", definitions: { i: { validator: function(chrs, maskset, pos) { return pos - 1 > -1 && "." != maskset.buffer[pos - 1] ? (chrs = maskset.buffer[pos - 1] + chrs, chrs = pos - 2 > -1 && "." != maskset.buffer[pos - 2] ? maskset.buffer[pos - 2] + chrs : "0" + chrs) : chrs = "00" + chrs, new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(chrs); }, cardinality: 1 } } }, email: { mask: "*{1,64}[.*{1,64}][.*{1,64}][.*{1,64}]@*{1,64}[.*{2,64}][.*{2,6}][.*{1,2}]", greedy: !1, onBeforePaste: function(pastedValue) { return pastedValue = pastedValue.toLowerCase(), pastedValue.replace("mailto:", ""); }, definitions: { "*": { validator: "[0-9A-Za-z!#$%&'*+/=?^_`{|}~-]", cardinality: 1, casing: "lower" } } } }), $.fn.inputmask; }(jQuery), function($) { return $.extend($.inputmask.defaults.aliases, { numeric: { mask: function(opts) { function autoEscape(txt) { for (var escapedTxt = "", i = 0; i < txt.length; i++) escapedTxt += opts.definitions[txt[i]] ? "\\" + txt[i] : txt[i]; return escapedTxt; } if (0 !== opts.repeat && isNaN(opts.integerDigits) && (opts.integerDigits = opts.repeat), opts.repeat = 0, opts.groupSeparator == opts.radixPoint && (opts.groupSeparator = "." == opts.radixPoint ? "," : "," == opts.radixPoint ? "." : ""), " " === opts.groupSeparator && (opts.skipOptionalPartCharacter = void 0), opts.autoGroup = opts.autoGroup && "" != opts.groupSeparator, opts.autoGroup && ("string" == typeof opts.groupSize && isFinite(opts.groupSize) && (opts.groupSize = parseInt(opts.groupSize)), isFinite(opts.integerDigits))) { var seps = Math.floor(opts.integerDigits / opts.groupSize), mod = opts.integerDigits % opts.groupSize; opts.integerDigits = parseInt(opts.integerDigits) + (0 == mod ? seps - 1 : seps); } opts.placeholder.length > 1 && (opts.placeholder = opts.placeholder.charAt(0)), opts.radixFocus = opts.radixFocus && "0" == opts.placeholder, opts.definitions[";"] = opts.definitions["~"]; var mask = autoEscape(opts.prefix); return mask += "[+]", mask += "~{1," + opts.integerDigits + "}", void 0 != opts.digits && (isNaN(opts.digits) || parseInt(opts.digits) > 0) && (mask += opts.digitsOptional ? "[" + (opts.decimalProtect ? ":" : opts.radixPoint) + ";{" + opts.digits + "}]" : (opts.decimalProtect ? ":" : opts.radixPoint) + ";{" + opts.digits + "}"), "" != opts.negationSymbol.back && (mask += "[-]"), mask += autoEscape(opts.suffix), opts.greedy = !1, mask; }, placeholder: "", greedy: !1, digits: "*", digitsOptional: !0, groupSeparator: "", radixPoint: ".", radixFocus: !0, groupSize: 3, autoGroup: !1, allowPlus: !0, allowMinus: !0, negationSymbol: { front: "-", back: "" }, integerDigits: "+", prefix: "", suffix: "", rightAlign: !0, decimalProtect: !0, min: void 0, max: void 0, postFormat: function(buffer, pos, reformatOnly, opts) { var suffixStripped = !1; buffer.length >= opts.suffix.length && buffer.join("").indexOf(opts.suffix) == buffer.length - opts.suffix.length && (buffer.length = buffer.length - opts.suffix.length, suffixStripped = !0), pos = pos >= buffer.length ? buffer.length - 1 : pos < opts.prefix.length ? opts.prefix.length : pos; var needsRefresh = !1, charAtPos = buffer[pos]; if ("" == opts.groupSeparator || -1 != $.inArray(opts.radixPoint, buffer) && pos >= $.inArray(opts.radixPoint, buffer) || new RegExp("[" + $.inputmask.escapeRegex(opts.negationSymbol.front) + "+]").test(charAtPos)) { if (suffixStripped) for (var i = 0, l = opts.suffix.length; l > i; i++) buffer.push(opts.suffix.charAt(i)); return { pos: pos }; } var cbuf = buffer.slice(); charAtPos == opts.groupSeparator && (cbuf.splice(pos--, 1), charAtPos = cbuf[pos]), reformatOnly ? cbuf[pos] = "?" : cbuf.splice(pos, 0, "?"); var bufVal = cbuf.join(""), bufValOrigin = bufVal; if (bufVal.length > 0 && opts.autoGroup || reformatOnly && -1 != bufVal.indexOf(opts.groupSeparator)) { var escapedGroupSeparator = $.inputmask.escapeRegex(opts.groupSeparator); needsRefresh = 0 == bufVal.indexOf(opts.groupSeparator), bufVal = bufVal.replace(new RegExp(escapedGroupSeparator, "g"), ""); var radixSplit = bufVal.split(opts.radixPoint); if (bufVal = "" == opts.radixPoint ? bufVal : radixSplit[0], bufVal != opts.prefix + "?0" && bufVal.length >= opts.groupSize + opts.prefix.length) for (var reg = new RegExp("([-+]?[\\d?]+)([\\d?]{" + opts.groupSize + "})"); reg.test(bufVal); ) bufVal = bufVal.replace(reg, "$1" + opts.groupSeparator + "$2"), bufVal = bufVal.replace(opts.groupSeparator + opts.groupSeparator, opts.groupSeparator); "" != opts.radixPoint && radixSplit.length > 1 && (bufVal += opts.radixPoint + radixSplit[1]); } needsRefresh = bufValOrigin != bufVal, buffer.length = bufVal.length; for (var i = 0, l = bufVal.length; l > i; i++) buffer[i] = bufVal.charAt(i); var newPos = $.inArray("?", buffer); if (reformatOnly ? buffer[newPos] = charAtPos : buffer.splice(newPos, 1), !needsRefresh && suffixStripped) for (var i = 0, l = opts.suffix.length; l > i; i++) buffer.push(opts.suffix.charAt(i)); return { pos: newPos, refreshFromBuffer: needsRefresh, buffer: buffer }; }, onBeforeWrite: function(e, buffer, caretPos, opts) { if (e && "blur" == e.type) { var maskedValue = buffer.join(""), processValue = maskedValue.replace(opts.prefix, ""); if (processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp($.inputmask.escapeRegex(opts.groupSeparator), "g"), ""), "," === opts.radixPoint && (processValue = processValue.replace($.inputmask.escapeRegex(opts.radixPoint), ".")), isFinite(processValue) && isFinite(opts.min) && parseFloat(processValue) < parseFloat(opts.min)) return $.extend(!0, { refreshFromBuffer: !0, buffer: (opts.prefix + opts.min).split("") }, opts.postFormat((opts.prefix + opts.min).split(""), 0, !0, opts)); var tmpBufSplit = "" != opts.radixPoint ? buffer.join("").split(opts.radixPoint) : [ buffer.join("") ], matchRslt = tmpBufSplit[0].match(opts.regex.integerPart(opts)), matchRsltDigits = 2 == tmpBufSplit.length ? tmpBufSplit[1].match(opts.regex.integerNPart(opts)) : void 0; !matchRslt || matchRslt[0] != opts.negationSymbol.front + "0" && matchRslt[0] != opts.negationSymbol.front && "+" != matchRslt[0] || void 0 != matchRsltDigits && !matchRsltDigits[0].match(/^0+$/) || buffer.splice(matchRslt.index, 1); var radixPosition = $.inArray(opts.radixPoint, buffer); if (-1 != radixPosition && isFinite(opts.digits) && !opts.digitsOptional) { for (var i = 1; i <= opts.digits; i++) (void 0 == buffer[radixPosition + i] || buffer[radixPosition + i] == opts.placeholder.charAt(0)) && (buffer[radixPosition + i] = "0"); return { refreshFromBuffer: !0, buffer: buffer }; } } if (opts.autoGroup) { var rslt = opts.postFormat(buffer, caretPos - 1, !0, opts); return rslt.caret = caretPos <= opts.prefix.length ? rslt.pos : rslt.pos + 1, rslt; } }, regex: { integerPart: function(opts) { return new RegExp("[" + $.inputmask.escapeRegex(opts.negationSymbol.front) + "+]?\\d+"); }, integerNPart: function(opts) { return new RegExp("[\\d" + $.inputmask.escapeRegex(opts.groupSeparator) + "]+"); } }, signHandler: function(chrs, maskset, pos, strict, opts) { if (!strict && opts.allowMinus && "-" === chrs || opts.allowPlus && "+" === chrs) { var matchRslt = maskset.buffer.join("").match(opts.regex.integerPart(opts)); if (matchRslt && matchRslt[0].length > 0) return maskset.buffer[matchRslt.index] == ("-" === chrs ? "+" : opts.negationSymbol.front) ? "-" == chrs ? "" != opts.negationSymbol.back ? { pos: matchRslt.index, c: opts.negationSymbol.front, remove: matchRslt.index, caret: pos, insert: { pos: maskset.buffer.length - opts.suffix.length - 1, c: opts.negationSymbol.back } } : { pos: matchRslt.index, c: opts.negationSymbol.front, remove: matchRslt.index, caret: pos } : "" != opts.negationSymbol.back ? { pos: matchRslt.index, c: "+", remove: [ matchRslt.index, maskset.buffer.length - opts.suffix.length - 1 ], caret: pos } : { pos: matchRslt.index, c: "+", remove: matchRslt.index, caret: pos } : maskset.buffer[matchRslt.index] == ("-" === chrs ? opts.negationSymbol.front : "+") ? "-" == chrs && "" != opts.negationSymbol.back ? { remove: [ matchRslt.index, maskset.buffer.length - opts.suffix.length - 1 ], caret: pos - 1 } : { remove: matchRslt.index, caret: pos - 1 } : "-" == chrs ? "" != opts.negationSymbol.back ? { pos: matchRslt.index, c: opts.negationSymbol.front, caret: pos + 1, insert: { pos: maskset.buffer.length - opts.suffix.length, c: opts.negationSymbol.back } } : { pos: matchRslt.index, c: opts.negationSymbol.front, caret: pos + 1 } : { pos: matchRslt.index, c: chrs, caret: pos + 1 }; } return !1; }, radixHandler: function(chrs, maskset, pos, strict, opts) { if (!strict && chrs === opts.radixPoint && opts.digits > 0) { var radixPos = $.inArray(opts.radixPoint, maskset.buffer), integerValue = maskset.buffer.join("").match(opts.regex.integerPart(opts)); if (-1 != radixPos && maskset.validPositions[radixPos]) return maskset.validPositions[radixPos - 1] ? { caret: radixPos + 1 } : { pos: integerValue.index, c: integerValue[0], caret: radixPos + 1 }; if (!integerValue || "0" == integerValue[0] && integerValue.index + 1 != pos) return maskset.buffer[integerValue ? integerValue.index : pos] = "0", { pos: (integerValue ? integerValue.index : pos) + 1 }; } return !1; }, leadingZeroHandler: function(chrs, maskset, pos, strict, opts) { var matchRslt = maskset.buffer.join("").match(opts.regex.integerNPart(opts)), radixPosition = $.inArray(opts.radixPoint, maskset.buffer); if (matchRslt && !strict && (-1 == radixPosition || radixPosition >= pos)) if (0 == matchRslt[0].indexOf("0")) { pos < opts.prefix.length && (pos = matchRslt.index); var _radixPosition = $.inArray(opts.radixPoint, maskset._buffer), digitsMatch = maskset._buffer && maskset.buffer.slice(radixPosition).join("") == maskset._buffer.slice(_radixPosition).join("") || 0 == parseInt(maskset.buffer.slice(radixPosition + 1).join("")), integerMatch = maskset._buffer && maskset.buffer.slice(matchRslt.index, radixPosition).join("") == maskset._buffer.slice(opts.prefix.length, _radixPosition).join("") || "0" == maskset.buffer.slice(matchRslt.index, radixPosition).join(""); if (-1 == radixPosition || digitsMatch && integerMatch) return maskset.buffer.splice(matchRslt.index, 1), pos = pos > matchRslt.index ? pos - 1 : matchRslt.index, { pos: pos, remove: matchRslt.index }; if (matchRslt.index + 1 == pos || "0" == chrs) return maskset.buffer.splice(matchRslt.index, 1), pos = matchRslt.index, { pos: pos, remove: matchRslt.index }; } else if ("0" === chrs && pos <= matchRslt.index && matchRslt[0] != opts.groupSeparator) return !1; return !0; }, postValidation: function(buffer, opts) { var isValid = !0, maskedValue = buffer.join(""), processValue = maskedValue.replace(opts.prefix, ""); return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp($.inputmask.escapeRegex(opts.groupSeparator), "g"), ""), "," === opts.radixPoint && (processValue = processValue.replace($.inputmask.escapeRegex(opts.radixPoint), ".")), processValue = processValue.replace(new RegExp("^" + $.inputmask.escapeRegex(opts.negationSymbol.front)), "-"), processValue = processValue.replace(new RegExp($.inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""), isFinite(processValue) && isFinite(opts.max) && (isValid = parseFloat(processValue) <= parseFloat(opts.max)), isValid; }, definitions: { "~": { validator: function(chrs, maskset, pos, strict, opts) { var isValid = opts.signHandler(chrs, maskset, pos, strict, opts); if (!isValid && (isValid = opts.radixHandler(chrs, maskset, pos, strict, opts), !isValid && (isValid = strict ? new RegExp("[0-9" + $.inputmask.escapeRegex(opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs), isValid === !0 && (isValid = opts.leadingZeroHandler(chrs, maskset, pos, strict, opts), isValid === !0)))) { var radixPosition = $.inArray(opts.radixPoint, maskset.buffer); isValid = opts.digitsOptional === !1 && pos > radixPosition && !strict ? { pos: pos, remove: pos } : { pos: pos }; } return isValid; }, cardinality: 1, prevalidator: null }, "+": { validator: function(chrs, maskset, pos, strict, opts) { var isValid = opts.signHandler(chrs, maskset, pos, strict, opts); return !isValid && (strict && opts.allowMinus && chrs === opts.negationSymbol.front || opts.allowMinus && "-" == chrs || opts.allowPlus && "+" == chrs) && (isValid = "-" == chrs ? "" != opts.negationSymbol.back ? { pos: pos, c: "-" === chrs ? opts.negationSymbol.front : "+", caret: pos + 1, insert: { pos: maskset.buffer.length, c: opts.negationSymbol.back } } : { pos: pos, c: "-" === chrs ? opts.negationSymbol.front : "+", caret: pos + 1 } : !0), isValid; }, cardinality: 1, prevalidator: null, placeholder: "" }, "-": { validator: function(chrs, maskset, pos, strict, opts) { var isValid = opts.signHandler(chrs, maskset, pos, strict, opts); return !isValid && strict && opts.allowMinus && chrs === opts.negationSymbol.back && (isValid = !0), isValid; }, cardinality: 1, prevalidator: null, placeholder: "" }, ":": { validator: function(chrs, maskset, pos, strict, opts) { var isValid = opts.signHandler(chrs, maskset, pos, strict, opts); if (!isValid) { var radix = "[" + $.inputmask.escapeRegex(opts.radixPoint) + "]"; isValid = new RegExp(radix).test(chrs), isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder == opts.radixPoint && (isValid = { caret: pos + 1 }); } return isValid; }, cardinality: 1, prevalidator: null, placeholder: function(opts) { return opts.radixPoint; } } }, insertMode: !0, autoUnmask: !1, unmaskAsNumber: !1, onUnMask: function(maskedValue, unmaskedValue, opts) { var processValue = maskedValue.replace(opts.prefix, ""); return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp($.inputmask.escapeRegex(opts.groupSeparator), "g"), ""), opts.unmaskAsNumber ? (processValue = processValue.replace($.inputmask.escapeRegex.call(this, opts.radixPoint), "."), Number(processValue)) : processValue; }, isComplete: function(buffer, opts) { var maskedValue = buffer.join(""), bufClone = buffer.slice(); if (opts.postFormat(bufClone, 0, !0, opts), bufClone.join("") != maskedValue) return !1; var processValue = maskedValue.replace(opts.prefix, ""); return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp($.inputmask.escapeRegex(opts.groupSeparator), "g"), ""), "," === opts.radixPoint && (processValue = processValue.replace($.inputmask.escapeRegex(opts.radixPoint), ".")), isFinite(processValue); }, onBeforeMask: function(initialValue, opts) { if ("" != opts.radixPoint && isFinite(initialValue)) initialValue = initialValue.toString().replace(".", opts.radixPoint); else { var kommaMatches = initialValue.match(/,/g), dotMatches = initialValue.match(/\./g); dotMatches && kommaMatches ? dotMatches.length > kommaMatches.length ? (initialValue = initialValue.replace(/\./g, ""), initialValue = initialValue.replace(",", opts.radixPoint)) : kommaMatches.length > dotMatches.length ? (initialValue = initialValue.replace(/,/g, ""), initialValue = initialValue.replace(".", opts.radixPoint)) : initialValue = initialValue.indexOf(".") < initialValue.indexOf(",") ? initialValue.replace(/\./g, "") : initialValue = initialValue.replace(/,/g, "") : initialValue = initialValue.replace(new RegExp($.inputmask.escapeRegex(opts.groupSeparator), "g"), ""); } return 0 == opts.digits && (-1 != initialValue.indexOf(".") ? initialValue = initialValue.substring(0, initialValue.indexOf(".")) : -1 != initialValue.indexOf(",") && (initialValue = initialValue.substring(0, initialValue.indexOf(",")))), initialValue; }, canClearPosition: function(maskset, position, lvp, strict, opts) { var positionInput = maskset.validPositions[position].input, canClear = positionInput != opts.radixPoint && isFinite(positionInput) || position == lvp || positionInput == opts.groupSeparator || positionInput == opts.negationSymbol.front || positionInput == opts.negationSymbol.back; if (canClear && isFinite(positionInput)) { var matchRslt; if (!strict && maskset.buffer) { matchRslt = maskset.buffer.join("").substr(0, position).match(opts.regex.integerNPart(opts)); var pos = position + 1, isNull = null == matchRslt || 0 == parseInt(matchRslt[0].replace(new RegExp($.inputmask.escapeRegex(opts.groupSeparator), "g"), "")); if (isNull) for (;maskset.validPositions[pos] && (maskset.validPositions[pos].input == opts.groupSeparator || "0" == maskset.validPositions[pos].input); ) delete maskset.validPositions[pos], pos++; } var buffer = []; for (var vp in maskset.validPositions) buffer.push(maskset.validPositions[vp].input); matchRslt = buffer.join("").match(opts.regex.integerNPart(opts)); var radixPosition = $.inArray(opts.radixPoint, maskset.buffer); if (matchRslt && (-1 == radixPosition || radixPosition >= position)) if (0 == matchRslt[0].indexOf("0")) canClear = matchRslt.index != position || -1 == radixPosition; else { var intPart = parseInt(matchRslt[0].replace(new RegExp($.inputmask.escapeRegex(opts.groupSeparator), "g"), "")); -1 != radixPosition && 10 > intPart && "0" == opts.placeholder.charAt(0) && (maskset.validPositions[position].input = "0", maskset.p = opts.prefix.length + 1, canClear = !1); } } return canClear; } }, currency: { prefix: "$ ", groupSeparator: ",", alias: "numeric", placeholder: "0", autoGroup: !0, digits: 2, digitsOptional: !1, clearMaskOnLostFocus: !1 }, decimal: { alias: "numeric" }, integer: { alias: "numeric", digits: "0", radixPoint: "" } }), $.fn.inputmask; }(jQuery), function($) { return $.extend($.inputmask.defaults.aliases, { phone: { url: "phone-codes/phone-codes.js", maskInit: "+pp(pp)pppppppp", countrycode: "", mask: function(opts) { opts.definitions = { p: { validator: function() { return !1; }, cardinality: 1 }, "#": { validator: "[0-9]", cardinality: 1 } }; var maskList = []; return $.ajax({ url: opts.url, async: !1, dataType: "json", success: function(response) { maskList = response; }, error: function(xhr, ajaxOptions, thrownError) { alert(thrownError + " - " + opts.url); } }), maskList = maskList.sort(function(a, b) { return (a.mask || a) < (b.mask || b) ? -1 : 1; }), "" != opts.countrycode && (opts.maskInit = "+" + opts.countrycode + opts.maskInit.substring(3)), maskList.splice(0, 0, opts.maskInit), maskList; }, nojumps: !0, nojumpsThreshold: 1, onBeforeMask: function(value, opts) { var processedValue = value.replace(/^0/g, ""); return (processedValue.indexOf(opts.countrycode) > 1 || -1 == processedValue.indexOf(opts.countrycode)) && (processedValue = "+" + opts.countrycode + processedValue), processedValue; } }, phonebe: { alias: "phone", url: "phone-codes/phone-be.js", countrycode: "32", nojumpsThreshold: 4 } }), $.fn.inputmask; }(jQuery), function($) { return $.extend($.inputmask.defaults.aliases, { Regex: { mask: "r", greedy: !1, repeat: "*", regex: null, regexTokens: null, tokenizer: /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g, quantifierFilter: /[0-9]+[^,]/, isComplete: function(buffer, opts) { return new RegExp(opts.regex).test(buffer.join("")); }, definitions: { r: { validator: function(chrs, maskset, pos, strict, opts) { function regexToken(isGroup, isQuantifier) { this.matches = [], this.isGroup = isGroup || !1, this.isQuantifier = isQuantifier || !1, this.quantifier = { min: 1, max: 1 }, this.repeaterPart = void 0; } function analyseRegex() { var match, m, currentToken = new regexToken(), opengroups = []; for (opts.regexTokens = []; match = opts.tokenizer.exec(opts.regex); ) switch (m = match[0], m.charAt(0)) { case "(": opengroups.push(new regexToken(!0)); break; case ")": var groupToken = opengroups.pop(); opengroups.length > 0 ? opengroups[opengroups.length - 1].matches.push(groupToken) : currentToken.matches.push(groupToken); break; case "{": case "+": case "*": var quantifierToken = new regexToken(!1, !0); m = m.replace(/[{}]/g, ""); var mq = m.split(","), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = 1 == mq.length ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]); if (quantifierToken.quantifier = { min: mq0, max: mq1 }, opengroups.length > 0) { var matches = opengroups[opengroups.length - 1].matches; if (match = matches.pop(), !match.isGroup) { var groupToken = new regexToken(!0); groupToken.matches.push(match), match = groupToken; } matches.push(match), matches.push(quantifierToken); } else { if (match = currentToken.matches.pop(), !match.isGroup) { var groupToken = new regexToken(!0); groupToken.matches.push(match), match = groupToken; } currentToken.matches.push(match), currentToken.matches.push(quantifierToken); } break; default: opengroups.length > 0 ? opengroups[opengroups.length - 1].matches.push(m) : currentToken.matches.push(m); } currentToken.matches.length > 0 && opts.regexTokens.push(currentToken); } function validateRegexToken(token, fromGroup) { var isvalid = !1; fromGroup && (regexPart += "(", openGroupCount++); for (var mndx = 0; mndx < token.matches.length; mndx++) { var matchToken = token.matches[mndx]; if (1 == matchToken.isGroup) isvalid = validateRegexToken(matchToken, !0); else if (1 == matchToken.isQuantifier) { var crrntndx = $.inArray(matchToken, token.matches), matchGroup = token.matches[crrntndx - 1], regexPartBak = regexPart; if (isNaN(matchToken.quantifier.max)) { for (;matchToken.repeaterPart && matchToken.repeaterPart != regexPart && matchToken.repeaterPart.length > regexPart.length && !(isvalid = validateRegexToken(matchGroup, !0)); ) ; isvalid = isvalid || validateRegexToken(matchGroup, !0), isvalid && (matchToken.repeaterPart = regexPart), regexPart = regexPartBak + matchToken.quantifier.max; } else { for (var i = 0, qm = matchToken.quantifier.max - 1; qm > i && !(isvalid = validateRegexToken(matchGroup, !0)); i++) ; regexPart = regexPartBak + "{" + matchToken.quantifier.min + "," + matchToken.quantifier.max + "}"; } } else if (void 0 != matchToken.matches) for (var k = 0; k < matchToken.length && !(isvalid = validateRegexToken(matchToken[k], fromGroup)); k++) ; else { var testExp; if ("[" == matchToken.charAt(0)) { testExp = regexPart, testExp += matchToken; for (var j = 0; openGroupCount > j; j++) testExp += ")"; var exp = new RegExp("^(" + testExp + ")$"); isvalid = exp.test(bufferStr); } else for (var l = 0, tl = matchToken.length; tl > l; l++) if ("\\" != matchToken.charAt(l)) { testExp = regexPart, testExp += matchToken.substr(0, l + 1), testExp = testExp.replace(/\|$/, ""); for (var j = 0; openGroupCount > j; j++) testExp += ")"; var exp = new RegExp("^(" + testExp + ")$"); if (isvalid = exp.test(bufferStr)) break; } regexPart += matchToken; } if (isvalid) break; } return fromGroup && (regexPart += ")", openGroupCount--), isvalid; } null == opts.regexTokens && analyseRegex(); var cbuffer = maskset.buffer.slice(), regexPart = "", isValid = !1, openGroupCount = 0; cbuffer.splice(pos, 0, chrs); for (var bufferStr = cbuffer.join(""), i = 0; i < opts.regexTokens.length; i++) { var regexToken = opts.regexTokens[i]; if (isValid = validateRegexToken(regexToken, regexToken.isGroup)) break; } return isValid; }, cardinality: 1 } } } }), $.fn.inputmask; }(jQuery); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/jquery.tablesorter.min.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 504 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/jquery.tablesorter.min.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 16520 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 16,520 bytes. |
(function($){$.extend({tablesorter:new
function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}if(table.tBodies.length==0)return;var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter);}else if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter);}if(!p){p=detectParserForColumn(table,rows,-1,i);}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n";}list.push(p);}}if(table.config.debug){log(parsersDebug);}return list;};function detectParserForColumn(table,rows,rowIndex,cellIndex){var l=parsers.length,node=false,nodeValue=false,keepLooking=true;while(nodeValue==''&&keepLooking){rowIndex++;if(rows[rowIndex]){node=getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex);nodeValue=trimAndGetNodeText(table.config,node);if(table.config.debug){log('Checking if value was empty on row:'+rowIndex);}}else{keepLooking=false;}}for(var i=1;i<l;i++){if(parsers[i].is(nodeValue,table,node)){return parsers[i];}}return parsers[0];}function getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex){return rows[rowIndex].cells[cellIndex];}function trimAndGetNodeText(config,node){return $.trim(getElementText(config,node));}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i];}}return false;}function buildCache(table){if(table.config.debug){var cacheTime=new Date();}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=$(table.tBodies[0].rows[i]),cols=[];if(c.hasClass(table.config.cssChildRow)){cache.row[cache.row.length-1]=cache.row[cache.row.length-1].add(c);continue;}cache.row.push(c);for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c[0].cells[j]),table,c[0].cells[j]));}cols.push(cache.normalized.length);cache.normalized.push(cols);cols=null;};if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime);}return cache;};function getElementText(config,node){var text="";if(!node)return"";if(!config.supportsTextContent)config.supportsTextContent=node.textContent||false;if(config.textExtraction=="simple"){if(config.supportsTextContent){text=node.textContent;}else{if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){text=node.childNodes[0].innerHTML;}else{text=node.innerHTML;}}}else{if(typeof(config.textExtraction)=="function"){text=config.textExtraction(node);}else{text=$(node).text();}}return text;}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){var pos=n[i][checkCell];rows.push(r[pos]);if(!table.config.appender){var l=r[pos].length;for(var j=0;j<l;j++){tableBody[0].appendChild(r[pos][j]);}}}if(table.config.appender){table.config.appender(table,rows);}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime);}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd");},0);};function buildHeaders(table){if(table.config.debug){var time=new Date();}var meta=($.metadata)?true:false;var header_index=computeTableHeaderCellIndexes(table);$tableHeaders=$(table.config.selectorHeaders,table).each(function(index){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(table.config.sortInitialOrder);this.count=this.order;if(checkHeaderMetadata(this)||checkHeaderOptions(table,index))this.sortDisabled=true;if(checkHeaderOptionsSortingLocked(table,index))this.order=this.lockedOrder=checkHeaderOptionsSortingLocked(table,index);if(!this.sortDisabled){var $th=$(this).addClass(table.config.cssHeader);if(table.config.onRenderHeader)table.config.onRenderHeader.apply($th);}table.config.headerList[index]=this;});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders);}return $tableHeaders;};function computeTableHeaderCellIndexes(t){var matrix=[];var lookup={};var thead=t.getElementsByTagName('THEAD')[0];var trs=thead.getElementsByTagName('TR');for(var i=0;i<trs.length;i++){var cells=trs[i].cells;for(var j=0;j<cells.length;j++){var c=cells[j];var rowIndex=c.parentNode.rowIndex;var cellId=rowIndex+"-"+c.cellIndex;var rowSpan=c.rowSpan||1;var colSpan=c.colSpan||1 var firstAvailCol;if(typeof(matrix[rowIndex])=="undefined"){matrix[rowIndex]=[];}for(var k=0;k<matrix[rowIndex].length+1;k++){if(typeof(matrix[rowIndex][k])=="undefined"){firstAvailCol=k;break;}}lookup[cellId]=firstAvailCol;for(var k=rowIndex;k<rowIndex+rowSpan;k++){if(typeof(matrix[k])=="undefined"){matrix[k]=[];}var matrixrow=matrix[k];for(var l=firstAvailCol;l<firstAvailCol+colSpan;l++){matrixrow[l]="x";}}}}return lookup;}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function checkHeaderOptionsSortingLocked(table,i){if((table.config.headers[i])&&(table.config.headers[i].lockedOrder))return table.config.headers[i].lockedOrder;return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table);}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i];}}};function formatSortingOrder(v){if(typeof(v)!="Number"){return(v.toLowerCase()=="desc")?1:0;}else{return(v==1)?1:0;}}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true;}}return false;}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this);}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]]);}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$('<colgroup>');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('<col>').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++;}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date();}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(table.config.parsers[c].type=="text")?((order==0)?makeSortFunction("text","asc",c):makeSortFunction("text","desc",c)):((order==0)?makeSortFunction("numeric","asc",c):makeSortFunction("numeric","desc",c));var e="e"+i;dynamicExp+="var "+e+" = "+s;dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { ";}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; ";}dynamicExp+="return 0; ";dynamicExp+="}; ";if(table.config.debug){benchmark("Evaling expression:"+dynamicExp,new Date());}eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime);}return cache;};function makeSortFunction(type,direction,index){var a="a["+index+"]",b="b["+index+"]";if(type=='text'&&direction=='asc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+a+" < "+b+") ? -1 : 1 )));";}else if(type=='text'&&direction=='desc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+b+" < "+a+") ? -1 : 1 )));";}else if(type=='numeric'&&direction=='asc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+a+" - "+b+"));";}else if(type=='numeric'&&direction=='desc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+b+" - "+a+"));";}};function makeSortText(i){return"((a["+i+"] < b["+i+"]) ? -1 : ((a["+i+"] > b["+i+"]) ? 1 : 0));";};function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));";};function makeSortNumeric(i){return"a["+i+"]-b["+i+"];";};function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];";};function sortText(a,b){if(table.config.sortLocaleCompare)return a.localeCompare(b);return((a<b)?-1:((a>b)?1:0));};function sortTextDesc(a,b){if(table.config.sortLocaleCompare)return b.localeCompare(a);return((b<a)?-1:((b>a)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder)this.order=this.lockedOrder;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j]);}}}config.sortList.push([i,this.order]);}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2;}}}else{config.sortList.push([i,this.order]);}};setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache));},1);return false;}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false;}});$this.bind("update",function(){var me=this;setTimeout(function(){me.config.parsers=buildParserCache(me,$headers);cache=buildCache(me);},1);}).bind("updateCell",function(e,cell){var config=this.config;var pos=[(cell.parentNode.rowIndex-1),cell.cellIndex];cache.normalized[pos[0]][pos[1]]=config.parsers[pos[1]].format(getElementText(config,cell),cell);}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache));}).bind("appendCache",function(){appendToTable(this,cache);}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this);}).bind("applyWidgets",function(){applyWidget(this);});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist;}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false;}}if(a){parsers.push(parser);};};this.addWidget=function(widget){widgets.push(widget);};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i;};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i;};this.isDigit=function(s,config){return/^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g,'')));};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild)this.removeChild(this.firstChild);}empty.apply(table.tBodies[0]);}else{table.tBodies[0].innerHTML="";}};}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true;},format:function(s){return $.trim(s.toLocaleLowerCase());},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c);},format:function(s){return $.tablesorter.formatFloat(s);},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s);},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g),""));},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item;}else{r+=item;}}return $.tablesorter.formatFloat(r);},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s);},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0");},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s));},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");}else if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");}else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");}return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime());},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false;},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(cell).metadata()[p];},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date();}var $tr,row=-1,odd;$("tr:visible",table.tBodies[0]).each(function(i){$tr=$(this);if(!$tr.hasClass(table.config.cssChildRow))row++;odd=(row%2==0);$tr.removeClass(table.config.widgetZebra.css[odd?0:1]).addClass(table.config.widgetZebra.css[odd?1:0])});if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time);}}});})(jQuery); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 515 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,143 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 9219 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 9,219 bytes. |
(function ( $ ) {
$.fn.lst_freeze_table = function( options ) { var opts = $.extend( {}, $.fn.lst_freeze_table.defaults, options ); return this.each(function() { var _this = this; var _thisContainer; if(!jQuery(_this).hasClass('lst_freeze_table')) { jQuery(_this).wrap(function() { return $("<div/>").addClass('lst_freeze_table_container'); }); _thisContainer = jQuery(_this).closest('.lst_freeze_table_container'); convert_element(_thisContainer.find('table'),'lst_freeze_table table'); convert_element(_thisContainer.find('.table thead'),'thead'); convert_element(_thisContainer.find('.table .thead tr'),'tr flexthis'); convert_element(_thisContainer.find('.table .thead .tr th'),'th'); convert_element(_thisContainer.find('.table tbody'),'tbody'); convert_element(_thisContainer.find('.table .tbody tr'),'tr flexthis'); convert_element(_thisContainer.find('.table .tbody .tr td'),'td'); } else { _thisContainer = jQuery(_this).closest('.lst_freeze_table_container'); } _thisContainer.css('width',opts.tbl_max_width); _thisContainer.css('height',opts.tbl_max_height); if(opts.column_width.length>0) { apply_width(_thisContainer,opts.column_width); } if(opts.left_fixed_column_index.length>0 && opts.right_fixed_column_index.length>0 && opts.column_width.length >0) { jQuery(_thisContainer).find('.table .thead .tr .th').removeClass('fixedcol'); jQuery(_thisContainer).find('.table .tbody .tr .td').removeClass('fixedcol'); apply_fixed_column(_thisContainer,opts.left_fixed_column_index,opts.column_width,'left'); apply_fixed_column(_thisContainer,opts.right_fixed_column_index,opts.column_width,'right'); } //if right only if(opts.left_fixed_column_index.length<=0 && opts.right_fixed_column_index.length>0 && opts.column_width.length >0) { jQuery(_thisContainer).find('.table .thead .tr .th').removeClass('fixedcol'); jQuery(_thisContainer).find('.table .tbody .tr .td').removeClass('fixedcol'); apply_fixed_column(_thisContainer,opts.right_fixed_column_index,opts.column_width,'right'); } //if left only if(opts.left_fixed_column_index.length>0 && opts.right_fixed_column_index.length<=0 && opts.column_width.length >0) { jQuery(_thisContainer).find('.table .thead .tr .th').removeClass('fixedcol'); jQuery(_thisContainer).find('.table .tbody .tr .td').removeClass('fixedcol'); apply_fixed_column(_thisContainer,opts.left_fixed_column_index,opts.column_width,'left'); } if(opts.hoverable_rows) { // alert('pass'); jQuery(_thisContainer).find('.table .tr').addClass('hoverable'); jQuery(_thisContainer).find('.table .tr .td').addClass('hoverable'); } }) }; function convert_element(tableObj,tableObjClass) { jQuery(tableObj).each(function() { var attrs = { }; $.each(jQuery(this)[0].attributes, function(index,attr) { attrs[attr.nodeName] = attr.nodeValue; }); return jQuery(this).replaceWith(function() { return $("<div />", attrs).addClass(tableObjClass).append(jQuery(this).contents()); }); }) } function apply_width(tableObjContainer,arrOptsWidth) { var th_visible=$(tableObjContainer).find('.table .thead .tr').first().find('.th:visible'); // console.log(th_visible); $(tableObjContainer.find('.table .thead .tr')).each(function(tableObjIndex) { $(this).find('.th:visible').each(function(subTableObjIndex) { jQuery(this).css('width',arrOptsWidth[subTableObjIndex]); }) }) $(tableObjContainer.find('.table .tbody .tr')).each(function(tableObjIndex) { var td_visible=$(this).find('.td:visible'); td_visible.each(function(subTableObjIndex) { if(jQuery(this).attr('colspan')==undefined) { jQuery(this).attr('colspan',1); } var max_colspan = jQuery(this).attr('colspan') > th_visible.length ? th_visible.length:jQuery(this).attr('colspan'); var colspan_ctr=1; var maxWidth=0; for (var i = subTableObjIndex; i < arrOptsWidth.length; i++) { if(colspan_ctr <= max_colspan) { maxWidth+=arrOptsWidth[i]; } else { break; } colspan_ctr++; } jQuery(this).css('width',maxWidth); }) }) if(tableObjContainer.outerWidth() > tableObjContainer.find('.tr.flexthis:first').outerWidth()) { var _width_diff = tableObjContainer.outerWidth() - tableObjContainer.find('.tr.flexthis:first').outerWidth(); var _last_th_width = tableObjContainer.find('.tr .th:visible:last-child').outerWidth(); tableObjContainer.find('.thead .tr').each(function() { jQuery(this).find('.th:visible').last().css('width',_width_diff+_last_th_width); }) tableObjContainer.find('.tbody .tr').each(function() { var last_td_visible = jQuery(this).find('.td:visible').last(); var length_td_visible = jQuery(this).find('.td:visible').length-1; if(last_td_visible.attr('colspan')>1) { var last_td_width=0; tableObjContainer.find('.thead .tr').first().find('.th:visible').each(function(th_index) { if(th_index>=length_td_visible) { last_td_width += jQuery(this).outerWidth(); } }) last_td_visible.css('width',last_td_width); } else { last_td_visible.css('width',_width_diff+_last_th_width); } }) } } function apply_fixed_column(tableObjContainer,fixed_column_index,column_width,fixed_position) { var fixedcol_left=0; var fixedcol_right=0; if(fixed_position=='left') { //sort fixed_column_index to ascending order fixed_column_index.sort(function(a, b){return a-b}); } else { //sort fixed_column_index to descending order fixed_column_index.sort(function(a, b){return b-a}); } $.each(fixed_column_index,function(index,value) { var fix_col_index_offset = value; // console.log(fix_col_index_offset,index,value); // console.log($(tableObjContainer).find('.table .thead .tr .th')); // console.log($(tableObjContainer).find('.table .thead .tr .th:nth-child('+fix_col_index_offset+')').get(0)); // $(tableObjContainer).find('.table .thead .tr .th:visible:nth-child('+fix_col_index_offset+')') // .addClass('fixedcol') // .css('left',fixedcol_left) // .css('right',fixedcol_right); jQuery(tableObjContainer).find(".table .thead .tr .th:visible").eq(fix_col_index_offset) .addClass('fixedcol') .css('left',fixedcol_left) .css('right',fixedcol_right);; if(fixed_position=='left') { $(tableObjContainer).find('.table .thead .tr .th:visible').eq(fix_col_index_offset) .addClass('fixedcol_left') } else { $(tableObjContainer).find('.table .thead .tr .th:visible').eq(fix_col_index_offset) .addClass('fixedcol_right') } $(tableObjContainer).find('.table .tbody .tr').each(function() { jQuery(this).find('.td:visible').eq(value).addClass('fixedcol') .css('left',fixedcol_left) .css('right',fixedcol_right); //for style display none // jQuery(this).find('.td,.hidden_td').eq(value).addClass('fixedcol') // .css('left',fixedcol_left) // .css('right',fixedcol_right); //for class hidden_td if(fixed_position=='left') { jQuery(this).find('.td:visible').eq(value).addClass('fixedcol_left'); // jQuery(this).find('.td,.hidden_td').eq(value).addClass('fixedcol_left pager_action_btn_container'); } else { jQuery(this).find('.td:visible').eq(value).addClass('fixedcol_right'); // jQuery(this).find('.td,.hidden_td').eq(value).addClass('fixedcol_right pager_action_btn_container'); } var nothing = ""; nothing = jQuery(this).find('.td:visible').eq(value).text(); if(nothing != "") { // console.log('nothing false'); // console.log("header_width",jQuery(this).find('.td:visible').eq(value).closest('.pager_tbody').siblings('.pager_thead').find('.pager_tr').width()); // var header_width = jQuery(this).find('.td:visible').eq(value).closest('.pager_tbody').siblings('.pager_thead').find('.pager_tr').width(); // jQuery(this).find('.td:visible').eq(value).width(header_width-10); // jQuery(this).find('.td:visible').eq(value).removeClass('fixedcol fixedcol_left fixedcol_right pager_action_btn_container'); // jQuery(this).find('.td:visible').eq(value).addClass('pager_action_btn_container'); } else { // console.log('nothing true'); } }); if(fixed_position=='left') { fixedcol_left = fixedcol_left + column_width[value]; } else { fixedcol_right = fixedcol_right + column_width[value]; } }) } // Plugin defaults – added as a property on our plugin function. $.fn.lst_freeze_table.defaults = { column_width: [], left_fixed_column_index: [], right_fixed_column_index: [], tbl_max_width: "auto", tbl_max_height: "auto", hoverable_rows:true }; }( jQuery )); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 487 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 15425 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 15,425 bytes. |
/**
*** used of names *** alphabet + dash(-) + period(.) **/ function isNameKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; // var regex = /[- . +a-zA-Z ]/; //20160809 - karlo - included Ñ,ñ to regex (\u00d1 \u00f1) var regex = /[- . +a-zA-Z \u00d1 \u00f1]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) **/ function isAlphaNum(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } //20191115 donita function disallow_tag(regex="") { // console.log('disallow tag'); //20191123 donita jQuery('body').find('input ,textarea').each(function(){ if(!jQuery(this).hasClass('hasDialogTag')) { jQuery(this).addClass('hasDialogTag'); jQuery(this).keypress(function(e){ // console.log(e.keyCode); if(e.keyCode == 60 || e.keyCode == 62){ return false; } }); } }); jQuery('body').find('input:not([onpaste][ondrop][onkeypress]),textarea:not([onpaste][ondrop][onkeypress])').not('#categcde').not('#categcde').not('#modalField_apporder').not('#modalField_scrto').not('#modalField_scrfrom').each(function(){ if(!jQuery(this).hasClass('hasDialogTag2')) { jQuery(this).addClass('hasDialogTag2'); // jQuery(this).keypress(function(e){ // // console.log(e.keyCode); // if(e.keyCode == 60 || e.keyCode == 62){ // return false; // } // }); jQuery(this).on("paste",function(e){ console.log("2") var x = e.originalEvent.clipboardData.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); newval = newval.substring(0,maxlen); } if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); // Kiel 11-27-2019 - Added maxlength validation if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); x = x.substring(0,maxlen); } jQuery(e.target).val(x); e.preventDefault(); } }); //mica 11-18-19 jQuery(this).on("drop",function(e){ var x = e.originalEvent.dataTransfer.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); jQuery(e.target).val(x); e.preventDefault(); } }); } }); } //20191030 donita function prevent_Event(evt) { evt.preventDefault(); } function isCheck_paste(evt, thisobj,regex) { xval = evt.clipboardData.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { // console.log(xval[i]); if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; //20191112 donita // if(jQuery("#"+evt.target.id).prop('disabled') == true) //20191121 donita - use the target tag/element if(jQuery(evt.target).prop('disabled') == true) { } else { xmaxlength = jQuery(thisobj).attr('maxlength'); xnewval = jQuery(thisobj).val() + newval; jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval.slice(0,xmaxlength)); jQuery(thisobj).focus(); } } function isCheck_drop(evt, thisobj,regex) { xval = evt.dataTransfer.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; if(jQuery(thisobj).attr('maxlength')!=undefined) { var maxlen = jQuery(thisobj).attr('maxlength'); xnewval = xnewval.substring(0,maxlen); } jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval); } /** *** used of alphanumeric *** alphabet + numbers + dash(-) **/ function isAlphaNumDash(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isAlphaNumPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isTextContent(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[/';(),.a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number only **/ function isNumberKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + period(.) **/ function isNumberKeyWithPeriod(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); var regex = /[0-9]|\./; inputval=$(evt.srcElement).val() inputval=inputval+key; var period_count = (inputval.split(".").length - 1); if( !regex.test(key) || (evt.keyCode==46 && period_count >1)) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[, . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey_2(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + minus sign **/ function isContactKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]|\+|\(|\)|\-/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** validation if the inputed value is a valid email **/ function isEmailKey(id) { var x = $('#'+id).val(); var atpos = x.indexOf("@"); var dotpos = x.lastIndexOf("."); if(x.trim()=='') { } else { if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { // alert("Not a valid e-mail address"); alertify.alert('Not a valid e-mail address.'); $('#'+id).val(''); } } } /** *** added 06262015 -jep *** auto compute age by date inputted in DOB **/ function ageCount(xid_dob,xid_age) { var date1 = new Date(); var dob = document.getElementById(xid_dob).value; var new_dob_str = dob.replace(/-/g,"/"); var date2 = new Date(new_dob_str); var pattern = /^\d{1,2}\/\d{1,2}\/\d{4}$/; //Regex to validate date format (dd/mm/yyyy) if(dob!='') { if (pattern.test(new_dob_str)) { var today = new Date(); var birthDate = date2; var age = today.getFullYear() - birthDate.getFullYear(); var m = today.getMonth() - birthDate.getMonth(); if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { age--; } //calculating age document.getElementById(xid_age).value = age; document.getElementById(xid_age).focus(); return true; } else { if(dob!='') { alertify.alert("Invalid date format. format!"); return false; } } } else { document.getElementById(xid_age).value = 0; } } function paste_syspar_regex(evt) { var textVal = jQuery(evt.target).val(); evt.preventDefault(); evt.returnValue = false; // console.log("pass2") var caretPos =event.target.selectionStart; var caretEnd = event.target.selectionEnd; var textAreaTxt = jQuery(evt.target).val(); // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery(evt.target).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr; //20191107 donita // console.log(evt.target.id); console.log(jQuery(evt.target).prop('disabled')) if(jQuery(evt.target).prop('disabled') == true || jQuery(evt.target).prop('readonly') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // //20191106 donita newstr = evt.target.value; // //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); // //end trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); jQuery(evt.target).focus(); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length },function() { }) } else { evt.target.value = text; //20191106 donita newstr = evt.target.value; newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length } } } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function isAlphaNumColumnPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. , +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) + colon(:) + new line (/r /n) **/ function isAlphaNumDashWithColumnNewLine(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/searchmodal/searchable.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 504 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/searchmodal/searchable.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 10850 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 10,850 bytes. |
(function( $ )
{ $.fn.searchable=function(options) { var that = this; var jquery_this = $(this); $.fn.searchable.destroy = function(searchable_input_selector) { jQuery(searchable_input_selector).each(function() { var searchable_input_backup = jQuery(this).closest('.searchable_container').find('.searchable_input_backup'); var input_orig_parent = jQuery(this).closest('.searchable_outer_container').parent(); var nodename=searchable_input_backup.data('nodename'); var input_orig=jQuery("<"+nodename+"/>"); $.each(searchable_input_backup.data(),function(name,value) { if(name!="nodename") { input_orig.attr(name,value); } }) input_orig_parent.html(input_orig); }) return; } $.fn.searchable.searchButton = function() { var btn = $('<button />').attr( { type: 'button', class: 'searchable_calldialog other-search', tabIndex:"-1" }); return btn; }; $.fn.searchable.modalClearButton = function() { var btn = $('<i />').attr( { class: 'fa fa-times searchable_clear_btn', title: 'Clear Field' }); return btn; }; $.fn.searchable.modalSearchButton = function() { var btn = $('<button />').attr( { value:'', class:'searchable_modalbtnfilterer save' }).text('Search'); return btn; }; $.fn.searchable.hiddenTblCols = function() { var txt = $('<input />').attr( { type:'hidden', name:'filter_txthidden' }); return txt; } $.fn.searchable.searchTxt = function() { var txt = $('<input />').attr( { type:'text', value:'', placeholder:'Search through here...', name:'filter_txt', class:'searchable_modaltxtfilterer' }); return txt; }; $.fn.searchable.searchBy = function(val,desc) { var sel = $('<select />', { name:'filter_col_name', class:'searchable_modalselfilterer' }); for (var key in val) { var option=$("<option />", { value:val[key] }).text(desc[key]); sel.append(option); } return sel; }; $.fn.searchable.createRequestorDestroyableBackup = function(requestor) { var data_nodename = requestor[0].nodeName; var elem_backup = $('<div />'); elem_backup.attr('data-nodeName',data_nodename.toLowerCase()); $.each(requestor[0].attributes, function() { if(this.specified) { elem_backup.attr('data-'+this.name,this.value); } }); elem_backup.addClass('searchable_input_backup'); return elem_backup; }; $.fn.searchable.div = function() { return $('<div />'); } $.fn.searchable.divDialog=function(title,height,width,resultContainer,filtererContainer,closeOnEscape,resizable) { title = title || ''; height = height || 500; width = width || 500; resultContainer = resultContainer || $('<div/ >'); filtererContainer = filtererContainer || $('<div/ >'); closeOnEscape = closeOnEscape || true; resizable = resizable || false; var divDialog = jQuery('<div />'); divDialog.addClass('searchable_dialog'); return divDialog.dialog({ autoOpen : false, modal : true, height: height, width:width, resizable : resizable, title : title, closeOnEscape : closeOnEscape, open:function() { jQuery(this).find('.ui-dialog-titlebar-close').hide(); resultContainer.empty(); jQuery('body').css('overflow-y','hidden'); filtererContainer.find('input').val(''); // filtererContainer.find('select').val(filtererContainer.find('select option:first').val()); jQuery(this).closest('.ui-dialog').css({ 'z-index': '2000'}); // jQuery('.ui-dialog').css({ 'z-index': '2000'}); }, close:function() { jQuery('body').css('overflow-y','scroll'); }, buttons:[ { text: "Cancel", "class": 'searchable_dialog_cancel_btn exit', click: function() { jQuery(this).dialog('close'); } } ] }); } $.fn.searchable.defaults = { // searchButtonCusClass:'', // searchButtonshrtct_keys_f: [114,115], modalselfilterer_codeshortcut:114, modalselfilterer_descshortcut:115, modalTitle:'', modalWidth:"auto", modalHeight:'auto', modalCloseOnEscape:true, modalResizable:false, ajaxPage:'../javascript/searchmodal/searchable_ajax.php', order:'asc', orderBy:'', groupBy:'', table:"", link_id:"", searchCol:'', searchByDesc:[], searchByValue:[], tableCol:'', tableColHeader:'', sqlfilter:'', data:'', passValueTo:[], passValue:[], autoOpen:true }; //public functions var opts = $.extend( {}, $.fn.searchable.defaults, options ); return this.each(function(index) { var id=index; var requestor=$(this); if(!requestor.hasClass('searchable_text')) { var createRequestorDestroyableBackup = $.fn.searchable.createRequestorDestroyableBackup(requestor); requestor.attr('placeholder','Click button to search...'); requestor.wrap('<div class=\"searchable_outer_container\"></div>'); requestor.wrap('<div class=\"searchable_container\"></div>'); requestor.addClass('searchable_text'); var searchButton = $.fn.searchable.searchButton(); var modalSearchButton = $.fn.searchable.modalSearchButton(); var selBy=$.fn.searchable.searchBy(opts.searchByValue,opts.searchByDesc); var searchTxt=$.fn.searchable.searchTxt(); var modalClearButton = $.fn.searchable.modalClearButton(); modalClearButton.insertAfter(requestor); var filtererContainer=$.fn.searchable.div(); filtererContainer.addClass('searchable_filterercontainer'); var resultContainer=$.fn.searchable.div(); resultContainer.addClass('searchable_resultcontainer'); var dialog = $.fn.searchable.divDialog(opts.modalTitle,opts.modalHeight,opts.modalWidth,resultContainer,filtererContainer,opts.modalCloseOnEscape,opts.modalResizable); filtererContainer.append(searchTxt); filtererContainer.append(selBy); filtererContainer.append(modalSearchButton); dialog.append(filtererContainer); dialog.append(resultContainer); requestor.data('target-dialog',dialog.attr('id')); createRequestorDestroyableBackup.appendTo(requestor.parents('.searchable_container')); searchButton.appendTo(requestor.parents('.searchable_container')); searchButton.html('<i class="fa fa-search" aria-hidden="true"></i>'); searchTxt.on('keypress', function (event) { if(event.which === 13) { modalSearchButton.click(); } }); searchButton.on('click',function(e) { //20190801 - randle to immediate load datas before dialog opens dialog.find(".searchable_modaltxtfilterer").val(""); dialog.find(".searchable_modalbtnfilterer").click(); dialog.dialog('open'); }); modalClearButton.on('click',function(e) { requestor.val('').change(); if(opts.passValue.length > 0) { //- remove value in passVlue fields for(var i =0;i<opts.passValue.length;i++) { var input_passValue=$(this).parents('td').find('.passValue_'+opts.passValueTo[i]).val(); $('#'+opts.passValueTo[i]).val(''); } } }); requestor.closest('.searchable_container').hover(function() { // if(requestor.val() != '' && (requestor.hasClass('disabled') == false || requestor.prop('disabled') == false) ) if(requestor.val() != '' && requestor.hasClass('disabled') == false) { $(this).find('.searchable_clear_btn').css('visibility','visible'); } },function() { if(requestor.hasClass('disabled') == false) { $(this).find('.searchable_clear_btn').css('visibility','hidden'); } }) // (this).closest('td').find('.searchable_clear_btn').show(); // }) requestor.on('keydown',function(e) { // if(opts.searchButtonshrtct_keys_f.indexOf(e.keyCode)!==-1) if(opts.modalselfilterer_codeshortcut==e.keyCode) { filtererContainer.find('.searchable_modalselfilterer').find('option[value$=cde],option[value$=code]').prop('selected',true); $(this).closest('.searchable_container').find('.searchable_calldialog').click(); } if(opts.modalselfilterer_descshortcut==e.keyCode) { filtererContainer.find('.searchable_modalselfilterer').find('option[value$=dsc],option[value$=desc]').prop('selected',true); $(this).closest('.searchable_container').find('.searchable_calldialog').click(); } }) requestor.closest('.searchable_outer_container').show(); if(opts.autoOpen==false) { requestor.closest('.searchable_outer_container').hide(); } } var target_dialog=jQuery('#'+requestor.data('target-dialog')); jQuery(target_dialog).find('.searchable_modalbtnfilterer').off('click'); jQuery(target_dialog).find('.searchable_modalbtnfilterer').click(function() { var data=target_dialog.find("*").serialize()+"&table="+opts.table+"&link_id="+opts.link_id+"&searchCol="+opts.searchCol+"&tblcol="+opts.tableCol+'&tblcolheaders='+opts.tableColHeader; data+="&sqlfilter="+opts.sqlfilter; data+="&sqlorderby="+opts.orderBy; data+="&sqlorder="+opts.order; data+="&sqlgroupBy="+opts.groupBy; data+="&"+opts.data; data+="&passValue="; var passValueData=""; for(var i =0;i<opts.passValue.length;i++) { data+=opts.passValue[i]; passValueData+="&passValueTo["+opts.passValueTo[i]+"]="+opts.passValue[i]; if((i+1)<opts.passValue.length) { data+=","; } } data+=passValueData; blockui(); $.ajax({ type: "POST", url: opts.ajaxPage, data: data, dataType: "json", success: function(xret) { jQuery.unblockUI(); target_dialog.find('.searchable_resultcontainer').html(xret.content); target_dialog.find('.searchable_resultcontainer').find('.filter_select').on('click',function() { for(var i =0;i<opts.passValue.length;i++) { var input_passValue=jQuery(this).closest('td').find('.passValue.searchable_'+opts.passValue[i]).val(); if(opts.passValueTo[i] instanceof jQuery) //if value is a jQuery Object { opts.passValueTo[i].val(input_passValue).change(); } else { jQuery('#'+opts.passValueTo[i]).val(input_passValue).change(); } } requestor.val(jQuery(this).val()).change(); target_dialog.dialog('close'); }); } }); }); }); }; }( jQuery )); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/sha1.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 486 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/sha1.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,143 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:05 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 3459 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 3,459 bytes. |
/**
* * Secure Hash Algorithm (SHA1) * http://www.webtoolkit.info/ * **/ function SHA1 (msg) { function rotate_left(n,s) { var t4 = ( n<<s ) | (n>>>(32-s)); return t4; }; function lsb_hex(val) { var str=""; var i; var vh; var vl; for( i=0; i<=6; i+=2 ) { vh = (val>>>(i*4+4))&0x0f; vl = (val>>>(i*4))&0x0f; str += vh.toString(16) + vl.toString(16); } return str; }; function cvt_hex(val) { var str=""; var i; var v; for( i=7; i>=0; i-- ) { v = (val>>>(i*4))&0x0f; str += v.toString(16); } return str; }; function Utf8Encode(string) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; }; var blockstart; var i, j; var W = new Array(80); var H0 = 0x67452301; var H1 = 0xEFCDAB89; var H2 = 0x98BADCFE; var H3 = 0x10325476; var H4 = 0xC3D2E1F0; var A, B, C, D, E; var temp; msg = Utf8Encode(msg); var msg_len = msg.length; var word_array = new Array(); for( i=0; i<msg_len-3; i+=4 ) { j = msg.charCodeAt(i)<<24 | msg.charCodeAt(i+1)<<16 | msg.charCodeAt(i+2)<<8 | msg.charCodeAt(i+3); word_array.push( j ); } switch( msg_len % 4 ) { case 0: i = 0x080000000; break; case 1: i = msg.charCodeAt(msg_len-1)<<24 | 0x0800000; break; case 2: i = msg.charCodeAt(msg_len-2)<<24 | msg.charCodeAt(msg_len-1)<<16 | 0x08000; break; case 3: i = msg.charCodeAt(msg_len-3)<<24 | msg.charCodeAt(msg_len-2)<<16 | msg.charCodeAt(msg_len-1)<<8 | 0x80; break; } word_array.push( i ); while( (word_array.length % 16) != 14 ) word_array.push( 0 ); word_array.push( msg_len>>>29 ); word_array.push( (msg_len<<3)&0x0ffffffff ); for ( blockstart=0; blockstart<word_array.length; blockstart+=16 ) { for( i=0; i<16; i++ ) W[i] = word_array[blockstart+i]; for( i=16; i<=79; i++ ) W[i] = rotate_left(W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16], 1); A = H0; B = H1; C = H2; D = H3; E = H4; for( i= 0; i<=19; i++ ) { temp = (rotate_left(A,5) + ((B&C) | (~B&D)) + E + W[i] + 0x5A827999) & 0x0ffffffff; E = D; D = C; C = rotate_left(B,30); B = A; A = temp; } for( i=20; i<=39; i++ ) { temp = (rotate_left(A,5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1) & 0x0ffffffff; E = D; D = C; C = rotate_left(B,30); B = A; A = temp; } for( i=40; i<=59; i++ ) { temp = (rotate_left(A,5) + ((B&C) | (B&D) | (C&D)) + E + W[i] + 0x8F1BBCDC) & 0x0ffffffff; E = D; D = C; C = rotate_left(B,30); B = A; A = temp; } for( i=60; i<=79; i++ ) { temp = (rotate_left(A,5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6) & 0x0ffffffff; E = D; D = C; C = rotate_left(B,30); B = A; A = temp; } H0 = (H0 + A) & 0x0ffffffff; H1 = (H1 + B) & 0x0ffffffff; H2 = (H2 + C) & 0x0ffffffff; H3 = (H3 + D) & 0x0ffffffff; H4 = (H4 + E) & 0x0ffffffff; } var temp = cvt_hex(H0) + cvt_hex(H1) + cvt_hex(H2) + cvt_hex(H3) + cvt_hex(H4); return temp.toLowerCase(); } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/tinymce/jquery.tinymce.min.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 508 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/tinymce/jquery.tinymce.min.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,143 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 3591 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 3,591 bytes. |
!function(a){function b(){function b(a){"remove"===a&&this.each(function(a,b){var c=e(b);c&&c.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(a,b){var c=tinymce.get(b.id.replace(/_parent$/,""));c&&c.remove()})}function d(a){var c,d=this;if(null!=a)b.call(d),d.each(function(b,c){var d;(d=tinymce.get(c.id))&&d.setContent(a)});else if(d.length>0&&(c=tinymce.get(d[0].id)))return c.getContent()}function e(a){var b=null;return a&&a.id&&g.tinymce&&(b=tinymce.get(a.id)),b}function f(a){return!!(a&&a.length&&g.tinymce&&a.is(":tinymce"))}var h={};a.each(["text","html","val"],function(b,g){var i=h[g]=a.fn[g],j="text"===g;a.fn[g]=function(b){var g=this;if(!f(g))return i.apply(g,arguments);if(b!==c)return d.call(g.filter(":tinymce"),b),i.apply(g.not(":tinymce"),arguments),g;var h="",k=arguments;return(j?g:g.eq(0)).each(function(b,c){var d=e(c);h+=d?j?d.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):d.getContent({save:!0}):i.apply(a(c),k)}),h}}),a.each(["append","prepend"],function(b,d){var g=h[d]=a.fn[d],i="prepend"===d;a.fn[d]=function(a){var b=this;return f(b)?a!==c?("string"==typeof a&&b.filter(":tinymce").each(function(b,c){var d=e(c);d&&d.setContent(i?a+d.getContent():d.getContent()+a)}),g.apply(b.not(":tinymce"),arguments),b):void 0:g.apply(b,arguments)}}),a.each(["remove","replaceWith","replaceAll","empty"],function(c,d){var e=h[d]=a.fn[d];a.fn[d]=function(){return b.call(this,d),e.apply(this,arguments)}}),h.attr=a.fn.attr,a.fn.attr=function(b,g){var i=this,j=arguments;if(!b||"value"!==b||!f(i))return g!==c?h.attr.apply(i,j):h.attr.apply(i,j);if(g!==c)return d.call(i.filter(":tinymce"),g),h.attr.apply(i.not(":tinymce"),j),i;var k=i[0],l=e(k);return l?l.getContent({save:!0}):h.attr.apply(a(k),j)}}var c,d,e,f=[],g=window;a.fn.tinymce=function(c){function h(){var d=[],f=0;e||(b(),e=!0),l.each(function(a,b){var e,g=b.id,h=c.oninit;g||(b.id=g=tinymce.DOM.uniqueId()),tinymce.get(g)||(e=new tinymce.Editor(g,c,tinymce.EditorManager),d.push(e),e.on("init",function(){var a,b=h;l.css("visibility",""),h&&++f==d.length&&("string"==typeof b&&(a=-1===b.indexOf(".")?null:tinymce.resolve(b.replace(/\.\w+$/,"")),b=tinymce.resolve(b)),b.apply(a||tinymce,d))}))}),a.each(d,function(a,b){b.render()})}var i,j,k,l=this,m="";if(!l.length)return l;if(!c)return window.tinymce?tinymce.get(l[0].id):null;if(l.css("visibility","hidden"),g.tinymce||d||!(i=c.script_url))1===d?f.push(h):h();else{d=1,j=i.substring(0,i.lastIndexOf("/")),-1!=i.indexOf(".min")&&(m=".min"),g.tinymce=g.tinyMCEPreInit||{base:j,suffix:m},-1!=i.indexOf("gzip")&&(k=c.language||"en",i=i+(/\?/.test(i)?"&":"?")+"js=true&core=true&suffix="+escape(m)+"&themes="+escape(c.theme||"modern")+"&plugins="+escape(c.plugins||"")+"&languages="+(k||""),g.tinyMCE_GZ||(g.tinyMCE_GZ={start:function(){function b(a){tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(a))}b("langs/"+k+".js"),b("themes/"+c.theme+"/theme"+m+".js"),b("themes/"+c.theme+"/langs/"+k+".js"),a.each(c.plugins.split(","),function(a,c){c&&(b("plugins/"+c+"/plugin"+m+".js"),b("plugins/"+c+"/langs/"+k+".js"))})},end:function(){}}));var n=document.createElement("script");n.type="text/javascript",n.onload=n.onreadystatechange=function(b){b=b||window.event,2===d||"load"!=b.type&&!/complete|loaded/.test(n.readyState)||(tinymce.dom.Event.domLoaded=1,d=2,c.script_loaded&&c.script_loaded(),h(),a.each(f,function(a,b){b()}))},n.src=i,document.body.appendChild(n)}return l},a.extend(a.expr[":"],{tinymce:function(a){var b;return!!(a.id&&"tinymce"in window&&(b=tinymce.get(a.id),b&&b.editorManager===tinymce))}})}(jQuery);
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/tinymce/tinymce.min.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 501 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/tinymce/tinymce.min.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 385081 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 385,081 bytes. |
// 4.4.3 (2016-09-01)
!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){var r,i,o,a,l;for(r=0;r<n.length;r++){i=e,o=n[r],a=o.split(/[.\/]/);for(var c=0;c<a.length-1;++c)i[a[c]]===t&&(i[a[c]]={}),i=i[a[c]];i[a[a.length-1]]=s[o]}if(e.AMDLC_TESTS){l=e.privateModules||{};for(o in s)l[o]=s[o];for(r=0;r<n.length;r++)delete l[n[r]];e.privateModules=l}}var s={},l="tinymce/geom/Rect",c="tinymce/util/Promise",u="tinymce/util/Delay",d="tinymce/Env",f="tinymce/dom/EventUtils",h="tinymce/dom/Sizzle",p="tinymce/util/Arr",m="tinymce/util/Tools",g="tinymce/dom/DomQuery",v="tinymce/html/Styles",y="tinymce/dom/TreeWalker",b="tinymce/dom/Range",C="tinymce/html/Entities",x="tinymce/dom/StyleSheetLoader",w="tinymce/dom/DOMUtils",N="tinymce/dom/ScriptLoader",E="tinymce/AddOnManager",_="tinymce/dom/NodeType",S="tinymce/text/Zwsp",k="tinymce/caret/CaretContainer",T="tinymce/dom/RangeUtils",R="tinymce/NodeChange",A="tinymce/html/Node",B="tinymce/html/Schema",D="tinymce/html/SaxParser",L="tinymce/html/DomParser",M="tinymce/html/Writer",P="tinymce/html/Serializer",O="tinymce/dom/Serializer",H="tinymce/dom/TridentSelection",I="tinymce/util/VK",F="tinymce/dom/ControlSelection",z="tinymce/util/Fun",U="tinymce/caret/CaretCandidate",W="tinymce/geom/ClientRect",V="tinymce/text/ExtendingChar",$="tinymce/caret/CaretPosition",q="tinymce/caret/CaretBookmark",j="tinymce/dom/BookmarkManager",Y="tinymce/dom/Selection",X="tinymce/dom/ElementUtils",K="tinymce/fmt/Preview",G="tinymce/fmt/Hooks",J="tinymce/Formatter",Q="tinymce/UndoManager",Z="tinymce/EnterKey",ee="tinymce/ForceBlocks",te="tinymce/caret/CaretUtils",ne="tinymce/caret/CaretWalker",re="tinymce/InsertList",ie="tinymce/InsertContent",oe="tinymce/EditorCommands",ae="tinymce/util/URI",se="tinymce/util/Class",le="tinymce/util/EventDispatcher",ce="tinymce/data/Binding",ue="tinymce/util/Observable",de="tinymce/data/ObservableObject",fe="tinymce/ui/Selector",he="tinymce/ui/Collection",pe="tinymce/ui/DomUtils",me="tinymce/ui/BoxUtils",ge="tinymce/ui/ClassList",ve="tinymce/ui/ReflowQueue",ye="tinymce/ui/Control",be="tinymce/ui/Factory",Ce="tinymce/ui/KeyboardNavigation",xe="tinymce/ui/Container",we="tinymce/ui/DragHelper",Ne="tinymce/ui/Scrollable",Ee="tinymce/ui/Panel",_e="tinymce/ui/Movable",Se="tinymce/ui/Resizable",ke="tinymce/ui/FloatPanel",Te="tinymce/ui/Window",Re="tinymce/ui/MessageBox",Ae="tinymce/WindowManager",Be="tinymce/ui/Tooltip",De="tinymce/ui/Widget",Le="tinymce/ui/Progress",Me="tinymce/ui/Notification",Pe="tinymce/NotificationManager",Oe="tinymce/dom/NodePath",He="tinymce/util/Quirks",Ie="tinymce/EditorObservable",Fe="tinymce/Mode",ze="tinymce/Shortcuts",Ue="tinymce/file/Uploader",We="tinymce/file/Conversions",Ve="tinymce/file/ImageScanner",$e="tinymce/file/BlobCache",qe="tinymce/file/UploadStatus",je="tinymce/EditorUpload",Ye="tinymce/caret/FakeCaret",Xe="tinymce/dom/Dimensions",Ke="tinymce/caret/LineWalker",Ge="tinymce/caret/LineUtils",Je="tinymce/dom/MousePosition",Qe="tinymce/DragDropOverrides",Ze="tinymce/SelectionOverrides",et="tinymce/util/Uuid",tt="tinymce/Editor",nt="tinymce/util/I18n",rt="tinymce/FocusManager",it="tinymce/EditorManager",ot="tinymce/LegacyInput",at="tinymce/util/XHR",st="tinymce/util/JSON",lt="tinymce/util/JSONRequest",ct="tinymce/util/JSONP",ut="tinymce/util/LocalStorage",dt="tinymce/Compat",ft="tinymce/ui/Layout",ht="tinymce/ui/AbsoluteLayout",pt="tinymce/ui/Button",mt="tinymce/ui/ButtonGroup",gt="tinymce/ui/Checkbox",vt="tinymce/ui/ComboBox",yt="tinymce/ui/ColorBox",bt="tinymce/ui/PanelButton",Ct="tinymce/ui/ColorButton",xt="tinymce/util/Color",wt="tinymce/ui/ColorPicker",Nt="tinymce/ui/Path",Et="tinymce/ui/ElementPath",_t="tinymce/ui/FormItem",St="tinymce/ui/Form",kt="tinymce/ui/FieldSet",Tt="tinymce/ui/FilePicker",Rt="tinymce/ui/FitLayout",At="tinymce/ui/FlexLayout",Bt="tinymce/ui/FlowLayout",Dt="tinymce/ui/FormatControls",Lt="tinymce/ui/GridLayout",Mt="tinymce/ui/Iframe",Pt="tinymce/ui/InfoBox",Ot="tinymce/ui/Label",Ht="tinymce/ui/Toolbar",It="tinymce/ui/MenuBar",Ft="tinymce/ui/MenuButton",zt="tinymce/ui/MenuItem",Ut="tinymce/ui/Throbber",Wt="tinymce/ui/Menu",Vt="tinymce/ui/ListBox",$t="tinymce/ui/Radio",qt="tinymce/ui/ResizeHandle",jt="tinymce/ui/SelectBox",Yt="tinymce/ui/Slider",Xt="tinymce/ui/Spacer",Kt="tinymce/ui/SplitButton",Gt="tinymce/ui/StackLayout",Jt="tinymce/ui/TabPanel",Qt="tinymce/ui/TextBox",Zt="tinymce/Register";r(l,[],function(){function e(e,t,n){var r,i,a,s,l,u;return r=t.x,i=t.y,a=e.w,s=e.h,l=t.w,u=t.h,n=(n||"").split(""),"b"===n[0]&&(i+=u),"r"===n[1]&&(r+=l),"c"===n[0]&&(i+=c(u/2)),"c"===n[1]&&(r+=c(l/2)),"b"===n[3]&&(i-=s),"r"===n[4]&&(r-=a),"c"===n[3]&&(i-=c(s/2)),"c"===n[4]&&(r-=c(a/2)),o(r,i,a,s)}function t(t,n,r,i){var o,a;for(a=0;a<i.length;a++)if(o=e(t,n,i[a]),o.x>=r.x&&o.x+o.w<=r.w+r.x&&o.y>=r.y&&o.y+o.h<=r.h+r.y)return i[a];return null}function n(e,t,n){return o(e.x-t,e.y-n,e.w+2*t,e.h+2*n)}function r(e,t){var n,r,i,a;return n=l(e.x,t.x),r=l(e.y,t.y),i=s(e.x+e.w,t.x+t.w),a=s(e.y+e.h,t.y+t.h),0>i-n||0>a-r?null:o(n,r,i-n,a-r)}function i(e,t,n){var r,i,a,s,c,u,d,f,h,p;return c=e.x,u=e.y,d=e.x+e.w,f=e.y+e.h,h=t.x+t.w,p=t.y+t.h,r=l(0,t.x-c),i=l(0,t.y-u),a=l(0,d-h),s=l(0,f-p),c+=r,u+=i,n&&(d+=r,f+=i,c-=a,u-=s),d-=a,f-=s,o(c,u,d-c,f-u)}function o(e,t,n,r){return{x:e,y:t,w:n,h:r}}function a(e){return o(e.left,e.top,e.width,e.height)}var s=Math.min,l=Math.max,c=Math.round;return{inflate:n,relativePosition:e,findBestRelativePosition:t,intersect:r,clamp:i,create:o,fromClientRect:a}}),r(c,[],function(){function e(e,t){return function(){e.apply(t,arguments)}}function t(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(t,e(r,this),e(i,this))}function n(e){var t=this;return null===this._state?void this._deferreds.push(e):void l(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=n(t._value)}catch(i){return void e.reject(i)}e.resolve(r)})}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void s(e(n,t),e(r,this),e(i,this))}this._state=!0,this._value=t,o.call(this)}catch(a){i.call(this,a)}}function i(e){this._state=!1,this._value=e,o.call(this)}function o(){for(var e=0,t=this._deferreds.length;t>e;e++)n.call(this,this._deferreds[e]);this._deferreds=null}function a(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function s(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(i){if(r)return;r=!0,n(i)}}if(window.Promise)return window.Promise;var l=t.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)},c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return t.prototype["catch"]=function(e){return this.then(null,e)},t.prototype.then=function(e,r){var i=this;return new t(function(t,o){n.call(i,new a(e,r,t,o))})},t.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&c(arguments[0])?arguments[0]:arguments);return new t(function(t,n){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},n)}e[o]=a,0===--i&&t(e)}catch(l){n(l)}}if(0===e.length)return t([]);for(var i=e.length,o=0;o<e.length;o++)r(o,e[o])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(t){t(e)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.race=function(e){return new t(function(t,n){for(var r=0,i=e.length;i>r;r++)e[r].then(t,n)})},t}),r(u,[c],function(e){function t(e,t){function n(e){window.setTimeout(e,0)}var r,i=window.requestAnimationFrame,o=["ms","moz","webkit"];for(r=0;r<o.length&&!i;r++)i=window[o[r]+"RequestAnimationFrame"];i||(i=n),i(e,t)}function n(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)}function r(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)}function i(e){return clearTimeout(e)}function o(e){return clearInterval(e)}var a;return{requestAnimationFrame:function(n,r){return a?void a.then(n):void(a=new e(function(e){r||(r=document.body),t(e,r)}).then(n))},setTimeout:n,setInterval:r,setEditorTimeout:function(e,t,r){return n(function(){e.removed||t()},r)},setEditorInterval:function(e,t,n){var i;return i=r(function(){e.removed?clearInterval(i):t()},n)},throttle:function(e,t){var r,i;return i=function(){var i=arguments;clearTimeout(r),r=n(function(){e.apply(this,i)},t)},i.stop=function(){clearTimeout(r)},i},clearInterval:o,clearTimeout:i}}),r(d,[],function(){function e(e){return"matchMedia"in window?matchMedia(e).matches:!1}var t=navigator,n=t.userAgent,r,i,o,a,s,l,c,u,d,f,h,p,m;r=window.opera&&window.opera.buildNumber,d=/Android/.test(n),i=/WebKit/.test(n),o=!i&&!r&&/MSIE/gi.test(n)&&/Explorer/gi.test(t.appName),o=o&&/MSIE (\w+)\./.exec(n)[1],a=-1==n.indexOf("Trident/")||-1==n.indexOf("rv:")&&-1==t.appName.indexOf("Netscape")?!1:11,s=-1==n.indexOf("Edge/")||o||a?!1:12,o=o||a||s,l=!i&&!a&&/Gecko/.test(n),c=-1!=n.indexOf("Mac"),u=/(iPad|iPhone)/.test(n),f="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,h=e("only screen and (max-device-width: 480px)")&&(d||u),p=e("only screen and (min-width: 800px)")&&(d||u),m=-1!=n.indexOf("Windows Phone"),s&&(i=!1);var g=!u||f||n.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:r,webkit:i,ie:o,gecko:l,mac:c,iOS:u,android:d,contentEditable:g,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=o,range:window.getSelection&&"Range"in window,documentMode:o&&!s?document.documentMode||7:10,fileApi:f,ceFalse:o===!1||o>8,canHaveCSP:o===!1||o>11,desktop:!h&&!p,windowsPhone:m}}),r(f,[u,d],function(e,t){function n(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function r(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function i(e,t){var n,r=t;return n=e.path,n&&n.length>0&&(r=n[0]),e.deepPath&&(n=e.deepPath(),n&&n.length>0&&(r=n[0])),r}function o(e,n){function r(){return!1}function o(){return!0}var a,s=n||{},l;for(a in e)u[a]||(s[a]=e[a]);if(s.target||(s.target=s.srcElement||document),t.experimentalShadowDom&&(s.target=i(e,s.target)),e&&c.test(e.type)&&e.pageX===l&&e.clientX!==l){var d=s.target.ownerDocument||document,f=d.documentElement,h=d.body;s.pageX=e.clientX+(f&&f.scrollLeft||h&&h.scrollLeft||0)-(f&&f.clientLeft||h&&h.clientLeft||0),s.pageY=e.clientY+(f&&f.scrollTop||h&&h.scrollTop||0)-(f&&f.clientTop||h&&h.clientTop||0)}return s.preventDefault=function(){s.isDefaultPrevented=o,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},s.stopPropagation=function(){s.isPropagationStopped=o,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},s.stopImmediatePropagation=function(){s.isImmediatePropagationStopped=o,s.stopPropagation()},s.isDefaultPrevented||(s.isDefaultPrevented=r,s.isPropagationStopped=r,s.isImmediatePropagationStopped=r),"undefined"==typeof s.metaKey&&(s.metaKey=!1),s}function a(t,i,o){function a(){o.domLoaded||(o.domLoaded=!0,i(u))}function s(){("complete"===c.readyState||"interactive"===c.readyState&&c.body)&&(r(c,"readystatechange",s),a())}function l(){try{c.documentElement.doScroll("left")}catch(t){return void e.setTimeout(l)}a()}var c=t.document,u={type:"ready"};return o.domLoaded?void i(u):(c.addEventListener?"complete"===c.readyState?a():n(t,"DOMContentLoaded",a):(n(c,"readystatechange",s),c.documentElement.doScroll&&t.self===t.top&&l()),void n(t,"load",a))}function s(){function e(e,t){var n,r,o,a,s=i[t];if(n=s&&s[e.type])for(r=0,o=n.length;o>r;r++)if(a=n[r],a&&a.func.call(a.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var t=this,i={},s,c,u,d,f;c=l+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},s=1,t.domLoaded=!1,t.events=i,t.bind=function(r,l,h,p){function m(t){e(o(t||N.event),g)}var g,v,y,b,C,x,w,N=window;if(r&&3!==r.nodeType&&8!==r.nodeType){for(r[c]?g=r[c]:(g=s++,r[c]=g,i[g]={}),p=p||r,l=l.split(" "),y=l.length;y--;)b=l[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),t.domLoaded&&"ready"===b&&"complete"==r.readyState?h.call(p,o({type:b})):(d||(C=f[b],C&&(x=function(t){var n,r;if(n=t.currentTarget,r=t.relatedTarget,r&&n.contains)r=n.contains(r);else for(;r&&r!==n;)r=r.parentNode;r||(t=o(t||N.event),t.type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=n,e(t,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(t){t=o(t||N.event),t.type="focus"===t.type?"focusin":"focusout",e(t,g)}),v=i[g][b],v?"ready"===b&&t.domLoaded?h({type:b}):v.push({func:h,scope:p}):(i[g][b]=v=[{func:h,scope:p}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?a(r,x,t):n(r,C||b,x,w)));return r=v=0,h}},t.unbind=function(e,n,o){var a,s,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return t;if(a=e[c]){if(f=i[a],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],s=f[d]){if(o)for(u=s.length;u--;)if(s[u].func===o){var h=s.nativeHandler,p=s.fakeName,m=s.capture;s=s.slice(0,u).concat(s.slice(u+1)),s.nativeHandler=h,s.fakeName=p,s.capture=m,f[d]=s}o&&0!==s.length||(delete f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture))}}else{for(d in f)s=f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture);f={}}for(d in f)return t;delete i[a];try{delete e[c]}catch(g){e[c]=null}}return t},t.fire=function(n,r,i){var a;if(!n||3===n.nodeType||8===n.nodeType)return t;i=o(null,i),i.type=r,i.target=n;do a=n[c],a&&e(i,a),n=n.parentNode||n.ownerDocument||n.defaultView||n.parentWindow;while(n&&!i.isPropagationStopped());return t},t.clean=function(e){var n,r,i=t.unbind;if(!e||3===e.nodeType||8===e.nodeType)return t;if(e[c]&&i(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(i(e),r=e.getElementsByTagName("*"),n=r.length;n--;)e=r[n],e[c]&&i(e);return t},t.destroy=function(){i={}},t.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var l="mce-data-",c=/^(?:mouse|contextmenu)|click/,u={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1};return s.Event=new s,s.Event.bind(window,"ready",function(){}),s}),r(h,[],function(){function e(e,t,n,r){var i,o,a,s,l,c,d,h,p,m;if((t?t.ownerDocument||t:z)!==D&&B(t),t=t||D,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(M&&!r){if(i=ve.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&I(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&x.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(x.qsa&&(!P||!P.test(e))){if(h=d=F,p=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=_(e),(d=t.getAttribute("id"))?h=d.replace(be,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=c.length;l--;)c[l]=h+f(c[l]);p=ye.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return Z.apply(n,p.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return k(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>w.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[F]=!0,e}function i(e){var t=D.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||X)-(~e.sourceIndex||X);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&typeof e.getElementsByTagName!==Y&&e}function d(){}function f(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[U,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[F]||(t[F]={}),(s=l[r])&&s[0]===U&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),c&&t.push(s)));return a}function v(e,t,n,i,o,a){return i&&!i[F]&&(i=v(i)),o&&!o[F]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,f=[],h=[],p=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,f,e,s,l),b=n?o||(r?e:p||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[h[u]]=!(y[h[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?te.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(p,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return te.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==T)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=w.relative[e[s].type])u=[h(p(u),n)];else{if(n=w.filter[e[s].type].apply(null,e[s].matches),n[F]){for(r=++s;i>r&&!w.relative[e[r].type];r++);return v(s>1&&p(u),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&f(e))}u.push(n)}return p(u)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,s,l,c){var u,d,f,h=0,p="0",m=r&&[],v=[],y=T,b=r||o&&w.find.TAG("*",c),C=U+=null==y?1:Math.random()||.1,x=b.length;for(c&&(T=a!==D&&a);p!==x&&null!=(u=b[p]);p++){if(o&&u){for(d=0;f=t[d++];)if(f(u,a,s)){l.push(u);break}c&&(U=C)}i&&((u=!f&&u)&&h--,r&&m.push(u))}if(h+=p,i&&p!==h){for(d=0;f=n[d++];)f(m,v,a,s);if(r){if(h>0)for(;p--;)m[p]||v[p]||(v[p]=J.call(l));v=g(v)}Z.apply(l,v),c&&!r&&v.length>0&&h+n.length>1&&e.uniqueSort(l)}return c&&(U=C,T=y),m};return i?r(a):a}var C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F="sizzle"+-new Date,z=window.document,U=0,W=0,V=n(),$=n(),q=n(),j=function(e,t){return e===t&&(A=!0),0},Y=typeof t,X=1<<31,K={}.hasOwnProperty,G=[],J=G.pop,Q=G.push,Z=G.push,ee=G.slice,te=G.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},ne="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",re="[\\x20\\t\\r\\n\\f]",ie="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",oe="\\["+re+"*("+ie+")(?:"+re+"*([*^$|!~]?=)"+re+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+re+"*\\]",ae=":("+ie+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp("^"+re+"+|((?:^|[^\\\\])(?:\\\\.)*)"+re+"+$","g"),le=new RegExp("^"+re+"*,"+re+"*"),ce=new RegExp("^"+re+"*([>+~]|"+re+")"+re+"*"),ue=new RegExp("="+re+"*([^\\]'\"]*?)"+re+"*\\]","g"),de=new RegExp(ae),fe=new RegExp("^"+ie+"$"),he={ID:new RegExp("^#("+ie+")"),CLASS:new RegExp("^\\.("+ie+")"),TAG:new RegExp("^("+ie+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+re+"*(even|odd|(([+-]|)(\\d*)n|)"+re+"*(?:([+-]|)"+re+"*(\\d+)|))"+re+"*\\)|)","i"),bool:new RegExp("^(?:"+ne+")$","i"),needsContext:new RegExp("^"+re+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+re+"*((?:-\\d)?\\d*)"+re+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ge=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,be=/'|\\/g,Ce=new RegExp("\\\\([\\da-f]{1,6}"+re+"?|("+re+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Z.apply(G=ee.call(z.childNodes),z.childNodes),G[z.childNodes.length].nodeType}catch(we){Z={apply:G.length?function(e,t){Q.apply(e,ee.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}x=e.support={},E=e.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},B=e.setDocument=function(e){function t(e){try{return e.top}catch(t){}return null}var n,r=e?e.ownerDocument||e:z,o=r.defaultView;return r!==D&&9===r.nodeType&&r.documentElement?(D=r,L=r.documentElement,M=!E(r),o&&o!==t(o)&&(o.addEventListener?o.addEventListener("unload",function(){B()},!1):o.attachEvent&&o.attachEvent("onunload",function(){B()})),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=ge.test(r.getElementsByClassName),x.getById=i(function(e){return L.appendChild(e).id=F,!r.getElementsByName||!r.getElementsByName(F).length}),x.getById?(w.find.ID=function(e,t){if(typeof t.getElementById!==Y&&M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){return e.getAttribute("id")===t}}):(delete w.find.ID,w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),w.find.TAG=x.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Y?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=x.getElementsByClassName&&function(e,t){return M?t.getElementsByClassName(e):void 0},O=[],P=[],(x.qsa=ge.test(r.querySelectorAll))&&(i(function(e){e.innerHTML="<select msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+re+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||P.push("\\["+re+"*(?:value|"+ne+")"),e.querySelectorAll(":checked").length||P.push(":checked")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&P.push("name"+re+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||P.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),P.push(",.*:")})),(x.matchesSelector=ge.test(H=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){x.disconnectedMatch=H.call(e,"div"),H.call(e,"[s!='']:x"),O.push("!=",ae)}),P=P.length&&new RegExp(P.join("|")),O=O.length&&new RegExp(O.join("|")),n=ge.test(L.compareDocumentPosition),I=n||ge.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},j=n?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===z&&I(z,e)?-1:t===r||t.ownerDocument===z&&I(z,t)?1:R?te.call(R,e)-te.call(R,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:R?te.call(R,e)-te.call(R,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===z?-1:c[i]===z?1:0},r):D},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==D&&B(t),n=n.replace(ue,"='$1']"),x.matchesSelector&&M&&(!O||!O.test(n))&&(!P||!P.test(n)))try{var r=H.call(t,n);if(r||x.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,D,null,[t]).length>0},e.contains=function(e,t){return(e.ownerDocument||e)!==D&&B(e),I(e,t)},e.attr=function(e,n){(e.ownerDocument||e)!==D&&B(e);var r=w.attrHandle[n.toLowerCase()],i=r&&K.call(w.attrHandle,n.toLowerCase())?r(e,n,!M):t;return i!==t?i:x.attributes||!M?e.getAttribute(n):(i=e.getAttributeNode(n))&&i.specified?i.value:null},e.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},e.uniqueSort=function(e){var t,n=[],r=0,i=0;if(A=!x.detectDuplicates,R=!x.sortStable&&e.slice(0),e.sort(j),A){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return R=null,e},N=e.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=N(t);return n},w=e.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ce,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(Ce,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=_(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ce,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+re+")"+e+"("+re+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,h,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(u=g[F]||(g[F]={}),c=u[e]||[],h=c[0]===U&&c[1],f=c[0]===U&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(f=h=0)||p.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[U,h,f];break}}else if(y&&(c=(t[F]||(t[F]={}))[e])&&c[0]===U)f=c[1];else for(;(d=++h&&d&&d[m]||(f=h=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[F]||(d[F]={}))[e]=[U,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(t,n){var i,o=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[F]?o(n):o.length>1?(i=[t,t,"",n],w.setFilters.hasOwnProperty(t.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=te.call(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=S(e.replace(se,"$1"));return i[F]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(e){return e=e.replace(Ce,xe),function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(t){return fe.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(Ce,xe).toLowerCase(),function(e){var n;do if(n=M?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}},w.pseudos.nth=w.pseudos.eq;for(C in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})w.pseudos[C]=s(C);for(C in{submit:!0,reset:!0})w.pseudos[C]=l(C);return d.prototype=w.filters=w.pseudos,w.setFilters=new d,_=e.tokenize=function(t,n){var r,i,o,a,s,l,c,u=$[t+" "];if(u)return n?0:u.slice(0);for(s=t,l=[],c=w.preFilter;s;){r&&!(i=le.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=ce.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(se," ")}),s=s.slice(r.length));for(a in w.filter)!(i=he[a].exec(s))||c[a]&&!(i=c[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?e.error(t):$(t,l).slice(0)},S=e.compile=function(e,t){var n,r=[],i=[],o=q[e+" "];if(!o){for(t||(t=_(e)),n=t.length;n--;)o=y(t[n]),o[F]?r.push(o):i.push(o);o=q(e,b(i,r)),o.selector=e}return o},k=e.select=function(e,t,n,r){var i,o,a,s,l,c="function"==typeof e&&e,d=!r&&_(e=c.selector||e);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&x.getById&&9===t.nodeType&&M&&w.relative[o[1].type]){if(t=(w.find.ID(a.matches[0].replace(Ce,xe),t)||[])[0], !t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=he.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((l=w.find[s])&&(r=l(a.matches[0].replace(Ce,xe),ye.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&f(o),!e)return Z.apply(n,r),n;break}}return(c||S(e,d))(r,t,!M,n,ye.test(e)&&u(t.parentNode)||t),n},x.sortStable=F.split("").sort(j).join("")===F,x.detectDuplicates=!!A,B(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(ne,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),e}),r(p,[],function(){function e(e){var t=e,n,r;if(!u(e))for(t=[],n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function n(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function r(e,t){var r=[];return n(e,function(n,i){r.push(t(n,i,e))}),r}function i(e,t){var r=[];return n(e,function(n,i){t&&!t(n,i,e)||r.push(n)}),r}function o(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function a(e,t,n,r){var i=0;for(arguments.length<3&&(n=e[0]);i<e.length;i++)n=t.call(r,n,e[i],i);return n}function s(e,t,n){var r,i;for(r=0,i=e.length;i>r;r++)if(t.call(n,e[r],r,e))return r;return-1}function l(e,n,r){var i=s(e,n,r);return-1!==i?e[i]:t}function c(e){return e[e.length-1]}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{isArray:u,toArray:e,each:n,map:r,filter:i,indexOf:o,reduce:a,findIndex:s,find:l,last:c}}),r(m,[d,p],function(e,n){function r(e){return null===e||e===t?"":(""+e).replace(h,"")}function i(e,r){return r?"array"==r&&n.isArray(e)?!0:typeof e==r:e!==t}function o(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function a(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],c?o[a]=function(){return i[s].apply(this,arguments)}:o[a]=function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function s(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function l(e,t,r,i){i=i||this,e&&(r&&(e=e[r]),n.each(e,function(e,n){return t.call(i,e,n,r)===!1?!1:void l(e,t,r,i)}))}function c(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)r=e[n],t[r]||(t[r]={}),t=t[r];return t}function u(e,t){var n,r;for(t=t||window,e=e.split("."),n=0,r=e.length;r>n&&(t=t[e[n]],t);n++);return t}function d(e,t){return!e||i(e,"array")?e:n.map(e.split(t||","),r)}function f(t){var n=e.cacheSuffix;return n&&(t+=(-1===t.indexOf("?")?"?":"&")+n),t}var h=/^\s*|\s*$/g;return{trim:r,isArray:n.isArray,is:i,toArray:n.toArray,makeMap:o,each:n.each,map:n.map,grep:n.filter,inArray:n.indexOf,extend:s,create:a,walk:l,createNS:c,resolve:u,explode:d,_addCacheSuffix:f}}),r(g,[f,h,m,d],function(e,n,r,i){function o(e){return"undefined"!=typeof e}function a(e){return"string"==typeof e}function s(e){return e&&e==e.window}function l(e,t){var n,r,i;for(t=t||w,i=t.createElement("div"),n=t.createDocumentFragment(),i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return n}function c(e,t,n,r){var i;if(a(t))t=l(t,v(e[0]));else if(t.length&&!t.nodeType){if(t=f.makeArray(t),r)for(i=t.length-1;i>=0;i--)c(e,t[i],n,r);else for(i=0;i<t.length;i++)c(e,t[i],n,r);return e}if(t.nodeType)for(i=e.length;i--;)n.call(e[i],t);return e}function u(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")}function d(e,t,n){var r,i;return t=f(t)[0],e.each(function(){var e=this;n&&r==e.parentNode?i.appendChild(e):(r=e.parentNode,i=t.cloneNode(!1),e.parentNode.insertBefore(i,e),i.appendChild(e))}),e}function f(e,t){return new f.fn.init(e,t)}function h(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1}function p(e){return null===e||e===k?"":(""+e).replace(P,"")}function m(e,t){var n,r,i,o,a;if(e)if(n=e.length,n===o){for(r in e)if(e.hasOwnProperty(r)&&(a=e[r],t.call(a,r,a)===!1))break}else for(i=0;n>i&&(a=e[i],t.call(a,i,a)!==!1);i++);return e}function g(e,t){var n=[];return m(e,function(e,r){t(r,e)&&n.push(r)}),n}function v(e){return e?9==e.nodeType?e:e.ownerDocument:w}function y(e,n,r){var i=[],o=e[n];for("string"!=typeof r&&r instanceof f&&(r=r[0]);o&&9!==o.nodeType;){if(r!==t){if(o===r)break;if("string"==typeof r&&f(o).is(r))break}1===o.nodeType&&i.push(o),o=o[n]}return i}function b(e,n,r,i){var o=[];for(i instanceof f&&(i=i[0]);e;e=e[n])if(!r||e.nodeType===r){if(i!==t){if(e===i)break;if("string"==typeof i&&f(e).is(i))break}o.push(e)}return o}function C(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType==n)return e;return null}function x(e,t,n){m(n,function(n,r){e[n]=e[n]||{},e[n][t]=r})}var w=document,N=Array.prototype.push,E=Array.prototype.slice,_=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,S=e.Event,k,T=r.makeMap("children,contents,next,prev"),R=r.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),A=r.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),B={"for":"htmlFor","class":"className",readonly:"readOnly"},D={"float":"cssFloat"},L={},M={},P=/^\s*|\s*$/g;return f.fn=f.prototype={constructor:f,selector:"",context:null,length:0,init:function(e,t){var n=this,r,i;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(t&&t.nodeType)n.context=t;else{if(t)return f(e).attr(t);n.context=t=document}if(a(e)){if(n.selector=e,r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:_.exec(e),!r)return f(t).find(e);if(r[1])for(i=l(e,v(t)).firstChild;i;)N.call(n,i),i=i.nextSibling;else{if(i=v(t).getElementById(r[2]),!i)return n;if(i.id!==r[2])return n.find(e);n.length=1,n[0]=i}}else this.add(e,!1);return n},toArray:function(){return r.toArray(this)},add:function(e,t){var n=this,r,i;if(a(e))return n.add(f(e));if(t!==!1)for(r=f.unique(n.toArray().concat(f.makeArray(e))),n.length=r.length,i=0;i<r.length;i++)n[i]=r[i];else N.apply(n,f.makeArray(e));return n},attr:function(e,t){var n=this,r;if("object"==typeof e)m(e,function(e,t){n.attr(e,t)});else{if(!o(t)){if(n[0]&&1===n[0].nodeType){if(r=L[e],r&&r.get)return r.get(n[0],e);if(A[e])return n.prop(e)?e:k;t=n[0].getAttribute(e,2),null===t&&(t=k)}return t}this.each(function(){var n;if(1===this.nodeType){if(n=L[e],n&&n.set)return void n.set(this,t);null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2)}})}return n},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if(e=B[e]||e,"object"==typeof e)m(e,function(e,t){n.prop(e,t)});else{if(!o(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1==this.nodeType&&(this[e]=t)})}return n},css:function(e,t){function n(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})}function r(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})}var i=this,a,s;if("object"==typeof e)m(e,function(e,t){i.css(e,t)});else if(o(t))e=n(e),"number"!=typeof t||R[e]||(t+="px"),i.each(function(){var n=this.style;if(s=M[e],s&&s.set)return void s.set(this,t);try{this.style[D[e]||e]=t}catch(i){}null!==t&&""!==t||(n.removeProperty?n.removeProperty(r(e)):n.removeAttribute(e))});else{if(a=i[0],s=M[e],s&&s.get)return s.get(a);if(a.ownerDocument.defaultView)try{return a.ownerDocument.defaultView.getComputedStyle(a,null).getPropertyValue(r(e))}catch(l){return k}else if(a.currentStyle)return a.currentStyle[n(e)]}return i},remove:function(){for(var e=this,t,n=this.length;n--;)t=e[n],S.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var e=this,t,n=this.length;n--;)for(t=e[n];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(e){var t=this,n;if(o(e)){n=t.length;try{for(;n--;)t[n].innerHTML=e}catch(r){f(t[n]).empty().append(e)}return t}return t[0]?t[0].innerHTML:""},text:function(e){var t=this,n;if(o(e)){for(n=t.length;n--;)"innerText"in t[n]?t[n].innerText=e:t[0].textContent=e;return t}return t[0]?t[0].innerText||t[0].textContent:""},append:function(){return c(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return c(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){var e=this;return e[0]&&e[0].parentNode?c(e,arguments,function(e){this.parentNode.insertBefore(e,this)}):e},after:function(){var e=this;return e[0]&&e[0].parentNode?c(e,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):e},appendTo:function(e){return f(e).append(this),this},prependTo:function(e){return f(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return d(this,e)},wrapAll:function(e){return d(this,e,!0)},wrapInner:function(e){return this.each(function(){f(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){f(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),f(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return"string"!=typeof e?n:(-1!==e.indexOf(" ")?m(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(n,r){var i,o;o=u(r,e),o!==t&&(i=r.className,o?r.className=p((" "+i+" ").replace(" "+e+" "," ")):r.className+=i?" "+e:e)}),n)},hasClass:function(e){return u(this[0],e)},each:function(e){return m(this,e)},on:function(e,t){return this.each(function(){S.bind(this,e,t)})},off:function(e,t){return this.each(function(){S.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?S.fire(this,e.type,e):S.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new f(E.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;n>t;t++)f.find(e,this[t],r);return f(r)},filter:function(e){return f("function"==typeof e?g(this.toArray(),function(t,n){return e(n,t)}):f.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof f&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&f(r).is(e)){t.push(r);break}if(r==e){t.push(r);break}r=r.parentNode}}),f(t)},offset:function(e){var t,n,r,i=0,o=0,a;return e?this.css(e):(t=this[0],t&&(n=t.ownerDocument,r=n.documentElement,t.getBoundingClientRect&&(a=t.getBoundingClientRect(),i=a.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,o=a.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:o})},push:N,sort:[].sort,splice:[].splice},r.extend(f,{extend:r.extend,makeArray:function(e){return s(e)||e.nodeType?[e]:r.toArray(e)},inArray:h,isArray:r.isArray,each:m,trim:p,grep:g,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,contains:n.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!=t[r].nodeType&&t.splice(r,1);return t=1===t.length?f.find.matchesSelector(t[0],e)?[t[0]]:[]:f.find.matches(e,t)}}),m({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return y(e,"parentNode")},next:function(e){return C(e,"nextSibling",1)},prev:function(e){return C(e,"previousSibling",1)},children:function(e){return b(e.firstChild,"nextSibling",1)},contents:function(e){return r.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){f.fn[e]=function(n){var r=this,i=[];return r.each(function(){var e=t.call(i,this,n,i);e&&(f.isArray(e)?i.push.apply(i,e):i.push(e))}),this.length>1&&(T[e]||(i=f.unique(i)),0===e.indexOf("parents")&&(i=i.reverse())),i=f(i),n?i.filter(n):i}}),m({parentsUntil:function(e,t){return y(e,"parentNode",t)},nextUntil:function(e,t){return b(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return b(e,"previousSibling",1,t).slice(1)}},function(e,t){f.fn[e]=function(n,r){var i=this,o=[];return i.each(function(){var e=t.call(o,this,n,o);e&&(f.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=f.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse())),o=f(o),r?o.filter(r):o}}),f.fn.is=function(e){return!!e&&this.filter(e).length>0},f.fn.init.prototype=f.fn,f.overrideDefaults=function(e){function t(r,i){return n=n||e(),0===arguments.length&&(r=n.element),i||(i=n.context),new t.fn.init(r,i)}var n;return f.extend(t,this),t},i.ie&&i.ie<8&&(x(L,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?k:t},size:function(e){var t=e.size;return 20===t?k:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?k:t}}),x(L,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),i.ie&&i.ie<9&&(D["float"]="styleFloat",x(M,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),f.attrHooks=L,f.cssHooks=M,f}),r(v,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d,f,h="\ufeff";for(e=e||{},t&&(d=t.getValidStyles(),f=t.getInvalidStyles()),u=("\\\" \\' \\; \\: ; : "+h).split(" "),l=0;l<u.length;l++)c[u[l]]=h+l,c[h+l]=u[l];return{toHex:function(e){return e.replace(r,n)},parse:function(t){function s(e,t,n){var r,i,o,a;if(r=m[e+"-top"+t],r&&(i=m[e+"-right"+t],i&&(o=m[e+"-bottom"+t],o&&(a=m[e+"-left"+t])))){var s=[r,i,o,a];for(l=s.length-1;l--&&s[l]===s[l+1];);l>-1&&n||(m[e+t]=-1==l?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}}function u(e){var t=m[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return m[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}function f(e){return b=!0,c[e]}function h(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function p(t,n,r,i,o,a){if(o=o||a)return o=h(o),"'"+o.replace(/\'/g,"\\'")+"'";if(n=h(n||r||i),!e.allow_script_urls){var s=n.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(s))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"}var m={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),y=y.replace(/\\[0-9a-f]+/g,function(e){return String.fromCharCode(parseInt(e.substr(1),16))}),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(|\/\*|\*\//.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":"color"!==v&&"background-color"!==v||(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,p),m[v]=b?h(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(e,t){function n(t){var n,r,o,a;if(n=d[t])for(r=0,o=n.length;o>r;r++)t=n[r],a=e[t],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+t+": "+a+";")}function r(e,t){var n;return n=f["*"],n&&n[e]?!1:(n=f[t],!n||!n[e])}var i="",o,a;if(t&&d)n("*"),n(t);else for(o in e)a=e[o],a!==s&&a.length>0&&(f&&!r(o,t)||(i+=(i.length>0?" ":"")+o+": "+a+";"));return i}}}}),r(y,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}function r(e,n,r,i){var o,a,s;if(e){if(o=e[r],t&&o===t)return;if(o){if(!i)for(s=o[n];s;s=s[n])if(!s[n])return s;return o}if(a=e.parentNode,a&&a!==t)return a}}var i=e;this.current=function(){return i},this.next=function(e){return i=n(i,"firstChild","nextSibling",e)},this.prev=function(e){return i=n(i,"lastChild","previousSibling",e)},this.prev2=function(e){return i=r(i,"lastChild","previousSibling",e)}}}),r(b,[m],function(e){function t(n){function r(){return P.createDocumentFragment()}function i(e,t){N(F,e,t)}function o(e,t){N(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(M[V]=M[W],M[$]=M[U]):(M[W]=M[V],M[U]=M[$]),M.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function h(e,t){var n=M[W],r=M[U],i=M[V],o=M[$],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function p(){E(I)}function m(){return E(O)}function g(){return E(H)}function v(e){var t=this[W],r=this[U],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=M.extractContents();M.insertNode(e),e.appendChild(t),M.selectNode(e)}function b(){return q(new t(n),{startContainer:M[W],startOffset:M[U],endContainer:M[V],endOffset:M[$],collapsed:M.collapsed,commonAncestorContainer:M.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return M[W]==M[V]&&M[U]==M[$]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function N(e,t,r){var i,o;for(e?(M[W]=t,M[U]=r):(M[V]=t,M[$]=r),i=M[V];i.parentNode;)i=i.parentNode;for(o=M[W];o.parentNode;)o=o.parentNode;o==i?w(M[W],M[U],M[V],M[$])>0&&M.collapse(e):M.collapse(e),M.collapsed=x(),M.commonAncestorContainer=n.findCommonAncestor(M[W],M[V])}function E(e){var t,n=0,r=0,i,o,a,s,l,c;if(M[W]==M[V])return _(e);for(t=M[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[W])return S(t,e);++n}for(t=M[W],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[V])return k(t,e);++r}for(o=r-n,a=M[W];o>0;)a=a.parentNode,o--;for(s=M[V];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function _(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),M[U]==M[$])return t;if(3==M[W].nodeType){if(n=M[W].nodeValue,i=n.substring(M[U],M[$]),e!=H&&(o=M[W],c=M[U],u=M[$]-M[U],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),M.collapse(F)),e==I)return;return i.length>0&&t.appendChild(P.createTextNode(i)),t}for(o=C(M[W],M[U]),a=M[$]-M[U];o&&a>0;)s=o.nextSibling,l=D(o,e),t&&t.appendChild(l),--a,o=s;return e!=H&&M.collapse(F),t}function S(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-M[U],0>=a)return t!=H&&(M.setEndBefore(e),M.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=D(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=H&&(M.setEndBefore(e),M.collapse(z)),n}function k(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=M[$]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=D(o,t),n&&n.appendChild(l),--a,o=s;return t!=H&&(M.setStartAfter(e),M.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=D(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=H&&(M.setStartAfter(e),M.collapse(F)),o}function R(e,t){var n=C(M[V],M[$]-1),r,i,o,a,s,l=n!=M[V];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(M[W],M[U]),r=n!=M[W],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return D(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=M[U],a=o.substring(l),s=o.substring(0,l)):(l=M[$],a=o.substring(0,l),s=o.substring(l)),i!=H&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function D(e,t){return t!=I?t==H?n.clone(e,F):e:void e.parentNode.removeChild(e)}function L(){return n.create("body",null,g()).outerText}var M=this,P=n.doc,O=0,H=1,I=2,F=!0,z=!1,U="startOffset",W="startContainer",V="endContainer",$="endOffset",q=e.extend,j=n.nodeIndex;return q(M,{startContainer:P,startOffset:0,endContainer:P,endOffset:0,collapsed:F,commonAncestorContainer:P,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:h,deleteContents:p,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:L}),M}return t.prototype.toString=function(){return this.toStringIE()},t}),r(C,[m],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),o[r]||(i="&"+e[n+1]+";",a[r]=i,a[i]=r);return a}}var r=e.makeMap,i,o,a,s=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n){return n?(n="x"===n.charAt(0).toLowerCase()?parseInt(n.substr(1),16):parseInt(n,10),n>65535?(n-=65536,String.fromCharCode(55296+(n>>10),56320+(1023&n))):d[n]||String.fromCharCode(n)):a[e]||i[e]||t(e)})}};return f}),r(x,[m,u],function(e,t){return function(n,r){function i(e){n.getElementsByTagName("head")[0].appendChild(e)}function o(r,o,c){function u(){for(var e=b.passed,t=e.length;t--;)e[t]();b.status=2,b.passed=[],b.failed=[]}function d(){for(var e=b.failed,t=e.length;t--;)e[t]();b.status=3,b.passed=[],b.failed=[]}function f(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function h(e,n){e()||((new Date).getTime()-y<l?t.setTimeout(n):d())}function p(){h(function(){for(var e=n.styleSheets,t,r=e.length,i;r--;)if(t=e[r],i=t.ownerNode?t.ownerNode:t.owningElement,i&&i.id===g.id)return u(),!0},p)}function m(){h(function(){try{var e=v.sheet.cssRules;return u(),!!e}catch(t){}},m)}var g,v,y,b;if(r=e._addCacheSuffix(r),s[r]?b=s[r]:(b={passed:[],failed:[]},s[r]=b),o&&b.passed.push(o),c&&b.failed.push(c),1!=b.status){if(2==b.status)return void u();if(3==b.status)return void d();if(b.status=1,g=n.createElement("link"),g.rel="stylesheet",g.type="text/css",g.id="u"+a++,g.async=!1,g.defer=!1,y=(new Date).getTime(),"onload"in g&&!f())g.onload=p,g.onerror=d;else{if(navigator.userAgent.indexOf("Firefox")>0)return v=n.createElement("style"),v.textContent='@import "'+r+'"',m(),void i(v);p()}i(g),g.href=r}}var a=0,s={},l;r=r||{},l=r.maxLoadTime||5e3,this.load=o}}),r(w,[h,g,v,f,y,b,C,d,m,x],function(e,n,r,i,o,a,s,l,c,u){function d(e,t){var n={},r=t.keep_values,i;return i={set:function(n,r,i){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||e,r,i,n[0])),n.attr("data-mce-"+i,r).attr(i,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},n={style:{set:function(e,t){return null!==t&&"object"==typeof t?void e.css(t):(r&&e.attr("data-mce-style",t),void e.attr("style",t))},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serializeStyle(e.parseStyle(n),t[0].nodeName)}}},r&&(n.href=n.src=i),n}function f(e,t){var n=t.attr("style");n=e.serializeStyle(e.parseStyle(n),t[0].nodeName),n||(n=null),t.attr("data-mce-style",n)}function h(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n}function p(e,t){var o=this,a;o.doc=e,o.win=window,o.files={},o.counter=0,o.stdMode=!b||e.documentMode>=8,o.boxModel=!b||"CSS1Compat"==e.compatMode||o.stdMode,o.styleSheetLoader=new u(e),o.boundEvents=[],o.settings=t=t||{},o.schema=t.schema,o.styles=new r({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),o.fixDoc(e),o.events=t.ownEvents?new i(t.proxy):i.Event,o.attrHooks=d(o,t),a=t.schema?t.schema.getBlockElements():{},o.$=n.overrideDefaults(function(){return{context:e,element:o.getRoot()}}),o.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!a[e.nodeName]):!!a[e]}}var m=c.each,g=c.is,v=c.grep,y=c.trim,b=l.ie,C=/^([a-z0-9],?)+$/i,x=/^[ \t\r\n]*$/;return p.prototype={$$:function(e){return"string"==typeof e&&(e=this.get(e)),this.$(e)},root:null,fixDoc:function(e){var t=this.settings,n;if(b&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!b||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.settings.root_element||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),g(n,"string")&&(a=n, n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.settings.root_element||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(C.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=g(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&"undefined"!=typeof t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"</"+e+">":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return e=this.$$(e),t?e.each(function(){for(var e;e=this.firstChild;)3==e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():e.remove(),e.length>1?e.toArray():e[0]},setStyle:function(e,t,n){e=this.$$(e).css(t,n),this.settings.update_styles&&f(this,e)},getStyle:function(e,n,r){return e=this.$$(e),r?e.css(n):(n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=l.ie&&l.ie<12?"styleFloat":"cssFloat"),e[0]&&e[0].style?e[0].style[n]:t)},setStyles:function(e,t){e=this.$$(e).css(t),this.settings.update_styles&&f(this,e)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this,i,o,a=r.settings;""===n&&(n=null),e=r.$$(e),i=e.attr(t),e.length&&(o=r.attrHooks[t],o&&o.set?o.set(e,n,t):e.attr(t,n),i!=n&&a.onSetAttrib&&a.onSetAttrib({attrElm:e,attrName:t,attrValue:n}))},setAttribs:function(e,t){var n=this;n.$$(e).each(function(e,r){m(t,function(e,t){n.setAttrib(r,t,e)})})},getAttrib:function(e,t,n){var r=this,i,o;return e=r.$$(e),e.length&&(i=r.attrHooks[t],o=i&&i.get?i.get(e,t):e.attr(t)),"undefined"==typeof o&&(o=n||""),o},getPos:function(e,t){var r=this,i=0,o=0,a,s=r.doc,l=s.body,c;if(e=r.get(e),t=t||l,e){if(t===l&&e.getBoundingClientRect&&"static"===n(l).css("position"))return c=e.getBoundingClientRect(),t=r.boxModel?s.documentElement:l,i=c.left+(s.documentElement.scrollLeft||l.scrollLeft)-t.clientLeft,o=c.top+(s.documentElement.scrollTop||l.scrollTop)-t.clientTop,{x:i,y:o};for(a=e;a&&a!=t&&a.nodeType;)i+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=e.parentNode;a&&a!=t&&a.nodeType;)i-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode}return{x:i,y:o}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==p.DOM&&n===document){var o=p.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,p.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==p.DOM&&n===document?void p.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void m(e.split(","),function(e){var i;e=c._addCacheSuffix(e),t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),b&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){this.$$(e).addClass(t)},removeClass:function(e,t){this.toggleClass(e,t,!1)},hasClass:function(e,t){return this.$$(e).hasClass(t)},toggleClass:function(e,t,r){this.$$(e).toggleClass(t,r).each(function(){""===this.className&&n(this).attr("class",null)})},show:function(e){this.$$(e).show()},hide:function(e){this.$$(e).hide()},isHidden:function(e){return"none"==this.$$(e).css("display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){e=this.$$(e),b?e.each(function(e,r){if(r.canHaveHTML!==!1){for(;r.firstChild;)r.removeChild(r.firstChild);try{r.innerHTML="<br>"+t,r.removeChild(r.firstChild)}catch(i){n("<div>").html("<br>"+t).contents().slice(1).appendTo(r)}return t}}):e.html(t)},getOuterHTML:function(e){return e=this.get(e),1==e.nodeType&&"outerHTML"in e?e.outerHTML:n("<div>").append(n(e).clone()).html()},setOuterHTML:function(e,t){var r=this;r.$$(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}r.remove(n(this).html(t),!0)})},decode:s.decode,encode:s.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return g(t,"array")&&(e=e.cloneNode(!0)),n&&m(v(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(c.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],m(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(b){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,i,a,s,l,c=0;if(e=e.firstChild){s=new o(e,e.parentNode),t=t||(n.schema?n.schema.getNonEmptyElements():null);do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(i=n.getAttribs(e),r=i.length;r--;)if(l=i[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!x.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new a(this)},nodeIndex:h,split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=y(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.insertBefore(n,e):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(c.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(c.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return e&&1==e.nodeType?(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null):null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&(n=this.getContentEditable(e),null===n);e=e.parentNode);return n},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},p.DOM=new p(document),p.nodeIndex=h,p}),r(N,[w,m],function(e,t){function n(){function e(e,n){function i(){a.remove(l),s&&(s.onreadystatechange=s.onload=s=null),n()}function o(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var a=r,s,l;l=a.uniqueId(),s=document.createElement("script"),s.id=l,s.type="text/javascript",s.src=t._addCacheSuffix(e),"onreadystatechange"in s?s.onreadystatechange=function(){/loaded|complete/.test(s.readyState)&&i()}:s.onload=i,s.onerror=o,(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}var n=0,a=1,s=2,l={},c=[],u={},d=[],f=0,h;this.isDone=function(e){return l[e]==s},this.markDone=function(e){l[e]=s},this.add=this.load=function(e,t,r){var i=l[e];i==h&&(c.push(e),l[e]=n),t&&(u[e]||(u[e]=[]),u[e].push({func:t,scope:r||this}))},this.remove=function(e){delete l[e],delete u[e]},this.loadQueue=function(e,t){this.loadScripts(c,e,t)},this.loadScripts=function(t,n,r){function c(e){i(u[e],function(e){e.func.call(e.scope)}),u[e]=h}var p;d.push({func:n,scope:r||this}),(p=function(){var n=o(t);t.length=0,i(n,function(t){return l[t]==s?void c(t):void(l[t]!=a&&(l[t]=a,f++,e(t,function(){l[t]=s,f--,c(t),p()})))}),f||(i(d,function(e){e.func.call(e.scope)}),d.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(E,[N,m],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){var i=r.language;if(i&&r.languageLoad!==!1){if(n)if(n=","+n+",",-1!=n.indexOf(","+i.substr(0,2)+","))i=i.substr(0,2);else if(-1==n.indexOf(","+i+","))return;e.ScriptLoader.add(this.urls[t]+"/langs/"+i+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},remove:function(e){delete this.urls[e],delete this.lookup[e]},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&(s?a.call(s):a.call(e))}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(_,[],function(){function e(e){return function(t){return!!t&&t.nodeType==e}}function t(e){return e=e.toLowerCase().split(" "),function(t){var n,r;if(t&&t.nodeType)for(r=t.nodeName.toLowerCase(),n=0;n<e.length;n++)if(r===e[n])return!0;return!1}}function n(e,t){return t=t.toLowerCase().split(" "),function(n){var r,i;if(s(n))for(r=0;r<t.length;r++)if(i=getComputedStyle(n,null).getPropertyValue(e),i===t[r])return!0;return!1}}function r(e,t){return function(n){return s(n)&&n[e]===t}}function i(e,t){return function(n){return s(n)&&n.getAttribute(e)===t}}function o(e){return s(e)&&e.hasAttribute("data-mce-bogus")}function a(e){return function(t){if(s(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}}var s=e(1);return{isText:e(3),isElement:s,isComment:e(8),isBr:t("br"),isContentEditableTrue:a("true"),isContentEditableFalse:a("false"),matchNodeNames:t,hasPropValue:r,hasAttributeValue:i,matchStyleValues:n,isBogus:o}}),r(S,[],function(){function e(e){return e==n}function t(e){return e.replace(new RegExp(n,"g"),"")}var n="\ufeff";return{isZwsp:e,ZWSP:n,trim:t}}),r(k,[_,S],function(e,t){function n(e){return p(e)&&(e=e.parentNode),h(e)&&e.hasAttribute("data-mce-caret")}function r(e){return p(e)&&t.isZwsp(e.data)}function i(e){return n(e)||r(e)}function o(e){var t=e.parentNode;t&&t.removeChild(e)}function a(e){try{return e.nodeValue}catch(t){return""}}function s(e,t){0===t.length?o(e):e.nodeValue=t}function l(e,n){var r,o,a,s;if(r=e.ownerDocument,a=r.createTextNode(t.ZWSP),s=e.parentNode,n){if(o=e.previousSibling,p(o)){if(i(o))return o;if(f(o))return o.splitText(o.data.length-1)}s.insertBefore(a,e)}else{if(o=e.nextSibling,p(o)){if(i(o))return o;if(d(o))return o.splitText(1),o}e.nextSibling?s.insertBefore(a,e.nextSibling):s.appendChild(a)}return a}function c(e,t,n){var r,i,o;return r=t.ownerDocument,i=r.createElement(e),i.setAttribute("data-mce-caret",n?"before":"after"),i.setAttribute("data-mce-bogus","all"),i.appendChild(r.createTextNode("\xa0")),o=t.parentNode,n?o.insertBefore(i,t):t.nextSibling?o.insertBefore(i,t.nextSibling):o.appendChild(i),i}function u(e){if(h(e)&&i(e)&&(" "!=e.innerHTML?e.removeAttribute("data-mce-caret"):o(e)),p(e)){var n=t.trim(a(e));s(e,n)}}function d(e){return p(e)&&e.data[0]==t.ZWSP}function f(e){return p(e)&&e.data[e.data.length-1]==t.ZWSP}var h=e.isElement,p=e.isText;return{isCaretContainer:i,isCaretContainerBlock:n,isCaretContainerInline:r,insertInline:l,insertBlock:c,remove:u,startsWithCaretContainer:d,endsWithCaretContainer:f}}),r(T,[m,y,_,b,k],function(e,t,n,r,i){function o(e,t){var n=e.childNodes;return t--,t>n.length-1?t=n.length-1:0>t&&(t=0),n[t]||e}function a(e){this.walk=function(t,n){function r(e){var t;return t=e[0],3===t.nodeType&&t===c&&u>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===f&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function i(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,o){var a=o?"nextSibling":"previousSibling";for(g=e,v=g.parentNode;g&&g!=t;g=v)v=g.parentNode,y=i(g==e?g:g[a],a),y.length&&(o||y.reverse(),n(r(y)))}var c=t.startContainer,u=t.startOffset,d=t.endContainer,f=t.endOffset,h,p,m,g,v,y,b;if(b=e.select("td[data-mce-selected],th[data-mce-selected]"),b.length>0)return void l(b,function(e){n([e])});if(1==c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[u]),1==d.nodeType&&d.hasChildNodes()&&(d=o(d,f)),c==d)return n(r([c]));for(h=e.findCommonAncestor(c,d),g=c;g;g=g.parentNode){if(g===d)return s(c,h,!0);if(g===h)break}for(g=d;g;g=g.parentNode){if(g===c)return s(d,h);if(g===h)break}p=a(c,h)||c,m=a(d,h)||d,s(c,p,!0),y=i(p==c?p:p.nextSibling,"nextSibling",m==d?m.nextSibling:m),y.length&&n(r(y)),s(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&r<n.nodeValue.length&&(i=t(n,r),n=i.previousSibling,o>r?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r<n.nodeValue.length&&(n=t(n,r),r=0),3==i.nodeType&&o>0&&o<i.nodeValue.length&&(i=t(i,o).previousSibling,o=i.nodeValue.length)),{startContainer:n,startOffset:r,endContainer:i,endOffset:o}},this.normalize=function(n){function r(r){function a(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}function s(n,r){for(var i=new t(n,e.getParent(n.parentNode,e.isBlock)||g);n=i[r?"prev":"next"]();)if("BR"===n.nodeName)return!0}function l(e){for(;e&&e!=g;){if(c(e))return!0;e=e.parentNode}return!1}function d(e,t){return e.previousSibling&&e.previousSibling.nodeName==t}function f(n,r){var a,s,l;if(r=r||h,l=e.getParent(r.parentNode,e.isBlock)||g,n&&"BR"==r.nodeName&&C&&e.isEmpty(l))return h=r.parentNode,p=e.nodeIndex(r),void(i=!0);for(a=new t(r,l);v=a[n?"prev":"next"]();){if("false"===e.getContentEditableParent(v)||u(v))return;if(3===v.nodeType&&v.nodeValue.length>0)return h=v,p=n?v.nodeValue.length:0,void(i=!0);if(e.isBlock(v)||y[v.nodeName.toLowerCase()])return;s=v}o&&s&&(h=s,i=!0,p=0)}var h,p,m,g=e.getRoot(),v,y,b,C;if(h=n[(r?"start":"end")+"Container"],p=n[(r?"start":"end")+"Offset"],C=1==h.nodeType&&p===h.childNodes.length,y=e.schema.getNonEmptyElements(),b=r,!u(h)){if(1==h.nodeType&&p>h.childNodes.length-1&&(b=!1),9===h.nodeType&&(h=e.getRoot(),p=0),h===g){if(b&&(v=h.childNodes[p>0?p-1:0])){if(u(v))return;if(y[v.nodeName]||"TABLE"==v.nodeName)return}if(h.hasChildNodes()){if(p=Math.min(!b&&p>0?p-1:p,h.childNodes.length-1),h=h.childNodes[p],p=0,!o&&h===g.lastChild&&"TABLE"===h.nodeName)return;if(l(h)||u(h))return;if(h.hasChildNodes()&&!/TABLE/.test(h.nodeName)){v=h,m=new t(h,g);do{if(c(v)||u(v)){i=!1;break}if(3===v.nodeType&&v.nodeValue.length>0){p=b?0:v.nodeValue.length,h=v,i=!0;break}if(y[v.nodeName.toLowerCase()]&&!a(v)){p=e.nodeIndex(v),h=v.parentNode,"IMG"!=v.nodeName||b||p++,i=!0;break}}while(v=b?m.next():m.prev())}}}o&&(3===h.nodeType&&0===p&&f(!0),1===h.nodeType&&(v=h.childNodes[p],v||(v=h.childNodes[p-1]),!v||"BR"!==v.nodeName||d(v,"A")||s(v)||s(v,!0)||f(!0,v))),b&&!o&&3===h.nodeType&&p===h.nodeValue.length&&f(!1),i&&n["set"+(r?"Start":"End")](h,p)}}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}function s(t,n,r){var i,o,a;if(i=r.elementFromPoint(t,n),o=r.body.createTextRange(),i&&"HTML"!=i.tagName||(i=r.body),o.moveToElementText(i),a=e.toArray(o.getClientRects()),a=a.sort(function(e,t){return e=Math.abs(Math.max(e.top-n,e.bottom-n)),t=Math.abs(Math.max(t.top-n,t.bottom-n)),e-t}),a.length>0){n=(a[0].bottom+a[0].top)/2;try{return o.moveToPoint(t,n),o.collapse(!0),o}catch(s){}}return null}var l=e.each,c=n.isContentEditableFalse,u=i.isCaretContainer;return a.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},a.getCaretRangeFromPoint=function(e,t,n){var r,i;if(n.caretPositionFromPoint)i=n.caretPositionFromPoint(e,t),r=n.createRange(),r.setStart(i.offsetNode,i.offset),r.collapse(!0);else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r=s(e,t,n)}}return r},a.getSelectedNode=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset==n+1?t.childNodes[n]:null},a.getNode=function(e,t){return 1==e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},a}),r(R,[T,d,u],function(e,t,n){return function(r){function i(e){var t,n;if(n=r.$(e).parentsUntil(r.getBody()).add(e),n.length===a.length){for(t=n.length;t>=0&&n[t]===a[t];t--);if(-1===t)return a=n,!0}return a=n,!1}var o,a=[];"onselectionchange"in r.getDoc()||r.on("NodeChange Click MouseUp KeyUp Focus",function(t){var n,i;n=r.selection.getRng(),i={startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset},"nodechange"!=t.type&&e.compareRanges(i,o)||r.fire("SelectionChange"),o=i}),r.on("contextmenu",function(){r.fire("SelectionChange")}),r.on("SelectionChange",function(){var e=r.selection.getStart(!0);!t.range&&r.selection.isCollapsed()||!i(e)&&r.dom.isChildOf(e,r.getBody())&&r.nodeChanged({selectionChange:!0})}),r.on("MouseUp",function(e){e.isDefaultPrevented()||("IMG"==r.selection.getNode().nodeName?n.setEditorTimeout(r,function(){r.nodeChanged()}):r.nodeChanged())}),this.nodeChanged=function(e){var t=r.selection,n,i,o;r.initialized&&t&&!r.settings.disable_nodechange&&!r.readonly&&(o=r.getBody(),n=t.getStart()||o,n.ownerDocument==r.getDoc()&&r.dom.isChildOf(n,o)||(n=o),"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),i=[],r.dom.getParent(n,function(e){return e===o?!0:void i.push(e)}),e=e||{},e.element=n,e.parents=i,r.fire("NodeChange",e))}}}),r(A,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(B,[m],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e,t){var n={},r,i;for(r=0,i=e.length;i>r;r++)n[e[r]]=t||{};return n}var s,c,u,d=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),c=3;c<d.length;c++)"string"==typeof d[c]&&(d[c]=t(d[c])),r.push.apply(r,d[c]);for(e=t(e),s=e.length;s--;)u=[].concat(l,t(n)),a[e[s]]={attributes:i(u),attributesOrder:u,children:i(r,o)}}function r(e,n){var r,i,o,s;for(e=t(e),r=e.length,n=t(n);r--;)for(i=a[e[r]],o=0,s=n.length;s>o;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},l,c,u,d,f,h;return i[e]?i[e]:(l=t("id accesskey class dir lang style tabindex title"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),u=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(l.push.apply(l,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),u.push.apply(u,t("audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(l.push("xml:lang"),h=t("acronym applet basefont big font strike tt"),u.push.apply(u,h),s(h,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),s(f,function(e){n(e,"",d)})),d=d||[].concat(c,u),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),n("address dt dd div caption","",d),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",u),n("blockquote","cite",d),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",d),n("dl","","dt dd"),n("a","href target rel media hreflang type",u),n("q","cite",u),n("ins del","cite datetime",d),n("img","src sizes srcset alt usemap ismap width height"),n("iframe","src name width height",d),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",d,"param"),n("param","name value"),n("map","name",d,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",d),n("th","colspan rowspan headers scope abbr",d),n("form","accept-charset action autocomplete enctype method name novalidate target",d),n("fieldset","disabled form name",d,"legend"),n("label","form for",u),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?d:u),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",d,"li"),n("noscript","",d),"html4"!=e&&(n("wbr"),n("ruby","",u,"rt rp"),n("figcaption","",d),n("mark rt rp summary bdi","",u),n("canvas","width height",d),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",d,"track source"),n("picture","","img source"),n("source","src srcset type media sizes"),n("track","kind src srclang label default"),n("datalist","",u,"option"),n("article section nav aside header footer","",d),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",d,"figcaption"),n("time","datetime",u),n("dialog","open",d),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",u),n("progress","value max",u),n("meter","value min max low high optimum",u),n("details","open",d,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(r("script","language xml:space"),r("style","xml:space"),r("object","declare classid code codebase codetype archive standby align border hspace vspace"),r("embed","align name hspace vspace"),r("param","valuetype type"),r("a","charset name rev shape coords"),r("br","clear"),r("applet","codebase archive code object alt name width height align hspace vspace"),r("img","name longdesc align border hspace vspace"),r("iframe","longdesc frameborder marginwidth marginheight scrolling align"),r("font basefont","size color face"),r("input","usemap align"),r("select","onchange"),r("textarea"),r("h1 h2 h3 h4 h5 h6 div p legend caption","align"),r("ul","type compact"),r("li","type"),r("ol dl menu dir","compact"),r("pre","width xml:space"),r("hr","align noshade size width"),r("isindex","prompt"),r("table","summary width frame rules cellspacing cellpadding align bgcolor"),r("col","width align char charoff valign"),r("colgroup","width align char charoff valign"),r("thead","align char charoff valign"),r("tr","align char charoff valign bgcolor"),r("th","axis align char charoff valign nowrap bgcolor width height"),r("form","accept"),r("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),r("tfoot","align char charoff valign"),r("tbody","align char charoff valign"),r("area","nohref"),r("body","background bgcolor text link vlink alink")),"html4"!=e&&(r("input button select textarea","autofocus"),r("input textarea","placeholder"),r("a","download"),r("link script img","crossorigin"),r("iframe","sandbox seamless allowfullscreen")),s(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,delete a.script,i[e]=a,a)}function r(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),s(e,function(e,r){n[r]=n[r.toUpperCase()]="map"==t?a(e,/[, ]/):c(e,/[, ]/)})),n}var i={},o={},a=e.makeMap,s=e.each,l=e.extend,c=e.explode,u=e.inArray;return function(e){function o(t,n,r){var o=e[t];return o?o=a(o,/[, ]/,a(o.toUpperCase(),/[, ]/)):(o=i[t],o||(o=a(n," ",a(n.toUpperCase()," ")),o=l(o,r),i[t]=o)),o}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function f(e){var n,r,i,o,s,l,c,f,h,p,m,g,v,b,x,w,N,E,_,S=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,k=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),y["@"]&&(w=y["@"].attributes,N=y["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=S.exec(e[n])){if(b=s[1],h=s[2],x=s[3],f=s[5],g={},v=[],l={attributes:g,attributesOrder:v},"#"===b&&(l.paddEmpty=!0),"-"===b&&(l.removeEmpty=!0),"!"===s[4]&&(l.removeEmptyAttrs=!0),w){for(E in w)g[E]=w[E];v.push.apply(v,N)}if(f)for(f=t(f,"|"),i=0,o=f.length;o>i;i++)if(s=k.exec(f[i])){if(c={},m=s[1],p=s[2].replace(/::/g,":"),b=s[3],_=s[4],"!"===m&&(l.attributesRequired=l.attributesRequired||[],l.attributesRequired.push(p),c.required=!0),"-"===m){delete g[p],v.splice(u(v,p),1);continue}b&&("="===b&&(l.attributesDefault=l.attributesDefault||[],l.attributesDefault.push({name:p,value:_}),c.defaultValue=_),":"===b&&(l.attributesForced=l.attributesForced||[],l.attributesForced.push({name:p,value:_}),c.forcedValue=_),"<"===b&&(c.validValues=a(_,"?"))), T.test(p)?(l.attributePatterns=l.attributePatterns||[],c.pattern=d(p),l.attributePatterns.push(c)):(g[p]||v.push(p),g[p]=c)}w||"@"!=h||(w=g,N=v),x&&(l.outputName=h,y[x]=l),T.test(h)?(l.pattern=d(h),C.push(l)):y[h]=l}}function h(e){y={},C=[],f(e),s(N,function(e,t){b[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&(i.text_block_elements=i.block_elements=null,s(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",o=t[2];if(b[o]=b[i],M[o]=i,r||(R[o.toUpperCase()]={},R[o]={}),!y[o]){var a=y[i];a=l({},a),delete a.removeEmptyAttrs,delete a.removeEmpty,y[o]=a}s(b,function(e,t){e[i]&&(b[t]=e=l({},b[t]),e[o]=e[i])})}))}function m(n){var r=/^([+\-]?)(\w+)\[([^\]]+)\]$/;i[e.schema]=null,n&&s(t(n,","),function(e){var n=r.exec(e),i,o;n&&(o=n[1],i=o?b[n[2]]:b[n[2]]={"#comment":{}},i=b[n[2]],s(t(n[3],"|"),function(e){"-"===o?delete i[e]:i[e]={}}))})}function g(e){var t=y[e],n;if(t)return t;for(n=C.length;n--;)if(t=C[n],t.pattern.test(e))return t}var v=this,y={},b={},C=[],x,w,N,E,_,S,k,T,R,A,B,D,L,M={},P={};e=e||{},N=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),x=r(e.valid_styles),w=r(e.invalid_styles,"map"),T=r(e.valid_classes,"map"),E=o("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=o("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),S=o("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),k=o("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),A=o("non_empty_elements","td th iframe video audio object script",S),B=o("move_caret_before_on_enter_elements","table",A),D=o("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),R=o("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption",D),L=o("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),s((e.special||"script noscript style textarea").split(" "),function(e){P[e]=new RegExp("</"+e+"[^>]*>","gi")}),e.valid_elements?h(e.valid_elements):(s(N,function(e,t){y[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},b[t]=e.children}),"html5"!=e.schema&&s(t("strong/b em/i"),function(e){e=t(e,"/"),y[e[1]].outputName=e[0]}),s(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){y[e]&&(y[e].removeEmpty=!0)}),s(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){y[e].paddEmpty=!0}),s(t("span"),function(e){y[e].removeEmptyAttrs=!0})),p(e.custom_elements),m(e.valid_children),f(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&s(c(e.invalid_elements),function(e){y[e]&&delete y[e]}),g("span")||f("span[!data-mce-type|*]"),v.children=b,v.getValidStyles=function(){return x},v.getInvalidStyles=function(){return w},v.getValidClasses=function(){return T},v.getBoolAttrs=function(){return k},v.getBlockElements=function(){return R},v.getTextBlockElements=function(){return D},v.getTextInlineElements=function(){return L},v.getShortEndedElements=function(){return S},v.getSelfClosingElements=function(){return _},v.getNonEmptyElements=function(){return A},v.getMoveCaretBeforeOnEnterElements=function(){return B},v.getWhiteSpaceElements=function(){return E},v.getSpecialElements=function(){return P},v.isValidChild=function(e,t){var n=b[e];return!(!n||!n[t])},v.isValid=function(e,t){var n,r,i=g(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},v.getElementRule=g,v.getCustomElements=function(){return M},v.addValidElements=f,v.setValidElements=h,v.addCustomElements=p,v.addValidChildren=m,v.elements=y}}),r(D,[B,C,m],function(e,t,n){function r(e,t,n){var r=1,i,o,a,s;for(s=e.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g,a.lastIndex=i=n;o=a.exec(t);){if(i=a.lastIndex,"/"===o[1])r--;else if(!o[1]){if(o[2]in s)continue;r++}if(0===r)break}return i}function i(i,a){function s(){}var l=this;i=i||{},l.schema=a=a||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),o("comment cdata text start end pi doctype".split(" "),function(e){e&&(l[e]=i[e]||s)}),l.parse=function(e){function o(e){var t,n;for(t=h.length;t--&&h[t].name!==e;);if(t>=0){for(n=h.length-1;n>=t;n--)e=h[n],e.valid&&l.end(e.name);h.length=t}}function s(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in x?t:z(n||r||o||""),N&&!y&&0!==t.indexOf("data-")){if(a=T[t],!a&&R){for(s=R.length;s--&&(a=R[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(W[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{c=decodeURIComponent(c)}catch(u){c=unescape(c)}if(V.test(c))return;if(!i.allow_html_data_urls&&$.test(c)&&!/^data:image\//i.test(c))return}p.map[t]=n,p.push({name:t,value:n})}var l=this,c,u=0,d,f,h=[],p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F=0,z=t.decode,U,W=n.makeMap("src,href,data,background,formaction,poster"),V=/((java|vb)script|mhtml):/i,$=/^data:/i;for(P=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),O=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,C=a.getShortEndedElements(),M=i.self_closing_elements||a.getSelfClosingElements(),x=a.getBoolAttrs(),N=i.validate,b=i.remove_internals,U=i.fix_self_closing,H=a.getSpecialElements();c=P.exec(e);){if(u<c.index&&l.text(z(e.substr(u,c.index-u))),d=c[6])d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),o(d);else if(d=c[7]){if(d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),w=d in C,U&&M[d]&&h.length>0&&h[h.length-1].name===d&&o(d),!N||(E=a.getElementRule(d))){if(_=!0,N&&(T=E.attributes,R=E.attributePatterns),(k=c[8])?(y=-1!==k.indexOf("data-mce-type"),y&&b&&(_=!1),p=[],p.map={},k.replace(O,s)):(p=[],p.map={}),N&&!y){if(A=E.attributesRequired,B=E.attributesDefault,D=E.attributesForced,L=E.removeEmptyAttrs,L&&!p.length&&(_=!1),D)for(m=D.length;m--;)S=D[m],v=S.name,I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I});if(B)for(m=B.length;m--;)S=B[m],v=S.name,v in p.map||(I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I}));if(A){for(m=A.length;m--&&!(A[m]in p.map););-1===m&&(_=!1)}if(S=p.map["data-mce-bogus"]){if("all"===S){u=r(a,e,P.lastIndex),P.lastIndex=u;continue}_=!1}}_&&l.start(d,p,w)}else _=!1;if(f=H[d]){f.lastIndex=u=c.index+c[0].length,(c=f.exec(e))?(_&&(g=e.substr(u,c.index-u)),u=c.index+c[0].length):(g=e.substr(u),u=e.length),_&&(g.length>0&&l.text(g,!0),l.end(d)),P.lastIndex=u;continue}w||(k&&k.indexOf("/")==k.length-1?_&&l.end(d):h.push({name:d,valid:_}))}else(d=c[1])?(">"===d.charAt(0)&&(d=" "+d),i.allow_conditional_comments||"[if"!==d.substr(0,3)||(d=" "+d),l.comment(d)):(d=c[2])?l.cdata(d):(d=c[3])?l.doctype(d):(d=c[4])&&l.pi(d,c[5]);u=c.index+c[0].length}for(u<e.length&&l.text(z(e.substr(u))),m=h.length-1;m>=0;m--)d=h[m],d.valid&&l.end(d.name)}}var o=n.each;return i.findEndTag=r,i}),r(L,[A,B,D,m],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,h,p,m,g,v,y,b;for(m=i("tr,td,th,tbody,thead,tfoot,table"),p=l.getNonEmptyElements(),g=l.getTextBlockElements(),v=l.getSpecialElements(),n=0;n<t.length;n++)if(r=t[n],r.parent&&!r.fixed)if(g[r.name]&&"li"==r.parent.name){for(y=r.next;y&&g[y.name];)y.name="li",y.fixed=!0,r.parent.insert(y,r.parent),y=y.next;r.unwrap(r)}else{for(a=[r],o=r.parent;o&&!l.isValidChild(o.name,r.name)&&!m[o.name];o=o.parent)a.push(o);if(o&&a.length>1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),h=0;h<a.length-1;h++){for(l.isValidChild(c.name,a[h].name)?(d=u.filterNode(a[h].clone()),c.append(d)):d=c,f=a[h].firstChild;f&&f!=a[h+1];)b=f.next,d.append(f),f=b;c=d}s.isEmpty(p)?o.insert(r,a[0],!0):(o.insert(s,a[0],!0),o.insert(r,s)),o=a[0],(o.isEmpty(p)||o.firstChild===o.lastChild&&"br"===o.firstChild.name)&&o.empty().remove()}else if(r.parent){if("li"===r.name){if(y=r.prev,y&&("ul"===y.name||"ul"===y.name)){y.append(r);continue}if(y=r.next,y&&("ul"===y.name||"ul"===y.name)){y.insert(r,y.firstChild,!0);continue}r.wrap(u.filterNode(new e("ul",1)));continue}l.isValidChild(r.parent.name,"div")&&l.isValidChild("div",r.name)?r.wrap(u.filterNode(new e("div",1))):v[r.name]?r.empty().remove():r.unwrap()}}}var u=this,d={},f=[],h={},p={};r=r||{},r.validate="validate"in r?r.validate:!0,r.root_name=r.root_name||"body",u.schema=l=l||new t,u.filterNode=function(e){var t,n,r;n in d&&(r=h[n],r?r.push(e):h[n]=[e]),t=f.length;for(;t--;)n=f[t].name,n in e.attributes.map&&(r=p[n],r?r.push(e):p[n]=[e]);return e},u.addNodeFilter=function(e,t){o(a(e),function(e){var n=d[e];n||(d[e]=n=[]),n.push(t)})},u.addAttributeFilter=function(e,t){o(a(e),function(e){var n;for(n=0;n<f.length;n++)if(f[n].name===e)return void f[n].callbacks.push(t);f.push({name:e,callbacks:[t]})})},u.parse=function(t,o){function a(){function e(e){e&&(t=e.firstChild,t&&3==t.type&&(t.value=t.value.replace(R,"")),t=e.lastChild,t&&3==t.type&&(t.value=t.value.replace(D,"")))}var t=y.firstChild,n,i;if(l.isValidChild(y.name,I.toLowerCase())){for(;t;)n=t.next,3==t.type||1==t.type&&"p"!==t.name&&!T[t.name]&&!t.attr("data-mce-type")?i?i.append(t):(i=u(I,1),i.attr(r.forced_root_block_attrs),y.insert(i,t),i.append(t)):(e(i),i=null),t=n;e(i)}}function u(t,n){var r=new e(t,n),i;return t in d&&(i=h[t],i?i.push(r):h[t]=[r]),r}function m(e){var t,n,r,i,o=l.getBlockElements();for(t=e.prev;t&&3===t.type;){if(r=t.value.replace(D,""),r.length>0)return void(t.value=r);if(n=t.next){if(3==n.type&&n.value.length){t=t.prev;continue}if(!o[n.name]&&"script"!=n.name&&"style"!=n.name){t=t.prev;continue}}i=t.prev,t.remove(),t=i}}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,N,E,_,S,k,T,R,A=[],B,D,L,M,P,O,H,I;if(o=o||{},h={},p={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),H=l.getNonEmptyElements(),O=l.children,k=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,P=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,L=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,v=new n({validate:k,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(L," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=k?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=O[b.name],s&&O[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(_=p[a],_?_.push(r):p[a]=[r]);T[e]&&m(r),n||(b=r),!B&&P[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=k?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(D,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o}if(B&&P[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(H))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,T[b.name]?b.empty().remove():b.unwrap(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),k&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(S in h){for(_=d[S],C=h[S],N=C.length;N--;)C[N].parent||C.splice(N,1);for(x=0,w=_.length;w>x;x++)_[x](C,S,o)}for(x=0,w=f.length;w>x;x++)if(_=f[x],_.name in p){for(C=p[_.name],N=C.length;N--;)C[N].parent||C.splice(N,1);for(N=0,E=_.callbacks.length;E>N;N++)_.callbacks[N](C,_.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,h,p;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(h=l.getElementRule(c.name),h&&(h.removeEmpty?c.remove():h.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(p=new e("#text",3),p.value="\xa0",i.replace(p))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}}),r.validate&&l.getValidClasses()&&u.addAttributeFilter("class",function(e){for(var t=e.length,n,r,i,o,a,s=l.getValidClasses(),c,u;t--;){for(n=e[t],r=n.attr("class").split(" "),a="",i=0;i<r.length;i++)o=r[i],u=!1,c=s["*"],c&&c[o]&&(u=!0),c=s[n.name],!u&&c&&c[o]&&(u=!0),u&&(a&&(a+=" "),a+=o);a.length||(a=null),n.attr("class",a)}})}}),r(M,[C,m],function(e,t){var n=t.makeMap;return function(t){var r=[],i,o,a,s,l;return t=t||{},i=t.indent,o=n(t.indent_before||""),a=n(t.indent_after||""),s=e.getEncodeFunc(t.entity_encoding||"raw",t.entities),l="html"==t.element_format,{start:function(e,t,n){var c,u,d,f;if(i&&o[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');!n||l?r[r.length]=">":r[r.length]=" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push("</",e,">"),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("<![CDATA[",e,"]]>")},comment:function(e){r.push("<!--",e,"-->")},pi:function(e,t){t?r.push("<?",e," ",s(t),"?>"):r.push("<?",e,"?>"),i&&r.push("\n")},doctype:function(e){r.push("<!DOCTYPE",e,">",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(P,[M,B],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,h,p,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1&&(f=[],f.map={},m=r.getElementRule(e.name))){for(h=0,p=m.attributesOrder.length;p>h;h++)u=m.attributesOrder[h],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(h=0,p=c.length;p>h;h++)u=c[h].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(O,[w,L,D,C,P,A,B,d,m,S],function(e,t,n,r,i,o,a,s,l,c){function u(e){function t(e){return e&&"br"===e.name}var n,r;n=e.lastChild,t(n)&&(r=n.prev,t(r)&&(n.remove(),r.remove()))}var d=l.each,f=l.trim,h=e.DOM,p=["data-mce-selected"];return function(e,o){function m(e){var t=new RegExp(["<span[^>]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","\\s?("+p.join("|")+')="[^"]+"'].join("|"),"gi");return e=c.trim(e.replace(t,""))}function g(){var e=o.getBody().innerHTML,t=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,r,i,a,s,l,c=o.schema;for(e=m(e),l=c.getShortEndedElements();s=t.exec(e);)i=t.lastIndex,a=s[0].length,r=l[s[1]]?i:n.findEndTag(c,e,i),e=e.substring(0,i-a)+e.substring(r),t.lastIndex=i-a;return f(e)}function v(e){-1===l.inArray(p,e)&&(C.addAttributeFilter(e,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),p.push(e))}var y,b,C;return o&&(y=o.dom,b=o.schema),y=y||h,b=b||new a(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,C=new t(e,b),C.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n=e.length,r;n--;)r=e[n],r.attr("tabindex",r.attributes.map["data-mce-tabindex"]),r.attr(t,null)}),C.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,s=e.url_converter,l=e.url_converter_scope,c;r--;)i=t[r],o=i.attributes.map[a],o!==c?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=y.serializeStyle(y.parseStyle(o),i.name):s&&(o=s.call(l,o,n,i.name)),i.attr(n,o.length>0?o:null))}),C.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class"),r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}),C.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),C.addNodeFilter("noscript",function(e){for(var t=e.length,n;t--;)n=e[t].firstChild,n&&(n.value=r.decode(n.value))}),C.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o,a;r--;)i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t?(a=i.attr("type"),a&&i.attr("type","mce-no/type"==a?null:a.replace(/^mce\-/,"")),o.length>0&&(i.firstChild.value="// <![CDATA[\n"+n(o)+"\n// ]]>")):o.length>0&&(i.firstChild.value="<!--\n"+n(o)+"\n-->")}),C.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),C.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&C.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,"ul"!==r.name&&"ol"!==r.name||n.prev&&"li"===n.prev.name&&n.prev.append(n)}),C.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:b,addNodeFilter:C.addNodeFilter,addAttributeFilter:C.addAttributeFilter,serialize:function(t,n){var r=this,o,a,l,h,p,m;return s.ie&&y.select("script,style,select,map").length>0?(p=t.innerHTML,t=t.cloneNode(!1),y.setHTML(t,p)):t=t.cloneNode(!0),o=document.implementation,o.createHTMLDocument&&(a=o.createHTMLDocument(""),d("BODY"==t.nodeName?t.childNodes:[t],function(e){a.body.appendChild(a.importNode(e,!0))}),t="BODY"!=t.nodeName?a.body.firstChild:a.body,l=y.doc,y.doc=a),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,r.onPreProcess(n)),m=C.parse(f(n.getInner?t.innerHTML:y.getOuterHTML(t)),n),u(m),h=new i(e,b),n.content=h.serialize(m),n.cleanup||(n.content=c.trim(n.content),n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||r.onPostProcess(n),l&&(y.doc=l),n.node=null,n.content},addRules:function(e){b.addValidElements(e)},setRules:function(e){b.setValidElements(e)},onPreProcess:function(e){o&&o.fire("PreProcess",e)},onPostProcess:function(e){o&&o.fire("PostProcess",e)},addTempAttr:v,trimHtml:m,getTrimmedContent:g}}}),r(H,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(3==l.nodeType&&(u=l.nodeValue,s+=u.length,s>=i)){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(3==l.nodeType&&(s+=l.nodeValue.length,s>=i)){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,p;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),t!=f&&t!=f.documentElement||(t=h,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(p=t.childNodes,p.length?(n>=p.length?i.insertAfter(a,p[p.length-1]):t.insertBefore(a,p[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="<span></span>",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,h=f.body,p,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=h.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="<span></span><span></span>",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=h.createControlRange(),a.addElement(m),a.select(),p=e.getRng(),p.item&&m===p.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(I,[d],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(t){return e.mac?t.metaKey:t.ctrlKey&&!t.altKey}}}),r(F,[I,m,u,d,_],function(e,t,n,r,i){function o(e,t){for(;t&&t!=e;){if(s(t)||a(t))return t;t=t.parentNode}return null}var a=i.isContentEditableFalse,s=i.isContentEditableTrue;return function(i,s){function l(e){var t=s.settings.object_resizing;return t===!1||r.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:e==s.getBody()?!1:s.dom.is(e,t))}function c(t){var n,r,i,o,a;n=t.screenX-L,r=t.screenY-M,U=n*B[2]+H,W=r*B[3]+I,U=5>U?5:U,W=5>W?5:W,i="IMG"==k.nodeName&&s.settings.resize_img_proportional!==!1?!e.modifierPressed(t):e.modifierPressed(t)||"IMG"==k.nodeName&&B[2]*B[3]!==0,i&&(j(n)>j(r)?(W=Y(U*F),U=Y(W/F)):(U=Y(W/F),W=Y(U*F))),_.setStyles(T,{width:U,height:W}),o=B.startPos.x+n,a=B.startPos.y+r,o=o>0?o:0,a=a>0?a:0,_.setStyles(R,{left:o,top:a,display:"block"}),R.innerHTML=U+" × "+W,B[2]<0&&T.clientWidth<=U&&_.setStyle(T,"left",P+(H-U)),B[3]<0&&T.clientHeight<=W&&_.setStyle(T,"top",O+(I-W)),n=X.scrollWidth-K,r=X.scrollHeight-G,n+r!==0&&_.setStyles(R,{left:o-n,top:a-r}),z||(s.fire("ObjectResizeStart",{target:k,width:H,height:I}),z=!0)}function u(){function e(e,t){t&&(k.style[e]||!s.schema.isValid(k.nodeName.toLowerCase(),e)?_.setStyle(k,e,t):_.setAttrib(k,e,t))}z=!1,e("width",U),e("height",W),_.unbind(V,"mousemove",c),_.unbind(V,"mouseup",u),$!=V&&(_.unbind($,"mousemove",c),_.unbind($,"mouseup",u)),_.remove(T),_.remove(R),q&&"TABLE"!=k.nodeName||d(k),s.fire("ObjectResized",{target:k,width:U,height:W}),_.setAttrib(k,"style",_.getAttrib(k,"style")),s.nodeChanged()}function d(e,t,n){var i,o,a,d,h;f(),x(),i=_.getPos(e,X),P=i.x,O=i.y,h=e.getBoundingClientRect(),o=h.width||h.right-h.left,a=h.height||h.bottom-h.top,k!=e&&(C(),k=e,U=W=0),d=s.fire("ObjectSelected",{target:e}),l(e)&&!d.isDefaultPrevented()?S(A,function(e,i){function s(t){L=t.screenX,M=t.screenY,H=k.clientWidth,I=k.clientHeight,F=I/H,B=e,e.startPos={x:o*e[0]+P,y:a*e[1]+O},K=X.scrollWidth,G=X.scrollHeight,T=k.cloneNode(!0),_.addClass(T,"mce-clonedresizable"),_.setAttrib(T,"data-mce-bogus","all"),T.contentEditable=!1,T.unSelectabe=!0,_.setStyles(T,{left:P,top:O,margin:0}),T.removeAttribute("data-mce-selected"),X.appendChild(T),_.bind(V,"mousemove",c),_.bind(V,"mouseup",u),$!=V&&(_.bind($,"mousemove",c),_.bind($,"mouseup",u)),R=_.add(X,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},H+" × "+I)}var l;return t?void(i==t&&s(n)):(l=_.get("mceResizeHandle"+i),l&&_.remove(l),l=_.add(X,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),r.ie&&(l.contentEditable=!1),_.bind(l,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),s(e)}),e.elm=l,void _.setStyles(l,{left:o*e[0]+P-l.offsetWidth/2,top:a*e[1]+O-l.offsetHeight/2}))}):f(),k.setAttribute("data-mce-selected","1")}function f(){var e,t;x(),k&&k.removeAttribute("data-mce-selected");for(e in A)t=_.get("mceResizeHandle"+e),t&&(_.unbind(t),_.remove(t))}function h(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n,r;if(!z&&!s.removed)return S(_.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),r="mousedown"==e.type?e.target:i.getNode(),r=_.$(r).closest(q?"table":"table,img,hr")[0],t(r,X)&&(w(),n=i.getStart(!0),t(n,r)&&t(i.getEnd(!0),r)&&(!q||r!=n&&"IMG"!==n.nodeName))?void d(r):void f()}function p(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function m(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function g(e){var t=e.srcElement,n,r,i,o,a,l,c;n=t.getBoundingClientRect(),l=D.clientX-n.left,c=D.clientY-n.top;for(r in A)if(i=A[r],o=t.offsetWidth*i[0],a=t.offsetHeight*i[1],j(o-l)<8&&j(a-c)<8){B=i;break}z=!0,s.fire("ObjectResizeStart",{target:k,width:k.clientWidth,height:k.clientHeight}),s.getDoc().selection.empty(),d(t,r,D)}function v(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function y(e){return a(o(s.getBody(),e))}function b(e){var t=e.srcElement;if(y(t))return void v(e);if(t!=k){if(s.fire("ObjectSelected",{target:t}),C(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);"IMG"!=t.nodeName&&"TABLE"!=t.nodeName||(f(),k=t,p(t,"resizestart",g))}}function C(){m(k,"resizestart",g)}function x(){for(var e in A){var t=A[e];t.elm&&(_.unbind(t.elm),delete t.elm)}}function w(){try{s.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function N(e){var t;if(q){t=V.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function E(){k=T=null,q&&(C(),m(X,"controlselect",b))}var _=s.dom,S=t.each,k,T,R,A,B,D,L,M,P,O,H,I,F,z,U,W,V=s.getDoc(),$=document,q=r.ie&&r.ie<11,j=Math.abs,Y=Math.round,X=s.getBody(),K,G;A={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var J=".mce-content-body";return s.contentStyles.push(J+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: box-sizing;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+J+" .mce-resizehandle:hover {background: #000}"+J+" img[data-mce-selected],"+J+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+J+" .mce-clonedresizable {position: absolute;"+(r.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+J+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}"),s.on("init",function(){q?(s.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(f(),N(e.target))}),p(X,"controlselect",b),s.on("mousedown",function(e){D=e})):(w(),r.ie>=11&&(s.on("mousedown click",function(e){var t=e.target,n=t.nodeName;z||!/^(TABLE|IMG|HR)$/.test(n)||y(t)||(s.selection.select(t,"TABLE"==n),"mousedown"==e.type&&s.nodeChanged())}),s.dom.bind(X,"mscontrolselect",function(e){function t(e){n.setEditorTimeout(s,function(){s.selection.select(e)})}return y(e.target)?(e.preventDefault(),void t(e.target)):void(/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&t(e.target)))})));var e=n.throttle(function(e){s.composing||h(e)});s.on("nodechange ResizeEditor ResizeWindow drop",e),s.on("keyup compositionend",function(t){k&&"TABLE"==k.nodeName&&e(t)}),s.on("hide blur",f)}),s.on("remove",x),{isResizable:l,showResizeRect:d,hideResizeRect:f,updateResizeRect:h,controlSelect:N,destroy:E}}}),r(z,[],function(){function e(e){return function(){return e}}function t(e){return function(t){return!e(t)}}function n(e,t){return function(n){return e(t(n))}}function r(){var e=a.call(arguments);return function(t){for(var n=0;n<e.length;n++)if(e[n](t))return!0;return!1}}function i(){var e=a.call(arguments); return function(t){for(var n=0;n<e.length;n++)if(!e[n](t))return!1;return!0}}function o(e){var t=a.call(arguments);return t.length-1>=e.length?e.apply(this,t.slice(1)):function(){var e=t.concat([].slice.call(arguments));return o.apply(this,e)}}var a=[].slice;return{constant:e,negate:t,and:i,or:r,curry:o,compose:n}}),r(U,[_,p,k],function(e,t,n){function r(e){return m(e)?!1:d(e)?!f(e.parentNode):h(e)||u(e)||p(e)||c(e)}function i(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode){if(c(e))return!1;if(l(e))return!0}return!0}function o(e){return c(e)?t.reduce(e.getElementsByTagName("*"),function(e,t){return e||l(t)},!1)!==!0:!1}function a(e){return h(e)||o(e)}function s(e,t){return r(e)&&i(e,t)}var l=e.isContentEditableTrue,c=e.isContentEditableFalse,u=e.isBr,d=e.isText,f=e.matchNodeNames("script style textarea"),h=e.matchNodeNames("img input textarea hr iframe video audio object"),p=e.matchNodeNames("table"),m=n.isCaretContainer;return{isCaretCandidate:r,isInEditable:i,isAtomic:a,isEditableCaretCandidate:s}}),r(W,[],function(){function e(e){return e?{left:u(e.left),top:u(e.top),bottom:u(e.bottom),right:u(e.right),width:u(e.width),height:u(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}}function t(t,n){return t=e(t),n?t.right=t.left:(t.left=t.left+t.width,t.right=t.left),t.width=0,t}function n(e,t){return e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right}function r(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2}function i(e,t){return e.bottom<t.top?!0:e.top>t.bottom?!1:r(t.top-e.bottom,e,t)}function o(e,t){return e.top>t.bottom?!0:e.bottom<t.top?!1:r(t.bottom-e.top,e,t)}function a(e,t){return e.left<t.left}function s(e,t){return e.right>t.right}function l(e,t){return i(e,t)?-1:o(e,t)?1:a(e,t)?-1:s(e,t)?1:0}function c(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom}var u=Math.round;return{clone:e,collapse:t,isEqual:n,isAbove:i,isBelow:o,isLeft:a,isRight:s,compare:l,containsXY:c}}),r(V,[],function(){function e(e){return"string"==typeof e&&e.charCodeAt(0)>=768&&t.test(e)}var t=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]");return{isExtendingChar:e}}),r($,[z,_,w,T,U,W,V],function(e,t,n,r,i,o,a){function s(e){return"createRange"in e?e.createRange():n.DOM.createRng()}function l(e){return e&&/[\r\n\t ]/.test(e)}function c(e){var t=e.startContainer,n=e.startOffset,r;return!!(l(e.toString())&&v(t.parentNode)&&(r=t.data,l(r[n-1])||l(r[n+1])))}function u(e){function t(e){var t=e.ownerDocument,n=s(t),r=t.createTextNode("\xa0"),i=e.parentNode,a;return i.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1),a=o.clone(n.getBoundingClientRect()),i.removeChild(r),a}function n(e){var n,r;return r=e.getClientRects(),n=r.length>0?o.clone(r[0]):o.clone(e.getBoundingClientRect()),b(e)&&0===n.left?t(e):n}function r(e,t){return e=o.collapse(e,t),e.width=1,e.right=e.left+1,e}function i(e){0!==e.height&&(u.length>0&&o.isEqual(e,u[u.length-1])||u.push(e))}function l(e,t){var o=s(e.ownerDocument);if(t<e.data.length){if(a.isExtendingChar(e.data[t]))return u;if(a.isExtendingChar(e.data[t-1])&&(o.setStart(e,t),o.setEnd(e,t+1),!c(o)))return i(r(n(o),!1)),u}t>0&&(o.setStart(e,t-1),o.setEnd(e,t),c(o)||i(r(n(o),!1))),t<e.data.length&&(o.setStart(e,t),o.setEnd(e,t+1),c(o)||i(r(n(o),!0)))}var u=[],d,h;if(y(e.container()))return l(e.container(),e.offset()),u;if(f(e.container()))if(e.isAtEnd())h=x(e.container(),e.offset()),y(h)&&l(h,h.data.length),g(h)&&!b(h)&&i(r(n(h),!1));else{if(h=x(e.container(),e.offset()),y(h)&&l(h,0),g(h)&&e.isAtEnd())return i(r(n(h),!1)),u;d=x(e.container(),e.offset()-1),g(d)&&!b(d)&&(p(d)||p(h)||!g(h))&&i(r(n(d),!1)),g(h)&&i(r(n(h),!0))}return u}function d(t,n,r){function i(){return y(t)?0===n:0===n}function o(){return y(t)?n>=t.data.length:n>=t.childNodes.length}function a(){var e;return e=s(t.ownerDocument),e.setStart(t,n),e.setEnd(t,n),e}function l(){return r||(r=u(new d(t,n))),r}function c(){return l().length>0}function f(e){return e&&t===e.container()&&n===e.offset()}function h(e){return x(t,e?n-1:n)}return{container:e.constant(t),offset:e.constant(n),toRange:a,getClientRects:l,isVisible:c,isAtStart:i,isAtEnd:o,isEqual:f,getNode:h}}var f=t.isElement,h=i.isCaretCandidate,p=t.matchStyleValues("display","block table"),m=t.matchStyleValues("float","left right"),g=e.and(f,h,e.negate(m)),v=e.negate(t.matchStyleValues("white-space","pre pre-line pre-wrap")),y=t.isText,b=t.isBr,C=n.nodeIndex,x=r.getNode;return d.fromRangeStart=function(e){return new d(e.startContainer,e.startOffset)},d.fromRangeEnd=function(e){return new d(e.endContainer,e.endOffset)},d.after=function(e){return new d(e.parentNode,C(e)+1)},d.before=function(e){return new d(e.parentNode,C(e))},d}),r(q,[_,w,z,p,$],function(e,t,n,r,i){function o(e){var t=e.parentNode;return v(t)?o(t):t}function a(e){return e?r.reduce(e.childNodes,function(e,t){return v(t)&&"BR"!=t.nodeName?e=e.concat(a(t)):e.push(t),e},[]):[]}function s(e,t){for(;(e=e.previousSibling)&&g(e);)t+=e.data.length;return t}function l(e){return function(t){return e===t}}function c(t){var n,i,s;return n=a(o(t)),i=r.findIndex(n,l(t),t),n=n.slice(0,i+1),s=r.reduce(n,function(e,t,r){return g(t)&&g(n[r-1])&&e++,e},0),n=r.filter(n,e.matchNodeNames(t.nodeName)),i=r.findIndex(n,l(t),t),i-s}function u(e){var t;return t=g(e)?"text()":e.nodeName.toLowerCase(),t+"["+c(e)+"]"}function d(e,t,n){var r=[];for(t=t.parentNode;t!=e&&(!n||!n(t));t=t.parentNode)r.push(t);return r}function f(t,i){var o,a,l=[],c,f,h;return o=i.container(),a=i.offset(),g(o)?c=s(o,a):(f=o.childNodes,a>=f.length?(c="after",a=f.length-1):c="before",o=f[a]),l.push(u(o)),h=d(t,o),h=r.filter(h,n.negate(e.isBogus)),l=l.concat(r.map(h,function(e){return u(e)})),l.reverse().join("/")+","+c}function h(t,n,i){var o=a(t);return o=r.filter(o,function(e,t){return!g(e)||!g(o[t-1])}),o=r.filter(o,e.matchNodeNames(n)),o[i]}function p(e,t){for(var n=e,r=0,o;g(n);){if(o=n.data.length,t>=r&&r+o>=t){e=n,t-=r;break}if(!g(n.nextSibling)){e=n,t=o;break}r+=o,n=n.nextSibling}return t>e.data.length&&(t=e.data.length),new i(e,t)}function m(e,t){var n,o,a;return t?(n=t.split(","),t=n[0].split("/"),a=n.length>1?n[1]:"before",o=r.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),h(e,t[1],parseInt(t[2],10))):null},e),o?g(o)?p(o,parseInt(a,10)):(a="after"===a?y(o)+1:y(o),new i(o.parentNode,a)):null):null}var g=e.isText,v=e.isBogus,y=t.nodeIndex;return{create:f,resolve:m}}),r(j,[d,m,k,q,$,_],function(e,t,n,r,i,o){function a(a){var l=a.dom;this.getBookmark=function(e,c){function u(e,n){var r=0;return t.each(l.select(e),function(e){return"all"!==e.getAttribute("data-mce-bogus")?e==n?!1:void r++:void 0}),r}function d(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function f(e){function t(e,t){var r=e[t?"startContainer":"endContainer"],i=e[t?"startOffset":"endOffset"],o=[],a,s,u=0;if(3==r.nodeType){if(c)for(a=r.previousSibling;a&&3==a.nodeType;a=a.previousSibling)i+=a.nodeValue.length;o.push(i)}else s=r.childNodes,i>=s.length&&s.length&&(u=1,i=Math.max(0,s.length-1)),o.push(l.nodeIndex(s[i],c)+u);for(;r&&r!=n;r=r.parentNode)o.push(l.nodeIndex(r,c));return o}var n=l.getRoot(),r={};return r.start=t(e,!0),a.isCollapsed()||(r.end=t(e)),r}function h(e){function t(e){var t;if(n.isCaretContainer(e)){if(o.isText(e)&&n.isCaretContainerBlock(e)&&(e=e.parentNode),t=e.previousSibling,s(t))return t;if(t=e.nextSibling,s(t))return t}}return t(e.startContainer)||t(e.endContainer)}var p,m,g,v,y,b,C="",x;if(2==e)return b=a.getNode(),y=b?b.nodeName:null,p=a.getRng(),s(b)||"IMG"==y?{name:y,index:u(y,b)}:a.tridentSel?a.tridentSel.getBookmark(e):(b=h(p),b?(y=b.tagName,{name:y,index:u(y,b)}):f(p));if(3==e)return p=a.getRng(),{start:r.create(l.getRoot(),i.fromRangeStart(p)),end:r.create(l.getRoot(),i.fromRangeEnd(p))};if(e)return{rng:a.getRng()};if(p=a.getRng(),g=l.uniqueId(),v=a.isCollapsed(),x="overflow:hidden;line-height:0px",p.duplicate||p.item){if(p.item)return b=p.item(0),y=b.nodeName,{name:y,index:u(y,b)};m=p.duplicate();try{p.collapse(),p.pasteHTML('<span data-mce-type="bookmark" id="'+g+'_start" style="'+x+'">'+C+"</span>"),v||(m.collapse(!1),p.moveToElementText(m.parentElement()),0===p.compareEndPoints("StartToEnd",m)&&m.move("character",-1),m.pasteHTML('<span data-mce-type="bookmark" id="'+g+'_end" style="'+x+'">'+C+"</span>"))}catch(w){return null}}else{if(b=a.getNode(),y=b.nodeName,"IMG"==y)return{name:y,index:u(y,b)};m=d(p.cloneRange()),v||(m.collapse(!1),m.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_end",style:x},C))),p=d(p),p.collapse(!0),p.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_start",style:x},C))}return a.moveToBookmark({id:g,keep:1}),{id:g}},this.moveToBookmark=function(n){function i(e){var t=n[e?"start":"end"],r,i,o,a;if(t){for(o=t[0],i=d,r=t.length-1;r>=1;r--){if(a=i.childNodes,t[r]>a.length-1)return;i=a[t[r]]}3===i.nodeType&&(o=Math.min(t[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(t[0],i.childNodes.length)),e?u.setStart(i,o):u.setEnd(i,o)}return!0}function o(r){var i=l.get(n.id+"_"+r),o,a,s,c,u=n.keep;if(i&&(o=i.parentNode,"start"==r?(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),f=h=o,p=m=a):(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),h=o,m=a),!u)){for(c=i.previousSibling,s=i.nextSibling,t.each(t.grep(i.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});i=l.get(n.id+"_"+r);)l.remove(i,1);c&&s&&c.nodeType==s.nodeType&&3==c.nodeType&&!e.opera&&(a=c.nodeValue.length,c.appendData(s.nodeValue),l.remove(s),"start"==r?(f=h=c,p=m=a):(h=c,m=a))}}function s(t){return!l.isBlock(t)||t.innerHTML||e.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t}function c(){var e,t;return e=l.createRng(),t=r.resolve(l.getRoot(),n.start),e.setStart(t.container(),t.offset()),t=r.resolve(l.getRoot(),n.end),e.setEnd(t.container(),t.offset()),e}var u,d,f,h,p,m;if(n)if(t.isArray(n.start)){if(u=l.createRng(),d=l.getRoot(),a.tridentSel)return a.tridentSel.moveToBookmark(n);i(!0)&&i()&&a.setRng(u)}else"string"==typeof n.start?a.setRng(c(n)):n.id?(o("start"),o("end"),f&&(u=l.createRng(),u.setStart(s(f),p),u.setEnd(s(h),m),a.setRng(u))):n.name?a.select(l.select(n.name)[n.index]):n.rng&&a.setRng(n.rng)}}var s=o.isContentEditableFalse;return a.isBookmarkNode=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},a}),r(Y,[y,H,F,T,j,_,d,m,$],function(e,n,r,i,o,a,s,l,c){function u(e,t,i,a){var s=this;s.dom=e,s.win=t,s.serializer=i,s.editor=a,s.bookmarkManager=new o(s),s.controlSelection=new r(s,a),s.win.getSelection||(s.tridentSel=new n(s))}var d=l.each,f=l.trim,h=s.ie;return u.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='<span id="__caret">_</span>',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('<span id="__mce_tmp">_</span>'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(e){var t=this,n=t.getRng(),r,i,o,a;if(n.duplicate||n.item){if(n.item)return n.item(0);for(o=n.duplicate(),o.collapse(1),r=o.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),i=a=n.parentElement();a=a.parentNode;)if(a==r){r=i;break}return r}return r=n.startContainer,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[Math.min(r.childNodes.length-1,n.startOffset)])),r&&3==r.nodeType?r.parentNode:r},getEnd:function(e){var t=this,n=t.getRng(),r,i;return n.duplicate||n.item?n.item?n.item(0):(n=n.duplicate(),n.collapse(0),r=n.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),r&&"BODY"==r.nodeName?r.lastChild||r:r):(r=n.endContainer,i=n.endOffset,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[i>0?i-1:i])),r&&3==r.nodeType?r.parentNode:r)},getBookmark:function(e,t){return this.bookmarkManager.getBookmark(e,t)},moveToBookmark:function(e){return this.bookmarkManager.moveToBookmark(e)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a,s,l;if(!n.win)return null;if(a=n.win.document,!e&&n.lastFocusBookmark){var c=n.lastFocusBookmark;return c.startContainer?(i=a.createRange(),i.setStart(c.startContainer,c.startOffset),i.setEnd(c.endContainer,c.endOffset)):i=c,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(u){}if(l=n.editor.fire("GetSelectionRange",{range:i}),l.range!==i)return l.range;if(h&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(u){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r,i,o;if(e)if(e.select){n.explicitRange=null;try{e.select()}catch(a){}}else if(n.tridentSel){if(e.cloneRange)try{n.tridentSel.addRange(e)}catch(a){}}else{if(r=n.getSel(),o=n.editor.fire("SetSelectionRange",{range:e}),e=o.range,r){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(a){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}e.collapsed||e.startContainer!=e.endContainer||!r.setBaseAndExtent||s.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(i=e.startContainer.childNodes[e.startOffset],i&&"IMG"==i.tagName&&n.getSel().setBaseAndExtent(i,0,i,1))}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i,o,a,s,l=t.dom.getRoot();return n?(i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r)):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return s.range&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};d(n.selectorChangedData,function(e,t){d(o,function(n){return i.is(n,t)?(r[t]||(d(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),d(r,function(e,n){a[n]||(delete r[n],d(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){function n(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var r,i,o=this,s=o.dom,l=s.getRoot(),c,u,d=0;if(a.isElement(e)){if(t===!1&&(d=e.offsetHeight),"BODY"!=l.nodeName){var f=o.getScrollContainer();if(f)return r=n(e).y-n(f).y+d,u=f.clientHeight,c=f.scrollTop,void((c>r||r+25>c+u)&&(f.scrollTop=c>r?r:r-u+25))}i=s.getViewPort(o.editor.getWin()),r=s.getPos(e).y+d,c=i.y,u=i.h,(r<i.y||r+25>c+u)&&o.editor.getWin().scrollTo(0,c>r?r:r-u+25)}},placeCaretAt:function(e,t){this.setRng(i.getCaretRangeFromPoint(e,t,this.editor.getDoc()))},_moveEndPoint:function(t,n,r){var i=n,o=new e(n,i),a=this.dom.schema.getNonEmptyElements();do{if(3==n.nodeType&&0!==f(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"==n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(s.ie&&s.ie<11&&this.dom.isBlock(n)&&this.dom.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?o.next():o.prev());"BODY"==i.nodeName&&(r?t.setStart(i,0):t.setEnd(i,i.childNodes.length))},getBoundingClientRect:function(){var e=this.getRng();return e.collapsed?c.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){this.win=null,this.controlSelection.destroy()}},u}),r(X,[j,m],function(e,t){function n(t){this.compare=function(n,i){function o(e){var n={};return r(t.getAttribs(e),function(r){var i=r.nodeName.toLowerCase();0!==i.indexOf("_")&&"style"!==i&&0!==i.indexOf("data-")&&(n[i]=t.getAttrib(e,i))}),n}function a(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(n=t[r],"undefined"==typeof n)return!1;if(e[r]!=n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0}return n.nodeName!=i.nodeName?!1:a(o(n),o(i))&&a(t.parseStyle(t.getAttrib(n,"style")),t.parseStyle(t.getAttrib(i,"style")))?!e.isBookmarkNode(n)&&!e.isBookmarkNode(i):!1}}var r=t.each;return n}),r(K,[m],function(e){function t(e,t){function r(e){return e.replace(/%(\w+)/g,"")}var i,o,a=e.dom,s="",l,c;if(c=e.settings.preview_styles,c===!1)return"";if(c||(c="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),"string"==typeof t){if(t=e.formatter.get(t),!t)return;t=t[0]}return i=t.block||t.inline||"span",o=a.create(i),n(t.styles,function(e,t){e=r(e),e&&a.setStyle(o,t,e)}),n(t.attributes,function(e,t){e=r(e),e&&a.setAttrib(o,t,e)}),n(t.classes,function(e){e=r(e),a.hasClass(o,e)||a.addClass(o,e)}),e.fire("PreviewFormats"),a.setStyles(o,{position:"absolute",left:-65535}),e.getBody().appendChild(o),l=a.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,n(c.split(" "),function(t){var n=a.getStyle(o,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=a.getStyle(e.getBody(),t,!0),"#ffffff"==a.toHex(n).toLowerCase())||"color"==t&&"#000000"==a.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(s+="padding:0 2px;"),s+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),a.remove(o),s}var n=e.each;return{getCssText:t}}),r(G,[p,_,g],function(e,t,n){function r(e,t){var n=o[e];n||(o[e]=n=[]),o[e].push(t)}function i(e,t){s(o[e],function(e){e(t)})}var o=[],a=e.filter,s=e.each;return r("pre",function(r){function i(t){return c(t.previousSibling)&&-1!=e.indexOf(u,t.previousSibling)}function o(e,t){n(t).remove(),n(e).append("<br><br>").append(t.childNodes)}var l=r.selection.getRng(),c,u;c=t.matchNodeNames("pre"),l.collapsed||(u=r.selection.getSelectedBlocks(),s(a(a(u,c),i),function(e){o(e.previousSibling,e)}))}),{postProcess:i}}),r(J,[y,T,j,X,m,K,G],function(e,t,n,r,i,o,a){return function(s){function l(e){return e.nodeType&&(e=e.nodeName),!!s.schema.getTextBlockElements()[e.toLowerCase()]}function c(e){return/^(TH|TD)$/.test(e.nodeName)}function u(e){return e&&/^(IMG)$/.test(e.nodeName)}function d(e,t){return Y.getParents(e,t,Y.getRoot())}function f(e){return 1===e.nodeType&&"_mce_caret"===e.id}function h(){g({valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,t,n){ue(n,function(t,n){Y.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),ue("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){g(e,{block:e,remove:"all"})}),g(s.settings.formats)}function p(){s.addShortcut("meta+b","bold_desc","Bold"),s.addShortcut("meta+i","italic_desc","Italic"),s.addShortcut("meta+u","underline_desc","Underline");for(var e=1;6>=e;e++)s.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);s.addShortcut("access+7","",["FormatBlock",!1,"p"]),s.addShortcut("access+8","",["FormatBlock",!1,"div"]),s.addShortcut("access+9","",["FormatBlock",!1,"address"])}function m(e){return e?j[e]:j}function g(e,t){e&&("string"!=typeof e?ue(e,function(e,t){g(t,e)}):(t=t.length?t:[t],ue(t,function(e){e.deep===oe&&(e.deep=!e.selector),e.split===oe&&(e.split=!e.selector||e.inline),e.remove===oe&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),j[e]=t))}function v(e){return e&&j[e]&&delete j[e],j}function y(e,t){var n=m(t);if(n)for(var r=0;r<n.length;r++)if(n[r].inherit===!1&&Y.is(e,n[r].selector))return!0;return!1}function b(e){var t;return s.dom.getParent(e,function(e){return t=s.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function C(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=b(e.parentNode),s.dom.getStyle(e,"color")&&t?s.dom.setStyle(e,"text-decoration",t):s.dom.getStyle(e,"text-decoration")===t&&s.dom.setStyle(e,"text-decoration",null))}function x(t,n,r){function i(e,t){if(t=t||d,e){if(t.onformat&&t.onformat(e,t,n,r),ue(t.styles,function(t,r){Y.setStyle(e,r,M(t,n))}),t.styles){var i=Y.getAttrib(e,"style");i&&e.setAttribute("data-mce-style",i)}ue(t.attributes,function(t,r){Y.setAttrib(e,r,M(t,n))}),ue(t.classes,function(t){t=M(t,n),Y.hasClass(e,t)||Y.addClass(e,t)})}}function o(){function t(t,n){var i=new e(n);for(r=i.prev2();r;r=i.prev2()){if(3==r.nodeType&&r.data.length>0)return r;if(r.childNodes.length>1||r==t||"BR"==r.tagName)return r}}var n=s.selection.getRng(),i=n.startContainer,o=n.endContainer;if(i!=o&&0===n.endOffset){var a=t(i,o),l=3==a.nodeType?a.data.length:a.childNodes.length;n.setEnd(a,l)}return n}function c(e,r,o){var a=[],s,c,h=!0;s=d.inline||d.block,c=Y.create(s),i(c),K.walk(e,function(e){function r(e){var m,v,y,b,C;return C=h,m=e.nodeName.toLowerCase(),v=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&ae(e)&&(C=h,h="true"===ae(e),b=!0),B(m,"br")?(p=0,void(d.block&&Y.remove(e))):d.wrapper&&E(e,t,n)?void(p=0):h&&!b&&d.block&&!d.wrapper&&l(m)&&G(v,s)?(e=Y.rename(e,s),i(e),a.push(e),void(p=0)):d.selector&&(ue(u,function(t){return"collapsed"in t&&t.collapsed!==g?void 0:Y.is(e,t.selector)&&!f(e)?(i(e,t),y=!0,!1):void 0}),!d.inline||y)?void(p=0):void(!h||b||!G(s,m)||!G(v,s)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||f(e)||d.inline&&J(e)?(p=0,ue(de(e.childNodes),r),b&&(h=C),p=0):(p||(p=Y.clone(c,ne),e.parentNode.insertBefore(p,e),a.push(p)),p.appendChild(e)))}var p;ue(e,r)}),d.links===!0&&ue(a,function(e){function t(e){"A"===e.nodeName&&i(e,d),ue(de(e.childNodes),t)}t(e)}),ue(a,function(e){function r(e){var t=0;return ue(e.childNodes,function(e){P(e)||ce(e)||t++}),t}function o(e){var t,n;return ue(e.childNodes,function(e){return 1!=e.nodeType||ce(e)||f(e)?void 0:(t=e,ne)}),t&&!ce(t)&&A(t,d)&&(n=Y.clone(t,ne),i(n),Y.replace(n,e,re),Y.remove(t,1)),n||e}var s;if(s=r(e),(a.length>1||!J(e))&&0===s)return void Y.remove(e,1);if(d.inline||d.wrapper){if(d.exact||1!==s||(e=o(e)),ue(u,function(t){ue(Y.select(t.inline,e),function(e){ce(e)||F(t,n,e,t.exact?e:null)})}),E(e.parentNode,t,n))return Y.remove(e,1),e=0,re;d.merge_with_parents&&Y.getParent(e.parentNode,function(r){return E(r,t,n)?(Y.remove(e,1),e=0,re):void 0}),e&&d.merge_siblings!==!1&&(e=W(U(e),e),e=W(e,U(e,re)))}})}var u=m(t),d=u[0],h,p,g=!r&&X.isCollapsed();if("false"!==ae(X.getNode())){if(d){if(r)r.nodeType?(p=Y.createRng(),p.setStartBefore(r),p.setEndAfter(r),c(H(p,u),null,!0)):c(r,null,!0);else if(g&&d.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length)$("apply",t,n);else{var v=s.selection.getNode();Q||!u[0].defaultBlock||Y.getParent(v,Y.isBlock)||x(u[0].defaultBlock),s.selection.setRng(o()),h=X.getBookmark(),c(H(X.getRng(re),u),h),d.styles&&(d.styles.color||d.styles.textDecoration)&&(fe(v,C,"childNodes"),C(v)),X.moveToBookmark(h),q(X.getRng(re)),s.nodeChanged()}a.postProcess(t,s)}}else{r=X.getNode();for(var y=0,b=u.length;b>y;y++)if(u[y].ceFalseOverride&&Y.is(r,u[y].selector))return void i(r,u[y])}}function w(e,t,n,r){function i(e){var n,r,o,a,s;if(1===e.nodeType&&ae(e)&&(a=y,y="true"===ae(e),s=!0),n=de(e.childNodes),y&&!s)for(r=0,o=h.length;o>r&&!F(h[r],t,e,e);r++);if(p.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(y=a)}}function o(n){var i;return ue(d(n.parentNode).reverse(),function(n){var o;i||"_start"==n.id||"_end"==n.id||(o=E(n,e,t,r),o&&o.split!==!1&&(i=n))}),i}function a(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode, o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=Y.clone(o,ne),c=0;c<h.length;c++)if(F(h[c],t,a,a)){a=0;break}a&&(s&&a.appendChild(s),l||(l=a),s=a)}!i||p.mixed&&J(e)||(n=Y.split(e,n)),s&&(r.parentNode.insertBefore(s,r),l.appendChild(r))}return n}function l(e){return a(o(e),e,e,!0)}function u(e){var t=Y.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return ce(n)&&(n=n[e?"firstChild":"lastChild"]),3==n.nodeType&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),Y.remove(t,!0),n}function f(e){var t,n,r=e.commonAncestorContainer;if(e=H(e,h,re),p.split){if(t=V(e,re),n=V(e),t!=n){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"==t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&c(n)&&n.firstChild&&(n=n.firstChild||n),Y.isChildOf(t,n)&&!J(n)&&!c(t)&&!c(n))return t=O(t,"span",{id:"_start","data-mce-type":"bookmark"}),l(t),void(t=u(re));t=O(t,"span",{id:"_start","data-mce-type":"bookmark"}),n=O(n,"span",{id:"_end","data-mce-type":"bookmark"}),l(t),l(n),t=u(re),n=u()}else t=n=l(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=Z(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=Z(n)+1}K.walk(e,function(e){ue(e,function(e){i(e),1===e.nodeType&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===b(e.parentNode)&&F({deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})}var h=m(e),p=h[0],g,v,y=!0;if(n)return void(n.nodeType?(v=Y.createRng(),v.setStartBefore(n),v.setEndAfter(n),f(v)):f(n));if("false"!==ae(X.getNode()))X.isCollapsed()&&p.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length?$("remove",e,t,r):(g=X.getBookmark(),f(X.getRng(re)),X.moveToBookmark(g),p.inline&&_(e,t,X.getStart())&&q(X.getRng(!0)),s.nodeChanged());else{n=X.getNode();for(var C=0,x=h.length;x>C&&(!h[C].ceFalseOverride||!F(h[C],t,n,n));C++);}}function N(e,t,n){var r=m(e);!_(e,t,n)||"toggle"in r[0]&&!r[0].toggle?x(e,t,n):w(e,t,n)}function E(e,t,n,r){function i(e,t,i){var o,a,s=t[i],l;if(t.onmatch)return t.onmatch(e,t,i);if(s)if(s.length===oe){for(o in s)if(s.hasOwnProperty(o)){if(a="attributes"===i?Y.getAttrib(e,o):D(e,o),r&&!a&&!t.exact)return;if((!r||t.exact)&&!B(a,L(M(s[o],n),o)))return}}else for(l=0;l<s.length;l++)if("attributes"===i?Y.getAttrib(e,s[l]):D(e,s[l]))return t;return t}var o=m(t),a,s,l;if(o&&e)for(s=0;s<o.length;s++)if(a=o[s],A(e,a)&&i(e,a,"attributes")&&i(e,a,"styles")){if(l=a.classes)for(s=0;s<l.length;s++)if(!Y.hasClass(e,l[s]))return;return a}}function _(e,t,n){function r(n){var r=Y.getRoot();return n===r?!1:(n=Y.getParent(n,function(n){return y(n,e)?!0:n.parentNode===r||!!E(n,e,t,!0)}),E(n,e,t))}var i;return n?r(n):(n=X.getNode(),r(n)?re:(i=X.getStart(),i!=n&&r(i)?re:ne))}function S(e,t){var n,r=[],i={};return n=X.getStart(),Y.getParent(n,function(n){var o,a;for(o=0;o<e.length;o++)a=e[o],!i[a]&&E(n,a,t)&&(i[a]=!0,r.push(a))},Y.getRoot()),r}function k(e){var t=m(e),n,r,i,o,a;if(t)for(n=X.getStart(),r=d(n),o=t.length-1;o>=0;o--){if(a=t[o].selector,!a||t[o].defaultBlock)return re;for(i=r.length-1;i>=0;i--)if(Y.is(r[i],a))return re}return ne}function T(e,t,n){var r;return ie||(ie={},r={},s.on("NodeChange",function(e){var t=d(e.element),n={};t=i.grep(t,function(e){return 1==e.nodeType&&!e.getAttribute("data-mce-bogus")}),ue(ie,function(e,i){ue(t,function(o){return E(o,i,{},e.similar)?(r[i]||(ue(e,function(e){e(!0,{node:o,format:i,parents:t})}),r[i]=e),n[i]=e,!1):y(o,i)?!1:void 0})}),ue(r,function(i,o){n[o]||(delete r[o],ue(i,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),ue(e.split(","),function(e){ie[e]||(ie[e]=[],ie[e].similar=n),ie[e].push(t)}),this}function R(e){return o.getCssText(s,e)}function A(e,t){return B(e,t.inline)?re:B(e,t.block)?re:t.selector?1==e.nodeType&&Y.is(e,t.selector):void 0}function B(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function D(e,t){return L(Y.getStyle(e,t),t)}function L(e,t){return"color"!=t&&"backgroundColor"!=t||(e=Y.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function M(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function P(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function O(e,t,n){var r=Y.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function H(t,n,r){function i(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=Y.getRoot(),3==r.nodeType&&!P(r)&&(e?v>0:b<r.nodeValue.length))return r;for(;;){if(!n[0].block_expand&&J(i))return i;for(o=i[a];o;o=o[a])if(!ce(o)&&!P(o)&&!t(o))return i;if(i==s||i.parentNode==s){r=i;break}i=i.parentNode}return r}function o(e,t){for(t===oe&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)e=e.childNodes[t],e&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}}function a(e){for(var t=e;t;){if(1===t.nodeType&&ae(t))return"false"===ae(t)?t:e;t=t.parentNode}return e}function c(t,n,i){function o(e,t){var n,o,a=e.nodeValue;return"undefined"==typeof t&&(t=i?a.length:0),i?(n=a.lastIndexOf(" ",t),o=a.lastIndexOf("\xa0",t),n=n>o?n:o,-1===n||r||n++):(n=a.indexOf(" ",t),o=a.indexOf("\xa0",t),n=-1!==n&&(-1===o||o>n)?n:o),n}var a,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(a=new e(t,Y.getParent(t,J)||s.getBody());l=a[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(J(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function u(e,r){var i,o,a,s;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=d(e),o=0;o<i.length;o++)for(a=0;a<n.length;a++)if(s=n[a],!("collapsed"in s&&s.collapsed!==t.collapsed)&&Y.is(i[o],s.selector))return i[o];return e}function f(e,t){var r,i=Y.getRoot();if(n[0].wrapper||(r=Y.getParent(e,n[0].block,i)),r||(r=Y.getParent(3==e.nodeType?e.parentNode:e,function(e){return e!=i&&l(e)})),r&&n[0].wrapper&&(r=d(r,"ul,ol").reverse()[0]||r),!r)for(r=e;r[t]&&!J(r[t])&&(r=r[t],!B(r,"br")););return r||e}var h,p,m,g=t.startContainer,v=t.startOffset,y=t.endContainer,b=t.endOffset;if(1==g.nodeType&&g.hasChildNodes()&&(h=g.childNodes.length-1,g=g.childNodes[v>h?h:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(h=y.childNodes.length-1,y=y.childNodes[b>h?h:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=a(g),y=a(y),(ce(g.parentNode)||ce(g))&&(g=ce(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(ce(y.parentNode)||ce(y))&&(y=ce(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=c(g,v,!0),m&&(g=m.container,v=m.offset),m=c(y,b),m&&(y=m.container,b=m.offset)),p=o(y,b),p.node)){for(;p.node&&0===p.offset&&p.node.previousSibling;)p=o(p.node.previousSibling);p.node&&p.offset>0&&3===p.node.nodeType&&" "===p.node.nodeValue.charAt(p.offset-1)&&p.offset>1&&(y=p.node,y.splitText(p.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=i(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=i())),n[0].selector&&n[0].expand!==ne&&!n[0].inline&&(g=u(g,"previousSibling"),y=u(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(J(g)||(g=i(!0)),J(y)||(y=i()))),1==g.nodeType&&(v=Z(g),g=g.parentNode),1==y.nodeType&&(b=Z(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function I(e,t){return t.links&&"A"==e.tagName}function F(e,t,n,r){var i,o,a;if(!A(n,e)&&!I(n,e))return ne;if("all"!=e.remove)for(ue(e.styles,function(i,o){i=L(M(i,t),o),"number"==typeof o&&(o=i,r=0),(e.remove_similar||!r||B(D(r,o),i))&&Y.setStyle(n,o,""),a=1}),a&&""===Y.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),ue(e.attributes,function(e,i){var o;if(e=M(e,t),"number"==typeof i&&(i=e,r=0),!r||B(Y.getAttrib(r,i),e)){if("class"==i&&(e=Y.getAttrib(n,i),e&&(o="",ue(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void Y.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),te.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),ue(e.classes,function(e){e=M(e,t),r&&!Y.hasClass(r,e)||Y.removeClass(n,e)}),o=Y.getAttribs(n),i=0;i<o.length;i++){var s=o[i].nodeName;if(0!==s.indexOf("_")&&0!==s.indexOf("data-"))return ne}return"none"!=e.remove?(z(n,e),re):void 0}function z(e,t){function n(e,t,n){return e=U(e,t,n),!e||"BR"==e.nodeName||J(e)}var r=e.parentNode,i;t.block&&(Q?r==Y.getRoot()&&(t.list_block&&B(e,t.list_block)||ue(de(e.childNodes),function(e){G(Q,e.nodeName.toLowerCase())?i?i.appendChild(e):(i=O(e,Q),Y.setAttribs(i,s.settings.forced_root_block_attrs)):i=0})):J(e)&&!J(r)&&(n(e,ne)||n(e.firstChild,re,1)||e.insertBefore(Y.create("br"),e.firstChild),n(e,re)||n(e.lastChild,ne,1)||e.appendChild(Y.create("br")))),t.selector&&t.inline&&!B(t.inline,e)||Y.remove(e,1)}function U(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1==e.nodeType||!P(e))return e}function W(e,t){function n(e,t){for(i=e;i;i=i[t]){if(3==i.nodeType&&0!==i.nodeValue.length)return e;if(1==i.nodeType&&!ce(i))return i}return e}var i,o,a=new r(Y);if(e&&t&&(e=n(e,"previousSibling"),t=n(t,"nextSibling"),a.compare(e,t))){for(i=e.nextSibling;i&&i!=t;)o=i,i=i.nextSibling,e.appendChild(o);return Y.remove(t),ue(de(t.childNodes),function(t){e.appendChild(t)}),e}return t}function V(t,n){var r,i,o;return r=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1==r.nodeType&&(o=r.childNodes.length-1,!n&&i&&i--,r=r.childNodes[i>o?o:i]),3===r.nodeType&&n&&i>=r.nodeValue.length&&(r=new e(r,s.getBody()).next()||r),3!==r.nodeType||n||0!==i||(r=new e(r,s.getBody()).prev()||r),r}function $(t,n,r,i){function o(e){var t=Y.create("span",{id:g,"data-mce-bogus":!0,style:v?"color:red":""});return e&&t.appendChild(s.getDoc().createTextNode(ee)),t}function a(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==ee||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function c(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=X.getRng(!0),a(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),Y.remove(e)):(n=u(e),n.nodeValue.charAt(0)===ee&&(n.deleteData(0,1),r.startContainer==n&&r.startOffset>0&&r.setStart(n,r.startOffset-1),r.endContainer==n&&r.endOffset>0&&r.setEnd(n,r.endOffset-1)),Y.remove(e,1)),X.setRng(r);else if(e=c(X.getStart()),!e)for(;e=Y.get(g);)d(e,!1)}function f(){var e,t,i,a,s,l,d;e=X.getRng(!0),a=e.startOffset,l=e.startContainer,d=l.nodeValue,t=c(X.getStart()),t&&(i=u(t)),d&&a>0&&a<d.length&&/\w/.test(d.charAt(a))&&/\w/.test(d.charAt(a-1))?(s=X.getBookmark(),e.collapse(!0),e=H(e,m(n)),e=K.split(e),x(n,r,e),X.moveToBookmark(s)):(t&&i.nodeValue===ee?x(n,r,t):(t=o(!0),i=t.firstChild,e.insertNode(t),a=1,x(n,r,t)),X.setCursorLocation(i,a))}function h(){var e=X.getRng(!0),t,a,s,c,u,d,f=[],h,p;for(t=e.startContainer,a=e.startOffset,u=t,3==t.nodeType&&(a!=t.nodeValue.length&&(c=!0),u=u.parentNode);u;){if(E(u,n,r,i)){d=u;break}u.nextSibling&&(c=!0),f.push(u),u=u.parentNode}if(d)if(c)s=X.getBookmark(),e.collapse(!0),e=H(e,m(n),!0),e=K.split(e),w(n,r,e),X.moveToBookmark(s);else{for(p=o(),u=p,h=f.length-1;h>=0;h--)u.appendChild(Y.clone(f[h],!1)),u=u.firstChild;u.appendChild(Y.doc.createTextNode(ee)),u=u.firstChild;var g=Y.getParent(d,l);g&&Y.isEmpty(g)?d.parentNode.replaceChild(p,d):Y.insertAfter(p,d),X.setCursorLocation(u,1),Y.isEmpty(d)&&Y.remove(d)}}function p(){var e;e=c(X.getStart()),e&&!Y.isEmpty(e)&&fe(e,function(e){1!=e.nodeType||e.id===g||Y.isEmpty(e)||Y.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var g="_mce_caret",v=s.settings.caret_debug;s._hasCaretEvents||(le=function(){var e=[],t;if(a(c(X.getStart()),e))for(t=e.length;t--;)Y.setAttrib(e[t],"data-mce-bogus","1")},se=function(e){var t=e.keyCode;d(),8==t&&X.isCollapsed()&&X.getStart().innerHTML==ee&&d(c(X.getStart())),37!=t&&39!=t||d(c(X.getStart())),p()},s.on("SetContent",function(e){e.selection&&p()}),s._hasCaretEvents=!0),"apply"==t?f():h()}function q(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if((t.startContainer!=t.endContainer||!u(t.startContainer.childNodes[t.startOffset]))&&(3==n.nodeType&&r>=n.nodeValue.length&&(r=Z(n),n=n.parentNode,i=!0),1==n.nodeType))for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,Y.getParent(n,Y.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!P(a))return l=Y.create("a",{"data-mce-bogus":"all"},ee),a.parentNode.insertBefore(l,a),t.setStart(a,0),X.setRng(t),void Y.remove(l)}var j={},Y=s.dom,X=s.selection,K=new t(Y),G=s.schema.isValidChild,J=Y.isBlock,Q=s.settings.forced_root_block,Z=Y.nodeIndex,ee="\ufeff",te=/^(src|href|style)$/,ne=!1,re=!0,ie,oe,ae=Y.getContentEditable,se,le,ce=n.isBookmarkNode,ue=i.each,de=i.grep,fe=i.walk,he=i.extend;he(this,{get:m,register:g,unregister:v,apply:x,remove:w,toggle:N,match:_,matchAll:S,matchNode:E,canApply:k,formatChanged:T,getCssText:R}),h(),p(),s.on("BeforeGetContent",function(e){le&&"raw"!=e.format&&le()}),s.on("mouseup keydown",function(e){se&&se(e)})}}),r(Q,[I,d],function(e,t){return function(e){function n(){return e.serializer.getTrimmedContent()}function r(t){e.setDirty(t)}function i(e){o.typing=!1,o.add({},e)}var o=this,a=0,s=[],l,c,u=0;return e.on("init",function(){o.add()}),e.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&o.beforeChange()}),e.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&i(e)}),e.on("ObjectResizeStart Cut",function(){o.beforeChange()}),e.on("SaveContent ObjectResized blur",i),e.on("DragEnd",i),e.on("KeyUp",function(a){var l=a.keyCode;a.isDefaultPrevented()||((l>=33&&36>=l||l>=37&&40>=l||45==l||13==l||a.ctrlKey)&&(i(),e.nodeChanged()),(46==l||8==l||t.mac&&(91==l||93==l))&&e.nodeChanged(),c&&o.typing&&(e.isDirty()||(r(s[0]&&n()!=s[0].content),e.isDirty()&&e.fire("change",{level:s[0],lastLevel:null})),e.fire("TypingUndo"),c=!1,e.nodeChanged()))}),e.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented()){if(t>=33&&36>=t||t>=37&&40>=t||45==t)return void(o.typing&&i(e));var n=e.ctrlKey&&!e.altKey||e.metaKey;!(16>t||t>20)||224==t||91==t||o.typing||n||(o.beforeChange(),o.typing=!0,o.add({},e),c=!0)}}),e.on("MouseDown",function(e){o.typing&&i(e)}),e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),e.on("AddUndo Undo Redo ClearUndos",function(t){t.isDefaultPrevented()||e.nodeChanged()}),o={data:s,typing:!1,beforeChange:function(){u||(l=e.selection.getBookmark(2,!0))},add:function(t,i){var o,c=e.settings,d;if(t=t||{},t.content=n(),u||e.removed)return null;if(d=s[a],e.fire("BeforeAddUndo",{level:t,lastLevel:d,originalEvent:i}).isDefaultPrevented())return null;if(d&&d.content==t.content)return null;if(s[a]&&(s[a].beforeBookmark=l),c.custom_undo_redo_levels&&s.length>c.custom_undo_redo_levels){for(o=0;o<s.length-1;o++)s[o]=s[o+1];s.length--,a=s.length}t.bookmark=e.selection.getBookmark(2,!0),a<s.length-1&&(s.length=a+1),s.push(t),a=s.length-1;var f={level:t,lastLevel:d,originalEvent:i};return e.fire("AddUndo",f),a>0&&(r(!0),e.fire("change",f)),t},undo:function(){var t;return o.typing&&(o.add(),o.typing=!1),a>0&&(t=s[--a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.beforeBookmark),r(!0),e.fire("undo",{level:t})),t},redo:function(){var t;return a<s.length-1&&(t=s[++a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.bookmark),r(!0),e.fire("redo",{level:t})),t},clear:function(){s=[],a=0,o.typing=!1,o.data=s,e.fire("ClearUndos")},hasUndo:function(){return a>0||o.typing&&s[0]&&n()!=s[0].content},hasRedo:function(){return a<s.length-1&&!this.typing},transact:function(e){o.beforeChange();try{u++,e()}finally{u--}return o.add()},extra:function(t,n){var r,i;o.transact(t)&&(i=s[a].bookmark,r=s[a-1],e.setContent(r.content,{format:"raw"}),e.selection.moveToBookmark(r.beforeBookmark),o.transact(n)&&(s[a-1].beforeBookmark=i))}}}}),r(Z,[y,T,d],function(e,t,n){var r=n.ie&&n.ie<11;return function(i){function o(o){function h(e){return e&&a.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==a.getContentEditable(e)}function p(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}function m(e){var t;a.isBlock(e)&&(t=s.getRng(),e.appendChild(a.create("span",null,"\xa0")),s.select(e),e.lastChild.outerHTML="",s.setRng(t))}function g(e){var t=e,n=[],r;if(t){for(;t=t.firstChild;){if(a.isBlock(t))return;1!=t.nodeType||d[t.nodeName.toLowerCase()]||n.push(t)}for(r=n.length;r--;)t=n[r],!t.hasChildNodes()||t.firstChild==t.lastChild&&""===t.firstChild.nodeValue?a.remove(t):"A"==t.nodeName&&" "===(t.innerText||t.textContent)&&a.remove(t)}}function v(t){function r(e){for(;e;){if(1==e.nodeType||3==e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}var i,o,l,c=t,u;if(t){if(n.ie&&n.ie<9&&M&&M.firstChild&&M.firstChild==M.lastChild&&"BR"==M.firstChild.tagName&&a.remove(M.firstChild),/^(LI|DT|DD)$/.test(t.nodeName)){var d=r(t.firstChild);d&&/^(UL|OL|DL)$/.test(d.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(l=a.createRng(),n.ie||t.normalize(),t.hasChildNodes()){for(i=new e(t,t);o=i.current();){if(3==o.nodeType){l.setStart(o,0),l.setEnd(o,0);break}if(f[o.nodeName.toLowerCase()]){l.setStartBefore(o),l.setEndBefore(o);break}c=o,o=i.next()}o||(l.setStart(c,0),l.setEnd(c,0))}else"BR"==t.nodeName?t.nextSibling&&a.isBlock(t.nextSibling)?((!P||9>P)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}}function y(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function b(e){e.innerHTML=r?"":'<br data-mce-bogus="1">'}function C(e){var t=D,n,i,o,s=u.getTextInlineElements();if(e||"TABLE"==z?(n=a.create(e||W),y(n)):n=M.cloneNode(!1),o=n,l.keep_styles!==!1)do if(s[t.nodeName]){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while((t=t.parentNode)&&t!=B);return r||(o.innerHTML='<br data-mce-bogus="1">'),n}function x(t){var n,r,i;if(3==D.nodeType&&(t?L>0:L<D.nodeValue.length))return!1;if(D.parentNode==M&&V&&!t)return!0;if(t&&1==D.nodeType&&D==M.firstChild)return!0;if("TABLE"===D.nodeName||D.previousSibling&&"TABLE"==D.previousSibling.nodeName)return V&&!t||!V&&t;for(n=new e(D,M),3==D.nodeType&&(t&&0===L?n.prev():t||L!=D.nodeValue.length||n.next());r=n.current();){if(1===r.nodeType){if(!r.getAttribute("data-mce-bogus")&&(i=r.nodeName.toLowerCase(),d[i]&&"br"!==i))return!1}else if(3===r.nodeType&&!/^[ \t\r\n]*$/.test(r.nodeValue))return!1;t?n.prev():n.next()}return!0}function w(e,t){var n,r,o,s,l,c,d=W||"P";if(r=a.getParent(e,a.isBlock),!r||!h(r)){if(r=r||B,c=r==i.getBody()||p(r)?r.nodeName.toLowerCase():r.parentNode.nodeName.toLowerCase(),!r.hasChildNodes())return n=a.create(d),y(n),r.appendChild(n),R.setStart(n,0),R.setEnd(n,0),n;for(s=e;s.parentNode!=r;)s=s.parentNode;for(;s&&!a.isBlock(s);)o=s,s=s.previousSibling;if(o&&u.isValidChild(c,d.toLowerCase())){for(n=a.create(d),y(n),o.parentNode.insertBefore(n,o),s=o;s&&!a.isBlock(s);)l=s.nextSibling,n.appendChild(s),s=l;R.setStart(e,t),R.setEnd(e,t)}}return e}function N(){function e(e){for(var t=F[e?"firstChild":"lastChild"];t&&1!=t.nodeType;)t=t[e?"nextSibling":"previousSibling"];return t===M}function t(){var e=F.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:F}if(F!=i.getBody()){var n=F.parentNode.nodeName;/^(OL|UL|LI)$/.test(n)&&(W="LI"),H=W?C(W):a.create("BR"),e(!0)&&e()?"LI"==n?a.insertAfter(H,t()):a.replace(H,F):e(!0)?"LI"==n?(a.insertAfter(H,t()),H.appendChild(a.doc.createTextNode(" ")),H.appendChild(F)):F.parentNode.insertBefore(H,F):e()?(a.insertAfter(H,t()),m(H)):(F=t(),A=R.cloneRange(),A.setStartAfter(M),A.setEndAfter(F),I=A.extractContents(),"LI"==W&&"LI"==I.firstChild.nodeName?(H=I.firstChild,a.insertAfter(I,F)):(a.insertAfter(I,F),a.insertAfter(H,F))),a.remove(M),v(H),c.add()}}function E(){i.execCommand("InsertLineBreak",!1,o)}function _(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function S(e){var t=a.getRoot(),n,r;for(n=e;n!==t&&"false"!==a.getContentEditable(n);)"true"===a.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function k(e){var t;r||(e.normalize(),t=e.lastChild,t&&!/^(left|right)$/gi.test(a.getStyle(t,"float",!0))||a.add(e,"br"))}function T(){H=/^(H[1-6]|PRE|FIGURE)$/.test(z)&&"HGROUP"!=U?C(W):C(),l.end_container_on_empty_block&&h(F)&&a.isEmpty(M)?H=a.split(F,M):a.insertAfter(H,M),v(H)}var R,A,B,D,L,M,P,O,H,I,F,z,U,W,V;if(R=s.getRng(!0),!o.isDefaultPrevented()){if(!R.collapsed)return void i.execCommand("Delete");if(new t(a).normalize(R),D=R.startContainer,L=R.startOffset,W=(l.force_p_newlines?"p":"")||l.forced_root_block,W=W?W.toUpperCase():"",P=a.doc.documentMode,O=o.shiftKey,1==D.nodeType&&D.hasChildNodes()&&(V=L>D.childNodes.length-1,D=D.childNodes[Math.min(L,D.childNodes.length-1)]||D,L=V&&3==D.nodeType?D.nodeValue.length:0),B=S(D)){if(c.beforeChange(),!a.isBlock(B)&&B!=a.getRoot())return void(W&&!O||E());if((W&&!O||!W&&O)&&(D=w(D,L)),M=a.getParent(D,a.isBlock),F=M?a.getParent(M.parentNode,a.isBlock):null,z=M?M.nodeName.toUpperCase():"",U=F?F.nodeName.toUpperCase():"","LI"!=U||o.ctrlKey||(M=F,z=U),/^(LI|DT|DD)$/.test(z)){if(!W&&O)return void E();if(a.isEmpty(M))return void N()}if("PRE"==z&&l.br_in_pre!==!1){if(!O)return void E()}else if(!W&&!O&&"LI"!=z||W&&O)return void E();W&&M===i.getBody()||(W=W||"P",x()?T():x(!0)?(H=M.parentNode.insertBefore(C(),M),m(H),v(M)):(A=R.cloneRange(),A.setEndAfter(M),I=A.extractContents(),_(I),H=I.firstChild,a.insertAfter(I,M),g(H),k(M),a.isEmpty(M)&&b(M),H.normalize(),a.isEmpty(H)?(a.remove(H),T()):v(H)),a.setAttrib(H,"id",""),i.fire("NewBlock",{newBlock:H}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements(),f=u.getMoveCaretBeforeOnEnterElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(ee,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,h,p,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){p=t,t=t.nextSibling,r.remove(p);continue}h||(h=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(h,t),g=!0),p=t,t=t.nextSibling,h.appendChild(p)}else h=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(te,[z,y,_,$,k,U],function(e,t,n,r,i,o){function a(e){return e>0}function s(e){return 0>e}function l(e,n,r,i,o){var l=new t(e,i);if(s(n)){if(C(e)&&(e=l.prev(!0),r(e)))return e;for(;e=l.prev(o);)if(r(e))return e}if(a(n)){if(C(e)&&(e=l.next(!0),r(e)))return e;for(;e=l.next(o);)if(r(e))return e}return null}function c(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode)if(b(e))return e;return t}function u(e,t){for(;e&&e!=t;){if(x(e))return e;e=e.parentNode}return null}function d(e,t,n){return u(e.container(),n)==u(t.container(),n)}function f(e,t,n){return c(e.container(),n)==c(t.container(),n)}function h(e,t){var n,r;return t?(n=t.container(),r=t.offset(),E(n)?n.childNodes[r+e]:null):null}function p(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n}function m(e,t,n){return u(t,e)==u(n,e)}function g(e,t,n){var r,i;for(i=e?"previousSibling":"nextSibling";n&&n!=t;){if(r=n[i],w(r)&&(r=r[i]),C(r)){if(m(t,r,n))return r;break}if(_(r))break;n=n.parentNode}return null}function v(e,t,r){var o,a,s,l,c=N(g,!0,t),u=N(g,!1,t);if(a=r.startContainer,s=r.startOffset,i.isCaretContainerBlock(a)){if(E(a)||(a=a.parentNode),l=a.getAttribute("data-mce-caret"),"before"==l&&(o=a.nextSibling,C(o)))return S(o);if("after"==l&&(o=a.previousSibling,C(o)))return k(o)}if(!r.collapsed)return r;if(n.isText(a)){if(w(a)){if(1===e){if(o=u(a))return S(o);if(o=c(a))return k(o)}if(-1===e){if(o=c(a))return k(o);if(o=u(a))return S(o)}return r}if(i.endsWithCaretContainer(a)&&s>=a.data.length-1)return 1===e&&(o=u(a))?S(o):r;if(i.startsWithCaretContainer(a)&&1>=s)return-1===e&&(o=c(a))?k(o):r;if(s===a.data.length)return o=u(a),o?S(o):r;if(0===s)return o=c(a),o?k(o):r}return r}function y(e,t){return C(h(e,t))}var b=n.isContentEditableTrue,C=n.isContentEditableFalse,x=n.matchStyleValues("display","block table table-cell table-caption"),w=i.isCaretContainer,N=e.curry,E=n.isElement,_=o.isCaretCandidate,S=N(p,!0),k=N(p,!1);return{isForwards:a,isBackwards:s,findNode:l,getEditingHost:c,getParentBlock:u,isInSameBlock:d,isInSameEditingHost:f,isBeforeContentEditableFalse:N(y,0),isAfterContentEditableFalse:N(y,-1),normalizeRange:v}}),r(ne,[_,U,$,te,p,z],function(e,t,n,r,i,o){function a(e,t){for(var n=[];e&&e!=t;)n.push(e),e=e.parentNode;return n}function s(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null}function l(e,t){if(m(e)){if(v(t.previousSibling)&&!f(t.previousSibling))return n.before(t);if(f(t))return n(t,0)}if(g(e)){if(v(t.nextSibling)&&!f(t.nextSibling))return n.after(t);if(f(t))return n(t,t.data.length)}return g(e)?p(t)?n.before(t):n.after(t):n.before(t)}function c(t,i){var o;return e.isBr(t)?(o=u(1,n.after(t),i),o?!r.isInSameBlock(n.before(t),n.before(o),i):!1):!1}function u(e,t,p){var C,x,w,N,E,_,S;if(!h(p)||!t)return null;if(S=t,C=S.container(),x=S.offset(),f(C)){if(g(e)&&x>0)return n(C,--x);if(m(e)&&x<C.length)return n(C,++x);w=C}else{if(g(e)&&x>0&&(N=s(C,x-1),v(N)))return!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,E.data.length):n.after(E):f(N)?n(N,N.data.length):n.before(N);if(m(e)&&x<C.childNodes.length&&(N=s(C,x),v(N)))return c(N,p)?u(e,n.after(N),p):!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,0):n.before(E):f(N)?n(N,0):n.after(N);w=S.getNode()}return(m(e)&&S.isAtEnd()||g(e)&&S.isAtStart())&&(w=r.findNode(w,e,o.constant(!0),p,!0),b(w))?l(e,w):(N=r.findNode(w,e,b,p),_=i.last(i.filter(a(C,p),d)),!_||N&&_.contains(N)?N?l(e,N):null:S=m(e)?n.after(_):n.before(_))}var d=e.isContentEditableFalse,f=e.isText,h=e.isElement,p=e.isBr,m=r.isForwards,g=r.isBackwards,v=t.isCaretCandidate,y=t.isAtomic,b=t.isEditableCaretCandidate;return function(e){return{next:function(t){return u(1,t,e)},prev:function(t){return u(-1,t,e)}}}}),r(re,[m,ne,$],function(e,t,n){var r=function(e){var t=e.firstChild,n=e.lastChild;return t&&"meta"===t.name&&(t=t.next),n&&"mce_marker"===n.attr("id")&&(n=n.prev),t&&t===n?"ul"===t.name||"ol"===t.name:!1},i=function(e){var t=e.firstChild,n=e.lastChild;return t&&"META"===t.nodeName&&t.parentNode.removeChild(t),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),e},o=function(e,t,n){var r=t.serialize(n),o=e.createFragment(r);return i(o)},a=function(t){return e.grep(t.childNodes,function(e){return"LI"===e.nodeName})},s=function(e){return!e.firstChild},l=function(e){return e.length>0&&s(e[e.length-1])?e.slice(0,-1):e},c=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},u=function(e,t){return!!c(e,t)},d=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]},f=function(e,r){var i=n.before(e),o=new t(r),a=o.next(i);return a?a.toRange():null},h=function(e,r){var i=n.after(e),o=new t(r),a=o.prev(i);return a?a.toRange():null},p=function(t,n,r,i){var o=d(t,i),a=t.parentNode;return a.insertBefore(o[0],t),e.each(n,function(e){a.insertBefore(e,t)}),a.insertBefore(o[1],t),a.removeChild(t),h(n[n.length-1],r)},m=function(t,n,r){var i=t.parentNode;return e.each(n,function(e){i.insertBefore(e,t)}),f(t,r)},g=function(e,t,n,r){return r.insertAfter(t.reverse(),e),h(t[0],n)},v=function(e,r,i,s){var u=o(r,e,s),d=c(r,i.startContainer),f=l(a(u.firstChild)),h=1,v=2,y=r.getRoot(),b=function(e){var o=n.fromRangeStart(i),a=new t(r.getRoot()),s=e===h?a.prev(o):a.next(o);return s?c(r,s.getNode())!==d:!0};return b(h)?m(d,f,y):b(v)?g(d,f,y,r):p(d,f,y,i)};return{isListFragment:r,insertAtCaret:v,isParentBlockLi:u,trimListItems:l,listItems:a}}),r(ie,[d,m,P,ne,$,X,_,re],function(e,t,n,r,i,o,a,s){var l=a.matchNodeNames("td th"),c=function(a,c,u){function d(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=D.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i<r.length?e=e.replace(/ (<br>|)$/," "):t("nextSibling")||(e=e.replace(/( | )(<br>|)$/," "))),e}function f(){var e,t,n;e=D.getRng(!0),t=e.startContainer,n=e.startOffset,3==t.nodeType&&e.collapsed&&("\xa0"===t.data[n]?(t.deleteData(n,1),/[\u00a0| ]$/.test(c)||(c+=" ")):"\xa0"===t.data[n-1]&&(t.deleteData(n-1,1),/[\u00a0| ]$/.test(c)||(c=" "+c)))}function h(){if(A){var e=a.getBody(),n=new o(L);t.each(L.select("*[data-mce-fragment]"),function(t){for(var r=t.parentNode;r&&r!=e;r=r.parentNode)B[t.nodeName.toLowerCase()]&&n.compare(r,t)&&L.remove(t,!0)})}}function p(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}function m(e){t.each(e.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")})}function g(e){return!!e.getAttribute("data-mce-fragment")}function v(e){return e&&!a.schema.getShortEndedElements()[e.nodeName]}function y(t){function n(e){for(var t=a.getBody();e&&e!==t;e=e.parentNode)if("false"===a.dom.getContentEditable(e))return e;return null}function o(e){var t=i.fromRangeStart(e),n=new r(a.getBody());return t=n.next(t),t?t.toRange():void 0}var s,c,u;if(t){if(D.scrollIntoView(t),s=n(t))return L.remove(t),void D.select(s);S=L.createRng(),k=t.previousSibling,k&&3==k.nodeType?(S.setStart(k,k.nodeValue.length),e.ie||(T=t.nextSibling,T&&3==T.nodeType&&(k.appendData(T.data),T.parentNode.removeChild(T)))):(S.setStartBefore(t),S.setEndBefore(t)),c=L.getParent(t,L.isBlock),L.remove(t),c&&L.isEmpty(c)&&(a.$(c).empty(),S.setStart(c,0),S.setEnd(c,0),l(c)||g(c)||!(u=o(S))?L.add(c,L.create("br",{"data-mce-bogus":"1"})):(S=u,L.remove(c))),D.setRng(S)}}var b,C,x,w,N,E,_,S,k,T,R,A,B=a.schema.getTextInlineElements(),D=a.selection,L=a.dom;/^ | $/.test(c)&&(c=d(c)),b=a.parser,A=u.merge,C=new n({validate:a.settings.validate},a.schema),R='<span id="mce_marker" data-mce-type="bookmark">​</span>',E={content:c,format:"html",selection:!0},a.fire("BeforeSetContent",E),c=E.content,-1==c.indexOf("{$caret}")&&(c+="{$caret}"),c=c.replace(/\{\$caret\}/,R),S=D.getRng();var M=S.startContainer||(S.parentElement?S.parentElement():null),P=a.getBody();M===P&&D.isCollapsed()&&L.isBlock(P.firstChild)&&v(P.firstChild)&&L.isEmpty(P.firstChild)&&(S=L.createRng(),S.setStart(P.firstChild,0),S.setEnd(P.firstChild,0),D.setRng(S)),D.isCollapsed()||(a.selection.setRng(a.selection.getRng()),a.getDoc().execCommand("Delete",!1,null), f()),x=D.getNode();var O={context:x.nodeName.toLowerCase(),data:u.data};if(N=b.parse(c,O),u.paste===!0&&s.isListFragment(N)&&s.isParentBlockLi(L,x))return S=s.insertAtCaret(C,L,a.selection.getRng(!0),N),a.selection.setRng(S),void a.fire("SetContent",E);if(p(N),k=N.lastChild,"mce_marker"==k.attr("id"))for(_=k,k=k.prev;k;k=k.walk(!0))if(3==k.type||!L.isBlock(k.name)){a.schema.isValidChild(k.parent.name,"span")&&k.parent.insert(_,k,"br"===k.name);break}if(a._selectionOverrides.showBlockCaretContainer(x),O.invalid){for(D.setContent(R),x=D.getNode(),w=a.getBody(),9==x.nodeType?x=k=w:k=x;k!==w;)x=k,k=k.parentNode;c=x==w?w.innerHTML:L.getOuterHTML(x),c=C.serialize(b.parse(c.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return C.serialize(N)}))),x==w?L.setHTML(w,c):L.setOuterHTML(x,c)}else c=C.serialize(N),k=x.firstChild,T=x.lastChild,!k||k===T&&"BR"===k.nodeName?L.setHTML(x,c):D.setContent(c);h(),y(L.get("mce_marker")),m(a.getBody()),a.fire("SetContent",E),a.addVisual()},u=function(e){var n;return"string"!=typeof e?(n=t.extend({paste:e.paste,data:{paste:e.paste}},e),{content:e.content,details:n}):{content:e,details:{}}},d=function(e,t){var n=u(t);c(e,n.content,n.details)};return{insertAtCaret:d}}),r(oe,[d,m,T,y,ie],function(e,n,r,i,o){var a=n.each,s=n.extend,l=n.map,c=n.inArray,u=n.explode,d=e.ie&&e.ie<11,f=!0,h=!1;return function(n){function p(e,t,r,i){var o,s,l=0;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||i&&i.skip_focus||n.focus(),i=n.fire("BeforeExecCommand",{command:e,ui:t,value:r}),i.isDefaultPrevented())return!1;if(s=e.toLowerCase(),o=B.exec[s])return o(s,t,r),n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;if(a(n.plugins,function(i){return i.execCommand&&i.execCommand(e,t,r)?(n.fire("ExecCommand",{command:e,ui:t,value:r}),l=!0,!1):void 0}),l)return l;if(n.theme&&n.theme.execCommand&&n.theme.execCommand(e,t,r))return n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;try{l=n.getDoc().execCommand(e,t,r)}catch(c){}return l?(n.fire("ExecCommand",{command:e,ui:t,value:r}),!0):!1}function m(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.state[e])return t(e);try{return n.getDoc().queryCommandState(e)}catch(r){}return!1}}function g(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.value[e])return t(e);try{return n.getDoc().queryCommandValue(e)}catch(r){}}}function v(e,t){t=t||"exec",a(e,function(e,n){a(n.toLowerCase().split(","),function(n){B[t][n]=e})})}function y(e,t,r){e=e.toLowerCase(),B.exec[e]=function(e,i,o,a){return t.call(r||n,i,o,a)}}function b(e){if(e=e.toLowerCase(),B.exec[e])return!0;try{return n.getDoc().queryCommandSupported(e)}catch(t){}return!1}function C(e,t,r){e=e.toLowerCase(),B.state[e]=function(){return t.call(r||n)}}function x(e,t,r){e=e.toLowerCase(),B.value[e]=function(){return t.call(r||n)}}function w(e){return e=e.toLowerCase(),!!B.exec[e]}function N(e,r,i){return r===t&&(r=h),i===t&&(i=null),n.getDoc().execCommand(e,r,i)}function E(e){return A.match(e)}function _(e,r){A.toggle(e,r?{value:r}:t),n.nodeChanged()}function S(e){L=R.getBookmark(e)}function k(){R.moveToBookmark(L)}var T,R,A,B={state:{},exec:{},value:{}},D=n.settings,L;n.on("PreInit",function(){T=n.dom,R=n.selection,D=n.settings,A=n.formatter}),s(this,{execCommand:p,queryCommandState:m,queryCommandValue:g,queryCommandSupported:b,addCommands:v,addCommand:y,addQueryStateHandler:C,addQueryValueHandler:x,hasCustomCommand:w}),v({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(t){var r=n.getDoc(),i;try{N(t)}catch(o){i=f}if("paste"!==t||r.queryCommandEnabled(t)||(i=!0),i||!r.queryCommandSupported(t)){var a=n.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");e.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),n.notificationManager.open({text:a,type:"error"})}},unlink:function(){if(R.isCollapsed()){var e=R.getNode();return void("A"==e.tagName&&n.dom.remove(e,!0))}A.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"==t&&(t="justify"),a("left,center,right,justify".split(","),function(e){t!=e&&A.remove("align"+e)}),"none"!=t&&_("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;N(e),t=T.getParent(R.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(S(),T.split(n,t),k()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){_(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){_(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=u(D.font_size_style_values),r=u(D.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),_(e,n)},RemoveFormat:function(e){A.remove(e)},mceBlockQuote:function(){_("blockquote")},FormatBlock:function(e,t,n){return _(n||"p")},mceCleanup:function(){var e=R.getBookmark();n.setContent(n.getContent({cleanup:f}),{cleanup:f}),R.moveToBookmark(e)},mceRemoveNode:function(e,t,r){var i=r||R.getNode();i!=n.getBody()&&(S(),n.dom.remove(i,f),k())},mceSelectNodeDepth:function(e,t,r){var i=0;T.getParent(R.getNode(),function(e){return 1==e.nodeType&&i++==r?(R.select(e),h):void 0},n.getBody())},mceSelectNode:function(e,t,n){R.select(n)},mceInsertContent:function(e,t,r){o.insertAtCaret(n,r)},mceInsertRawHTML:function(e,t,r){R.setContent("tiny_mce_marker"),n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return r}))},mceToggleFormat:function(e,t,n){_(n)},mceSetContent:function(e,t,r){n.setContent(r)},"Indent,Outdent":function(e){var t,r,i;t=D.indentation,r=/[a-z%]+$/i.exec(t),t=parseInt(t,10),m("InsertUnorderedList")||m("InsertOrderedList")?N(e):(D.forced_root_block||T.getParent(R.getNode(),T.isBlock)||A.apply("div"),a(R.getSelectedBlocks(),function(o){if("false"!==T.getContentEditable(o)&&"LI"!=o.nodeName){var a=n.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==T.getStyle(o,"direction",!0)?"Right":"Left","outdent"==e?(i=Math.max(0,parseInt(o.style[a]||0,10)-t),T.setStyle(o,a,i?i+r:"")):(i=parseInt(o.style[a]||0,10)+t+r,T.setStyle(o,a,i))}}))},mceRepaint:function(){},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual,n.addVisual()},mceReplaceContent:function(e,t,r){n.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,R.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=T.getParent(R.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||A.remove("link"),n.href&&A.apply("link",n,r)},selectAll:function(){var e=T.getRoot(),t;R.getRng().setStart?(t=T.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),R.setRng(t)):(t=R.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){N("Delete");var e=n.getBody();T.isEmpty(e)&&(n.setContent(""),e.firstChild&&T.isBlock(e.firstChild)?n.selection.setCursorLocation(e.firstChild,0):n.selection.setCursorLocation(e,0))},mceNewDocument:function(){n.setContent("")},InsertLineBreak:function(e,t,o){function a(){for(var e=new i(m,v),t,r=n.schema.getNonEmptyElements();t=e.next();)if(r[t.nodeName.toLowerCase()]||t.length>0)return!0}var s=o,l,c,u,h=R.getRng(!0);new r(T).normalize(h);var p=h.startOffset,m=h.startContainer;if(1==m.nodeType&&m.hasChildNodes()){var g=p>m.childNodes.length-1;m=m.childNodes[Math.min(p,m.childNodes.length-1)]||m,p=g&&3==m.nodeType?m.nodeValue.length:0}var v=T.getParent(m,T.isBlock),y=v?v.nodeName.toUpperCase():"",b=v?T.getParent(v.parentNode,T.isBlock):null,C=b?b.nodeName.toUpperCase():"",x=s&&s.ctrlKey;"LI"!=C||x||(v=b,y=C),m&&3==m.nodeType&&p>=m.nodeValue.length&&(d||a()||(l=T.create("br"),h.insertNode(l),h.setStartAfter(l),h.setEndAfter(l),c=!0)),l=T.create("br"),h.insertNode(l);var w=T.doc.documentMode;return d&&"PRE"==y&&(!w||8>w)&&l.parentNode.insertBefore(T.doc.createTextNode("\r"),l),u=T.create("span",{}," "),l.parentNode.insertBefore(u,l),R.scrollIntoView(u),T.remove(u),c?(h.setStartBefore(l),h.setEndBefore(l)):(h.setStartAfter(l),h.setEndAfter(l)),R.setRng(h),n.undoManager.add(),f}}),v({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=R.isCollapsed()?[T.getParent(R.getNode(),T.isBlock)]:R.getSelectedBlocks(),r=l(n,function(e){return!!A.matchNode(e,t)});return-1!==c(r,f)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return E(e)},mceBlockQuote:function(){return E("blockquote")},Outdent:function(){var e;if(D.inline_styles){if((e=T.getParent(R.getStart(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f;if((e=T.getParent(R.getEnd(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f}return m("InsertUnorderedList")||m("InsertOrderedList")||!D.inline_styles&&!!T.getParent(R.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=T.getParent(R.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),v({"FontSize,FontName":function(e){var t=0,n;return(n=T.getParent(R.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),v({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}),r(ae,[m],function(e){function t(e,o){var a=this,s,l;if(e=r(e),o=a.settings=o||{},s=o.base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(a.source=e);var c=0===e.indexOf("//");0!==e.indexOf("/")||c||(e=(s?s.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(l=o.base_uri?o.base_uri.path:new t(location.href).directory,""===o.base_uri.protocol?e="//mce_host"+a.toAbsPath(l,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(s&&s.protocol||"http")+"://mce_host"+a.toAbsPath(l,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(i,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),a[t]=r}),s&&(a.protocol||(a.protocol=s.protocol),a.userInfo||(a.userInfo=s.userInfo),a.port||"mce_host"!==a.host||(a.port=s.port),a.host&&"mce_host"!==a.host||(a.host=s.host),a.source=""),c&&(a.protocol="")}var n=e.each,r=e.trim,i="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),o={ftp:21,http:80,https:443,mailto:25};return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(n&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=o[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.length<n.length)for(o=0,a=n.length;a>o;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}},t.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},t}),r(se,[m],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r=this;if(!o&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],"function"==typeof f&&c[d]?u[d]=s(d,f):u[d]=f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(le,[m],function(e){function t(t){function n(){return!1}function r(){return!0}function i(e,i){var o,s,l,c;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=u),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=r},i.stopPropagation=function(){i.isPropagationStopped=r},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=r},i.isDefaultPrevented=n,i.isPropagationStopped=n,i.isImmediatePropagationStopped=n),t.beforeFire&&t.beforeFire(i),o=d[e])for(s=0,l=o.length;l>s;s++){if(c=o[s],c.once&&a(e,c.func),i.isImmediatePropagationStopped())return i.stopPropagation(),i;if(c.func.call(u,i)===!1)return i.preventDefault(),i}return i}function o(t,r,i,o){var a,s,l;if(r===!1&&(r=n),r)for(r={func:r},o&&e.extend(r,o),s=t.toLowerCase().split(" "),l=s.length;l--;)t=s[l],a=d[t],a||(a=d[t]=[],f(t,!0)),i?a.unshift(r):a.push(r);return c}function a(e,t){var n,r,i,o,a;if(e)for(o=e.toLowerCase().split(" "),n=o.length;n--;){if(e=o[n],r=d[e],!e){for(i in d)f(i,!1),delete d[i];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),d[e]=r);else r.length=0;r.length||(f(e,!1),delete d[e])}}else{for(e in d)f(e,!1);d={}}return c}function s(e,t,n){return o(e,t,n,{once:!0})}function l(e){return e=e.toLowerCase(),!(!d[e]||0===d[e].length)}var c=this,u,d={},f;t=t||{},u=t.scope||c,f=t.toggleEvent||n,c.fire=i,c.on=o,c.off=a,c.once=s,c.has=l}var n=e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," ");return t.isNative=function(e){return!!n[e.toLowerCase()]},t}),r(ce,[],function(){function e(e){this.create=e.create}return e.create=function(t,n){return new e({create:function(e,r){function i(t){e.set(r,t.value)}function o(e){t.set(n,e.value)}var a;return e.on("change:"+r,o),t.on("change:"+n,i),a=e._bindings,a||(a=e._bindings=[],e.on("destroy",function(){for(var e=a.length;e--;)a[e]()})),a.push(function(){t.off("change:"+n,i)}),t.get(n)}})},e}),r(ue,[le],function(e){function t(t){return t._eventDispatcher||(t._eventDispatcher=new e({scope:t,toggleEvent:function(n,r){e.isNative(n)&&t.toggleNativeEvent&&t.toggleNativeEvent(n,r)}})),t._eventDispatcher}return{fire:function(e,n,r){var i=this;if(i.removed&&"remove"!==e)return n;if(n=t(i).fire(e,n,r),r!==!1&&i.parent)for(var o=i.parent();o&&!n.isPropagationStopped();)o.fire(e,n,!1),o=o.parent();return n},on:function(e,n,r){return t(this).on(e,n,r)},off:function(e,n){return t(this).off(e,n)},once:function(e,n){return t(this).once(e,n)},hasEventListeners:function(e){return t(this).has(e)}}}),r(de,[ce,ue,se,m],function(e,t,n,r){function i(e){return e.nodeType>0}function o(e,t){var n,a;if(e===t)return!0;if(null===e||null===t)return e===t;if("object"!=typeof e||"object"!=typeof t)return e===t;if(r.isArray(t)){if(e.length!==t.length)return!1;for(n=e.length;n--;)if(!o(e[n],t[n]))return!1}if(i(e)||i(t))return e===t;a={};for(n in t){if(!o(e[n],t[n]))return!1;a[n]=!0}for(n in e)if(!a[n]&&!o(e[n],t[n]))return!1;return!0}return n.extend({Mixins:[t],init:function(t){var n,r;t=t||{};for(n in t)r=t[n],r instanceof e&&(t[n]=r.create(this,n));this.data=t},set:function(t,n){var r,i,a=this.data[t];if(n instanceof e&&(n=n.create(this,t)),"object"==typeof t){for(r in t)this.set(r,t[r]);return this}return o(a,n)||(this.data[t]=n,i={target:this,name:t,value:n,oldValue:a},this.fire("change:"+t,i),this.fire("change",i)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(t){return e.create(this,t)},destroy:function(){this.fire("destroy")}})}),r(fe,[se],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.classes.contains(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.pseudo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a<n.length;a++)">"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,h,p;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,p=e,h=0,i=o-1;i>=0;i--)for(c=a[i];p;){if(c.pseudo)for(f=p.parent().items(),u=d=f.length;u--&&f[u]!==p;);for(s=0,l=c.length;l>s;s++)if(!c[s](p,u,d)){s=l+1;break}if(s===l){h++;break}if(i===o-1)break;p=p.parent()}if(h===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(he,[m,fe,se],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].classes.contains(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(e){return this.each(function(t){t.classes.add(e)})},removeClass:function(e){return this.each(function(t){t.classes.remove(e)})}},e.each("fire on off show hide append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(pe,[d,m,w],function(e,t,n){var r=0,i={id:function(){return"mceu_"+r++},create:function(e,r,i){var o=document.createElement(e);return n.DOM.setAttribs(o,r),"string"==typeof i?o.innerHTML=i:t.each(i,function(e){e.nodeType&&o.appendChild(e)}),o},createFragment:function(e){return n.DOM.createFragment(e)},getWindowSize:function(){return n.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return n.DOM.getPos(e,t||i.getContainer())},getContainer:function(){return e.container?e.container:document.body},getViewPort:function(e){return n.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return n.DOM.addClass(e,t)},removeClass:function(e,t){return n.DOM.removeClass(e,t)},hasClass:function(e,t){return n.DOM.hasClass(e,t)},toggleClass:function(e,t,r){return n.DOM.toggleClass(e,t,r)},css:function(e,t,r){return n.DOM.setStyle(e,t,r)},getRuntimeStyle:function(e,t){return n.DOM.getStyle(e,t,!0)},on:function(e,t,r,i){return n.DOM.bind(e,t,r,i)},off:function(e,t,r){return n.DOM.unbind(e,t,r)},fire:function(e,t,r){return n.DOM.fire(e,t,r)},innerHtml:function(e,t){n.DOM.setHTML(e,t)}};return i}),r(me,[],function(){return{parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}}}}),r(ge,[m],function(e){function t(){}function n(e){this.cls=[],this.cls._map={},this.onchange=e||t,this.prefix=""}return e.extend(n.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){for(var t=0;t<this.cls.length&&this.cls[t]!==e;t++);this.cls.splice(t,1),delete this.cls._map[e],this._change()}return this},toggle:function(e,t){var n=this.contains(e);return n!==t&&(n?this.remove(e):this.add(e),this._change()),this},contains:function(e){return!!this.cls._map[e]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),n.prototype.toString=function(){var e;if(this.clsValue)return this.clsValue;e="";for(var t=0;t<this.cls.length;t++)t>0&&(e+=" "),e+=this.prefix+this.cls[t];return e},n}),r(ve,[u],function(e){var t={},n;return{add:function(r){var i=r.parent();if(i){if(!i._layout||i._layout.isNative())return;t[i._id]||(t[i._id]=i),n||(n=!0,e.requestAnimationFrame(function(){var e,r;n=!1;for(e in t)r=t[e],r.state.get("rendered")&&r.reflow();t={}},document.body))}},remove:function(e){t[e._id]&&delete t[e._id]}}}),r(ye,[se,m,le,de,he,pe,g,me,ge,ve],function(e,t,n,r,i,o,a,s,l,c){function u(e){return e._eventDispatcher||(e._eventDispatcher=new n({scope:e,toggleEvent:function(t,r){r&&n.isNative(t)&&(e._nativeEvents||(e._nativeEvents={}),e._nativeEvents[t]=!0,e.state.get("rendered")&&d(e))}})),e._eventDispatcher}function d(e){function t(t){var n=e.getParentCtrl(t.target);n&&n.fire(t.type,t)}function n(){var e=c._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),c._lastHoverCtrl=null)}function r(t){var n=e.getParentCtrl(t.target),r=c._lastHoverCtrl,i=0,o,a,s;if(n!==r){if(c._lastHoverCtrl=n,a=n.parents().toArray().reverse(),a.push(n),r){for(s=r.parents().toArray().reverse(),s.push(r),i=0;i<s.length&&a[i]===s[i];i++);for(o=s.length-1;o>=i;o--)r=s[o],r.fire("mouseleave",{target:r.getEl()})}for(o=i;o<a.length;o++)n=a[o],n.fire("mouseenter",{target:n.getEl()})}}function i(t){t.preventDefault(),"mousewheel"==t.type?(t.deltaY=-1/40*t.wheelDelta,t.wheelDeltaX&&(t.deltaX=-1/40*t.wheelDeltaX)):(t.deltaX=0,t.deltaY=t.detail),t=e.fire("wheel",t)}var o,s,l,c,u,d;if(u=e._nativeEvents){for(l=e.parents().toArray(),l.unshift(e),o=0,s=l.length;!c&&s>o;o++)c=l[o]._eventsRoot;for(c||(c=l[l.length-1]||e),e._eventsRoot=c,s=o,o=0;s>o;o++)l[o]._eventsRoot=c;var p=c._delegates;p||(p=c._delegates={});for(d in u){if(!u)return!1;"wheel"!==d||h?("mouseenter"===d||"mouseleave"===d?c._hasMouseEnter||(a(c.getEl()).on("mouseleave",n).on("mouseover",r),c._hasMouseEnter=1):p[d]||(a(c.getEl()).on(d,t),p[d]=!0),u[d]=!1):f?a(e.getEl()).on("mousewheel",i):a(e.getEl()).on("DOMMouseScroll",i)}}}var f="onmousewheel"in document,h=!1,p="mce-",m,g=0,v={Statics:{classPrefix:p},isRtl:function(){return m.rtl},classPrefix:p,init:function(e){function n(e){var t;for(e=e.split(" "),t=0;t<e.length;t++)i.classes.add(e[t])}var i=this,o,c;i.settings=e=t.extend({},i.Defaults,e),i._id=e.id||"mceu_"+g++,i._aria={role:e.role},i._elmCache={},i.$=a,i.state=new r({visible:!0,active:!1,disabled:!1,value:""}),i.data=new r(e.data),i.classes=new l(function(){i.state.get("rendered")&&(i.getEl().className=this.toString())}),i.classes.prefix=i.classPrefix,o=e.classes,o&&(i.Defaults&&(c=i.Defaults.classes,c&&o!=c&&n(c)),n(o)),t.each("title text name visible disabled active value".split(" "),function(t){t in e&&i[t](e[t])}),i.on("click",function(){return i.disabled()?!1:void 0}),i.settings=e,i.borderBox=s.parseBox(e.border),i.paddingBox=s.parseBox(e.padding),i.marginBox=s.parseBox(e.margin),e.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){return o.getContainer()},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},initLayoutRect:function(){var e=this,t=e.settings,n,r,i=e.getEl(),a,l,c,u,d,f,h,p;n=e.borderBox=e.borderBox||s.measureBox(i,"border"),e.paddingBox=e.paddingBox||s.measureBox(i,"padding"),e.marginBox=e.marginBox||s.measureBox(i,"margin"),p=o.getSize(i),f=t.minWidth,h=t.minHeight,c=f||p.width,u=h||p.height,a=t.width,l=t.height,d=t.autoResize,d="undefined"!=typeof d?d:!a&&!l,a=a||c,l=l||u;var m=n.left+n.right,g=n.top+n.bottom,v=t.maxWidth||65535,y=t.maxHeight||65535;return e._layoutRect=r={x:t.x||0,y:t.y||0,w:a,h:l,deltaW:m,deltaH:g,contentW:a-m,contentH:l-g,innerW:a-m,innerH:l-g,startMinWidth:f||0,startMinHeight:h||0,minW:Math.min(c,v),minH:Math.min(u,y),maxW:v,maxH:y,autoResize:d,scrollW:0},e._lastLayoutRect={},r},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,l;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=i<n.minW?n.minW:i,i=i>n.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=i<n.minH?n.minH:i,i=i>n.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=i<n.minW-o?n.minW-o:i,i=i>n.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=i<n.minH-a?n.minH-a:i,i=i>n.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,r.x===n.x&&r.y===n.y&&r.w===n.w&&r.h===n.h||(l=m.repaintControls,l&&l.map&&!l.map[t._id]&&(l.push(t),l.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o,a,s,l,c,u;c=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,i=e._layoutRect,l=e._lastRepaintRect||{},o=e.borderBox,a=o.left+o.right,s=o.top+o.bottom,i.x!==l.x&&(t.left=c(i.x)+"px",l.x=i.x),i.y!==l.y&&(t.top=c(i.y)+"px",l.y=i.y),i.w!==l.w&&(u=c(i.w-a),t.width=(u>=0?u:0)+"px",l.w=i.w),i.h!==l.h&&(u=c(i.h-s),t.height=(u>=0?u:0)+"px",l.h=i.h),e._hasBody&&i.innerW!==l.innerW&&(u=c(i.innerW),r=e.getEl("body"),r&&(n=r.style,n.width=(u>=0?u:0)+"px"),l.innerW=i.innerW),e._hasBody&&i.innerH!==l.innerH&&(u=c(i.innerH),r=r||e.getEl("body"),r&&(n=n||r.style,n.height=(u>=0?u:0)+"px"),l.innerH=i.innerH),e._lastRepaintRect=l,e.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,o.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){function n(e){var t,n;return"string"!=typeof e?e:function(i){return t||r.parentsAndSelf().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t?t.call(n,i):(i.action=e,void this.fire("execute",i))}}var r=this;return u(r).on(e,n(t)),r},off:function(e,t){return u(this).off(e,t),this},fire:function(e,t,n){var r=this;if(t=t||{},t.control||(t.control=r),t=u(r).fire(e,t),n!==!1&&r.parent)for(var i=r.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return u(this).has(e)},parents:function(e){var t=this,n,r=new i;for(n=t.parent();n;n=n.parent())r.add(n);return e&&(r=r.filter(e)),r},parentsAndSelf:function(e){return new i(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=a("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return m.translate?m.translate(e):e},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),r,i; if(e.items){var o=e.items().toArray();for(i=o.length;i--;)o[i].remove()}n&&n.items&&(r=[],n.items().each(function(t){t!==e&&r.push(t)}),n.items().set(r),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&a(t).off();var s=e.getRoot().controlIdLookup;return s&&delete s[e._id],t&&t.parentNode&&t.parentNode.removeChild(t),e.state.set("rendered",!1),e.state.destroy(),e.fire("remove"),e},renderBefore:function(e){return a(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return a(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var e=this,t=e.settings,n,r,i,o,s;e.$el=a(e.getEl()),e.state.set("rendered",!0);for(o in t)0===o.indexOf("on")&&e.on(o.substr(2),t[o]);if(e._eventsRoot){for(i=e.parent();!s&&i;i=i.parent())s=i._eventsRoot;if(s)for(o in s._nativeEvents)e._nativeEvents[o]=!0}d(e),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e.settings.border&&(r=e.borderBox,e.$el.css({"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var u in e._aria)e.aria(u,e._aria[u]);e.state.get("visible")===!1&&(e.getEl().style.display="none"),e.bindStates(),e.state.on("change:visible",function(t){var n=t.value,r;e.state.get("rendered")&&(e.getEl().style.display=n===!1?"none":"",e.getEl().getBoundingClientRect()),r=e.parent(),r&&(r._lastRect=null),e.fire(n?"show":"hide"),c.add(e)}),e.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){c.remove(this);var e=this.parent();return e._layout&&!e._layout.isNative()&&e.reflow(),this}};return t.each("text title visible disabled active value".split(" "),function(e){v[e]=function(t){return 0===arguments.length?this.state.get(e):("undefined"!=typeof t&&this.state.set(e,t),this)}}),m=e.extend(v)}),r(be,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(Ce,[],function(){return function(e){function t(e){return e&&1===e.nodeType}function n(e){return e=e||C,t(e)?e.getAttribute("role"):null}function r(e){for(var t,r=e||C;r=r.parentNode;)if(t=n(r))return t}function i(e){var n=C;return t(n)?n.getAttribute("aria-"+e):void 0}function o(e){var t=e.tagName.toUpperCase();return"INPUT"==t||"TEXTAREA"==t||"SELECT"==t}function a(e){return o(e)&&!e.hidden?!0:!!/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(n(e))}function s(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){a(e)&&n.push(e);for(var r=0;r<e.childNodes.length;r++)t(e.childNodes[r])}}var n=[];return t(e||b.getEl()),n}function l(e){var t,n;e=e||x,n=e.parents().toArray(),n.unshift(e);for(var r=0;r<n.length&&(t=n[r],!t.settings.ariaRoot);r++);return t}function c(e){var t=l(e),n=s(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?u(t.lastAriaIndex,n):u(0,n)}function u(e,t){return 0>e?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function d(e,t){var n=-1,r=l();t=t||s(r.getEl());for(var i=0;i<t.length;i++)t[i]===C&&(n=i);n+=e,r.lastAriaIndex=u(n,t)}function f(){var e=r();"tablist"==e?d(-1,s(C.parentNode)):x.parent().submenu?v():d(-1)}function h(){var e=n(),t=r();"tablist"==t?d(1,s(C.parentNode)):"menuitem"==e&&"menu"==t&&i("haspopup")?y():d(1)}function p(){d(-1)}function m(){var e=n(),t=r();"menuitem"==e&&"menubar"==t?y():"button"==e&&i("haspopup")?y({key:"down"}):d(1)}function g(e){var t=r();if("tablist"==t){var n=s(x.getEl("body"))[0];n&&n.focus()}else d(e.shiftKey?-1:1)}function v(){x.fire("cancel")}function y(e){e=e||{},x.fire("click",{target:C,aria:e})}var b=e.root,C,x;try{C=document.activeElement}catch(w){C=document.body}return x=b.getParentCtrl(C),b.on("keydown",function(e){function t(e,t){o(C)||"slider"!==n(C)&&t(e)!==!1&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,f);break;case 39:t(e,h);break;case 38:t(e,p);break;case 40:t(e,m);break;case 27:v();break;case 14:case 13:case 32:t(e,y);break;case 9:g(e)!==!1&&e.preventDefault()}}),b.on("focusin",function(e){C=e.target,x=e.control}),{focusFirst:c}}}),r(xe,[ye,he,fe,be,Ce,m,g,ge,ve],function(e,t,n,r,i,o,a,s,l){var c={};return e.extend({init:function(e){var n=this;n._super(e),e=n.settings,e.fixed&&n.state.set("fixed",!0),n._items=new t,n.isRtl()&&n.classes.add("rtl"),n.bodyClasses=new s(function(){n.state.get("rendered")&&(n.getEl("body").className=this.toString())}),n.bodyClasses.prefix=n.classPrefix,n.classes.add("container"),n.bodyClasses.add("container-body"),e.containerCls&&n.classes.add(e.containerCls),n._layout=r.create((e.layout||"")+"layout"),n.settings.items?n.add(n.settings.items):n.add(n.render()),n._hasBody=!0},items:function(){return this._items},find:function(e){return e=c[e]=c[e]||new n(e),e.find(this)},add:function(e){var t=this;return t.items().add(t.create(e)).parent(t),t},focus:function(e){var t=this,n,r,i;return e&&(r=t.keyboardNav||t.parents().eq(-1)[0].keyboardNav)?void r.focusFirst(t):(i=t.find("*"),t.statusbar&&i.add(t.statusbar.items()),i.each(function(e){return e.settings.autofocus?(n=null,!1):void(e.canFocus&&(n=n||e))}),n&&n.focus(),t)},replace:function(e,t){for(var n,r=this.items(),i=r.length;i--;)if(r[i]===e){r[i]=t;break}i>=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,i,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r;t.parent(e),t.state.get("rendered")||(r=e.getEl("body"),r.hasChildNodes()&&n<=r.childNodes.length-1?a(r.childNodes[n]).before(t.renderHtml()):a(r).append(t.renderHtml()),t.postRender(),l.add(t))}),e._layout.applyClasses(e.items().filter(":visible")),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t<i.length-1&&(t+=1),t>=0&&t<i.length&&(o=i.slice(0,t).toArray(),a=i.slice(t).toArray(),i.set(o.concat(e,a))),r.renderNew()},fromJSON:function(e){var t=this;for(var n in e)t.find("#"+n).value(e[n]);return t},toJSON:function(){var e=this,t={};return e.find("*").each(function(e){var n=e.name(),r=e.value();n&&"undefined"!=typeof r&&(t[n]=r)}),t},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e.state.set("rendered",!0),e.settings.style&&e.$el.css(e.settings.style),e.settings.border&&(t=e.borderBox,e.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(l.remove(this),this.visible()){for(e.repaintControls=[],e.repaintControls.map={},this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(we,[g],function(e){function t(e){var t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}function n(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}return function(r,i){function o(){return s.getElementById(i.handle||r)}var a,s=i.document||document,l,c,u,d,f,h;i=i||{},c=function(r){var c=t(s),p,m;n(r),r.preventDefault(),l=r.button,p=o(),f=r.screenX,h=r.screenY,m=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,a=e("<div>").css({position:"absolute",top:0,left:0,width:c.width,height:c.height,zIndex:2147483647,opacity:1e-4,cursor:m}).appendTo(s.body),e(s).on("mousemove touchmove",d).on("mouseup touchend",u),i.start(r)},d=function(e){return n(e),e.button!==l?u(e):(e.deltaX=e.screenX-f,e.deltaY=e.screenY-h,e.preventDefault(),void i.drag(e))},u=function(t){n(t),e(s).off("mousemove touchmove",d).off("mouseup touchend",u),a.remove(),i.stop&&i.stop(t)},this.destroy=function(){e(o()).off()},e(o()).on("mousedown touchstart",c)}}),r(Ne,[g,we],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,h,p,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),e(i.getEl("absend")).css(y,i.layoutRect()[l]-1),!c)return void e(f).css("display","none");e(f).css("display","block"),d=i.getEl("body"),h=i.getEl("scroll"+t+"t"),p=d["client"+s]-2*o,p-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=p/m,v={},v[y]=d["offset"+a]+o,v[b]=p,e(f).css(v),v={},v[y]=d["scroll"+a]*g,v[b]=p*g,e(h).css(v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;e(i.getEl()).append('<div id="'+u+'" class="'+d+"scrollbar "+d+"scrollbar-"+n+'"><div id="'+u+'t" class="'+d+'scrollbar-thumb"></div></div>'),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e("#"+u).addClass(d+"active")},drag:function(e){var t,u,d,f,h=i.layoutRect();u=h.contentW>h.innerW,d=h.contentH>h.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e("#"+u).removeClass(d+"active")}})}i.classes.add("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e(i.getEl("body")).on("scroll",n)),n())}}}),r(Ee,[xe,Ne],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}})}),r(_e,[pe],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,h;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t.state.get("fixed")&&"static"==e.getRuntimeStyle(document.body,"position")&&(a-=f.x,s-=f.y),i=t.getEl(),h=e.getSize(i),l=h.width,c=h.height,h=e.getSize(n),u=h.width,d=h.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o<r.length;o++){var a=t(this,n,r[o]);if(this.state.get("fixed")){if(a.x>0&&a.x+a.w<i.w&&a.y>0&&a.y+a.h<i.h)return r[o]}else if(a.x>i.x&&a.x+a.w<i.w+i.x&&a.y>i.y&&a.y+a.h<i.h+i.y)return r[o]}return r[0]},moveRel:function(e,n){"string"!=typeof n&&(n=this.testMoveRel(e,n));var r=t(this,e,n);return this.moveTo(r.x,r.y)},moveBy:function(e,t){var n=this,r=n.layoutRect();return n.moveTo(r.x+e,r.y+t),n},moveTo:function(t,n){function r(e,t,n){return 0>e?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i.state.get("rendered")?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(Se,[pe],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(ke,[Ee,_e,Se,pe,g,u],function(e,t,n,r,i,o){function a(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}function s(e){for(var t=v.length;t--;){var n=v[t],r=n.getParentCtrl(e.target);if(n.settings.autohide){if(r&&(a(r,n)||n.parent()===r))continue;e=n.fire("autohide",{target:e.target}),e.isDefaultPrevented()||n.hide()}}}function l(){p||(p=function(e){2!=e.button&&s(e)},i(document).on("click touchstart",p))}function c(){m||(m=function(){var e;for(e=v.length;e--;)d(v[e])},i(window).on("scroll",m))}function u(){if(!g){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;g=function(){document.all&&t==e.clientWidth&&n==e.clientHeight||(t=e.clientWidth,n=e.clientHeight,C.hideAll())},i(window).on("resize",g)}}function d(e){function t(t,n){for(var r,i=0;i<v.length;i++)if(v[i]!=e)for(r=v[i].parent();r&&(r=r.parent());)r==e&&v[i].fixed(t).moveBy(0,n).repaint()}var n=r.getViewPort().y;e.settings.autofix&&(e.state.get("fixed")?e._autoFixY>n&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY<n&&(e.fixed(!0).layoutRect({y:0}).repaint(),t(!0,n-e._autoFixY))))}function f(e,t){var n,r=C.zIndex||65535,o;if(e)y.push(t);else for(n=y.length;n--;)y[n]===t&&y.splice(n,1);if(y.length)for(n=0;n<y.length;n++)y[n].modal&&(r++,o=y[n]),y[n].getEl().style.zIndex=r,y[n].zIndex=r,r++;var a=i("#"+t.classPrefix+"modal-block",t.getContainerElm())[0];o?i(a).css("z-index",o.zIndex-1):a&&(a.parentNode.removeChild(a),b=!1),C.currentZIndex=r}function h(e){var t;for(t=v.length;t--;)v[t]===e&&v.splice(t,1);for(t=y.length;t--;)y[t]===e&&y.splice(t,1)}var p,m,g,v=[],y=[],b,C=e.extend({Mixins:[t,n],init:function(e){var t=this;t._super(e),t._eventsRoot=t,t.classes.add("floatpanel"),e.autohide&&(l(),u(),v.push(t)),e.autofix&&(c(),t.on("move",function(){d(this)})),t.on("postrender show",function(e){if(e.control==t){var n,r=t.classPrefix;t.modal&&!b&&(n=i("#"+r+"modal-block",t.getContainerElm()),n[0]||(n=i('<div id="'+r+'modal-block" class="'+r+"reset "+r+'fade"></div>').appendTo(t.getContainerElm())),o.setTimeout(function(){n.addClass(r+"in"),i(t.getEl()).addClass(r+"in")}),b=!0),f(!0,t)}}),t.on("show",function(){t.parents().each(function(e){return e.state.get("fixed")?(t.fixed(!0),!1):void 0})}),e.popover&&(t._preBodyHtml='<div class="'+t.classPrefix+'arrow"></div>',t.classes.add("popover").add("bottom").add(t.isRtl()?"end":"start")),t.aria("label",e.ariaLabel),t.aria("labelledby",t._id),t.aria("describedby",t.describedBy||t._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!=e){if(t.state.get("rendered")){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e=this,t,n=e._super();for(t=v.length;t--&&v[t]!==e;);return-1===t&&v.push(e),n},hide:function(){return h(this),f(!1,this),this._super()},hideAll:function(){C.hideAll()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||(e.remove(),f(!1,e)),e},remove:function(){h(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return C.hideAll=function(){for(var e=v.length;e--;){var t=v[e];t&&t.settings.autohide&&(t.hide(),v.splice(e,1))}},C}),r(Te,[ke,Ee,pe,g,we,me,d,u],function(e,t,n,r,i,o,a,s){function l(e){var t="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0",n=r("meta[name=viewport]")[0],i;a.overrideViewPort!==!1&&(n||(n=document.createElement("meta"),n.setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),i=n.getAttribute("content"),i&&"undefined"!=typeof f&&(f=i),n.setAttribute("content",e?t:f))}function c(e){for(var t=0;t<d.length;t++)if(d[t]._fullscreen)return;r([document.documentElement,document.body]).removeClass(e+"fullscreen")}function u(){function e(){var e,t=n.getWindowSize(),r;for(e=0;e<d.length;e++)r=d[e].layoutRect(),d[e].moveTo(d[e].settings.x||Math.max(0,t.w/2-r.w/2),d[e].settings.y||Math.max(0,t.h/2-r.h/2))}if(!a.desktop){var t={w:window.innerWidth,h:window.innerHeight};s.setInterval(function(){var e=window.innerWidth,n=window.innerHeight;t.w==e&&t.h==n||(t={w:e,h:n},r(window).trigger("resize"))},100)}r(window).on("resize",e)}var d=[],f="",h=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var r=this;r._super(e),r.isRtl()&&r.classes.add("rtl"),r.classes.add("window"),r.bodyClasses.add("window-body"),r.state.set("fixed",!0),e.buttons&&(r.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:r.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),r.statusbar.classes.add("foot"),r.statusbar.parent(r)),r.on("click",function(e){var t=r.classPrefix+"close";(n.hasClass(e.target,t)||n.hasClass(e.target.parentNode,t))&&r.close()}),r.on("cancel",function(){r.close()}),r.aria("describedby",r.describedBy||r._id+"-none"),r.aria("label",e.title),r._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=e.settings.x||Math.max(0,a.w/2-t.w/2),t.y=e.settings.y||Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='<div id="'+n+'-head" class="'+r+'window-head"><div id="'+n+'-title" class="'+r+'title">'+e.encode(i.title)+'</div><div id="'+n+'-dragh" class="'+r+'dragh"></div><button type="button" class="'+r+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),i.url&&(s='<iframe src="'+i.url+'" tabindex="-1"></iframe>'),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.bodyClasses+'">'+s+"</div>"+a+"</div></div>"},fullscreen:function(e){var t=this,i=document.documentElement,a,l=t.classPrefix,c;if(e!=t._fullscreen)if(r(window).on("resize",function(){var e;if(t._fullscreen)if(a)t._timer||(t._timer=s.setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(a=!0)}}),c=t.layoutRect(),t._fullscreen=e,e){t._initial={x:c.x,y:c.y,w:c.w,h:c.h},t.borderBox=o.parseBox("0"),t.getEl("head").style.display="none",c.deltaH-=c.headerH+2,r([i,document.body]).addClass(l+"fullscreen"),t.classes.add("fullscreen");var u=n.getWindowSize();t.moveTo(0,0).resizeTo(u.w,u.h)}else t.borderBox=o.parseBox(t.settings.border),t.getEl("head").style.display="",c.deltaH+=c.headerH,r([i,document.body]).removeClass(l+"fullscreen"),t.classes.remove("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.classes.add("in"),e.fire("open")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()}),d.push(e),l(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t;for(e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),t=d.length;t--;)d[t]===e&&d.splice(t,1);l(d.length>0),c(e.classPrefix)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});return u(),h}),r(Re,[Te],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){function r(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),o(t)}}}var i,o=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:i=[r("Ok",!0,!0),r("Cancel",!1)];break;case t.YES_NO:case t.YES_NO_CANCEL:i=[r("Yes",1,!0),r("No",0)],n.buttons==t.YES_NO_CANCEL&&i.push(r("Cancel",-1));break;default:i=[r("Ok",!0,!0)]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:i,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){o(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(Ae,[Te,Re],function(e,t){return function(n){function r(){return s.length?s[s.length-1]:void 0}function i(e){n.fire("OpenWindow",{win:e})}function o(e){n.fire("CloseWindow",{win:e})}var a=this,s=[];a.windows=s,n.on("remove",function(){for(var e=s.length;e--;)s[e].close()}),a.open=function(t,r){var a;return n.editorManager.setActive(n),t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body,data:t.data,callbacks:t.commands}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){a.find("form")[0].submit()}},{text:"Cancel",onclick:function(){a.close()}}]),a=new e(t),s.push(a),a.on("close",function(){for(var e=s.length;e--;)s[e]===a&&s.splice(e,1);s.length||n.focus(),o(a)}),t.data&&a.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),a.features=t||{},a.params=r||{},1===s.length&&n.nodeChanged(),a=a.renderTo().reflow(),i(a),a},a.alert=function(e,r,a){var s;s=t.alert(e,function(){r?r.call(a||this):n.focus()}),s.on("close",function(){o(s)}),i(s)},a.confirm=function(e,n,r){var a;a=t.confirm(e,function(e){n.call(r||this,e)}),a.on("close",function(){o(a)}),i(a)},a.close=function(){r()&&r().close()},a.getParams=function(){return r()?r().params:null},a.setParams=function(e){r()&&(r().params=e)},a.getWindows=function(){return s}}}),r(Be,[ye,_e],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'" role="presentation"><div class="'+t+'tooltip-arrow"></div><div class="'+t+'tooltip-inner">'+e.encode(e.state.get("text"))+"</div></div>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)}),e._super()},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(De,[ye,Be],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.classes.toggle("tooltip-n","bc-tc"==i),r.classes.toggle("tooltip-nw","bc-tl"==i),r.classes.toggle("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){function e(e){n.aria("disabled",e),n.classes.toggle("disabled",e)}function t(e){n.aria("pressed",e),n.classes.toggle("active",e)}var n=this;return n.state.on("change:disabled",function(t){e(t.value)}),n.state.on("change:active",function(e){t(e.value)}),n.state.get("disabled")&&e(!0),n.state.get("active")&&t(!0),n._super()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(Le,[De],function(e){return e.extend({Defaults:{value:0},init:function(e){var t=this;t._super(e),t.classes.add("progress"),t.settings.filter||(t.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this,t=e._id,n=this.classPrefix;return'<div id="'+t+'" class="'+e.classes+'"><div class="'+n+'bar-container"><div class="'+n+'bar"></div></div><div class="'+n+'text">0%</div></div>'},postRender:function(){var e=this;return e._super(),e.value(e.settings.value),e},bindStates:function(){function e(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}var t=this;return t.state.on("change:value",function(t){e(t.value)}),e(t.state.get("value")),t._super()}})}),r(Me,[ye,_e,Le,u],function(e,t,n,r){return e.extend({Mixins:[t],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||e.timeout>0)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new n),t.on("click",function(e){-1!=e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e=this,t=e.classPrefix,n="",r="",i="",o="";return e.icon&&(n='<i class="'+t+"ico "+t+"i-"+e.icon+'"></i>'),e.color&&(o=' style="background-color: '+e.color+'"'),e.closeButton&&(r='<button type="button" class="'+t+'close" aria-hidden="true">\xd7</button>'),e.progressBar&&(i=e.progressBar.renderHtml()),'<div id="'+e._id+'" class="'+e.classes+'"'+o+' role="presentation">'+n+'<div class="'+t+'notification-inner">'+e.state.get("text")+"</div>"+i+r+"</div>"},postRender:function(){var e=this;return r.setTimeout(function(){e.$el.addClass(e.classPrefix+"in")}),e._super()},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().childNodes[1].innerHTML=t.value}),e.progressBar&&e.progressBar.bindStates(),e._super()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||e.remove(),e},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(Pe,[Me,u],function(e,t){return function(n){function r(){return l.length?l[l.length-1]:void 0}function i(){t.requestAnimationFrame(function(){o(),a()})}function o(){for(var e=0;e<l.length;e++)l[e].moveTo(0,0)}function a(){if(l.length>0){var e=l.slice(0,1)[0],t=n.inline?n.getElement():n.getContentAreaContainer();if(e.moveRel(t,"tc-tc"),l.length>1)for(var r=1;r<l.length;r++)l[r].moveRel(l[r-1].getEl(),"bc-tc")}}var s=this,l=[];s.notifications=l,n.on("remove",function(){for(var e=l.length;e--;)l[e].close()}),n.on("ResizeEditor",a),n.on("ResizeWindow",i),s.open=function(t){var r;return n.editorManager.setActive(n),r=new e(t),l.push(r),t.timeout>0&&(r.timer=setTimeout(function(){r.close()},t.timeout)),r.on("close",function(){var e=l.length;for(r.timer&&n.getWin().clearTimeout(r.timer);e--;)l[e]===r&&l.splice(e,1);a()}),r.renderTo(),a(),r},s.close=function(){r()&&r().close()},s.getNotifications=function(){return l},n.on("SkinLoaded",function(){var e=n.settings.service_message;e&&n.notificationManager.open({text:e,type:"warning",timeout:0,icon:""})})}}),r(Oe,[w],function(e){function t(t,n,r){for(var i=[];n&&n!=t;n=n.parentNode)i.push(e.nodeIndex(n,r));return i}function n(e,t){var n,r,i;for(r=e,n=t.length-1;n>=0;n--){if(i=r.childNodes,t[n]>i.length-1)return null;r=i[t[n]]}return r}return{create:t,resolve:n}}),r(He,[I,T,y,Oe,A,C,d,m,u,k,$,ne],function(e,t,n,r,i,o,a,s,l,c,u,d){return function(f){function h(e,t){try{f.getDoc().execCommand(e,!1,t)}catch(n){}}function p(){var e=f.getDoc().documentMode;return e?e:6}function m(e){return e.isDefaultPrevented()}function g(e){var t,n;e.dataTransfer&&(f.selection.isCollapsed()&&"IMG"==e.target.tagName&&re.select(e.target),t=f.selection.getContent(),t.length>0&&(n=ue+escape(f.id)+","+escape(t),e.dataTransfer.setData(de,n)))}function v(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(de),t&&t.indexOf(ue)>=0)?(t=t.substr(ue.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}function y(e){f.queryCommandSupported("mceInsertClipboardContent")?f.execCommand("mceInsertClipboardContent",!1,{content:e}):f.execCommand("mceInsertContent",!1,e)}function b(){function i(e){var t=C.schema.getBlockElements(),n=f.getBody();if("BR"!=e.nodeName)return!1;for(;e!=n&&!t[e.nodeName];e=e.parentNode)if(e.nextSibling)return!1;return!0}function o(e,t){var n;for(n=e.nextSibling;n&&n!=t;n=n.nextSibling)if((3!=n.nodeType||0!==Z.trim(n.data).length)&&n!==t)return!1;return n===t}function a(e,t,r){var o,a,s;for(s=C.schema.getNonEmptyElements(),o=new n(r||e,e);a=o[t?"next":"prev"]();){if(s[a.nodeName]&&!i(a))return a;if(3==a.nodeType&&a.data.length>0)return a}}function c(e){var n,r,i,o,s;if(!e.collapsed&&(n=C.getParent(t.getNode(e.startContainer,e.startOffset),C.isBlock), r=C.getParent(t.getNode(e.endContainer,e.endOffset),C.isBlock),s=f.schema.getTextBlockElements(),n!=r&&s[n.nodeName]&&s[r.nodeName]&&"false"!==C.getContentEditable(n)&&"false"!==C.getContentEditable(r)))return e.deleteContents(),i=a(n,!1),o=a(r,!0),C.isEmpty(r)||Z(n).append(r.childNodes),Z(r).remove(),i?1==i.nodeType?"BR"==i.nodeName?(e.setStartBefore(i),e.setEndBefore(i)):(e.setStartAfter(i),e.setEndAfter(i)):(e.setStart(i,i.data.length),e.setEnd(i,i.data.length)):o&&(1==o.nodeType?(e.setStartBefore(o),e.setEndBefore(o)):(e.setStart(o,0),e.setEnd(o,0))),x.setRng(e),!0}function u(e,n){var r,i,s,l,c,u;if(!e.collapsed)return e;if(c=e.startContainer,u=e.startOffset,3==c.nodeType)if(n){if(u<c.data.length)return e}else if(u>0)return e;if(r=t.getNode(e.startContainer,e.startOffset),s=C.getParent(r,C.isBlock),i=a(f.getBody(),n,r),l=C.getParent(i,C.isBlock),!r||!i)return e;if(l&&s!=l)if(n){if(!o(s,l))return e;1==r.nodeType?"BR"==r.nodeName?e.setStartBefore(r):e.setStartAfter(r):e.setStart(r,r.data.length),1==i.nodeType?e.setEnd(i,0):e.setEndBefore(i)}else{if(!o(l,s))return e;1==i.nodeType?"BR"==i.nodeName?e.setStartBefore(i):e.setStartAfter(i):e.setStart(i,i.data.length),1==r.nodeType?e.setEnd(r,0):e.setEndBefore(r)}return e}function d(e){var t=x.getRng();return t=u(t,e),c(t)?!0:void 0}function h(e,t){function n(e,n){return m=Z(n).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),l=e.cloneNode(!1),m=s.map(m,function(e){return e=e.cloneNode(!1),l.hasChildNodes()?(e.appendChild(l.firstChild),l.appendChild(e)):l.appendChild(e),l.appendChild(e),e}),m.length?(p=C.create("br"),m[0].appendChild(p),C.replace(l,e),t.setStartBefore(p),t.setEndBefore(p),f.selection.setRng(t),p):null}function i(e){return e&&f.schema.getTextBlockElements()[e.tagName]}var o,a,l,c,u,d,h,p,m;if(t.collapsed&&(d=t.startContainer,h=t.startOffset,a=C.getParent(d,C.isBlock),i(a)))if(1==d.nodeType){if(d=d.childNodes[h],d&&"BR"!=d.tagName)return;if(u=e?a.nextSibling:a.previousSibling,C.isEmpty(a)&&i(u)&&C.isEmpty(u)&&n(a,d))return C.remove(u),!0}else if(3==d.nodeType){if(o=r.create(a,d),c=a.cloneNode(!0),d=r.resolve(c,o),e){if(h>=d.data.length)return;d.deleteData(h,1)}else{if(0>=h)return;d.deleteData(h-1,1)}if(C.isEmpty(c))return n(a,d)}}function p(e){var t,n,r;d(e)||(s.each(f.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&f.dom.setAttrib(e,"style",f.dom.getAttrib(e,"style"))}),t=new w(function(){}),t.observe(f.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),f.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),n=f.selection.getRng(),r=n.startContainer.parentNode,s.each(t.takeRecords(),function(e){if(C.isChildOf(e.target,f.getBody())){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}s.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),C.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),f.selection.setRng(n))}})}}),t.disconnect(),s.each(f.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")}))}var b=f.getDoc(),C=f.dom,x=f.selection,w=window.MutationObserver,N,E;w||(N=!0,w=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMSubtreeModified",e,!1),r.removeEventListener("DOMNodeInsertedIntoDocument",e,!1),r.removeEventListener("DOMNodeInserted",e,!1),r.removeEventListener("DOMAttrModified",t,!1)},this.takeRecords=function(){return n}}),f.on("keydown",function(e){var t=e.keyCode==te,n=e.ctrlKey||e.metaKey;if(!m(e)&&(t||e.keyCode==ee)){var r=f.selection.getRng(),i=r.startContainer,o=r.startOffset;if(t&&e.shiftKey)return;if(h(t,r))return void e.preventDefault();if(!n&&r.collapsed&&3==i.nodeType&&(t?o<i.data.length:o>0))return;e.preventDefault(),n&&f.selection.getSel().modify("extend",t?"forward":"backward",e.metaKey?"lineboundary":"word"),p(t)}}),f.on("keypress",function(t){if(!m(t)&&!x.isCollapsed()&&t.charCode>31&&!e.metaKeyPressed(t)){var n,r,i,o,a,s;n=f.selection.getRng(),s=String.fromCharCode(t.charCode),t.preventDefault(),r=Z(n.startContainer).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),p(!0),r=r.filter(function(e,t){return!Z.contains(f.getBody(),t)}),r.length?(i=C.createFragment(),r.each(function(e,t){t=t.cloneNode(!1),i.hasChildNodes()?(t.appendChild(i.firstChild),i.appendChild(t)):(a=t,i.appendChild(t)),i.appendChild(t)}),a.appendChild(f.getDoc().createTextNode(s)),o=C.getParent(n.startContainer,C.isBlock),C.isEmpty(o)?Z(o).empty().append(i):n.insertNode(i),n.setStart(a.firstChild,1),n.setEnd(a.firstChild,1),f.selection.setRng(n)):f.selection.setContent(s)}}),f.addCommand("Delete",function(){p()}),f.addCommand("ForwardDelete",function(){p(!0)}),N||(f.on("dragstart",function(e){E=x.getRng(),g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);n&&(e.preventDefault(),l.setEditorTimeout(f,function(){var r=t.getCaretRangeFromPoint(e.x,e.y,b);E&&(x.setRng(E),E=null),p(),x.setRng(r),y(n.html)}))}}),f.on("cut",function(e){m(e)||!e.clipboardData||f.selection.isCollapsed()||(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",f.selection.getContent()),e.clipboardData.setData("text/plain",f.selection.getContent({format:"text"})),l.setEditorTimeout(f,function(){p(!0)}))}))}function C(){function e(e){var t=ne.create("body"),n=e.cloneContents();return t.appendChild(n),re.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(f.getBody()),t.compareRanges(n,r)}var i=e(n),o=ne.createRng();o.selectNode(f.getBody());var a=e(o);return i===a}f.on("keydown",function(e){var t=e.keyCode,r,i;if(!m(e)&&(t==te||t==ee)){if(r=f.selection.isCollapsed(),i=f.getBody(),r&&!ne.isEmpty(i))return;if(!r&&!n(f.selection.getRng()))return;e.preventDefault(),f.setContent(""),i.firstChild&&ne.isBlock(i.firstChild)?f.selection.setCursorLocation(i.firstChild,0):f.selection.setCursorLocation(i,0),f.nodeChanged()}})}function x(){f.shortcuts.add("meta+a",null,"SelectAll")}function w(){f.settings.content_editable||ne.bind(f.getDoc(),"mousedown mouseup",function(e){var t;if(e.target==f.getDoc().documentElement)if(t=re.getRng(),f.getBody().focus(),"mousedown"==e.type){if(c.isCaretContainer(t.startContainer))return;re.placeCaretAt(e.clientX,e.clientY)}else re.setRng(t)})}function N(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee){if(!f.getBody().getElementsByTagName("hr").length)return;if(re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return ne.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(ne.remove(n),e.preventDefault())}}})}function E(){window.Range.prototype.getClientRects||f.on("mousedown",function(e){if(!m(e)&&"HTML"===e.target.nodeName){var t=f.getBody();t.blur(),l.setEditorTimeout(f,function(){t.focus()})}})}function _(){f.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==ne.getContentEditableParent(t)&&(e.preventDefault(),re.getSel().setBaseAndExtent(t,0,t,1),f.nodeChanged()),"A"==t.nodeName&&ne.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),re.select(t))})}function S(){function e(){var e=ne.getAttribs(re.getStart().cloneNode(!1));return function(){var t=re.getStart();t!==f.getBody()&&(ne.setAttrib(t,"style",null),Q(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!re.isCollapsed()&&ne.getParent(re.getStart(),ne.isBlock)!=ne.getParent(re.getEnd(),ne.isBlock)}f.on("keypress",function(n){var r;return m(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),f.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),ne.bind(f.getDoc(),"cut",function(n){var r;!m(n)&&t()&&(r=e(),l.setEditorTimeout(f,function(){r()}))})}function k(){document.body.setAttribute("role","application")}function T(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee&&re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function R(){p()>7||(h("RespectVisibilityInDesign",!0),f.contentStyles.push(".mceHideBrInPre pre br {display: none}"),ne.addClass(f.getBody(),"mceHideBrInPre"),oe.addNodeFilter("pre",function(e){for(var t=e.length,n,r,o,a;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)o=n[r],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new i("#text",3),o,!0).value="\n"}),ae.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function A(){ne.bind(f.getBody(),"mouseup",function(){var e,t=re.getNode();"IMG"==t.nodeName&&((e=ne.getStyle(t,"width"))&&(ne.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"width","")),(e=ne.getStyle(t,"height"))&&(ne.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"height","")))})}function B(){f.on("keydown",function(t){var n,r,i,o,a;if(!m(t)&&t.keyCode==e.BACKSPACE&&(n=re.getRng(),r=n.startContainer,i=n.startOffset,o=ne.getRoot(),a=r,n.collapsed&&0===i)){for(;a&&a.parentNode&&a.parentNode.firstChild==a&&a.parentNode!=o;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(f.formatter.toggle("blockquote",null,a),n=ne.createRng(),n.setStart(r,0),n.setEnd(r,0),re.setRng(n))}})}function D(){function e(){K(),h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),ie.object_resizing||h("enableObjectResizing",!1)}ie.readonly||f.on("BeforeExecCommand MouseDown",e)}function L(){function e(){Q(ne.select("a"),function(e){var t=e.parentNode,n=ne.getRoot();if(t.lastChild===e){for(;t&&!ne.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}ne.add(t,"br",{"data-mce-bogus":1})}})}f.on("SetContent ExecCommand",function(t){"setcontent"!=t.type&&"mceInsertLink"!==t.command||e()})}function M(){ie.forced_root_block&&f.on("init",function(){h("DefaultParagraphSeparator",ie.forced_root_block)})}function P(){f.on("keydown",function(e){var t;m(e)||e.keyCode!=ee||(t=f.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),f.undoManager.beforeChange(),ne.remove(t.item(0)),f.undoManager.add()))})}function O(){var e;p()>=10&&(e="",Q("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),f.contentStyles.push(e+"{padding-right: 1px !important}"))}function H(){p()<9&&(oe.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),ae.addNodeFilter("noscript",function(e){for(var t=e.length,n,r,a;t--;)n=e[t],r=e[t].firstChild,r?r.value=o.decode(r.value):(a=n.attributes.map["data-mce-innertext"],a&&(n.attr("data-mce-innertext",null),r=new i("#text",3),r.value=a,r.raw=!0,n.append(r)))}))}function I(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),ne.unbind(r,"mouseup",n),ne.unbind(r,"mousemove",t),a=o=0}var r=ne.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,ne.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(ne.bind(r,"mouseup",n),ne.bind(r,"mousemove",t),ne.getRoot().focus(),a.select())}})}function F(){f.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||re.normalize()},!0)}function z(){f.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function U(){f.inline||f.on("keydown",function(){document.activeElement==document.body&&f.getWin().focus()})}function W(){f.inline||(f.contentStyles.push("body {min-height: 150px}"),f.on("click",function(e){var t;if("HTML"==e.target.nodeName){if(a.ie>11)return void f.getBody().focus();t=f.selection.getRng(),f.getBody().focus(),f.selection.setRng(t),f.selection.normalize(),f.nodeChanged()}}))}function V(){a.mac&&f.on("keydown",function(t){!e.metaKeyPressed(t)||t.shiftKey||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),f.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","lineboundary"))})}function $(){h("AutoUrlDetect",!1)}function q(){f.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),f.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function j(){f.on("init",function(){f.dom.bind(f.getBody(),"submit",function(e){e.preventDefault()})})}function Y(){oe.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}function X(){f.on("dragstart",function(e){g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);if(n&&n.id!=f.id){e.preventDefault();var r=t.getCaretRangeFromPoint(e.x,e.y,f.getDoc());re.setRng(r),y(n.html)}}})}function K(){var e,t;G()&&(e=f.getBody(),t=e.parentNode,t.removeChild(e),t.appendChild(e),e.focus())}function G(){var e;return se?(e=f.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}function J(){function t(e){var t=new d(e.getBody()),n=e.selection.getRng(),r=u.fromRangeStart(n),i=u.fromRangeEnd(n);return!e.selection.isCollapsed()&&!t.prev(r)&&!t.next(i)}f.on("keypress",function(n){!m(n)&&!re.isCollapsed()&&n.charCode>31&&!e.metaKeyPressed(n)&&t(f)&&(n.preventDefault(),f.setContent(String.fromCharCode(n.charCode)),f.selection.select(f.getBody(),!0),f.selection.collapse(!1),f.nodeChanged())}),f.on("keydown",function(e){var n=e.keyCode;m(e)||n!=te&&n!=ee||t(f)&&(e.preventDefault(),f.setContent(""),f.nodeChanged())})}var Q=s.each,Z=f.$,ee=e.BACKSPACE,te=e.DELETE,ne=f.dom,re=f.selection,ie=f.settings,oe=f.parser,ae=f.serializer,se=a.gecko,le=a.ie,ce=a.webkit,ue="data:text/mce-internal,",de=le?"Text":"URL";return B(),C(),a.windowsPhone||F(),ce&&(J(),b(),w(),_(),M(),j(),T(),Y(),a.iOS?(U(),W(),q()):x()),le&&a.ie<11&&(N(),k(),R(),A(),P(),O(),H(),I()),a.ie>=11&&(W(),T()),a.ie&&(x(),$(),X()),se&&(J(),N(),E(),S(),D(),L(),z(),V(),T()),{refreshContentEditable:K,isHidden:G}}}),r(Ie,[ue,w,m],function(e,t,n){function r(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=o.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()}function i(e,t){function n(e){return!e.hidden&&!e.readonly}var i=r(e,t),s;if(e.delegates||(e.delegates={}),!e.delegates[t])if(e.settings.event_root){if(a||(a={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&a){for(t in a)e.dom.unbind(r(e,t));a=null}})),a[t])return;s=function(r){for(var i=r.target,a=e.editorManager.editors,s=a.length;s--;){var l=a[s].getBody();(l===i||o.isChildOf(i,l))&&n(a[s])&&a[s].fire(t,r)}},a[t]=s,o.bind(i,t,s)}else s=function(r){n(e)&&e.fire(t,r)},o.bind(i,t,s),e.delegates[t]=s}var o=t.DOM,a,s={bindPendingEventDelegates:function(){var e=this;n.each(e._pendingNativeEvents,function(t){i(e,t)})},toggleNativeEvent:function(e,t){var n=this;"focus"!=e&&"blur"!=e&&(t?n.initialized?i(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(r(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e=this,t;if(e.delegates){for(t in e.delegates)e.dom.unbind(r(e,t),t,e.delegates[t]);delete e.delegates}e.inline||(e.getBody().onload=null,e.dom.unbind(e.getWin()),e.dom.unbind(e.getDoc())),e.dom.unbind(e.getBody()),e.dom.unbind(e.getContainer())}};return s=n.extend({},e,s)}),r(Fe,[],function(){function e(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}}function t(e){var t,n;return t=e.getBody(),n=function(t){e.dom.getParents(t.target,"a").length>0&&t.preventDefault()},e.dom.bind(t,"click",n),{unbind:function(){e.dom.unbind(t,"click",n)}}}function n(n,r){n._clickBlocker&&(n._clickBlocker.unbind(),n._clickBlocker=null),r?(n._clickBlocker=t(n),n.selection.controlSelection.hideResizeRect(),n.readonly=!0,n.getBody().contentEditable=!1):(n.readonly=!1,n.getBody().contentEditable=!0,e(n,"StyleWithCSS",!1),e(n,"enableInlineTableEditing",!1),e(n,"enableObjectResizing",!1),n.focus(),n.nodeChanged())}function r(e,t){var r=e.readonly?"readonly":"design";t!=r&&(e.initialized?n(e,"readonly"==t):e.on("init",function(){n(e,"readonly"==t)}),e.fire("SwitchMode",{mode:t}))}return{setMode:r}}),r(ze,[m,d],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122},o=e.makeMap("alt,ctrl,shift,meta,access");return function(a){function s(e){var a,s,l={};n(r(e,"+"),function(e){e in o?l[e]=!0:/^[0-9]{2,}$/.test(e)?l.keyCode=parseInt(e,10):(l.charCode=e.charCodeAt(0),l.keyCode=i[e]||e.toUpperCase().charCodeAt(0))}),a=[l.keyCode];for(s in o)l[s]?a.push(s):l[s]=!1;return l.id=a.join(","),l.access&&(l.alt=!0,t.mac?l.ctrl=!0:l.shift=!0),l.meta&&(t.mac?l.meta=!0:(l.ctrl=!0,l.meta=!1)),l}function l(t,n,i,o){var l;return l=e.map(r(t,">"),s),l[l.length-1]=e.extend(l[l.length-1],{func:i,scope:o||a}),e.extend(l[0],{desc:a.translate(n),subpatterns:l.slice(1)})}function c(e){return e.altKey||e.ctrlKey||e.metaKey}function u(e){return e.keyCode>=112&&e.keyCode<=123}function d(e,t){return t?t.ctrl!=e.ctrlKey||t.meta!=e.metaKey?!1:t.alt!=e.altKey||t.shift!=e.shiftKey?!1:e.keyCode==t.keyCode||e.charCode&&e.charCode==t.charCode?(e.preventDefault(),!0):!1:!1}function f(e){return e.func?e.func.call(e.scope):null}var h=this,p={},m=[];a.on("keyup keypress keydown",function(e){!c(e)&&!u(e)||e.isDefaultPrevented()||(n(p,function(t){return d(e,t)?(m=t.subpatterns.slice(0),"keydown"==e.type&&f(t),!0):void 0}),d(e,m[0])&&(1===m.length&&"keydown"==e.type&&f(m[0]),m.shift()))}),h.add=function(t,i,o,s){var c;return c=o,"string"==typeof o?o=function(){a.execCommand(c,!1,null)}:e.isArray(c)&&(o=function(){a.execCommand(c[0],c[1],c[2])}),n(r(e.trim(t.toLowerCase())),function(e){var t=l(e,i,o,s);p[t.id]=t}),!0},h.remove=function(e){var t=l(e);return p[t.id]?(delete p[t.id],!0):!1}}}),r(Ue,[c,m,z],function(e,t,n){return function(r,i){function o(e){var t,n;return n={"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"},t=n[e.blob().type.toLowerCase()]||"dat",e.id()+"."+t}function a(e,t){return e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t}function s(e){return{id:e.id,blob:e.blob,base64:e.base64,filename:n.constant(o(e))}}function l(e,t,n,r){var s,l;s=new XMLHttpRequest,s.open("POST",i.url),s.withCredentials=i.credentials,s.upload.onprogress=function(e){r(e.loaded/e.total*100)},s.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+s.status)},s.onload=function(){var e;return 200!=s.status?void n("HTTP Error: "+s.status):(e=JSON.parse(s.responseText),e&&"string"==typeof e.location?void t(a(i.basePath,e.location)):void n("Invalid JSON: "+s.responseText))},l=new FormData,l.append("file",e.blob(),o(e)),s.send(l)}function c(){return new e(function(e){e([])})}function u(e,t){return{url:t,blobInfo:e,status:!0}}function d(e,t){return{url:"",blobInfo:e,status:!1,error:t}}function f(e,n){t.each(y[e],function(e){e(n)}),delete y[e]}function h(t,n,i){return r.markPending(t.blobUri()),new e(function(e){var o,a,l=function(){};try{var c=function(){o&&(o.close(),a=l)},h=function(n){c(),r.markUploaded(t.blobUri(),n),f(t.blobUri(),u(t,n)),e(u(t,n))},p=function(){c(),r.removeFailed(t.blobUri()),f(t.blobUri(),d(t,p)),e(d(t,p))};a=function(e){0>e||e>100||(o||(o=i()),o.progressBar.value(e))},n(s(t),h,p,a)}catch(m){e(d(t,m.message))}})}function p(e){return e===l}function m(t){var n=t.blobUri();return new e(function(e){y[n]=y[n]||[],y[n].push(e)})}function g(n,o){return n=t.grep(n,function(e){return!r.isUploaded(e.blobUri())}),e.all(t.map(n,function(e){return r.isPending(e.blobUri())?m(e):h(e,i.handler,o)}))}function v(e,t){return!i.url&&p(i.handler)?c():g(e,t)}var y={};return i=t.extend({credentials:!1,handler:l},i),{upload:v}}}),r(We,[c],function(e){function t(t){return new e(function(e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="blob",n.onload=function(){200==this.status&&e(this.response)},n.send()})}function n(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}}function r(t){return new e(function(e){var r,i,o;t=n(t);try{r=atob(t.data)}catch(a){return void e(new Blob([]))}for(i=new Uint8Array(r.length),o=0;o<i.length;o++)i[o]=r.charCodeAt(o);e(new Blob([i],{type:t.type}))})}function i(e){return 0===e.indexOf("blob:")?t(e):0===e.indexOf("data:")?r(e):null}function o(t){return new e(function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)})}return{uriToBlob:i,blobToDataUri:o,parseDataUri:n}}),r(Ve,[c,p,z,We,d],function(e,t,n,r,i){var o=0;return function(a,s){function l(l,u){function d(e,t){var n,i;return 0===e.src.indexOf("blob:")?(i=s.getByUri(e.src),void(i&&t({image:e,blobInfo:i}))):(n=r.parseDataUri(e.src).data,i=s.findFirst(function(e){return e.base64()===n}),void(i?t({image:e,blobInfo:i}):r.uriToBlob(e.src).then(function(r){var i="blobid"+o++,a=s.create(i,r,n);s.add(a),t({image:e,blobInfo:a})})))}var f,h;return u||(u=n.constant(!0)),f=t.filter(l.getElementsByTagName("img"),function(e){var t=e.src;return i.fileApi?e.hasAttribute("data-mce-bogus")?!1:e.hasAttribute("data-mce-placeholder")?!1:t&&t!=i.transparentSrc?0===t.indexOf("blob:")?!a.isUploaded(t):0===t.indexOf("data:")?u(e):!1:!1:!1}),h=t.map(f,function(t){var n;return c[t.src]?new e(function(e){c[t.src].then(function(n){e({image:t,blobInfo:n.blobInfo})})}):(n=new e(function(e){d(t,e)}).then(function(e){return delete c[e.image.src],e})["catch"](function(e){return delete c[t.src],e}),c[t.src]=n,n)}),e.all(h)}var c={};return{findAll:l}}}),r($e,[p,z],function(e,t){return function(){function n(e,t,n){return{id:u(e),blob:u(t),base64:u(n),blobUri:u(URL.createObjectURL(t))}}function r(e){i(e.id())||c.push(e)}function i(e){return o(function(t){return t.id()===e})}function o(t){return e.filter(c,t)[0]}function a(e){return o(function(t){return t.blobUri()==e})}function s(t){c=e.filter(c,function(e){return e.blobUri()===t?(URL.revokeObjectURL(e.blobUri()),!1):!0})}function l(){e.each(c,function(e){URL.revokeObjectURL(e.blobUri())}),c=[]}var c=[],u=t.constant;return{create:n,add:r,get:i,getByUri:a,findFirst:o,removeByUri:s,destroy:l}}}),r(qe,[],function(){return function(){function e(e,t){return{status:e,resultUri:t}}function t(e){return e in d}function n(e){var t=d[e];return t?t.resultUri:null}function r(e){return t(e)?d[e].status===c:!1}function i(e){return t(e)?d[e].status===u:!1}function o(t){d[t]=e(c,null)}function a(t,n){d[t]=e(u,n)}function s(e){delete d[e]}function l(){d={}}var c=1,u=2,d={};return{hasBlobUri:t,getResultUri:n,isPending:r,isUploaded:i,markPending:o,markUploaded:a,removeFailed:s,destroy:l}}}),r(je,[p,Ue,Ve,$e,qe],function(e,t,n,r,i){return function(o){function a(e){return function(t){return o.selection?e(t):[]}}function s(e,t,n){var r=0;do r=e.indexOf(t,r),-1!==r&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1);while(-1!==r);return e}function l(e,t,n){return e=s(e,'src="'+t+'"','src="'+n+'"'),e=s(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')}function c(t,n){e.each(o.undoManager.data,function(e){e.content=l(e.content,t,n)})}function u(){return o.notificationManager.open({text:o.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}function d(e,t){y.removeByUri(e.src),c(e.src,t),o.$(e).attr({src:t,"data-mce-src":o.convertURL(t,"src")})}function f(n){return b||(b=new t(w,{url:x.images_upload_url,basePath:x.images_upload_base_path,credentials:x.images_upload_credentials,handler:x.images_upload_handler})),m().then(a(function(t){var r;return r=e.map(t,function(e){return e.blobInfo}),b.upload(r,u).then(a(function(r){return r=e.map(r,function(e,n){var r=t[n].image;return e.status&&o.settings.images_replace_blob_uris!==!1&&d(r,e.url),{element:r,status:e.status}}),n&&n(r),r}))}))}function h(e){return x.automatic_uploads!==!1?f(e):void 0}function p(e){return x.images_dataimg_filter?x.images_dataimg_filter(e):!0}function m(){return C||(C=new n(w,y)),C.findAll(o.getBody(),p).then(a(function(t){return e.each(t,function(e){c(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),t}))}function g(){y.destroy(),w.destroy(),C=b=null}function v(t){return t.replace(/src="(blob:[^"]+)"/g,function(t,n){var r=w.getResultUri(n);if(r)return'src="'+r+'"';var i=y.getByUri(n);return i||(i=e.reduce(o.editorManager.editors,function(e,t){return e||t.editorUpload.blobCache.getByUri(n)},null)),i?'src="data:'+i.blob().type+";base64,"+i.base64()+'"':t})}var y=new r,b,C,x=o.settings,w=new i;return o.on("setContent",function(){o.settings.automatic_uploads!==!1?h():m()}),o.on("RawSaveContent",function(e){e.content=v(e.content)}),o.on("getContent",function(e){e.source_view||"raw"==e.format||(e.content=v(e.content))}),o.on("PostRender",function(){o.parser.addNodeFilter("img",function(t){e.each(t,function(e){var t=e.attr("src");if(!y.getByUri(t)){var n=w.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:y,uploadImages:f,uploadImagesAuto:h,scanForImages:m,destroy:g}}}),r(Ye,[k,$,_,T,g,W,u],function(e,t,n,r,i,o,a){var s=n.isContentEditableFalse;return function(t,n){function r(e,n){var r=o.collapse(e.getBoundingClientRect(),n),i,a,s,l,c;return"BODY"==t.tagName?(i=t.ownerDocument.documentElement,a=t.scrollLeft||i.scrollLeft,s=t.scrollTop||i.scrollTop):(c=t.getBoundingClientRect(),a=t.scrollLeft-c.left,s=t.scrollTop-c.top),r.left+=a,r.right+=a,r.top+=s,r.bottom+=s,r.width=1,l=e.offsetWidth-e.clientWidth,l>0&&(n&&(l*=-1),r.left+=l,r.right+=l),r}function l(){var n,r,o,a,s;for(n=i("*[contentEditable=false]",t),a=0;a<n.length;a++)r=n[a],o=r.previousSibling,e.endsWithCaretContainer(o)&&(s=o.data,1==s.length?o.parentNode.removeChild(o):o.deleteData(s.length-1,1)),o=r.nextSibling,e.startsWithCaretContainer(o)&&(s=o.data,1==s.length?o.parentNode.removeChild(o):o.deleteData(0,1));return null}function c(o,a){var l,c,f;return u(),n(a)?(g=e.insertBlock("p",a,o),l=r(a,o),i(g).css("top",l.top),m=i('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(l).appendTo(t),o&&m.addClass("mce-visual-caret-before"),d(),c=a.ownerDocument.createRange(),f=g.firstChild,c.setStart(f,0),c.setEnd(f,1),c):(g=e.insertInline(a,o),c=a.ownerDocument.createRange(),s(g.nextSibling)?(c.setStart(g,0),c.setEnd(g,0)):(c.setStart(g,1),c.setEnd(g,1)),c)}function u(){l(),g&&(e.remove(g),g=null),m&&(m.remove(),m=null),clearInterval(p)}function d(){p=a.setInterval(function(){i("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden")},500)}function f(){a.clearInterval(p)}function h(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"}var p,m,g;return{show:c,hide:u,getCss:h,destroy:f}}}),r(Xe,[p,_,W],function(e,t,n){function r(i){function o(t){return e.map(t,function(e){return e=n.clone(e),e.node=i,e})}if(e.isArray(i))return e.reduce(i,function(e,t){return e.concat(r(t))},[]);if(t.isElement(i))return o(i.getClientRects());if(t.isText(i)){var a=i.ownerDocument.createRange();return a.setStart(i,0),a.setEnd(i,i.data.length),o(a.getClientRects())}}return{getClientRects:r}}),r(Ke,[z,p,Xe,U,te,ne,$,W],function(e,t,n,r,i,o,a,s){function l(e,t,n,o){for(;o=i.findNode(o,e,r.isEditableCaretCandidate,t);)if(n(o))return}function c(e,r,i,o,a,s){function c(o){var s,l,c;for(c=n.getClientRects(o),-1==e&&(c=c.reverse()),s=0;s<c.length;s++)if(l=c[s],!i(l,h)){if(f.length>0&&r(l,t.last(f))&&u++,l.line=u,a(l))return!0;f.push(l)}}var u=0,d,f=[],h;return(h=t.last(s.getClientRects()))?(d=s.getNode(),c(d),l(e,o,c,d),f):f}function u(e,t){return t.line>e}function d(e,t){return t.line===e}function f(e,n,r,i){function l(n){return 1==e?t.last(n.getClientRects()):t.last(n.getClientRects())}var c=new o(n),u,d,f,h,p=[],m=0,g,v;1==e?(u=c.next,d=s.isBelow,f=s.isAbove,h=a.after(i)):(u=c.prev,d=s.isAbove,f=s.isBelow,h=a.before(i)),v=l(h);do if(h.isVisible()&&(g=l(h),!f(g,v))){if(p.length>0&&d(g,t.last(p))&&m++,g=s.clone(g),g.position=h,g.line=m,r(g))return p;p.push(g)}while(h=u(h));return p}var h=e.curry,p=h(c,-1,s.isAbove,s.isBelow),m=h(c,1,s.isBelow,s.isAbove);return{upUntil:p,downUntil:m,positionsUntil:f,isAboveLine:h(u),isLine:h(d)}}),r(Ge,[z,p,_,Xe,W,te,U],function(e,t,n,r,i,o,a){function s(e,t){return Math.abs(e.left-t)}function l(e,t){return Math.abs(e.right-t)}function c(e,n){function r(e,t){return e>=t.left&&e<=t.right}return t.reduce(e,function(e,t){var i,o;return i=Math.min(s(e,n),l(e,n)),o=Math.min(s(t,n),l(t,n)),r(n,t)?t:r(n,e)?e:o==i&&m(t.node)?t:i>o?t:e})}function u(e,t,n,r){for(;r=g(r,e,a.isEditableCaretCandidate,t);)if(n(r))return}function d(e,n){function o(e,i){var o;return o=t.filter(r.getClientRects(i),function(t){return!e(t,n)}),a=a.concat(o),0===o.length}var a=[];return a.push(n),u(-1,e,v(o,i.isAbove),n.node),u(1,e,v(o,i.isBelow),n.node),a}function f(e){return t.filter(t.toArray(e.getElementsByTagName("*")),m)}function h(e,t){return{node:e.node,before:s(e,t)<l(e,t)}}function p(e,n,i){var o,a;return o=r.getClientRects(f(e)),o=t.filter(o,function(e){return i>=e.top&&i<=e.bottom}),a=c(o,n),a&&(a=c(d(e,a),n),a&&m(a.node))?h(a,n):null}var m=n.isContentEditableFalse,g=o.findNode,v=e.curry;return{findClosestClientRect:c,findLineNodeRects:d,closestCaret:p}}),r(Je,[],function(){var e=function(e){var t,n,r,i;return i=e.getBoundingClientRect(),t=e.ownerDocument,n=t.documentElement,r=t.defaultView,{top:i.top+r.pageYOffset-n.clientTop,left:i.left+r.pageXOffset-n.clientLeft}},t=function(t){return t.inline?e(t.getBody()):{left:0,top:0}},n=function(e){var t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}},r=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},i={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:i},i=function(t,n){if(n.target.ownerDocument!==t.getDoc()){var i=e(t.getContentAreaContainer()),o=r(t);return{left:n.pageX-i.left+o.left,top:n.pageY-i.top+o.top}}return{left:n.pageX,top:n.pageY}},o=function(e,t,n){return{pageX:n.left-e.left+t.left,pageY:n.top-e.top+t.top}},a=function(e,r){return o(t(e),n(e),i(e,r))};return{calc:a}}),r(Qe,[_,p,z,u,w,Je],function(e,t,n,r,i,o){var a=e.isContentEditableFalse,s=e.isContentEditableTrue,l=function(e){return a(e)},c=function(e,t,n){return t===n||e.dom.isChildOf(t,n)?!1:!a(t)},u=function(e){var t=e.cloneNode(!0);return t.removeAttribute("data-mce-selected"),t},d=function(e,t,n,r){var i=t.cloneNode(!0);e.dom.setStyles(i,{width:n,height:r}),e.dom.setAttrib(i,"data-mce-selected",null);var o=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(o,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(i,{margin:0,boxSizing:"border-box"}),o.appendChild(i),o},f=function(e,t){e.parentNode!==t&&t.appendChild(e)},h=function(e,t,n,r,i,o){var a=0,s=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>i&&(a=t.pageX+n-i), t.pageY+r>o&&(s=t.pageY+r-o),e.style.width=n-a+"px",e.style.height=r-s+"px"},p=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},m=function(e){return 0===e.button},g=function(e){return e.element},v=function(e,t){return{pageX:t.pageX-e.relX,pageY:t.pageY+5}},y=function(e,r){return function(i){if(m(i)){var o=t.find(r.dom.getParents(i.target),n.or(a,s));if(l(o)){var c=r.dom.getPos(o),u=r.getBody(),f=r.getDoc().documentElement;e.element=o,e.screenX=i.screenX,e.screenY=i.screenY,e.maxX=(r.inline?u.scrollWidth:f.offsetWidth)-2,e.maxY=(r.inline?u.scrollHeight:f.offsetHeight)-2,e.relX=i.pageX-c.x,e.relY=i.pageY-c.y,e.width=o.offsetWidth,e.height=o.offsetHeight,e.ghost=d(r,o,e.width,e.height)}}}},b=function(e,t){var n=r.throttle(function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n)},0);return function(r){var i=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(g(e)&&!e.dragging&&i>10){var a=t.fire("dragstart",{target:e.element});if(a.isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){var s=v(e,o.calc(t,r));f(e.ghost,t.getBody()),h(e.ghost,s,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY)}}},C=function(e,t){return function(n){if(e.dragging&&c(t,t.selection.getNode(),e.element)){var r=u(e.element),i=t.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});i.isDefaultPrevented()||(r=i.targetClone,t.undoManager.transact(function(){p(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret()}))}w(e)}},x=function(e,t){return function(){w(e),e.dragging&&t.fire("dragend")}},w=function(e){e.dragging=!1,e.element=null,p(e.ghost)},N=function(e){var t={},n,r,o,a,s,l;n=i.DOM,l=document,r=y(t,e),o=b(t,e),a=C(t,e),s=x(t,e),e.on("mousedown",r),e.on("mousemove",o),e.on("mouseup",a),n.bind(l,"mousemove",o),n.bind(l,"mouseup",s),e.on("remove",function(){n.unbind(l,"mousemove",o),n.unbind(l,"mouseup",s)})},E=function(e){e.on("drop",function(t){var n="undefined"!=typeof t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(a(n)||a(e.dom.getContentEditableParent(n)))&&t.preventDefault()})},_=function(e){N(e),E(e)};return{init:_}}),r(Ze,[d,ne,$,k,te,Ye,Ke,Ge,_,T,W,I,z,p,u,Qe,S],function(e,t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g){function v(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function y(c){function y(){var e=c.dom.get(le);return e?e.getElementsByTagName("*")[0]:e}function S(e){return c.dom.isBlock(e)}function k(e){e&&c.selection.setRng(e)}function T(){return c.selection.getRng()}function R(e,t){c.selection.scrollIntoView(e,t)}function A(e,t,n){var r;return r=c.fire("ShowCaret",{target:t,direction:e,before:n}),r.isDefaultPrevented()?null:(R(t,-1===e),se.show(n,t))}function B(e){var t;return se.hide(),t=c.fire("BeforeObjectSelected",{target:e}),t.isDefaultPrevented()?null:D(e)}function D(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}function L(e,t){var n=i.isInSameBlock(e,t);return!n&&l.isBr(e.getNode())?!0:n}function M(e,t){return t=i.normalizeRange(e,re,t),-1==e?n.fromRangeStart(t):n.fromRangeEnd(t)}function P(e){return r.isCaretContainerBlock(e.startContainer)}function O(e,t,n,r){var i,o,a,s;return!r.collapsed&&(i=_(r),x(i))?A(e,i,-1==e):(s=P(r),o=M(e,r),n(o)?B(o.getNode(-1==e)):(o=t(o))?n(o)?A(e,o.getNode(-1==e),1==e):(a=t(o),n(a)&&L(o,a)?A(e,a.getNode(-1==e),1==e):s?$(o.toRange()):null):s?r:null)}function H(e,t,n){var r,i,o,l,c,u,d,f,p;if(p=_(n),r=M(e,n),i=t(re,a.isAboveLine(1),r),o=h.filter(i,a.isLine(1)),c=h.last(r.getClientRects()),E(r)&&(p=r.getNode()),N(r)&&(p=r.getNode(!0)),!c)return null;if(u=c.left,l=s.findClosestClientRect(o,u),l&&x(l.node))return d=Math.abs(u-l.left),f=Math.abs(u-l.right),A(e,l.node,f>d);if(p){var m=a.positionsUntil(e,re,a.isAboveLine(1),p);if(l=s.findClosestClientRect(h.filter(m,a.isLine(1)),u))return $(l.position.toRange());if(l=h.last(h.filter(m,a.isLine(0))))return $(l.position.toRange())}}function I(t,r){function i(){var t=c.dom.create(c.settings.forced_root_block);return(!e.ie||e.ie>=11)&&(t.innerHTML='<br data-mce-bogus="1">'),t}var o,a,s;if(r.collapsed&&c.settings.forced_root_block){if(o=c.dom.getParent(r.startContainer,"PRE"),!o)return;a=1==t?oe(n.fromRangeStart(r)):ae(n.fromRangeStart(r)),a||(s=i(),1==t?c.$(o).after(s):c.$(o).before(s),c.selection.select(s,!0),c.selection.collapse())}}function F(e,t,n,r){var i;return(i=O(e,t,n,r))?i:(i=I(e,r),i?i:null)}function z(e,t,n){var r;return(r=H(e,t,n))?r:(r=I(e,n),r?r:null)}function U(){return ue("*[data-mce-caret]")[0]}function W(e){e=ue(e),e.attr("data-mce-caret")&&(se.hide(),e.removeAttr("data-mce-caret"),e.removeAttr("data-mce-bogus"),e.removeAttr("style"),k(T()),R(e[0]))}function V(e){var t,r;return e=i.normalizeRange(1,re,e),t=n.fromRangeStart(e),x(t.getNode())?A(1,t.getNode(),!t.isAtEnd()):x(t.getNode(!0))?A(1,t.getNode(!0),!1):(r=c.dom.getParent(t.getNode(),f.or(x,C)),x(r)?A(1,r,!1):(se.hide(),null))}function $(e){var t;return e&&e.collapsed?(t=V(e),t?t:e):e}function q(e){var t,i,o,a;return x(e)?(x(e.previousSibling)&&(o=e.previousSibling),i=ae(n.before(e)),i||(t=oe(n.after(e))),t&&w(t.getNode())&&(a=t.getNode()),r.remove(e.previousSibling),r.remove(e.nextSibling),c.dom.remove(e),ee(),c.dom.isEmpty(c.getBody())?(c.setContent(""),void c.focus()):o?n.after(o).toRange():a?n.before(a).toRange():i?i.toRange():t?t.toRange():null):null}function j(e){var t=c.schema.getTextBlockElements();return e.nodeName in t}function Y(e){return c.dom.isEmpty(e)}function X(e,t,r){var i=c.dom,o,a,s,l;if(o=i.getParent(t.getNode(),i.isBlock),a=i.getParent(r.getNode(),i.isBlock),-1===e){if(l=r.getNode(!0),N(r)&&S(l))return j(o)?(Y(o)&&i.remove(o),n.after(l).toRange()):q(r.getNode(!0))}else if(l=t.getNode(),E(t)&&S(l))return j(a)?(Y(a)&&i.remove(a),n.before(l).toRange()):q(t.getNode());if(o===a||!j(o)||!j(a))return null;for(;s=o.firstChild;)a.appendChild(s);return c.dom.remove(o),r.toRange()}function K(e,t,n,i){var o,a,s,l;return!i.collapsed&&(o=_(i),x(o))?$(q(o)):(a=M(e,i),n(a)&&r.isCaretContainerBlock(i.startContainer)?(l=-1==e?ie.prev(a):ie.next(a),l?$(l.toRange()):i):t(a)?$(q(a.getNode(-1==e))):(s=-1==e?ie.prev(a):ie.next(a),t(s)?-1===e?X(e,a,s):X(e,s,a):void 0))}function G(){function r(e,t){var n=t(T());n&&!e.isDefaultPrevented()&&(e.preventDefault(),k(n))}function i(e){for(var t=c.getBody();e&&e!=t;){if(C(e)||x(e))return e;e=e.parentNode}return null}function o(e,t,n){return n.collapsed?!1:h.reduce(n.getClientRects(),function(n,r){return n||u.containsXY(r,e,t)},!1)}function l(e){var t=!1;e.on("touchstart",function(){t=!1}),e.on("touchmove",function(){t=!0}),e.on("touchend",function(e){var n=i(e.target);x(n)?t||(e.preventDefault(),Z(B(n))):ee()})}function f(){var e,t=i(c.selection.getNode());C(t)&&S(t)&&c.dom.isEmpty(t)&&(e=c.dom.create("br",{"data-mce-bogus":"1"}),c.$(t).empty().append(e),c.selection.setRng(n.before(e).toRange()))}function g(e){var t=U();if(t)return"compositionstart"==e.type?(e.preventDefault(),e.stopPropagation(),void W(t)):void(" "!=t.innerHTML&&W(t))}function v(e){var t;switch(e.keyCode){case d.DELETE:t=f();break;case d.BACKSPACE:t=f()}t&&e.preventDefault()}var w=b(F,1,oe,E),_=b(F,-1,ae,N),R=b(K,1,E,N),D=b(K,-1,N,E),L=b(z,-1,a.upUntil),M=b(z,1,a.downUntil);c.on("mouseup",function(){var e=T();e.collapsed&&k(V(e))}),c.on("click",function(e){var t;t=i(e.target),t&&x(t)&&(e.preventDefault(),c.focus())});var P=function(e){var r=new t(e);if(!e.firstChild)return!1;var i=n.before(e.firstChild),o=r.next(i);return o&&!E(o)&&!N(o)},O=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n===r},H=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n&&!O(n,r)&&P(n)};l(c),c.on("mousedown",function(e){var t;if(t=i(e.target))x(t)?(e.preventDefault(),Z(B(t))):(ee(),o(e.clientX,e.clientY,c.selection.getRng())||c.selection.placeCaretAt(e.clientX,e.clientY));else{ee(),se.hide();var n=s.closestCaret(re,e.clientX,e.clientY);n&&(H(e.target,n.node)||(e.preventDefault(),c.getBody().focus(),k(A(1,n.node,n.before))))}}),c.on("keydown",function(e){if(!d.modifierPressed(e))switch(e.keyCode){case d.RIGHT:r(e,w);break;case d.DOWN:r(e,M);break;case d.LEFT:r(e,_);break;case d.UP:r(e,L);break;case d.DELETE:r(e,R);break;case d.BACKSPACE:r(e,D);break;default:x(c.selection.getNode())&&e.preventDefault()}}),c.on("keyup compositionstart",function(e){g(e),v(e)},!0),c.on("cut",function(){var e=c.selection.getNode();x(e)&&p.setEditorTimeout(c,function(){k($(q(e)))})}),c.on("getSelectionRange",function(e){var t=e.range;if(ce){if(!ce.parentNode)return void(ce=null);t=t.cloneRange(),t.selectNode(ce),e.range=t}}),c.on("setSelectionRange",function(e){var t;t=Z(e.range),t&&(e.range=t)}),c.on("focus",function(){p.setEditorTimeout(c,function(){c.selection.setRng($(c.selection.getRng()))},0)}),c.on("copy",function(t){var n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!e.ie){var r=y();r&&(t.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),m.init(c)}function J(){var e=c.contentStyles,t=".mce-content-body";e.push(se.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")}function Q(e){return r.isCaretContainer(e.startContainer)||r.isCaretContainer(e.endContainer)}function Z(t){var n,r=c.$,i=c.dom,o,a,s,l,u,d,f,h,p;if(!t)return ee(),null;if(t.collapsed){if(ee(),!Q(t)){if(f=M(1,t),x(f.getNode()))return A(1,f.getNode(),!f.isAtEnd());if(x(f.getNode(!0)))return A(1,f.getNode(!0),!1)}return null}return s=t.startContainer,l=t.startOffset,u=t.endOffset,3==s.nodeType&&0==l&&x(s.parentNode)&&(s=s.parentNode,l=i.nodeIndex(s),s=s.parentNode),1!=s.nodeType?(ee(),null):(u==l+1&&(n=s.childNodes[l]),x(n)?(h=p=n.cloneNode(!0),d=c.fire("ObjectSelected",{target:n,targetClone:h}),d.isDefaultPrevented()?(ee(),null):(h=d.targetClone,o=r("#"+le),0===o.length&&(o=r('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",le),o.appendTo(c.getBody())),t=c.dom.createRng(),h===p&&e.ie?(o.empty().append(g.ZWSP).append(h).append(g.ZWSP),t.setStart(o[0].firstChild,0),t.setEnd(o[0].lastChild,1)):(o.empty().append("\xa0").append(h).append("\xa0"),t.setStart(o[0].firstChild,1),t.setEnd(o[0].lastChild,0)),o.css({top:i.getPos(n,c.getBody()).y}),o[0].focus(),a=c.selection.getSel(),a.removeAllRanges(),a.addRange(t),c.$("*[data-mce-selected]").removeAttr("data-mce-selected"),n.setAttribute("data-mce-selected",1),ce=n,t)):(ee(),null))}function ee(){ce&&(ce.removeAttribute("data-mce-selected"),c.$("#"+le).remove(),ce=null)}function te(){se.destroy(),ce=null}function ne(){se.hide()}var re=c.getBody(),ie=new t(re),oe=b(v,ie.next),ae=b(v,ie.prev),se=new o(c.getBody(),S),le="sel-"+c.dom.uniqueId(),ce,ue=c.$;return e.ceFalse&&(G(),J()),{showBlockCaretContainer:W,hideFakeCaret:ne,destroy:te}}var b=f.curry,C=l.isContentEditableTrue,x=l.isContentEditableFalse,w=l.isElement,N=i.isAfterContentEditableFalse,E=i.isBeforeContentEditableFalse,_=c.getSelectedNode;return y}),r(et,[],function(){var e=0,t=function(){var e=function(){return Math.round(4294967295*Math.random()).toString(36)},t=(new Date).getTime();return"s"+t.toString(36)+e()+e()+e()},n=function(n){return n+e++ +t()};return{uuid:n}}),r(tt,[w,g,E,R,A,O,P,Y,J,Q,Z,ee,oe,ae,N,f,Ae,Pe,B,L,He,d,m,u,Ie,Fe,ze,je,Ze,et],function(e,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A){function B(e,t,i){var o=this,a,s,l;a=o.documentBaseUrl=i.documentBaseURL,s=i.baseURI,l=i.defaultSettings,t=P({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:a,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o,ie7_compat:!0},l,t),l&&l.external_plugins&&t.external_plugins&&(t.external_plugins=P({},l.external_plugins,t.external_plugins)),o.settings=t,r.language=t.language||"en",r.languageLoad=t.language_load,r.baseURL=i.baseURL,o.id=t.id=e,o.setDirty(!1),o.plugins={},o.documentBaseURI=new p(t.document_base_url||a,{base_uri:s}),o.baseURI=s,o.contentCSS=[],o.contentStyles=[],o.shortcuts=new k(o),o.loadedCSS={},o.editorCommands=new h(o),t.target&&(o.targetElm=t.target),o.suffix=i.suffix,o.editorManager=i,o.inline=t.inline,o.settings.content_editable=o.inline,t.cache_suffix&&(w.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),t.override_viewport===!1&&(w.overrideViewPort=!1),i.fire("SetupEditor",o),o.execCallback("setup",o),o.$=n.overrideDefaults(function(){return{context:o.inline?o.getBody():o.getDoc(),element:o.getBody()}})}var D=e.DOM,L=r.ThemeManager,M=r.PluginManager,P=N.extend,O=N.each,H=N.explode,I=N.inArray,F=N.trim,z=N.resolve,U=g.Event,W=w.gecko,V=w.ie;return B.prototype={render:function(){function e(){D.unbind(window,"ready",e),n.render()}function t(){var e=m.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!L.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",L.load(r.theme,t)}N.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),O(r.external_plugins,function(e,t){M.load(t,e),r.plugins+=" "+t}),O(r.plugins.split(/[ ,]/),function(e){if(e=F(e),e&&!M.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=M.dependencies(e);O(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=M.createUrl(t,e),M.load(e.resource,e)})}else M.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!U.domLoaded)return void D.bind(window,"ready",e);if(n.getElement()&&w.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||D.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(D.insertAfter(D.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},D.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.setDirty(!1),a._mceOldSubmit(a)})),n.windowManager=new v(n),n.notificationManager=new y(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=D.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),n.editorManager.add(n),t()}},init:function(){function e(n){var r=M.get(n),i,o;if(i=M.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=F(n),r&&-1===I(m,n)){if(O(M.dependencies(n),function(t){e(t)}),t.plugins[n])return;o=new r(t,i,t.$),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n))}}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,h,p,m=[];if(t.rtl=n.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(n.language),n.aria_label=n.aria_label||D.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=L.get(n.theme),t.theme=new c(t,L.urls[n.theme]),t.theme.init&&t.theme.init(t,L.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""),t.$)):t.theme=n.theme),O(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,h=/^[0-9\.]+(|px)$/i,h.test(""+i)&&(i=Math.max(parseInt(i,10),100)),h.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&O(H(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();if(t.iframeHTML=n.doctype+"<html><head>",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+='<base href="'+t.documentBaseURI.getURI()+'" />'),!w.caretAfter&&n.ie7_compat&&(t.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'),t.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',!/#$/.test(document.location.href))for(p=0;p<t.contentCSS.length;p++){var g=t.contentCSS[p];t.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+N._addCacheSuffix(g)+'" />',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),n.content_security_policy&&(t.iframeHTML+='<meta http-equiv="Content-Security-Policy" content="'+n.content_security_policy+'" />'),t.iframeHTML+='</head><body id="'+d+'" class="mce-content-body '+f+'" data-id="'+t.id+'"><br></body></html>';var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';document.domain!=location.hostname&&w.ie&&w.ie<12&&(u=v);var y=D.create("iframe",{id:t.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}});if(y.onload=function(){y.onload=null,t.fire("load")},D.setAttrib(y,"src",u||'javascript:""'),t.contentAreaContainer=l.iframeContainer,t.iframeElement=y,s=D.add(l.iframeContainer,y),V)try{t.getDoc()}catch(b){s.src=u=v}l.editorContainer&&(D.get(l.editorContainer).style.display=t.orgDisplay,t.hidden=D.isHidden(l.editorContainer)),t.getElement().style.display="none",D.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,r=n.settings,s=n.getElement(),h=n.getDoc(),p,m;r.inline||(n.getElement().style.visibility=n.orgVisibility),t||r.content_editable||(h.open(),h.write(n.iframeHTML),h.close()),r.content_editable&&(n.on("remove",function(){var e=this.getBody();D.removeClass(e,"mce-content-body"),D.removeClass(e,"mce-edit-focus"),D.setAttrib(e,"contentEditable",null)}),D.addClass(s,"mce-content-body"),n.contentDocument=h=r.content_document||document,n.contentWindow=r.content_window||window,n.bodyElement=s,r.content_document=r.content_window=null,r.root_name=s.nodeName.toLowerCase()),p=n.getBody(),p.disabled=!0,n.readonly=r.readonly,n.readonly||(n.inline&&"static"==D.getStyle(p,"position",!0)&&(p.style.position="relative"),p.contentEditable=n.getParam("content_editable_state",!0)),p.disabled=!1,n.editorUpload=new T(n),n.schema=new b(r),n.dom=new e(h,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:n.inline?n.getBody():null,collect:r.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new C(r,n.schema),n.parser.addAttributeFilter("src,href,style,tabindex",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)if(i=e[r],a=i.attr(t),s="data-mce-"+t,!i.attributes.map[s]){if(0===a.indexOf("data:")||0===a.indexOf("blob:"))continue;"style"===t?(a=o.serializeStyle(o.parseStyle(a),i.name),a.length||(a=null),i.attr(s,a),i.attr(t,a)):"tabindex"===t?(i.attr(s,a),i.attr(t,null)):i.attr(s,n.convertURL(a,t,i.name))}}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("type")||"no/type",0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,r,i=n.schema.getNonEmptyElements();t--;)r=e[t],r.isEmpty(i)&&(r.append(new o("br",1)).shortEnded=!0)}),n.serializer=new a(r,n),n.selection=new l(n.dom,n.getWin(),n.serializer,n),n.formatter=new c(n),n.undoManager=new u(n),n.forceBlocks=new f(n),n.enterKey=new d(n),n._nodeChangeDispatcher=new i(n),n._selectionOverrides=new R(n),n.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(h.body.spellcheck=!1,D.setAttrib(p,"spellcheck","false")),n.quirks=new x(n),n.fire("PostRender"),r.directionality&&(p.dir=r.directionality),r.nowrap&&(p.style.whiteSpace="nowrap"),r.protect&&n.on("BeforeSetContent",function(e){O(r.protect,function(t){e.content=e.content.replace(t,function(e){return"<!--mce:protected "+escape(e)+"-->"})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),r.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,n.bindPendingEventDelegates(),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.on("compositionstart compositionend",function(e){n.composing="compositionstart"===e.type}),n.contentStyles.length>0&&(m="",O(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),O(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),r.auto_focus&&E.setEditorTimeout(n,function(){var e;e=r.auto_focus===!0?n:n.editorManager.get(r.auto_focus),e.destroyed||e.focus()},100),s=h=p=null},focus:function(e){function t(e){return n.dom.getParent(e,function(e){return"true"===n.dom.getContentEditable(e)})}var n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l=n.getBody(),c;if(!e){if(o=r.getRng(),o.item&&(a=o.item(0)),n.quirks.refreshContentEditable(),c=t(r.getNode()),n.$.contains(l,c))return c.focus(),r.normalize(),void n.editorManager.setActive(n);if(i||(w.opera||n.getBody().focus(),n.getWin().focus()),W||i){if(l.setActive)try{l.setActive()}catch(u){l.focus()}else l.focus();i&&r.normalize()}a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())}n.editorManager.setActive(n)},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?z(r):0,n=z(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?(e=n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}),this.editorManager.translate(e)):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?O(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(e){e=e.split("="),e.length>1?i[F(e[0])]=F(e[1]):i[F(e[0])]=F(e)}):i=r,i):r},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addContextToolbar:function(e,t){var n=this,r;n.contextToolbars=n.contextToolbars||[],"string"==typeof e&&(r=e,e=function(e){return n.dom.is(e,r)}),n.contextToolbars.push({id:A.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable=!0:(D.show(e.getContainer()),D.hide(e.id)),e.load(),e.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(V&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e==e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(D.hide(e.getContainer()),D.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),"raw"==e.format&&t.fire("RawSaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=D.getParent(t.id,"form"))&&O(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&t.setDirty(!1),r},setContent:function(e,t){var n=this,r=n.getBody(),i,o;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(o=V&&11>V?"":'<br data-mce-bogus="1">',"TABLE"==r.nodeName?e="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(r.nodeName)&&(e="<li>"+o+"</li>"),i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=o,e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):V||e||(e='<br data-mce-bogus="1">'),n.dom.setHTML(r,e),n.fire("SetContent",t)):("raw"!==t.format&&(e=new s({validate:n.validate},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=F(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?t.serializer.getTrimmedContent():"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),"text"!=e.format?e.content=F(n):e.content=n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=P({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!=t&&this.fire("dirty")},setMode:function(e){S.setMode(this,e)},getContainer:function(){var e=this;return e.container||(e.container=D.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=D.get(this.id)),this.targetElm},getWin:function(){var e=this,t;return e.contentWindow||(t=e.iframeElement,t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),O(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||!n.hasVisual?i.removeClass(e,o):i.addClass(e,o));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&n.hasVisual?i.addClass(e,o):i.removeClass(e,o)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&D.remove(e.getElement().nextSibling),e.inline||(V&&10>V&&e.getDoc().execCommand("SelectAll",!1,null),D.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),D.remove(e.getContainer()),e._selectionOverrides.destroy(),e.editorUpload.destroy(),e.destroy())},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),D.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},P(B.prototype,_),B}),r(nt,[],function(){var e={},t="en";return{setCode:function(e){e&&(t=e,this.rtl=this.data[e]?"rtl"===this.data[e]._dir:!1)},getCode:function(){return t},rtl:!1,add:function(t,n){var r=e[t];r||(e[t]=r={});for(var i in n)r[i]=n[i];this.setCode(t)},translate:function(n){var r;if(r=e[t],r||(r={}),"undefined"==typeof n)return n;if("string"!=typeof n&&n.raw)return n.raw;if(n.push){var i=n.slice(1);n=(r[n[0]]||n[0]).replace(/\{([0-9]+)\}/g,function(e,t){return i[t]})}return(r[n]||n).replace(/{context:\w+}$/,"")},data:e}}),r(rt,[w,u,d],function(e,t,n){function r(e){function l(){try{return document.activeElement}catch(e){return document.body}}function c(e,t){if(t&&t.startContainer){if(!e.isChildOf(t.startContainer,e.getRoot())||!e.isChildOf(t.endContainer,e.getRoot()))return;return{startContainer:t.startContainer, startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset}}return t}function u(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function d(e){return!!s.getParent(e,r.isEditorUIElement)}function f(r){var f=r.editor;f.on("init",function(){(f.inline||n.ie)&&("onbeforedeactivate"in document&&n.ie<9?f.dom.bind(f.getBody(),"beforedeactivate",function(e){if(e.target==f.getBody())try{f.lastRng=f.selection.getRng()}catch(t){}}):f.on("nodechange mouseup keyup",function(e){var t=l();"nodechange"==e.type&&e.selectionChange||(t&&t.id==f.id+"_ifr"&&(t=f.getBody()),f.dom.isChildOf(t,f.getBody())&&(f.lastRng=f.selection.getRng()))}),n.webkit&&!i&&(i=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(f.lastRng=n)}},s.bind(document,"selectionchange",i)))}),f.on("setcontent",function(){f.lastRng=null}),f.on("mousedown",function(){f.selection.lastFocusBookmark=null}),f.on("focusin",function(){var t=e.focusedEditor,n;f.selection.lastFocusBookmark&&(n=u(f,f.selection.lastFocusBookmark),f.selection.lastFocusBookmark=null,f.selection.setRng(n)),t!=f&&(t&&t.fire("blur",{focusedEditor:f}),e.setActive(f),e.focusedEditor=f,f.fire("focus",{blurredEditor:t}),f.focus(!0)),f.lastRng=null}),f.on("focusout",function(){t.setEditorTimeout(f,function(){var t=e.focusedEditor;d(l())||t!=f||(f.fire("blur",{focusedEditor:null}),e.focusedEditor=null,f.selection&&(f.selection.lastFocusBookmark=null))})}),o||(o=function(t){var n=e.activeEditor,r;r=t.target,n&&r.ownerDocument==document&&(n.selection&&r!=n.getBody()&&(n.selection.lastFocusBookmark=c(n.dom,n.lastRng)),r==document.body||d(r)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},s.bind(document,"focusin",o)),f.inline&&!a&&(a=function(t){var n=e.activeEditor,r=n.dom;if(n.inline&&r&&!r.isChildOf(t.target,n.getBody())){var i=n.selection.getRng();i.collapsed||(n.lastRng=i)}},s.bind(document,"mouseup",a))}function h(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(s.unbind(document,"selectionchange",i),s.unbind(document,"focusin",o),s.unbind(document,"mouseup",a),i=o=a=null)}e.on("AddEditor",f),e.on("RemoveEditor",h)}var i,o,a,s=e.DOM;return r.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},r}),r(it,[tt,g,w,ae,d,m,c,ue,nt,rt],function(e,t,n,r,i,o,a,s,l,c){function u(e){g(C.editors,function(t){"scroll"===e.type?t.fire("ScrollWindow",e):t.fire("ResizeWindow",e)})}function d(e,n){n!==x&&(n?t(window).on("resize scroll",u):t(window).off("resize scroll",u),x=n)}function f(e){var t=C.editors,n;delete t[e.id];for(var r=0;r<t.length;r++)if(t[r]==e){t.splice(r,1),n=!0;break}return C.activeEditor==e&&(C.activeEditor=t[0]),C.focusedEditor==e&&(C.focusedEditor=null),n}function h(e){return e&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(f(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null),e}var p=n.DOM,m=o.explode,g=o.each,v=o.extend,y=0,b,C,x=!1;return C={$:t,majorVersion:"4",minorVersion:"4.3",releaseDate:"2016-09-01",editors:[],i18n:l,activeEditor:null,setup:function(){var e=this,t,n,i="",o,a;if(n=r.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/")),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else{for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){a=s[l].src;var u=a.substring(a.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(a)){-1!=u.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/"));break}}!t&&document.currentScript&&(a=document.currentScript.src,-1!=a.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/")))}e.baseURL=new r(n).toAbsolute(t),e.documentBaseURL=n,e.baseURI=new r(e.baseURL),e.suffix=i,e.focusManager=new c(e)},overrideDefaults:function(e){var t,n;t=e.base_url,t&&(this.baseURL=new r(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new r(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n),this.defaultSettings=e},init:function(n){function r(e,t){return e.inline&&t.tagName.toLowerCase()in C}function i(e,t){window.console&&!window.test&&window.console.log(e,t)}function s(e){var t=e.id;return t||(t=e.name,t=t&&!p.get(t)?e.name:p.uniqueId(),e.setAttribute("id",t)),t}function l(e){var t=n[e];if(t)return t.apply(f,Array.prototype.slice.call(arguments,2))}function c(e,t){return t.constructor===RegExp?t.test(e.className):p.hasClass(e,t)}function u(e){var t,n=[];if(e.types)return g(e.types,function(e){n=n.concat(p.select(e.selector))}),n;if(e.selector)return p.select(e.selector);if(e.target)return[e.target];switch(e.mode){case"exact":t=e.elements||"",t.length>0&&g(m(t),function(e){var t;(t=p.get(e))?n.push(t):g(document.forms,function(t){g(t.elements,function(t){t.name===e&&(e="mce_editor_"+y++,p.setAttrib(t,"id",e),n.push(t))})})});break;case"textareas":case"specific_textareas":g(p.select("textarea"),function(t){e.editor_deselector&&c(t,e.editor_deselector)||e.editor_selector&&!c(t,e.editor_selector)||n.push(t)})}return n}function d(){function a(t,n,r){var i=new e(t,n,f);m.push(i),i.on("init",function(){++c===y.length&&x(m)}),i.targetElm=i.targetElm||r,i.render()}var c=0,m=[],y;return p.unbind(window,"ready",d),l("onpageload"),y=t.unique(u(n)),n.types?void g(n.types,function(e){o.each(y,function(t){return p.is(t,e.selector)?(a(s(t),v({},n,e),t),!1):!0})}):(o.each(y,function(e){h(f.get(e.id))}),y=o.grep(y,function(e){return!f.get(e.id)}),void g(y,function(e){r(n,e)?i("Could not initialize inline editor on invalid inline target element",e):a(s(e),n,e)}))}var f=this,b,C;C=o.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var x=function(e){b=e};return f.settings=n,p.bind(window,"ready",d),new a(function(e){b?e(b):x=function(t){e(t)}})},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),d(n,!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),b||(b=function(){t.fire("BeforeUnload")},p.bind(window,"beforeunload",b)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void g(p.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(f(i)&&t.fire("RemoveEditor",{editor:i}),r.length||p.unbind(window,"beforeunload",b),i.remove(),d(r,r.length>0),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){g(this.editors,function(e){e.save()})},addI18n:function(e,t){l.add(e,t)},translate:function(e){return l.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},v(C,s),C.setup(),window.tinymce=window.tinyMCE=C,C}),r(ot,[it,m],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(n,r){"html4"===t.settings.schema&&e(r,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(at,[ue,m],function(e,t){var n={send:function(e){function r(){!e.async||4==i.readyState||o++>1e4?(e.success&&1e4>o&&200==i.status?e.success.call(e.success_scope,""+i.responseText,i,e):e.error&&e.error.call(e.error_scope,o>1e4?"TIMED_OUT":"GENERAL",i,e),i=null):setTimeout(r,10)}var i,o=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async!==!1,e.data=e.data||"",n.fire("beforeInitialize",{settings:e}),i=new XMLHttpRequest){if(i.overrideMimeType&&i.overrideMimeType(e.content_type),i.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(i.withCredentials=!0),e.content_type&&i.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&t.each(e.requestheaders,function(e){i.setRequestHeader(e.key,e.value)}),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i=n.fire("beforeSend",{xhr:i,settings:e}).xhr,i.send(e.data),!e.async)return r();setTimeout(r,10)}}};return t.extend(n,e),n}),r(st,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r<t.length;r++)i+=(r>0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(lt,[st,at,m],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(ct,[w],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(ut,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(dt,[w,f,N,E,m,d],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(ft,[se,m],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t=this,n=t.settings,r,i,o,a;r=n.firstControlClass,i=n.lastControlClass,e.each(function(e){e.classes.remove(r).remove(i).add(n.controlClass),e.visible()&&(o||(o=e),a=e)}),o&&o.classes.add(r),a&&a.classes.add(i)},renderHtml:function(e){var t=this,n="";return t.applyClasses(e.items()),e.items().each(function(e){n+=e.renderHtml()}),n},recalc:function(){},postRender:function(){},isNative:function(){return!1}})}),r(ht,[ft],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}})}),r(pt,[De],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t._super(e),e=t.settings,n=t.settings.size,t.on("click mousedown",function(e){e.preventDefault()}),t.on("touchstart",function(e){t.fire("click",e),e.preventDefault()}),e.subtype&&t.classes.add(e.subtype),n&&t.classes.add("btn-"+n),e.icon&&t.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e=this.getEl().firstChild,t;e&&(t=e.style,t.width=t.height="100%"),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("icon"),i,o=e.state.get("text"),a="";return i=e.settings.image,i?(r="none","string"!=typeof i&&(i=window.getSelection?i[0]:i[1]),i=" style=\"background-image: url('"+i+"')\""):i="",o&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(o)+"</span>"),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'<div id="'+t+'" class="'+e.classes+'" tabindex="-1" aria-labelledby="'+t+'"><button role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+i+"></i>":"")+a+"</button></div>"},bindStates:function(){function e(e){var i=n("span."+r,t.getEl());e?(i[0]||(n("button:first",t.getEl()).append('<span class="'+r+'"></span>'),i=n("span."+r,t.getEl())),i.html(t.encode(e))):i.remove(),t.classes.toggle("btn-has-text",!!e)}var t=this,n=t.$,r=t.classPrefix+"txt";return t.state.on("change:text",function(t){e(t.value)}),t.state.on("change:icon",function(n){var r=n.value,i=t.classPrefix;t.settings.icon=r,r=r?i+"ico "+i+"i-"+t.settings.icon:"";var o=t.getEl().firstChild,a=o.getElementsByTagName("i")[0];r?(a&&a==o.firstChild||(a=document.createElement("i"),o.insertBefore(a,o.firstChild)),a.className=r):a&&o.removeChild(a),e(t.state.get("text"))}),t._super()}})}),r(mt,[xe],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(gt,[De],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'" unselectable="on" aria-labelledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'label">'+e.encode(e.state.get("text"))+"</span></div>"},bindStates:function(){function e(e){t.classes.toggle("checked",e),t.aria("checked",e)}var t=this;return t.state.on("change:text",function(e){t.getEl("al").firstChild.data=t.translate(e.value)}),t.state.on("change:checked change:value",function(n){t.fire("change"),e(n.value)}),t.state.on("change:icon",function(e){var n=e.value,r=t.classPrefix;if("undefined"==typeof n)return t.settings.icon;t.settings.icon=n,n=n?r+"ico "+r+"i-"+t.settings.icon:"";var i=t.getEl().firstChild,o=i.getElementsByTagName("i")[0];n?(o&&o==i.firstChild||(o=document.createElement("i"),i.insertBefore(o,i.firstChild)),o.className=n):o&&i.removeChild(o)}),t.state.get("checked")&&e(!0),t._super()}})}),r(vt,[De,be,pe,g],function(e,t,n,r){return e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.classes.add("combobox"),t.subinput=!0,t.ariaTarget="inp",e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){var i=n.target,o=t.getEl();if(r.contains(o,i)||i==o)for(;i&&i!=o;)i.id&&-1!=i.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),i=i.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){var r=t.state.get("value"),i=t.getEl("inp").value;return e.preventDefault(),t.state.set("value",i),r!=i&&t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),t.on("keyup",function(e){"INPUT"==e.target.nodeName&&t.state.set("value",e.target.value)})},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),i=e.getEl("open"),o=e.layoutRect(),a,s;a=i?o.w-n.getSize(i).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(s=e.layoutRect().h-2+"px"),r(t.firstChild).css({width:a,lineHeight:s}),e._super(),e},postRender:function(){var e=this;return r(this.getEl("inp")).on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)}),e._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=e.state.get("value")||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e.state.get("text"),(o||a)&&(s='<div id="'+t+'-open" class="'+r+"btn "+r+'open" tabIndex="-1" role="button"><button id="'+t+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!=o?'<i class="'+o+'"></i>':'<i class="'+r+'caret"></i>')+(a?(o?" ":"")+a:"")+"</button></div>",e.classes.add("has-open")),'<div id="'+t+'" class="'+e.classes+'"><input id="'+t+'-inp" class="'+r+'textbox" value="'+e.encode(i,!1)+'" hidefocus="1"'+l+' placeholder="'+e.encode(n.placeholder)+'" />'+s+"</div>"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl("inp").value!=t.value&&(e.getEl("inp").value=t.value)}),e.state.on("change:disabled",function(t){e.getEl("inp").disabled=t.value}),e._super()},remove:function(){r(this.getEl("inp")).off(),this._super()}})}),r(yt,[vt],function(e){return e.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl().getElementsByTagName("i")[0];if(t)try{t.style.background=e}catch(n){}},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.state.get("rendered")&&e.repaintColor(t.value)}),e._super()}})}),r(bt,[pt,ke],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),r(Ct,[bt,w],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("text"),i=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",a="";return r&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(r)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(i?'<i class="'+i+'"'+o+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+a+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(xt,[],function(){function e(e){function i(e,i,o){var a,s,l,c,u,d;return a=0,s=0,l=0,e/=255,i/=255,o/=255,u=t(e,t(i,o)),d=n(e,n(i,o)),u==d?(l=u,{h:0,s:0,v:100*l}):(c=e==u?i-o:o==u?e-i:o-e,a=e==u?3:o==u?1:5,a=60*(a-c/(d-u)),s=(d-u)/d,l=d,{h:r(a),s:r(100*s),v:r(100*l)})}function o(e,i,o){var a,s,l,c;if(e=(parseInt(e,10)||0)%360,i=parseInt(i,10)/100,o=parseInt(o,10)/100,i=n(0,t(i,1)),o=n(0,t(o,1)),0===i)return void(d=f=h=r(255*o));switch(a=e/60,s=o*i,l=s*(1-Math.abs(a%2-1)),c=o-s,Math.floor(a)){case 0:d=s,f=l,h=0;break;case 1:d=l,f=s,h=0;break;case 2:d=0,f=s,h=l;break;case 3:d=0,f=l,h=s;break;case 4:d=l,f=0,h=s;break;case 5:d=s,f=0,h=l;break;default:d=f=h=0}d=r(255*(d+c)),f=r(255*(f+c)),h=r(255*(h+c))}function a(){function e(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+e(d)+e(f)+e(h)}function s(){return{r:d,g:f,b:h}}function l(){return i(d,f,h)}function c(e){var t;return"object"==typeof e?"r"in e?(d=e.r,f=e.g,h=e.b):"v"in e&&o(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(d=parseInt(t[1],10),f=parseInt(t[2],10),h=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(d=parseInt(t[1],16),f=parseInt(t[2],16),h=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(d=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16),h=parseInt(t[3]+t[3],16)),d=0>d?0:d>255?255:d,f=0>f?0:f>255?255:f,h=0>h?0:h>255?255:h,u}var u=this,d=0,f=0,h=0;e&&c(e),u.toRgb=s,u.toHsv=l,u.toHex=a,u.parse=c}var t=Math.min,n=Math.max,r=Math.round;return e}),r(wt,[De,we,pe,xt],function(e,t,n,r){return e.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){function e(e,t){var r=n.getPos(e),i,o;return i=t.pageX-r.x,o=t.pageY-r.y,i=Math.max(0,Math.min(i/e.clientWidth,1)),o=Math.max(0,Math.min(o/e.clientHeight,1)),{x:i,y:o}}function i(e,t){var i=(360-e.h)/360;n.css(d,{top:100*i+"%"}),t||n.css(h,{left:e.s+"%",top:100-e.v+"%"}),f.style.background=new r({s:100,v:100,h:e.h}).toHex(),s.color().parse({s:e.s,v:e.v,h:e.h})}function o(t){var n;n=e(f,t),c.s=100*n.x,c.v=100*(1-n.y),i(c),s.fire("change")}function a(t){var n;n=e(u,t),c=l.toHsv(),c.h=360*(1-n.y),i(c,!0),s.fire("change")}var s=this,l=s.color(),c,u,d,f,h;u=s.getEl("h"),d=s.getEl("hp"),f=s.getEl("sv"),h=s.getEl("svp"),s._repaint=function(){c=l.toHsv(),i(c)},s._super(),s._svdraghelper=new t(s._id+"-sv",{start:o,drag:o}),s._hdraghelper=new t(s._id+"-h",{start:a,drag:a}),s._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;return arguments.length?(t.color().parse(e),void(t._rendered&&t._repaint())):t.color().toHex()},color:function(){return this._color||(this._color=new r),this._color},renderHtml:function(){function e(){var e,t,n="",i,a;for(i="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",a=o.split(","),e=0,t=a.length-1;t>e;e++)n+='<div class="'+r+'colorpicker-h-chunk" style="height:'+100/t+"%;"+i+a[e]+",endColorstr="+a[e+1]+");-ms-"+i+a[e]+",endColorstr="+a[e+1]+')"></div>';return n}var t=this,n=t._id,r=t.classPrefix,i,o="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",a="background: -ms-linear-gradient(top,"+o+");background: linear-gradient(to bottom,"+o+");";return i='<div id="'+n+'-h" class="'+r+'colorpicker-h" style="'+a+'">'+e()+'<div id="'+n+'-hp" class="'+r+'colorpicker-h-marker"></div></div>','<div id="'+n+'" class="'+t.classes+'"><div id="'+n+'-sv" class="'+r+'colorpicker-sv"><div class="'+r+'colorpicker-overlay1"><div class="'+r+'colorpicker-overlay2"><div id="'+n+'-svp" class="'+r+'colorpicker-selector1"><div class="'+r+'colorpicker-selector2"></div></div></div></div></div>'+i+"</div>"}})}),r(Nt,[De],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.classes.add("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.row()[n],index:n})}),t.row(t.settings.row)},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){var e=this;return'<div id="'+e._id+'" class="'+e.classes+'">'+e._getDataPathHtml(e.state.get("row"))+"</div>"},bindStates:function(){var e=this;return e.state.on("change:row",function(t){e.innerHtml(e._getDataPathHtml(t.value))}),e._super()},_getDataPathHtml:function(e){var t=this,n=e||[],r,i,o="",a=t.classPrefix;for(r=0,i=n.length;i>r;r++)o+=(r>0?'<div class="'+a+'divider" aria-hidden="true"> '+t.settings.delimiter+" </div>":"")+'<div role="button" class="'+a+"path-item"+(r==i-1?" "+a+"last":"")+'" data-index="'+r+'" tabindex="-1" id="'+t._id+"-"+r+'" aria-level="'+r+'">'+n[r].name+"</div>";return o||(o='<div class="'+a+'path-item">\xa0</div>'),o}})}),r(Et,[Nt],function(e){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var t=this,n=t.settings.editor;return n.settings.elementpath!==!1&&(t.on("select",function(e){n.focus(),n.selection.select(this.row()[e.index].element),n.nodeChanged()}),n.on("nodeChange",function(r){for(var i=[],o=r.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=n.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});if(s.isDefaultPrevented()||i.push({name:s.name,element:o[a]}),s.isPropagationStopped())break}t.row(i)})),t._super()}})}),r(_t,[xe],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(St,[xe,_t,m],function(e,t,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,r=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),r.each(function(r){var i,o=r.settings.label;o&&(i=new t(n.extend({items:{type:"label",id:r._id+"-l",text:o,flex:0,forId:r._id,disabled:r.disabled()}},e.settings.formItemDefaults)),i.type="formitem",r.aria("labelledby",r._id+"-l"),"undefined"==typeof r.settings.flex&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.fromJSON(e.settings.data)},bindStates:function(){function e(){var e=0,n=[],r,i,o;if(t.settings.labelGapCalc!==!1)for(o="children"==t.settings.labelGapCalc?t.find("formitem"):t.items(),o.filter("formitem").each(function(t){var r=t.items()[0],i=r.getEl().clientWidth;e=i>e?i:e,n.push(r)}),i=t.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=e+i}var t=this;t._super(),t.on("show",e),e()}})}),r(kt,[St],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}})}),r(Tt,[vt,m],function(e,t){return e.extend({init:function(e){var n=this,r=tinymce.activeEditor,i=r.settings,o,a,s;e.spellcheck=!1,s=i.file_picker_types||i.file_browser_callback_types,s&&(s=t.makeMap(s,/[, ]/)),s&&!s[e.filetype]||(a=i.file_picker_callback,!a||s&&!s[e.filetype]?(a=i.file_browser_callback,!a||s&&!s[e.filetype]||(o=function(){a(n.getEl("inp").id,n.value(),e.filetype,window)})):o=function(){var i=n.fire("beforecall").meta;i=t.extend({filetype:e.filetype},i),a.call(r,function(e,t){n.value(e).fire("change",{meta:t})},n.value(),i)}),o&&(e.icon="browse",e.onaction=o),n._super(e)}})}),r(Rt,[ht],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(At,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v=[],y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F,z=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e.paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,"row-reversed"!=f&&"column-reverse"!=f||(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(S="y",E="h",_="minH",k="maxH",R="innerH",T="top",A="deltaH",B="contentH",O="left",M="w",D="x",L="innerW", P="minW",H="right",I="deltaW",F="contentW"):(S="x",E="w",_="minW",k="maxW",R="innerW",T="left",A="deltaW",B="contentW",O="top",M="h",D="y",L="innerH",P="minH",H="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],N=u=0,t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),m=h.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,p[k]&&v.push(h),p.flex=g),d-=p[_],y=o[O]+p[P]+o[H],y>N&&(N=y);if(x={},0>d?x[_]=i[_]-d+i[A]:x[_]=i[R]-d+i[A],x[P]=N+i[I],x[B]=i[R]-d,x[F]=N,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)h=v[t],p=h.layoutRect(),b=p[k],y=p[_]+p.flex*C,y>b?(d-=p[k]-p[_],u-=p.flex,p.flex=0,p.maxFlexSize=b):p.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[D]=o[O],t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),y=p.maxFlexSize||p[_],"center"===s?x[D]=Math.round(i[L]/2-p[M]/2):"stretch"===s?(x[M]=z(p[P]||0,i[L]-o[O]-o[H]),x[D]=o[O]):"end"===s&&(x[D]=i[L]-p[M]-o.top),p.flex>0&&(y+=p.flex*C),x[E]=y,x[S]=w,h.layoutRect(x),h.recalc&&h.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var W=e.parent();W&&(W._lastRect=null,W.recalc())}}})}),r(Bt,[ft],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}})}),r(Dt,[ye,De,ke,m,w,it,d],function(e,t,n,r,i,o,a){function s(e){e.settings.ui_container&&(a.container=i.DOM.select(e.settings.ui_container)[0])}function l(t){t.on("ScriptsLoaded",function(){t.rtl&&(e.rtl=!0)})}function c(e){function t(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;u(i.parents,function(e){return u(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function r(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function i(){function t(e){var n=[];if(e)return u(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=t(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a,o.cmd=e.cmd}n.push(o)}),n}function n(){var n;return n=t(e.settings.style_formats_merge?e.settings.style_formats?o.concat(e.settings.style_formats):o:e.settings.style_formats||o)}var r=0,i=[],o=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){u(i,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:n(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?e.formatter.getCssText(this.settings.format):void 0},onPostRender:function(){var t=this;t.parent().on("show",function(){var n,r;n=t.settings.format,n&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),r=t.settings.cmd,r&&t.active(e.queryCommandState(r))})},onclick:function(){this.settings.format&&l(this.settings.format),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}function o(t){return function(){var n=this;e.formatter?e.formatter.formatChanged(t,function(e){n.active(e)}):e.on("init",function(){e.formatter.formatChanged(t,function(e){n.active(e)})})}}function a(t){return function(){function n(){return e.undoManager?e.undoManager[t]():!1}var r=this;t="redo"==t?"hasRedo":"hasUndo",r.disabled(!n()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){r.disabled(e.readonly||!n())})}}function s(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function l(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var c;c=i(),u({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:o(n),onclick:function(){l(n)}})}),u({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),u({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:o(n)})}),e.addButton("undo",{tooltip:"Undo",onPostRender:a("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:a("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:s,cmd:"mceToggleVisualAid"}),e.addButton("remove",{tooltip:"Remove",icon:"remove",cmd:"Delete"}),u({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return u(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return u(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return u(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var u=r.each;o.on("AddEditor",function(e){var t=e.editor;l(t),c(t),s(t)}),e.translate=function(e){return o.translate(e)},t.tooltips=!a.iOS}),r(Lt,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E=[],_=[],S,k,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e.paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)_.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),S=c.minW,k=c.minH,E[d]=S>E[d]?S:E[d],_[f]=k>_[f]?k:_[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,N=0,f=0;n>f;f++)N+=_[f]+(f>0?b:0),R-=(f>0?b:0)+_[f];if(w+=g.left+g.right,N+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=N+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var D;D="start"==t.packV?0:R>0?Math.floor(R/n):0;var L=0,M=t.flexWidths;if(M)for(d=0;d<M.length;d++)L+=M[d];else L=r;var P=T/L;for(d=0;r>d;d++)E[d]+=M?M[d]*P:P;for(p=g.top,f=0;n>f;f++){for(h=g.left,s=_[f]+D,d=0;r>d&&(B=A?f*r+r-1-d:f*r+d,u=i[B],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(E[d],c.startMinWidth),c.x=h,c.y=p,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=h+a/2-c.w/2:"right"==v?c.x=h+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=p+s/2-c.h/2:"bottom"==v?c.y=p+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),h+=a+y,u.recalc&&u.recalc();p+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var O=e.parent();O&&(O._lastRect=null,O.recalc())}}})}),r(Mt,[De,u],function(e,t){return e.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,n){var r=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,n&&n()):t.setTimeout(function(){r.html(e)}),this}})}),r(Pt,[De],function(e){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("infobox"),t.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+e.encode(e.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+t+"ico "+t+'i-help"></i></button></div></div>'},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl("body").firstChild.data=e.encode(t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e.state.on("change:help",function(t){e.classes.toggle("has-help",t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ot,[De,pe],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.classes.add("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e=this,t,n,r=e.settings.forId;return!r&&(n=e.settings.forName)&&(t=e.getRoot().find("#"+n)[0],t&&(r=t._id)),r?'<label id="'+e._id+'" class="'+e.classes+'"'+(r?' for="'+r+'"':"")+">"+e.encode(e.state.get("text"))+"</label>":'<span id="'+e._id+'" class="'+e.classes+'">'+e.encode(e.state.get("text"))+"</span>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.innerHtml(e.encode(t.value)),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ht,[xe],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.classes.add("toolbar")},postRender:function(){var e=this;return e.items().each(function(e){e.classes.add("toolbar-item")}),e._super()}})}),r(It,[Ht],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(Ft,[pt,be,It],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(){var e=this,n;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(n=e.state.get("menu")||[],n.length?n={type:"menu",items:n}:n.type=n.type||"menu",n.renderTo?e.menu=n.parent(e).show().renderTo():e.menu=t.create(n).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon,o,a=e.state.get("text"),s="";return o=e.settings.image,o?(i="none","string"!=typeof o&&(o=window.getSelection?o[0]:o[1]),o=" style=\"background-image: url('"+o+"')\""):o="",a&&(e.classes.add("btn-has-text"),s='<span class="'+r+'txt">'+e.encode(a)+"</span>"),i=e.settings.icon?r+"ico "+r+"i-"+i:"",e.aria("role",e.parent()instanceof n?"menuitem":"button"),'<div id="'+t+'" class="'+e.classes+'" tabindex="-1" aria-labelledby="'+t+'"><button id="'+t+'-open" role="presentation" type="button" tabindex="-1">'+(i?'<i class="'+i+'"'+o+"></i>":"")+s+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});return i}),r(zt,[De,be,d,u],function(e,t,n,r){return e.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t=this,n;t._super(e),e=t.settings,t.classes.add("menu-item"),e.menu&&t.classes.add("menu-item-expand"),e.preview&&t.classes.add("menu-item-preview"),n=t.state.get("text"),"-"!==n&&"|"!==n||(t.classes.add("menu-item-sep"),t.aria("role","separator"),t.state.set("text","-")),e.selectable&&(t.aria("role","menuitemcheckbox"),t.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||t.classes.add("menu-item-normal"),t.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&t.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r,i=e.parent();if(i.items().each(function(t){t!==e&&t.hideMenu()}),n.menu){r=e.menu,r?r.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",i.settings.itemDefaults&&(r.itemDefaults=i.settings.itemDefaults),r=e.menu=t.create(r).parent(e).renderTo(),r.reflow(),r.on("cancel",function(t){t.stopPropagation(),e.focus(),r.hide()}),r.on("show hide",function(e){e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),r.on("hide",function(t){t.control===r&&e.classes.remove("selected")}),r.submenu=!0),r._parentMenu=i,r.classes.add("menu-sub");var o=r.testMoveRel(e.getEl(),e.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);r.moveRel(e.getEl(),o),r.rel=o,o="menu-sub-"+o,r.classes.remove(r._lastRel).add(o),r._lastRel=o,e.classes.add("selected"),e.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){function e(e){var t,r,i={};for(i=n.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)r=i[e[t].toLowerCase()],r&&(e[t]=r);return e.join("+")}var t=this,r=t._id,i=t.settings,o=t.classPrefix,a=t.encode(t.state.get("text")),s=t.settings.icon,l="",c=i.shortcut;return s&&t.parent().classes.add("menu-has-icons"),i.image&&(l=" style=\"background-image: url('"+i.image+"')\""),c&&(c=e(c)),s=o+"ico "+o+"i-"+(t.settings.icon||"none"),'<div id="'+r+'" class="'+t.classes+'" tabindex="-1">'+("-"!==a?'<i class="'+s+'"'+l+"></i>\xa0":"")+("-"!==a?'<span id="'+r+'-text" class="'+o+'text">'+a+"</span>":"")+(c?'<div id="'+r+'-shortcut" class="'+o+'menu-shortcut">'+c+"</div>":"")+(i.menu?'<div class="'+o+'caret"></div>':"")+"</div>"},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var i=e.getEl("text");i&&i.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),r.requestAnimationFrame(function(){e.parent().hideAll()})))}),e._super(),e},hover:function(){var e=this;return e.parent().items().each(function(e){e.classes.remove("selected")}),e.classes.toggle("selected",!0),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ut,[g,ye,u],function(e,t,n){return function(r,i){var o=this,a,s=t.classPrefix,l;o.show=function(t,c){function u(){a&&(e(r).append('<div class="'+s+"throbber"+(i?" "+s+"throbber-inline":"")+'"></div>'),c&&c())}return o.hide(),a=!0,t?l=n.setTimeout(u,t):u(),o},o.hide=function(){var e=r.lastChild;return n.clearTimeout(l),e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),a=!1,o}}}),r(Wt,[ke,zt,Ut,m],function(e,t,n,r){return e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var n=e.items,i=n.length;i--;)n[i]=r.extend({},e.itemDefaults,n[i]);t._super(e),t.classes.add("menu")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},load:function(){function e(){t.throbber&&(t.throbber.hide(),t.throbber=null)}var t=this,r,i;i=t.settings.itemsFactory,i&&(t.throbber||(t.throbber=new n(t.getEl("body"),!0),0===t.items().length?(t.throbber.show(),t.fire("loading")):t.throbber.show(100,function(){t.items().remove(),t.fire("loading")}),t.on("hide close",e)),t.requestTime=r=(new Date).getTime(),t.settings.itemsFactory(function(n){return 0===n.length?void t.hide():void(t.requestTime===r&&(t.getEl().style.width="",t.getEl("body").style.width="",e(),t.items().remove(),t.getEl("body").innerHTML="",t.add(n),t.renderNew(),t.fire("loaded")))}))},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.image||n.selectable?(e._hasIcons=!0,!1):void 0}),e.settings.itemsFactory&&e.on("postrender",function(){e.settings.itemsFactory&&e.load()}),e._super()}})}),r(Vt,[Ft,Wt],function(e,t){return e.extend({init:function(e){function t(r){for(var a=0;a<r.length;a++){if(i=r[a].selected||e.value===r[a].value)return o=o||r[a].text,n.state.set("value",r[a].value),!0;if(r[a].menu&&t(r[a].menu))return!0}}var n=this,r,i,o,a;n._super(e),e=n.settings,n._values=r=e.values,r&&("undefined"!=typeof e.value&&t(r),!i&&r.length>0&&(o=r[0].text,n.state.set("value",r[0].value)),n.state.set("menu",r)),n.state.set("text",e.text||o),n.classes.add("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.value()),a=r})},bindStates:function(){function e(e,n){e instanceof t&&e.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}function n(e,t){var r;if(e)for(var i=0;i<e.length;i++){if(e[i].value===t)return e[i];if(e[i].menu&&(r=n(e[i].menu,t)))return r}}var r=this;return r.on("show",function(t){e(t.control,r.value())}),r.state.on("change:value",function(e){var t=n(r.state.get("menu"),e.value);t?r.text(t.text):r.text(r.settings.text)}),r._super()}})}),r($t,[gt],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(qt,[De,we],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"==e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(jt,[De],function(e){function t(e){var t="";if(e)for(var n=0;n<e.length;n++)t+='<option value="'+e[n]+'">'+e[n]+"</option>";return t}return e.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var t=this;t._super(e),t.settings.size&&(t.size=t.settings.size),t.settings.options&&(t._options=t.settings.options),t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e=this,n,r="";return n=t(e._options),e.size&&(r=' size = "'+e.size+'"'),'<select id="'+e._id+'" class="'+e.classes+'"'+r+">"+n+"</select>"},bindStates:function(){var e=this;return e.state.on("change:options",function(n){e.getEl().innerHTML=t(n.value)}),e._super()}})}),r(Yt,[De,we,pe],function(e,t,n){function r(e,t,n){return t>e&&(e=t),e>n&&(e=n),e}function i(e,t,n){e.setAttribute("aria-"+t,n)}function o(e,t){var r,o,a,s,l,c;"v"==e.settings.orientation?(s="top",a="height",o="h"):(s="left",a="width",o="w"),c=e.getEl("handle"),r=(e.layoutRect()[o]||100)-n.getSize(c)[a],l=r*((t-e._minValue)/(e._maxValue-e._minValue))+"px",c.style[s]=l,c.style.height=e.layoutRect().h+"px",i(c,"valuenow",t),i(c,"valuetext",""+e.settings.previewFilter(t)),i(c,"valuemin",e._minValue),i(c,"valuemax",e._maxValue)}return e.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"==e.orientation&&t.classes.add("vertical"),t._minValue=e.minValue||0,t._maxValue=e.maxValue||100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'"><div id="'+t+'-handle" class="'+n+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){function e(e,t,n){return(n+e)/(t-e)}function i(e,t,n){return n*(t-e)-e}function o(t,n){function o(o){var a;a=s.value(),a=i(t,n,e(t,n,a)+.05*o),a=r(a,t,n),s.value(a),s.fire("dragstart",{value:a}),s.fire("drag",{value:a}),s.fire("dragend",{value:a})}s.on("keydown",function(e){switch(e.keyCode){case 37:case 38:o(-1);break;case 39:case 40:o(1)}})}function a(e,i,o){var a,l,c,p,m;s._dragHelper=new t(s._id,{handle:s._id+"-handle",start:function(e){a=e[u],l=parseInt(s.getEl("handle").style[d],10),c=(s.layoutRect()[h]||100)-n.getSize(o)[f],s.fire("dragstart",{value:m})},drag:function(t){var n=t[u]-a;p=r(l+n,0,c),o.style[d]=p+"px",m=e+p/c*(i-e),s.value(m),s.tooltip().text(""+s.settings.previewFilter(m)).show().moveRel(o,"bc tc"),s.fire("drag",{value:m})},stop:function(){s.tooltip().hide(),s.fire("dragend",{value:m})}})}var s=this,l,c,u,d,f,h;l=s._minValue,c=s._maxValue,"v"==s.settings.orientation?(u="screenY",d="top",f="height",h="h"):(u="screenX",d="left",f="width",h="w"),s._super(),o(l,c,s.getEl("handle")),a(l,c,s.getEl("handle"))},repaint:function(){this._super(),o(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){o(e,t.value)}),e._super()}})}),r(Xt,[De],function(e){return e.extend({renderHtml:function(){var e=this;return e.classes.add("spacer"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"></div>'}})}),r(Kt,[Ft,pe,g],function(e,t,n){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,r=e.getEl(),i=e.layoutRect(),o,a;return e._super(),o=r.firstChild,a=r.lastChild,n(o).css({width:i.w-t.getSize(a).width,height:i.h-2}),n(a).css({height:i.h-2}),e},activeMenu:function(e){var t=this;n(t.getEl().lastChild).toggleClass(t.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r,i=e.state.get("icon"),o=e.state.get("text"),a="";return r=e.settings.image,r?(i="none","string"!=typeof r&&(r=window.getSelection?r[0]:r[1]),r=" style=\"background-image: url('"+r+"')\""):r="",i=e.settings.icon?n+"ico "+n+"i-"+i:"",o&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(o)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(i?'<i class="'+i+'"'+r+"></i>":"")+a+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1">'+(e._menuBtnText?(i?"\xa0":"")+e._menuBtnText:"")+' <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void(t&&t.call(this,e));n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Gt,[Bt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}})}),r(Jt,[Ee,g,pe],function(e,t,n){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t(n).removeClass(this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t(n).addClass(this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='<div id="'+o+'" class="'+r+'tab" unselectable="on" role="tab" aria-controls="'+t._id+'" aria-selected="false" tabIndex="-1">'+e.encode(t.settings.title)+"</div>"}),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1"><div id="'+e._id+'-head" class="'+r+'tabs" role="tablist">'+n+'</div><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,t,r,i;r=n.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=n.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,t=e._super(),t.deltaH+=o,t.innerH=t.h-t.deltaH,t}})}),r(Qt,[De,m,pe],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("textbox"),e.multiline?t.classes.add("multiline"):(t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))}),t.on("keyup",function(e){t.state.set("value",e.target.value)}))},repaint:function(){var e=this,t,n,r,i,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e.borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,r=e.settings,i,o;return i={id:e._id,hidefocus:"1"},t.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){i[e]=r[e]}),e.disabled()&&(i.disabled="disabled"),r.subtype&&(i.type=r.subtype),o=n.create(r.multiline?"textarea":"input",i),o.value=e.state.get("value"),o.className=e.classes,o.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e.getEl().value=e.state.get("value"),e._super(),e.$el.on("change",function(t){ e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!=t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.value}),e._super()},remove:function(){this.$el.off(),this._super()}})}),r(Zt,[],function(){var e=this||window,t=function(){return e.tinymce};return"function"==typeof e.define&&(e.define.amd||e.define("ephox/tinymce",[],t)),{}}),a([l,c,u,d,f,h,m,g,v,y,C,w,N,E,T,A,B,D,L,M,P,O,I,F,j,Y,J,Q,oe,ae,se,le,ue,fe,he,ve,ye,be,Ce,xe,we,Ne,Ee,_e,Se,ke,Te,Re,Ae,Be,De,Le,Me,Pe,Ie,ze,tt,nt,rt,it,at,st,lt,ct,ut,dt,ft,ht,pt,mt,gt,vt,yt,bt,Ct,xt,wt,Nt,Et,_t,St,kt,Tt,Rt,At,Bt,Dt,Lt,Mt,Pt,Ot,Ht,It,Ft,zt,Ut,Wt,Vt,$t,qt,jt,Yt,Xt,Kt,Gt,Jt,Qt])}(this); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/validation.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 492 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/validation.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,142 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 160 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 160 bytes. |
function validateEmail(email) {
var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; return re.test(email); } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/webcamjs-master2/webcam.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 505 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/webcamjs-master2/webcam.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 26791 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 26,791 bytes. |
// WebcamJS v1.0.16
// Webcam library for capturing JPEG/PNG images in JavaScript // Attempts getUserMedia, falls back to Flash // Author: Joseph Huckaby: http://github.com/jhuckaby // Based on JPEGCam: http://code.google.com/p/jpegcam/ // Copyright (c) 2012 - 2016 Joseph Huckaby // Licensed under the MIT License (function(window) { var _userMedia; // declare error types // inheritance pattern here: // https://stackoverflow.com/questions/783818/how-do-i-create-a-custom-error-in-javascript function FlashError() { var temp = Error.apply(this, arguments); temp.name = this.name = "FlashError"; this.stack = temp.stack; this.message = temp.message; } function WebcamError() { var temp = Error.apply(this, arguments); temp.name = this.name = "WebcamError"; this.stack = temp.stack; this.message = temp.message; } IntermediateInheritor = function() {}; IntermediateInheritor.prototype = Error.prototype; FlashError.prototype = new IntermediateInheritor(); WebcamError.prototype = new IntermediateInheritor(); var Webcam = { version: '1.0.16', // globals protocol: location.protocol.match(/https/i) ? 'https' : 'http', loaded: false, // true when webcam movie finishes loading live: false, // true when webcam is initialized and ready to snap userMedia: true, // true when getUserMedia is supported natively params: { width: 0, height: 0, dest_width: 0, // size of captured image dest_height: 0, // these default to width/height image_format: 'jpeg', // image format (may be jpeg or png) jpeg_quality: 90, // jpeg image quality from 0 (worst) to 100 (best) enable_flash: true, // enable flash fallback, force_flash: false, // force flash mode, flip_horiz: false, // flip image horiz (mirror mode) fps: 30, // camera frames per second upload_name: 'webcam', // name of file in upload post data constraints: null, // custom user media constraints, swfURL: '', // URI to webcam.swf movie (defaults to the js location) flashNotDetectedText: 'ERROR: No Adobe Flash Player detected. Webcam.js relies on Flash for browsers that do not support getUserMedia (like yours).', noInterfaceFoundText: 'No supported webcam interface found.', unfreeze_snap: true // Whether to unfreeze the camera after snap (defaults to true) }, errors: { FlashError: FlashError, WebcamError: WebcamError }, hooks: {}, // callback hook functions init: function() { // initialize, check for getUserMedia support var self = this; // Setup getUserMedia, with polyfill for older browsers // Adapted from: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia this.mediaDevices = (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) ? navigator.mediaDevices : ((navigator.mozGetUserMedia || navigator.webkitGetUserMedia) ? { getUserMedia: function(c) { return new Promise(function(y, n) { (navigator.mozGetUserMedia || navigator.webkitGetUserMedia).call(navigator, c, y, n); }); } } : null); window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; this.userMedia = this.userMedia && !!this.mediaDevices && !!window.URL; // Older versions of firefox (< 21) apparently claim support but user media does not actually work if (navigator.userAgent.match(/Firefox\D+(\d+)/)) { if (parseInt(RegExp.$1, 10) < 21) this.userMedia = null; } // Make sure media stream is closed when navigating away from page if (this.userMedia) { window.addEventListener( 'beforeunload', function(event) { self.reset(); } ); } }, attach: function(elem) { // create webcam preview and attach to DOM element // pass in actual DOM reference, ID, or CSS selector if (typeof(elem) == 'string') { elem = document.getElementById(elem) || document.querySelector(elem); } if (!elem) { return this.dispatch('error', new WebcamError("Could not locate DOM element to attach to.")); } this.container = elem; elem.innerHTML = ''; // start with empty element // insert "peg" so we can insert our preview canvas adjacent to it later on var peg = document.createElement('div'); elem.appendChild( peg ); this.peg = peg; // set width/height if not already set if (!this.params.width) this.params.width = elem.offsetWidth; if (!this.params.height) this.params.height = elem.offsetHeight; // make sure we have a nonzero width and height at this point if (!this.params.width || !this.params.height) { return this.dispatch('error', new WebcamError("No width and/or height for webcam. Please call set() first, or attach to a visible element.")); } // set defaults for dest_width / dest_height if not set if (!this.params.dest_width) this.params.dest_width = this.params.width; if (!this.params.dest_height) this.params.dest_height = this.params.height; this.userMedia = _userMedia === undefined ? this.userMedia : _userMedia; // if force_flash is set, disable userMedia if (this.params.force_flash) { _userMedia = this.userMedia; this.userMedia = null; } // check for default fps if (typeof this.params.fps !== "number") this.params.fps = 30; // adjust scale if dest_width or dest_height is different var scaleX = this.params.width / this.params.dest_width; var scaleY = this.params.height / this.params.dest_height; if (this.userMedia) { // setup webcam video container var video = document.createElement('video'); video.setAttribute('autoplay', 'autoplay'); video.style.width = '' + this.params.dest_width + 'px'; video.style.height = '' + this.params.dest_height + 'px'; if ((scaleX != 1.0) || (scaleY != 1.0)) { elem.style.overflow = 'hidden'; video.style.webkitTransformOrigin = '0px 0px'; video.style.mozTransformOrigin = '0px 0px'; video.style.msTransformOrigin = '0px 0px'; video.style.oTransformOrigin = '0px 0px'; video.style.transformOrigin = '0px 0px'; video.style.webkitTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; video.style.mozTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; video.style.msTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; video.style.oTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; video.style.transform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; } // add video element to dom elem.appendChild( video ); this.video = video; // ask user for access to their camera var self = this; this.mediaDevices.getUserMedia({ "audio": false, "video": this.params.constraints || { mandatory: { minWidth: this.params.dest_width, minHeight: this.params.dest_height } } }) .then( function(stream) { // got access, attach stream to video video.onloadedmetadata = function(e) { self.stream = stream; self.loaded = true; self.live = true; self.dispatch('load'); self.dispatch('live'); self.flip(); }; video.src = window.URL.createObjectURL( stream ) || stream; }) .catch( function(err) { // JH 2016-07-31 Instead of dispatching error, now falling back to Flash if userMedia fails (thx @john2014) // JH 2016-08-07 But only if flash is actually installed -- if not, dispatch error here and now. if (self.params.enable_flash && self.detectFlash()) { setTimeout( function() { self.params.force_flash = 1; self.attach(elem); }, 1 ); } else { self.dispatch('error', err); } }); } else if (this.params.enable_flash && this.detectFlash()) { // flash fallback window.Webcam = Webcam; // needed for flash-to-js interface var div = document.createElement('div'); div.innerHTML = this.getSWFHTML(); elem.appendChild( div ); } else { this.dispatch('error', new WebcamError( this.params.noInterfaceFoundText )); } // setup final crop for live preview if (this.params.crop_width && this.params.crop_height) { var scaled_crop_width = Math.floor( this.params.crop_width * scaleX ); var scaled_crop_height = Math.floor( this.params.crop_height * scaleY ); elem.style.width = '' + scaled_crop_width + 'px'; elem.style.height = '' + scaled_crop_height + 'px'; elem.style.overflow = 'hidden'; elem.scrollLeft = Math.floor( (this.params.width / 2) - (scaled_crop_width / 2) ); elem.scrollTop = Math.floor( (this.params.height / 2) - (scaled_crop_height / 2) ); } else { // no crop, set size to desired elem.style.width = '' + this.params.width + 'px'; elem.style.height = '' + this.params.height + 'px'; } }, reset: function() { // shutdown camera, reset to potentially attach again if (this.preview_active) this.unfreeze(); // attempt to fix issue #64 this.unflip(); if (this.userMedia) { if (this.stream) { if (this.stream.getVideoTracks) { // get video track to call stop on it var tracks = this.stream.getVideoTracks(); if (tracks && tracks[0] && tracks[0].stop) tracks[0].stop(); } else if (this.stream.stop) { // deprecated, may be removed in future this.stream.stop(); } } delete this.stream; delete this.video; } if (this.userMedia !== true) { // call for turn off camera in flash var movie = this.getMovie(); if (movie && movie._releaseCamera) movie._releaseCamera(); } if (this.container) { this.container.innerHTML = ''; delete this.container; } this.loaded = false; this.live = false; }, set: function() { // set one or more params // variable argument list: 1 param = hash, 2 params = key, value if (arguments.length == 1) { for (var key in arguments[0]) { this.params[key] = arguments[0][key]; } } else { this.params[ arguments[0] ] = arguments[1]; } }, on: function(name, callback) { // set callback hook name = name.replace(/^on/i, '').toLowerCase(); if (!this.hooks[name]) this.hooks[name] = []; this.hooks[name].push( callback ); }, off: function(name, callback) { // remove callback hook name = name.replace(/^on/i, '').toLowerCase(); if (this.hooks[name]) { if (callback) { // remove one selected callback from list var idx = this.hooks[name].indexOf(callback); if (idx > -1) this.hooks[name].splice(idx, 1); } else { // no callback specified, so clear all this.hooks[name] = []; } } }, dispatch: function() { // fire hook callback, passing optional value to it var name = arguments[0].replace(/^on/i, '').toLowerCase(); var args = Array.prototype.slice.call(arguments, 1); if (this.hooks[name] && this.hooks[name].length) { for (var idx = 0, len = this.hooks[name].length; idx < len; idx++) { var hook = this.hooks[name][idx]; if (typeof(hook) == 'function') { // callback is function reference, call directly hook.apply(this, args); } else if ((typeof(hook) == 'object') && (hook.length == 2)) { // callback is PHP-style object instance method hook[0][hook[1]].apply(hook[0], args); } else if (window[hook]) { // callback is global function name window[ hook ].apply(window, args); } } // loop return true; } else if (name == 'error') { if ((args[0] instanceof FlashError) || (args[0] instanceof WebcamError)) { message = args[0].message; } else { message = "Could not access webcam: " + args[0].name + ": " + args[0].message + " " + args[0].toString(); } // default error handler if no custom one specified alert("Webcam.js Error: " + message); } return false; // no hook defined }, setSWFLocation: function(value) { // for backward compatibility. this.set('swfURL', value); }, detectFlash: function() { // return true if browser supports flash, false otherwise // Code snippet borrowed from: https://github.com/swfobject/swfobject var SHOCKWAVE_FLASH = "Shockwave Flash", SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", FLASH_MIME_TYPE = "application/x-shockwave-flash", win = window, nav = navigator, hasFlash = false; if (typeof nav.plugins !== "undefined" && typeof nav.plugins[SHOCKWAVE_FLASH] === "object") { var desc = nav.plugins[SHOCKWAVE_FLASH].description; if (desc && (typeof nav.mimeTypes !== "undefined" && nav.mimeTypes[FLASH_MIME_TYPE] && nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { hasFlash = true; } } else if (typeof win.ActiveXObject !== "undefined") { try { var ax = new ActiveXObject(SHOCKWAVE_FLASH_AX); if (ax) { var ver = ax.GetVariable("$version"); if (ver) hasFlash = true; } } catch (e) {;} } return hasFlash; }, getSWFHTML: function() { // Return HTML for embedding flash based webcam capture movie var html = '', swfURL = this.params.swfURL; // make sure we aren't running locally (flash doesn't work) if (location.protocol.match(/file/)) { this.dispatch('error', new FlashError("Flash does not work from local disk. Please run from a web server.")); return '<h3 style="color:red">ERROR: the Webcam.js Flash fallback does not work from local disk. Please run it from a web server.</h3>'; } // make sure we have flash if (!this.detectFlash()) { this.dispatch('error', new FlashError("Adobe Flash Player not found. Please install from get.adobe.com/flashplayer and try again.")); return '<h3 style="color:red">' + this.params.flashNotDetectedText + '</h3>'; } // set default swfURL if not explicitly set if (!swfURL) { // find our script tag, and use that base URL var base_url = ''; var scpts = document.getElementsByTagName('script'); for (var idx = 0, len = scpts.length; idx < len; idx++) { var src = scpts[idx].getAttribute('src'); if (src && src.match(/\/webcam(\.min)?\.js/)) { base_url = src.replace(/\/webcam(\.min)?\.js.*$/, ''); idx = len; } } if (base_url) swfURL = base_url + '/webcam.swf'; else swfURL = 'webcam.swf'; } // if this is the user's first visit, set flashvar so flash privacy settings panel is shown first if (window.localStorage && !localStorage.getItem('visited')) { this.params.new_user = 1; localStorage.setItem('visited', 1); } // construct flashvars string var flashvars = ''; for (var key in this.params) { if (flashvars) flashvars += '&'; flashvars += key + '=' + escape(this.params[key]); } // construct object/embed tag html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" type="application/x-shockwave-flash" codebase="'+this.protocol+'://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+this.params.width+'" height="'+this.params.height+'" id="webcam_movie_obj" align="middle"><param name="wmode" value="opaque" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+swfURL+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><embed id="webcam_movie_embed" src="'+swfURL+'" wmode="opaque" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+this.params.width+'" height="'+this.params.height+'" name="webcam_movie_embed" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'"></embed></object>'; return html; }, getMovie: function() { // get reference to movie object/embed in DOM if (!this.loaded) return this.dispatch('error', new FlashError("Flash Movie is not loaded yet")); var movie = document.getElementById('webcam_movie_obj'); if (!movie || !movie._snap) movie = document.getElementById('webcam_movie_embed'); if (!movie) this.dispatch('error', new FlashError("Cannot locate Flash movie in DOM")); return movie; }, freeze: function() { // show preview, freeze camera var self = this; var params = this.params; // kill preview if already active if (this.preview_active) this.unfreeze(); // determine scale factor var scaleX = this.params.width / this.params.dest_width; var scaleY = this.params.height / this.params.dest_height; // must unflip container as preview canvas will be pre-flipped this.unflip(); // calc final size of image var final_width = params.crop_width || params.dest_width; var final_height = params.crop_height || params.dest_height; // create canvas for holding preview var preview_canvas = document.createElement('canvas'); preview_canvas.width = final_width; preview_canvas.height = final_height; var preview_context = preview_canvas.getContext('2d'); // save for later use this.preview_canvas = preview_canvas; this.preview_context = preview_context; // scale for preview size if ((scaleX != 1.0) || (scaleY != 1.0)) { preview_canvas.style.webkitTransformOrigin = '0px 0px'; preview_canvas.style.mozTransformOrigin = '0px 0px'; preview_canvas.style.msTransformOrigin = '0px 0px'; preview_canvas.style.oTransformOrigin = '0px 0px'; preview_canvas.style.transformOrigin = '0px 0px'; preview_canvas.style.webkitTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; preview_canvas.style.mozTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; preview_canvas.style.msTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; preview_canvas.style.oTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; preview_canvas.style.transform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; } // take snapshot, but fire our own callback this.snap( function() { // add preview image to dom, adjust for crop preview_canvas.style.position = 'relative'; preview_canvas.style.left = '' + self.container.scrollLeft + 'px'; preview_canvas.style.top = '' + self.container.scrollTop + 'px'; self.container.insertBefore( preview_canvas, self.peg ); self.container.style.overflow = 'hidden'; // set flag for user capture (use preview) self.preview_active = true; }, preview_canvas ); }, unfreeze: function() { // cancel preview and resume live video feed if (this.preview_active) { // remove preview canvas this.container.removeChild( this.preview_canvas ); delete this.preview_context; delete this.preview_canvas; // unflag this.preview_active = false; // re-flip if we unflipped before this.flip(); } }, flip: function() { // flip container horiz (mirror mode) if desired if (this.params.flip_horiz) { var sty = this.container.style; sty.webkitTransform = 'scaleX(-1)'; sty.mozTransform = 'scaleX(-1)'; sty.msTransform = 'scaleX(-1)'; sty.oTransform = 'scaleX(-1)'; sty.transform = 'scaleX(-1)'; sty.filter = 'FlipH'; sty.msFilter = 'FlipH'; } }, unflip: function() { // unflip container horiz (mirror mode) if desired if (this.params.flip_horiz) { var sty = this.container.style; sty.webkitTransform = 'scaleX(1)'; sty.mozTransform = 'scaleX(1)'; sty.msTransform = 'scaleX(1)'; sty.oTransform = 'scaleX(1)'; sty.transform = 'scaleX(1)'; sty.filter = ''; sty.msFilter = ''; } }, savePreview: function(user_callback, user_canvas) { // save preview freeze and fire user callback var params = this.params; var canvas = this.preview_canvas; var context = this.preview_context; // render to user canvas if desired if (user_canvas) { var user_context = user_canvas.getContext('2d'); user_context.drawImage( canvas, 0, 0 ); } // fire user callback if desired user_callback( user_canvas ? null : canvas.toDataURL('image/' + params.image_format, params.jpeg_quality / 100 ), canvas, context ); // remove preview if (this.params.unfreeze_snap) this.unfreeze(); }, snap: function(user_callback, user_canvas) { // take snapshot and return image data uri var self = this; var params = this.params; if (!this.loaded) return this.dispatch('error', new WebcamError("Webcam is not loaded yet")); // if (!this.live) return this.dispatch('error', new WebcamError("Webcam is not live yet")); if (!user_callback) return this.dispatch('error', new WebcamError("Please provide a callback function or canvas to snap()")); // if we have an active preview freeze, use that if (this.preview_active) { this.savePreview( user_callback, user_canvas ); return null; } // create offscreen canvas element to hold pixels var canvas = document.createElement('canvas'); canvas.width = this.params.dest_width; canvas.height = this.params.dest_height; var context = canvas.getContext('2d'); // flip canvas horizontally if desired if (this.params.flip_horiz) { context.translate( params.dest_width, 0 ); context.scale( -1, 1 ); } // create inline function, called after image load (flash) or immediately (native) var func = function() { // render image if needed (flash) if (this.src && this.width && this.height) { context.drawImage(this, 0, 0, params.dest_width, params.dest_height); } // crop if desired if (params.crop_width && params.crop_height) { var crop_canvas = document.createElement('canvas'); crop_canvas.width = params.crop_width; crop_canvas.height = params.crop_height; var crop_context = crop_canvas.getContext('2d'); crop_context.drawImage( canvas, Math.floor( (params.dest_width / 2) - (params.crop_width / 2) ), Math.floor( (params.dest_height / 2) - (params.crop_height / 2) ), params.crop_width, params.crop_height, 0, 0, params.crop_width, params.crop_height ); // swap canvases context = crop_context; canvas = crop_canvas; } // render to user canvas if desired if (user_canvas) { var user_context = user_canvas.getContext('2d'); user_context.drawImage( canvas, 0, 0 ); } // fire user callback if desired user_callback( user_canvas ? null : canvas.toDataURL('image/' + params.image_format, params.jpeg_quality / 100 ), canvas, context ); }; // grab image frame from userMedia or flash movie if (this.userMedia) { // native implementation context.drawImage(this.video, 0, 0, this.params.dest_width, this.params.dest_height); // fire callback right away func(); } else { // flash fallback var raw_data = this.getMovie()._snap(); // render to image, fire callback when complete var img = new Image(); img.onload = func; img.src = 'data:image/'+this.params.image_format+';base64,' + raw_data; } return null; }, configure: function(panel) { // open flash configuration panel -- specify tab name: // "camera", "privacy", "default", "localStorage", "microphone", "settingsManager" if (!panel) panel = "camera"; this.getMovie()._configure(panel); }, flashNotify: function(type, msg) { // receive notification from flash about event switch (type) { case 'flashLoadComplete': // movie loaded successfully this.loaded = true; this.dispatch('load'); break; case 'cameraLive': // camera is live and ready to snap this.live = true; this.dispatch('live'); break; case 'error': // Flash error this.dispatch('error', new FlashError(msg)); break; default: // catch-all event, just in case // console.log("webcam flash_notify: " + type + ": " + msg); break; } }, b64ToUint6: function(nChr) { // convert base64 encoded character to 6-bit integer // from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding return nChr > 64 && nChr < 91 ? nChr - 65 : nChr > 96 && nChr < 123 ? nChr - 71 : nChr > 47 && nChr < 58 ? nChr + 4 : nChr === 43 ? 62 : nChr === 47 ? 63 : 0; }, base64DecToArr: function(sBase64, nBlocksSize) { // convert base64 encoded string to Uintarray // from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding var sB64Enc = sBase64.replace(/[^A-Za-z0-9\+\/]/g, ""), nInLen = sB64Enc.length, nOutLen = nBlocksSize ? Math.ceil((nInLen * 3 + 1 >> 2) / nBlocksSize) * nBlocksSize : nInLen * 3 + 1 >> 2, taBytes = new Uint8Array(nOutLen); for (var nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx++) { nMod4 = nInIdx & 3; nUint24 |= this.b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 18 - 6 * nMod4; if (nMod4 === 3 || nInLen - nInIdx === 1) { for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) { taBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255; } nUint24 = 0; } } return taBytes; }, upload: function(image_data_uri, target_url, callback) { // submit image data to server using binary AJAX var form_elem_name = this.params.upload_name || 'webcam'; // detect image format from within image_data_uri var image_fmt = ''; if (image_data_uri.match(/^data\:image\/(\w+)/)) image_fmt = RegExp.$1; else throw "Cannot locate image format in Data URI"; // extract raw base64 data from Data URI var raw_image_data = image_data_uri.replace(/^data\:image\/\w+\;base64\,/, ''); // contruct use AJAX object var http = new XMLHttpRequest(); http.open("POST", target_url, true); // setup progress events if (http.upload && http.upload.addEventListener) { http.upload.addEventListener( 'progress', function(e) { if (e.lengthComputable) { var progress = e.loaded / e.total; Webcam.dispatch('uploadProgress', progress, e); } }, false ); } // completion handler var self = this; http.onload = function() { if (callback) callback.apply( self, [http.status, http.responseText, http.statusText] ); Webcam.dispatch('uploadComplete', http.status, http.responseText, http.statusText); }; // create a blob and decode our base64 to binary var blob = new Blob( [ this.base64DecToArr(raw_image_data) ], {type: 'image/'+image_fmt} ); // stuff into a form, so servers can easily receive it as a standard file upload var form = new FormData(); form.append( form_elem_name, blob, form_elem_name+"."+image_fmt.replace(/e/, '') ); // send data to server http.send(form); } }; Webcam.init(); if (typeof define === 'function' && define.amd) { define( function() { return Webcam; } ); } else if (typeof module === 'object' && module.exports) { module.exports = Webcam; } else { window.Webcam = Webcam; } }(window)); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/alertify/alertify.min.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 496 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/alertify/alertify.min.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 33298 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 33,298 bytes. |
/*! alertifyjs - v1.2.1 - Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) */
!function(a){"use strict";function b(a,b){a.className+=" "+b}function c(a,b){for(var c=b.split(" "),d=0;d<c.length;d+=1)a.className=a.className.replace(" "+c[d],"")}function d(){return"rtl"===a.getComputedStyle(document.body).direction}function e(){return document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop}function f(){return document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft}function g(a,b){return function(){if(arguments.length>0){for(var c=[],d=0;d<arguments.length;d+=1)c.push(arguments[d]);return c.push(a),b.apply(a,c)}return b.apply(a,[null,a])}}function h(a,b){return{index:a,button:b,cancel:!1}}function i(){function a(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function b(a){var b=d[a].dialog;return b&&"function"==typeof b.__init&&b.__init(b),b}function c(b,c,e,f){var g={dialog:null,factory:c};return void 0!==f&&(g.factory=function(){return a(new d[f].factory,new c)}),e||(g.dialog=a(new g.factory,p)),d[b]=g}var d={};return{defaults:k,dialog:function(d,e,f,g){if("function"!=typeof e)return b(d);if(this.hasOwnProperty(d))throw new Error("alertify.dialog: name already exists");var h=c(d,e,f,g);this[d]=f?function(){if(0===arguments.length)return h.dialog;var b=a(new h.factory,p);return b&&"function"==typeof b.__init&&b.__init(b),b.main.apply(b,arguments),b.show.apply(b)}:function(){if(h.dialog&&"function"==typeof h.dialog.__init&&h.dialog.__init(h.dialog),0===arguments.length)return h.dialog;var a=h.dialog;return a.main.apply(h.dialog,arguments),a.show.apply(h.dialog)}},closeAll:function(a){for(var b=l.slice(0),c=0;c<b.length;c+=1){var d=b[c];(void 0===a||a!==d)&&d.close()}},setting:function(a,c,d){if("notifier"===a)return q.setting(c,d);var e=b(a);return e?e.setting(c,d):void 0},set:function(a,b,c){return this.setting(a,b,c)},get:function(a,b){return this.setting(a,b)},notify:function(a,b,c,d){return q.create(b,d).push(a,c)},message:function(a,b,c){return q.create(null,c).push(a,b)},success:function(a,b,c){return q.create("success",c).push(a,b)},error:function(a,b,c){return q.create("error",c).push(a,b)},warning:function(a,b,c){return q.create("warning",c).push(a,b)},dismissAll:function(){q.dismissAll()}}}var j={ENTER:13,ESC:27,F1:112,F12:123,LEFT:37,RIGHT:39},k={modal:!0,basic:!1,frameless:!1,movable:!0,resizable:!0,closable:!0,closableByDimmer:!0,maximizable:!0,startMaximized:!1,pinnable:!0,pinned:!0,padding:!0,overflow:!0,maintainFocus:!0,transition:"zoom",notifier:{delay:2,position:"bottom-right"},glossary:{title:"",ok:"OK",cancel:"Cancel",acccpt:"Accept",deny:"Deny",confirm:"Confirm",decline:"Decline",close:"Close",maximize:"Maximize",restore:"Restore"},theme:{input:"ajs-input",ok:"print",cancel:"exit"}},l=[],m=function(){return document.addEventListener?function(a,b,c,d){a.addEventListener(b,c,d===!0)}:document.attachEvent?function(a,b,c){a.attachEvent("on"+b,c)}:void 0}(),n=function(){return document.removeEventListener?function(a,b,c,d){a.removeEventListener(b,c,d===!0)}:document.detachEvent?function(a,b,c){a.detachEvent("on"+b,c)}:void 0}(),o=function(){var a,b,c=!1,d={animation:"animationend",OAnimation:"oAnimationEnd oanimationend",msAnimation:"MSAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(a in d)if(void 0!==document.documentElement.style[a]){b=d[a],c=!0;break}return{type:b,supported:c}}(),p=function(){function i(a){if(!a.__internal){delete a.__init,null===pb&&document.body.setAttribute("tabindex","0");var c;"function"==typeof a.setup?(c=a.setup(),c.options=c.options||{},c.focus=c.focus||{}):c={buttons:[],focus:{element:null,select:!1},options:{}},"object"!=typeof a.hooks&&(a.hooks={});var d=a.__internal={isOpen:!1,activeElement:document.body,timerIn:void 0,timerOut:void 0,buttons:c.buttons||[],focus:c.focus,options:{title:void 0,modal:void 0,basic:void 0,frameless:void 0,pinned:void 0,movable:void 0,resizable:void 0,closable:void 0,closableByDimmer:void 0,maximizable:void 0,startMaximized:void 0,pinnable:void 0,transition:void 0,padding:void 0,overflow:void 0,onshow:void 0,onclose:void 0,onfocus:void 0},resetHandler:void 0,beginMoveHandler:void 0,beginResizeHandler:void 0,bringToFrontHandler:void 0,modalClickHandler:void 0,buttonsClickHandler:void 0,commandsClickHandler:void 0,transitionInHandler:void 0,transitionOutHandler:void 0},e={};e.root=document.createElement("div"),e.root.className=sb.base+" "+sb.hidden+" ",e.root.innerHTML=rb.dimmer+rb.modal,e.dimmer=e.root.firstChild,e.modal=e.root.lastChild,e.modal.innerHTML=rb.dialog,e.dialog=e.modal.firstChild,e.dialog.innerHTML=rb.reset+rb.commands+rb.header+rb.body+rb.footer+rb.resizeHandle+rb.reset,e.reset=[],e.reset.push(e.dialog.firstChild),e.reset.push(e.dialog.lastChild),e.commands={},e.commands.container=e.reset[0].nextSibling,e.commands.pin=e.commands.container.firstChild,e.commands.maximize=e.commands.pin.nextSibling,e.commands.close=e.commands.maximize.nextSibling,e.header=e.commands.container.nextSibling,e.body=e.header.nextSibling,e.body.innerHTML=rb.content,e.content=e.body.firstChild,e.footer=e.body.nextSibling,e.footer.innerHTML=rb.buttons.auxiliary+rb.buttons.primary,e.resizeHandle=e.footer.nextSibling,e.buttons={},e.buttons.auxiliary=e.footer.firstChild,e.buttons.primary=e.buttons.auxiliary.nextSibling,e.buttons.primary.innerHTML=rb.button,e.buttonTemplate=e.buttons.primary.firstChild,e.buttons.primary.removeChild(e.buttonTemplate);for(var f=0;f<a.__internal.buttons.length;f+=1){var h=a.__internal.buttons[f];ob.indexOf(h.key)<0&&ob.push(h.key),h.element=e.buttonTemplate.cloneNode(),h.element.innerHTML=h.text,"string"==typeof h.className&&""!==h.className&&b(h.element,h.className);for(var i in h.attrs)"className"!==i&&h.attrs.hasOwnProperty(i)&&h.element.setAttribute(i,h.attrs[i]);"auxiliary"===h.scope?e.buttons.auxiliary.appendChild(h.element):e.buttons.primary.appendChild(h.element)}a.elements=e,d.resetHandler=g(a,Q),d.beginMoveHandler=g(a,U),d.beginResizeHandler=g(a,$),d.bringToFrontHandler=g(a,u),d.modalClickHandler=g(a,K),d.buttonsClickHandler=g(a,M),d.commandsClickHandler=g(a,y),d.transitionInHandler=g(a,R),d.transitionOutHandler=g(a,S),a.set("title",void 0===c.options.title?r.defaults.glossary.title:c.options.title),a.set("modal",void 0===c.options.modal?r.defaults.modal:c.options.modal),a.set("basic",void 0===c.options.basic?r.defaults.basic:c.options.basic),a.set("frameless",void 0===c.options.frameless?r.defaults.frameless:c.options.frameless),a.set("movable",void 0===c.options.movable?r.defaults.movable:c.options.movable),a.set("resizable",void 0===c.options.resizable?r.defaults.resizable:c.options.resizable),a.set("closable",void 0===c.options.closable?r.defaults.closable:c.options.closable),a.set("closableByDimmer",void 0===c.options.closableByDimmer?r.defaults.closableByDimmer:c.options.closableByDimmer),a.set("maximizable",void 0===c.options.maximizable?r.defaults.maximizable:c.options.maximizable),a.set("startMaximized",void 0===c.options.startMaximized?r.defaults.startMaximized:c.options.startMaximized),a.set("pinnable",void 0===c.options.pinnable?r.defaults.pinnable:c.options.pinnable),a.set("pinned",void 0===c.options.pinned?r.defaults.pinned:c.options.pinned),a.set("transition",void 0===c.options.transition?r.defaults.transition:c.options.transition),a.set("padding",void 0===c.options.padding?r.defaults.padding:c.options.padding),a.set("overflow",void 0===c.options.overflow?r.defaults.overflow:c.options.overflow),"function"==typeof a.build&&a.build()}document.body.appendChild(a.elements.root)}function k(){for(var a=0,d=0;d<l.length;d+=1){var e=l[d];(e.isModal()||e.isMaximized())&&(a+=1)}0===a?c(document.body,sb.noOverflow):a>0&&document.body.className.indexOf(sb.noOverflow)<0&&b(document.body,sb.noOverflow)}function p(a,d,e){"string"==typeof e&&c(a.elements.root,sb.prefix+e),b(a.elements.root,sb.prefix+d),pb=a.elements.root.offsetWidth}function q(a){a.get("modal")?(c(a.elements.root,sb.modeless),a.isOpen()&&(hb(a),G(a),k())):(b(a.elements.root,sb.modeless),a.isOpen()&&(gb(a),G(a),k()))}function s(a){a.get("basic")?b(a.elements.root,sb.basic):c(a.elements.root,sb.basic)}function t(a){a.get("frameless")?b(a.elements.root,sb.frameless):c(a.elements.root,sb.frameless)}function u(a,b){for(var c=l.indexOf(b),d=c+1;d<l.length;d+=1)if(l[d].isModal())return;return document.body.lastChild!==b.elements.root&&(document.body.appendChild(b.elements.root),l.splice(l.indexOf(b),1),l.push(b),P(b)),!1}function v(a,d,e,f){switch(d){case"title":a.setHeader(f);break;case"modal":q(a);break;case"basic":s(a);break;case"frameless":t(a);break;case"pinned":H(a);break;case"closable":J(a);break;case"maximizable":I(a);break;case"pinnable":D(a);break;case"movable":Y(a);break;case"resizable":cb(a);break;case"transition":p(a,f,e);break;case"padding":f?c(a.elements.root,sb.noPadding):a.elements.root.className.indexOf(sb.noPadding)<0&&b(a.elements.root,sb.noPadding);break;case"overflow":f?c(a.elements.root,sb.noOverflow):a.elements.root.className.indexOf(sb.noOverflow)<0&&b(a.elements.root,sb.noOverflow);break;case"transition":p(a,f,e)}"function"==typeof a.hooks.onupdate&&a.hooks.onupdate.call(a,d,e,f)}function w(a,b,c,d,e){var f={op:void 0,items:[]};if("undefined"==typeof e&&"string"==typeof d)f.op="get",b.hasOwnProperty(d)?(f.found=!0,f.value=b[d]):(f.found=!1,f.value=void 0);else{var g;if(f.op="set","object"==typeof d){var h=d;for(var i in h)b.hasOwnProperty(i)?(b[i]!==h[i]&&(g=b[i],b[i]=h[i],c.call(a,i,g,h[i])),f.items.push({key:i,value:h[i],found:!0})):f.items.push({key:i,value:h[i],found:!1})}else{if("string"!=typeof d)throw new Error("args must be a string or object");b.hasOwnProperty(d)?(b[d]!==e&&(g=b[d],b[d]=e,c.call(a,d,g,e)),f.items.push({key:d,value:e,found:!0})):f.items.push({key:d,value:e,found:!1})}}return f}function x(a){var b;L(a,function(a){return b=a.invokeOnClose===!0}),!b&&a.isOpen()&&a.close()}function y(a,b){var c=a.srcElement||a.target;switch(c){case b.elements.commands.pin:b.isPinned()?A(b):z(b);break;case b.elements.commands.maximize:b.isMaximized()?C(b):B(b);break;case b.elements.commands.close:x(b)}return!1}function z(a){a.set("pinned",!0)}function A(a){a.set("pinned",!1)}function B(a){b(a.elements.root,sb.maximized),a.isOpen()&&k()}function C(a){c(a.elements.root,sb.maximized),a.isOpen()&&k()}function D(a){a.get("pinnable")?b(a.elements.root,sb.pinnable):c(a.elements.root,sb.pinnable)}function E(a){var b=f();a.elements.modal.style.marginTop=e()+"px",a.elements.modal.style.marginLeft=b+"px",a.elements.modal.style.marginRight=-b+"px"}function F(a){var b=parseInt(a.elements.modal.style.marginTop,10),c=parseInt(a.elements.modal.style.marginLeft,10);if(a.elements.modal.style.marginTop="",a.elements.modal.style.marginLeft="",a.elements.modal.style.marginRight="",a.isOpen()){var d=0,g=0;""!==a.elements.dialog.style.top&&(d=parseInt(a.elements.dialog.style.top,10)),a.elements.dialog.style.top=d+(b-e())+"px",""!==a.elements.dialog.style.left&&(g=parseInt(a.elements.dialog.style.left,10)),a.elements.dialog.style.left=g+(c-f())+"px"}}function G(a){a.get("modal")||a.get("pinned")?F(a):E(a)}function H(a){a.get("pinned")?(c(a.elements.root,sb.unpinned),a.isOpen()&&F(a)):(b(a.elements.root,sb.unpinned),a.isOpen()&&!a.isModal()&&E(a))}function I(a){a.get("maximizable")?b(a.elements.root,sb.maximizable):c(a.elements.root,sb.maximizable)}function J(a){a.get("closable")?(b(a.elements.root,sb.closable),mb(a)):(c(a.elements.root,sb.closable),nb(a))}function K(a,b){var c=a.srcElement||a.target;return tb||c!==b.elements.modal||b.get("closableByDimmer")!==!0||x(b),tb=!1,!1}function L(a,b){for(var c=0;c<a.__internal.buttons.length;c+=1){var d=a.__internal.buttons[c];if(!d.element.disabled&&b(d)){var e=h(c,d);"function"==typeof a.callback&&a.callback.apply(a,[e]),e.cancel===!1&&a.close();break}}}function M(a,b){var c=a.srcElement||a.target;L(b,function(a){return a.element===c&&(ub=!0)})}function N(a){if(ub)return void(ub=!1);var b=l[l.length-1],c=a.keyCode;return 0===b.__internal.buttons.length&&c===j.ESC&&b.get("closable")===!0?(x(b),!1):ob.indexOf(c)>-1?(L(b,function(a){return a.key===c}),!1):void 0}function O(a){var b=l[l.length-1],c=a.keyCode;if(c===j.LEFT||c===j.RIGHT){for(var d=b.__internal.buttons,e=0;e<d.length;e+=1)if(document.activeElement===d[e].element)switch(c){case j.LEFT:return void d[(e||d.length)-1].element.focus();case j.RIGHT:return void d[(e+1)%d.length].element.focus()}}else if(c<j.F12+1&&c>j.F1-1&&ob.indexOf(c)>-1)return a.preventDefault(),a.stopPropagation(),L(b,function(a){return a.key===c}),!1}function P(a,b){if(b)b.focus();else{var c=a.__internal.focus,d=c.element;switch(typeof c.element){case"number":a.__internal.buttons.length>c.element&&(d=a.get("basic")===!0?a.elements.reset[0]:a.__internal.buttons[c.element].element);break;case"string":d=a.elements.body.querySelector(c.element);break;case"function":d=c.element.call(a)}"undefined"!=typeof d&&null!==d||0!==a.__internal.buttons.length||(d=a.elements.reset[0]),d&&d.focus&&(d.focus(),c.select&&d.select&&d.select())}}function Q(a,b){if(!b)for(var c=l.length-1;c>-1;c-=1)if(l[c].isModal()){b=l[c];break}if(b&&b.isModal()){var d,e=a.srcElement||a.target,f=e===b.elements.reset[1]||0===b.__internal.buttons.length&&e===document.body;f&&(b.get("maximizable")?d=b.elements.commands.maximize:b.get("closable")&&(d=b.elements.commands.close)),void 0===d&&("number"==typeof b.__internal.focus.element?e===b.elements.reset[0]?d=b.elements.buttons.auxiliary.firstChild||b.elements.buttons.primary.firstChild:f&&(d=b.elements.reset[0]):e===b.elements.reset[0]&&(d=b.elements.buttons.primary.lastChild||b.elements.buttons.auxiliary.lastChild)),P(b,d)}}function R(a,b){clearTimeout(b.__internal.timerIn),P(b),ub=!1,"function"==typeof b.get("onfocus")&&b.get("onfocus")(),n(b.elements.dialog,o.type,b.__internal.transitionInHandler),c(b.elements.root,sb.animationIn)}function S(a,b){clearTimeout(b.__internal.timerOut),n(b.elements.dialog,o.type,b.__internal.transitionOutHandler),X(b),bb(b),b.isMaximized()&&!b.get("startMaximized")&&C(b),r.defaults.maintainFocus&&b.__internal.activeElement&&(b.__internal.activeElement.focus(),b.__internal.activeElement=null)}function T(a,b){b.style.left=a[yb]-wb+"px",b.style.top=a[zb]-xb+"px"}function U(a,c){if(null===Ab&&!c.isMaximized()&&c.get("movable")){var d;if("touchstart"===a.type?(a.preventDefault(),d=a.targetTouches[0],yb="clientX",zb="clientY"):0===a.button&&(d=a),d){vb=c,wb=d[yb],xb=d[zb];var e=c.elements.dialog;return b(e,sb.capture),e.style.left&&(wb-=parseInt(e.style.left,10)),e.style.top&&(xb-=parseInt(e.style.top,10)),T(d,e),b(document.body,sb.noSelection),!1}}}function V(a){if(vb){var b;"touchmove"===a.type?(a.preventDefault(),b=a.targetTouches[0]):0===a.button&&(b=a),b&&T(b,vb.elements.dialog)}}function W(){if(vb){var a=vb.elements.dialog;vb=null,c(document.body,sb.noSelection),c(a,sb.capture)}}function X(a){vb=null;var b=a.elements.dialog;b.style.left=b.style.top=""}function Y(a){a.get("movable")?(b(a.elements.root,sb.movable),a.isOpen()&&ib(a)):(X(a),c(a.elements.root,sb.movable),a.isOpen()&&jb(a))}function Z(a,b,c){var e=b,f=0,g=0;do f+=e.offsetLeft,g+=e.offsetTop;while(e=e.offsetParent);var h,i;c===!0?(h=a.pageX,i=a.pageY):(h=a.clientX,i=a.clientY);var j=d();if(j&&(h=document.body.offsetWidth-h,isNaN(Bb)||(f=document.body.offsetWidth-f-b.offsetWidth)),b.style.height=i-g+Eb+"px",b.style.width=h-f+Eb+"px",!isNaN(Bb)){var k=.5*Math.abs(b.offsetWidth-Cb);j&&(k*=-1),b.offsetWidth>Cb?b.style.left=Bb+k+"px":b.offsetWidth>=Db&&(b.style.left=Bb-k+"px")}}function $(a,c){if(!c.isMaximized()){var d;if("touchstart"===a.type?(a.preventDefault(),d=a.targetTouches[0]):0===a.button&&(d=a),d){Ab=c,Eb=c.elements.resizeHandle.offsetHeight/2;var e=c.elements.dialog;return b(e,sb.capture),Bb=parseInt(e.style.left,10),e.style.height=e.offsetHeight+"px",e.style.minHeight=c.elements.header.offsetHeight+c.elements.footer.offsetHeight+"px",e.style.width=(Cb=e.offsetWidth)+"px","none"!==e.style.maxWidth&&(e.style.minWidth=(Db=e.offsetWidth)+"px"),e.style.maxWidth="none",b(document.body,sb.noSelection),!1}}}function _(a){if(Ab){var b;"touchmove"===a.type?(a.preventDefault(),b=a.targetTouches[0]):0===a.button&&(b=a),b&&Z(b,Ab.elements.dialog,!Ab.get("modal")&&!Ab.get("pinned"))}}function ab(){if(Ab){var a=Ab.elements.dialog;Ab=null,c(document.body,sb.noSelection),c(a,sb.capture),tb=!0}}function bb(a){Ab=null;var b=a.elements.dialog;"none"===b.style.maxWidth&&(b.style.maxWidth=b.style.minWidth=b.style.width=b.style.height=b.style.minHeight=b.style.left="",Bb=Number.Nan,Cb=Db=Eb=0)}function cb(a){a.get("resizable")?(b(a.elements.root,sb.resizable),a.isOpen()&&kb(a)):(bb(a),c(a.elements.root,sb.resizable),a.isOpen()&&lb(a))}function db(){for(var a=0;a<l.length;a+=1){var b=l[a];X(b),bb(b)}}function eb(b){1===l.length&&(m(a,"resize",db),m(document.body,"keyup",N),m(document.body,"keydown",O),m(document.body,"focus",Q),m(document.documentElement,"mousemove",V),m(document.documentElement,"touchmove",V),m(document.documentElement,"mouseup",W),m(document.documentElement,"touchend",W),m(document.documentElement,"mousemove",_),m(document.documentElement,"touchmove",_),m(document.documentElement,"mouseup",ab),m(document.documentElement,"touchend",ab)),m(b.elements.commands.container,"click",b.__internal.commandsClickHandler),m(b.elements.footer,"click",b.__internal.buttonsClickHandler),m(b.elements.reset[0],"focus",b.__internal.resetHandler),m(b.elements.reset[1],"focus",b.__internal.resetHandler),ub=!0,m(b.elements.dialog,o.type,b.__internal.transitionInHandler),b.get("modal")||gb(b),b.get("resizable")&&kb(b),b.get("movable")&&ib(b)}function fb(b){1===l.length&&(n(a,"resize",db),n(document.body,"keyup",N),n(document.body,"keydown",O),n(document.body,"focus",Q),n(document.documentElement,"mousemove",V),n(document.documentElement,"mouseup",W),n(document.documentElement,"mousemove",_),n(document.documentElement,"mouseup",ab)),n(b.elements.commands.container,"click",b.__internal.commandsClickHandler),n(b.elements.footer,"click",b.__internal.buttonsClickHandler),n(b.elements.reset[0],"focus",b.__internal.resetHandler),n(b.elements.reset[1],"focus",b.__internal.resetHandler),m(b.elements.dialog,o.type,b.__internal.transitionOutHandler),b.get("modal")||hb(b),b.get("movable")&&jb(b),b.get("resizable")&&lb(b)}function gb(a){m(a.elements.dialog,"focus",a.__internal.bringToFrontHandler,!0)}function hb(a){n(a.elements.dialog,"focus",a.__internal.bringToFrontHandler,!0)}function ib(a){m(a.elements.header,"mousedown",a.__internal.beginMoveHandler),m(a.elements.header,"touchstart",a.__internal.beginMoveHandler)}function jb(a){n(a.elements.header,"mousedown",a.__internal.beginMoveHandler),n(a.elements.header,"touchstart",a.__internal.beginMoveHandler)}function kb(a){m(a.elements.resizeHandle,"mousedown",a.__internal.beginResizeHandler),m(a.elements.resizeHandle,"touchstart",a.__internal.beginResizeHandler)}function lb(a){n(a.elements.resizeHandle,"mousedown",a.__internal.beginResizeHandler),n(a.elements.resizeHandle,"touchstart",a.__internal.beginResizeHandler)}function mb(a){m(a.elements.modal,"click",a.__internal.modalClickHandler)}function nb(a){n(a.elements.modal,"click",a.__internal.modalClickHandler)}var ob=[],pb=null,qb=a.navigator.userAgent.indexOf("Safari")>-1&&a.navigator.userAgent.indexOf("Chrome")<0,rb={dimmer:'<div class="ajs-dimmer"></div>',modal:'<div class="ajs-modal" tabindex="0"></div>',dialog:'<div class="ajs-dialog" tabindex="0"></div>',reset:'<button class="ajs-reset"></button>',commands:'<div class="ajs-commands"><button class="ajs-pin"></button><button class="ajs-maximize"></button></div>',header:'<div class="ajs-header"></div>',body:'<div class="ajs-body"></div>',content:'<div class="ajs-content"></div>',footer:'<div class="ajs-footer"></div>',buttons:{primary:'<div class="ajs-primary ajs-buttons"></div>',auxiliary:'<div class="ajs-auxiliary ajs-buttons"></div>'},button:'<button class="ajs-button"></button>',resizeHandle:'<div class="ajs-handle"></div>'},sb={base:"alertify",prefix:"ajs-",hidden:"ajs-hidden",noSelection:"ajs-no-selection",noOverflow:"ajs-no-overflow",noPadding:"ajs-no-padding",modeless:"ajs-modeless",movable:"ajs-movable",resizable:"ajs-resizable",capture:"ajs-capture",fixed:"ajs-fixed",closable:"ajs-closable",maximizable:"ajs-maximizable",maximize:"ajs-maximize",restore:"ajs-restore",pinnable:"ajs-pinnable",unpinned:"ajs-unpinned",pin:"ajs-pin",maximized:"ajs-maximized",animationIn:"ajs-in",animationOut:"ajs-out",shake:"ajs-shake",basic:"ajs-basic",frameless:"ajs-frameless"},tb=!1,ub=!1,vb=null,wb=0,xb=0,yb="pageX",zb="pageY",Ab=null,Bb=Number.Nan,Cb=0,Db=0,Eb=0;return{__init:i,isOpen:function(){return this.__internal.isOpen},isModal:function(){return this.elements.root.className.indexOf(sb.modeless)<0},isMaximized:function(){return this.elements.root.className.indexOf(sb.maximized)>-1},isPinned:function(){return this.elements.root.className.indexOf(sb.unpinned)<0},maximize:function(){return this.isMaximized()||B(this),this},restore:function(){return this.isMaximized()&&C(this),this},pin:function(){return this.isPinned()||z(this),this},unpin:function(){return this.isPinned()&&A(this),this},moveTo:function(a,b){if(!isNaN(a)&&!isNaN(b)){var c=this.elements.dialog,e=c,f=0,g=0;c.style.left&&(f-=parseInt(c.style.left,10)),c.style.top&&(g-=parseInt(c.style.top,10));do f+=e.offsetLeft,g+=e.offsetTop;while(e=e.offsetParent);var h=a-f,i=b-g;d()&&(h*=-1),c.style.left=h+"px",c.style.top=i+"px"}return this},resizeTo:function(a,b){if(!isNaN(a)&&!isNaN(b)&&this.get("resizable")===!0){var c=this.elements.dialog;"none"!==c.style.maxWidth&&(c.style.minWidth=(Db=c.offsetWidth)+"px"),c.style.maxWidth="none",c.style.minHeight=this.elements.header.offsetHeight+this.elements.footer.offsetHeight+"px",c.style.width=a+"px",c.style.height=b+"px"}return this},setting:function(a,b){var c=this,d=w(this,this.__internal.options,function(a,b,d){v(c,a,b,d)},a,b);if("get"===d.op)return d.found?d.value:"undefined"!=typeof this.settings?w(this,this.settings,this.settingUpdated||function(){},a,b).value:void 0;if("set"===d.op){if(d.items.length>0)for(var e=this.settingUpdated||function(){},f=0;f<d.items.length;f+=1){var g=d.items[f];g.found||"undefined"==typeof this.settings||w(this,this.settings,e,g.key,g.value)}return this}},set:function(a,b){return this.setting(a,b),this},get:function(a){return this.setting(a)},setHeader:function(b){return"string"==typeof b?this.elements.header.innerHTML=b:b instanceof a.HTMLElement&&this.elements.header.firstChild!==b&&(this.elements.header.innerHTML="",this.elements.header.appendChild(b)),this},setContent:function(b){return"string"==typeof b?this.elements.content.innerHTML=b:b instanceof a.HTMLElement&&this.elements.content.firstChild!==b&&(this.elements.content.innerHTML="",this.elements.content.appendChild(b)),this},showModal:function(a){return this.show(!0,a)},show:function(a,d){if(i(this),this.__internal.isOpen){X(this),bb(this),b(this.elements.dialog,sb.shake);var e=this;setTimeout(function(){c(e.elements.dialog,sb.shake)},200)}else{if(this.__internal.isOpen=!0,l.push(this),r.defaults.maintainFocus&&(this.__internal.activeElement=document.activeElement),"function"==typeof this.prepare&&this.prepare(),eb(this),void 0!==a&&this.set("modal",a),k(),"string"==typeof d&&""!==d&&(this.__internal.className=d,b(this.elements.root,d)),this.get("startMaximized")?this.maximize():this.isMaximized()&&C(this),G(this),c(this.elements.root,sb.animationOut),b(this.elements.root,sb.animationIn),clearTimeout(this.__internal.timerIn),this.__internal.timerIn=setTimeout(this.__internal.transitionInHandler,o.supported?1e3:100),qb){var f=this.elements.root;f.style.display="none",setTimeout(function(){f.style.display="block"},0)}pb=this.elements.root.offsetWidth,c(this.elements.root,sb.hidden),"function"==typeof this.hooks.onshow&&this.hooks.onshow.call(this),"function"==typeof this.get("onshow")&&this.get("onshow")()}return this},close:function(){return this.__internal.isOpen&&(fb(this),c(this.elements.root,sb.animationIn),b(this.elements.root,sb.animationOut),clearTimeout(this.__internal.timerOut),this.__internal.timerOut=setTimeout(this.__internal.transitionOutHandler,o.supported?1e3:100),b(this.elements.root,sb.hidden),pb=this.elements.modal.offsetWidth,"undefined"!=typeof this.__internal.className&&""!==this.__internal.className&&c(this.elements.root,this.__internal.className),"function"==typeof this.hooks.onclose&&this.hooks.onclose.call(this),"function"==typeof this.get("onclose")&&this.get("onclose")(),l.splice(l.indexOf(this),1),this.__internal.isOpen=!1,k()),this},closeOthers:function(){return r.closeAll(this),this}}}(),q=function(){function a(a){a.__internal||(a.__internal={position:r.defaults.notifier.position,delay:r.defaults.notifier.delay},j=document.createElement("DIV"),f(a)),j.parentNode!==document.body&&document.body.appendChild(j)}function d(a){a.__internal.pushed=!0,k.push(a)}function e(a){k.splice(k.indexOf(a),1),a.__internal.pushed=!1}function f(a){switch(j.className=l.base,a.__internal.position){case"top-right":b(j,l.top+" "+l.right);break;case"top-left":b(j,l.top+" "+l.left);break;case"bottom-left":b(j,l.bottom+" "+l.left);break;default:case"bottom-right":b(j,l.bottom+" "+l.right)}}function h(a,f){function h(a,b){b.dismiss(!0)}function k(a,b){n(b.element,o.type,k),j.removeChild(b.element)}function p(a){return a.__internal||(a.__internal={pushed:!1,delay:void 0,timer:void 0,clickHandler:void 0,transitionEndHandler:void 0,transitionTimeout:void 0},a.__internal.clickHandler=g(a,h),a.__internal.transitionEndHandler=g(a,k)),a}function r(a){clearTimeout(a.__internal.timer),clearTimeout(a.__internal.transitionTimeout)}return p({element:a,push:function(a,c){if(!this.__internal.pushed){d(this),r(this);var e,f;switch(arguments.length){case 0:f=this.__internal.delay;break;case 1:"number"==typeof a?f=a:(e=a,f=this.__internal.delay);break;case 2:e=a,f=c}return"undefined"!=typeof e&&this.setContent(e),q.__internal.position.indexOf("top")<0?j.appendChild(this.element):j.insertBefore(this.element,j.firstChild),i=this.element.offsetWidth,b(this.element,l.visible),m(this.element,"click",this.__internal.clickHandler),this.delay(f)}return this},ondismiss:function(){},callback:f,dismiss:function(a){return this.__internal.pushed&&(r(this),("function"!=typeof this.ondismiss||this.ondismiss.call(this)!==!1)&&(n(this.element,"click",this.__internal.clickHandler),"undefined"!=typeof this.element&&this.element.parentNode===j&&(this.__internal.transitionTimeout=setTimeout(this.__internal.transitionEndHandler,o.supported?1e3:100),c(this.element,l.visible),"function"==typeof this.callback&&this.callback.call(this,a)),e(this))),this},delay:function(a){if(r(this),this.__internal.delay="undefined"==typeof a||isNaN(+a)?q.__internal.delay:+a,this.__internal.delay>0){var b=this;this.__internal.timer=setTimeout(function(){b.dismiss()},1e3*this.__internal.delay)}return this},setContent:function(a){return"string"==typeof a?this.element.innerHTML=a:this.element.appendChild(a),this},dismissOthers:function(){return q.dismissAll(this),this}})}var i,j,k=[],l={base:"alertify-notifier",message:"ajs-message",top:"ajs-top",right:"ajs-right",bottom:"ajs-bottom",left:"ajs-left",visible:"ajs-visible",hidden:"ajs-hidden"};return{setting:function(b,c){if(a(this),"undefined"==typeof c)return this.__internal[b];switch(b){case"position":this.__internal.position=c,f(this);break;case"delay":this.__internal.delay=c}return this},set:function(a,b){return this.setting(a,b),this},get:function(a){return this.setting(a)},create:function(b,c){a(this);var d=document.createElement("div");return d.className=l.message+("string"==typeof b&&""!==b?" ajs-"+b:""),h(d,c)},dismissAll:function(a){for(var b=k.slice(0),c=0;c<b.length;c+=1){var d=b[c];(void 0===a||a!==d)&&d.dismiss()}}}}(),r=new i;r.dialog("alert",function(){return{main:function(a,b,c){var d,e,f;switch(arguments.length){case 1:e=a;break;case 2:"function"==typeof b?(e=a,f=b):(d=a,e=b);break;case 3:d=a,e=b,f=c}return this.set("title",d),this.set("message",e),this.set("onok",f),this},setup:function(){return{buttons:[{text:r.defaults.glossary.ok,key:j.ESC,invokeOnClose:!0,className:r.defaults.theme.ok}],focus:{element:0,select:!1},options:{maximizable:!1,resizable:!1}}},build:function(){},prepare:function(){},setMessage:function(a){this.setContent(a)},settings:{message:void 0,onok:void 0,label:void 0},settingUpdated:function(a,b,c){switch(a){case"message":this.setMessage(c);break;case"label":this.__internal.buttons[0].element&&(this.__internal.buttons[0].element.innerHTML=c)}},callback:function(a){if("function"==typeof this.get("onok")){var b=this.get("onok").call(void 0,a);"undefined"!=typeof b&&(a.cancel=!b)}}}}),r.dialog("confirm",function(){function a(a){null!==c.timer&&(clearInterval(c.timer),c.timer=null,a.__internal.buttons[c.index].element.innerHTML=c.text)}function b(b,d,e){a(b),c.duration=e,c.index=d,c.text=b.__internal.buttons[d].element.innerHTML,c.timer=setInterval(g(b,c.task),1e3),c.task(null,b)}var c={timer:null,index:null,text:null,duratuin:null,task:function(b,d){if(d.isOpen()){if(d.__internal.buttons[c.index].element.innerHTML=c.text+" (‏"+c.duration+"‏) ",c.duration-=1,-1===c.duration){a(d);var e=d.__internal.buttons[c.index],f=h(c.index,e);"function"==typeof d.callback&&d.callback.apply(d,[f]),f.close!==!1&&d.close()}}else a(d)}};return{main:function(a,b,c,d){var e,f,g,h;switch(arguments.length){case 1:f=a;break;case 2:f=a,g=b;break;case 3:f=a,g=b,h=c;break;case 4:e=a,f=b,g=c,h=d}return this.set("title",e),this.set("message",f),this.set("onok",g),this.set("oncancel",h),this},setup:function(){return{buttons:[{text:r.defaults.glossary.ok,key:j.ENTER,className:r.defaults.theme.ok},{text:r.defaults.glossary.cancel,key:j.ESC,invokeOnClose:!0,className:r.defaults.theme.cancel}],focus:{element:0,select:!1},options:{maximizable:!1,resizable:!1}}},build:function(){},prepare:function(){},setMessage:function(a){this.setContent(a)},settings:{message:null,labels:null,onok:null,oncancel:null,defaultFocus:null,reverseButtons:null},settingUpdated:function(a,b,c){switch(a){case"message":this.setMessage(c);break;case"labels":"ok"in c&&this.__internal.buttons[0].element&&(this.__internal.buttons[0].text=c.ok,this.__internal.buttons[0].element.innerHTML=c.ok),"cancel"in c&&this.__internal.buttons[1].element&&(this.__internal.buttons[1].text=c.cancel,this.__internal.buttons[1].element.innerHTML=c.cancel);break;case"reverseButtons":this.elements.buttons.primary.appendChild(c===!0?this.__internal.buttons[0].element:this.__internal.buttons[1].element);break;case"defaultFocus":this.__internal.focus.element="ok"===c?0:1}},callback:function(b){a(this);var c;switch(b.index){case 0:"function"==typeof this.get("onok")&&(c=this.get("onok").call(void 0,b),"undefined"!=typeof c&&(b.cancel=!c));break;case 1:"function"==typeof this.get("oncancel")&&(c=this.get("oncancel").call(void 0,b),"undefined"!=typeof c&&(b.cancel=!c))}},autoOk:function(a){return b(this,0,a),this},autoCancel:function(a){return b(this,1,a),this}}}),r.dialog("prompt",function(){var b=document.createElement("INPUT"),c=document.createElement("P");return{main:function(a,b,c,d,e){var f,g,h,i,j;switch(arguments.length){case 1:g=a;break;case 2:g=a,h=b;break;case 3:g=a,h=b,i=c;break;case 4:g=a,h=b,i=c,j=d;break;case 5:f=a,g=b,h=c,i=d,j=e}return this.set("title",f),this.set("message",g),this.set("value",h),this.set("onok",i),this.set("oncancel",j),this},setup:function(){return{buttons:[{text:r.defaults.glossary.ok,key:j.ENTER,className:r.defaults.theme.ok},{text:r.defaults.glossary.cancel,key:j.ESC,invokeOnClose:!0,className:r.defaults.theme.cancel}],focus:{element:b,select:!0},options:{maximizable:!1,resizable:!1}}},build:function(){b.className=r.defaults.theme.input,b.setAttribute("type","text"),b.value=this.get("value"),this.elements.content.appendChild(c),this.elements.content.appendChild(b)},prepare:function(){},setMessage:function(b){"string"==typeof b?c.innerHTML=b:b instanceof a.HTMLElement&&c.firstChild!==b&&(c.innerHTML="",c.appendChild(b)) },settings:{message:void 0,labels:void 0,onok:void 0,oncancel:void 0,value:"",reverseButtons:void 0},settingUpdated:function(a,c,d){switch(a){case"message":this.setMessage(d);break;case"value":b.value=d;break;case"labels":d.ok&&this.__internal.buttons[0].element&&(this.__internal.buttons[0].element.innerHTML=d.ok),d.cancel&&this.__internal.buttons[1].element&&(this.__internal.buttons[1].element.innerHTML=d.cancel);break;case"reverseButtons":this.elements.buttons.primary.appendChild(d===!0?this.__internal.buttons[0].element:this.__internal.buttons[1].element)}},callback:function(a){var c;switch(a.index){case 0:this.value=b.value,"function"==typeof this.get("onok")&&(c=this.get("onok").call(void 0,a,this.value),"undefined"!=typeof c&&(a.cancel=!c));break;case 1:"function"==typeof this.get("oncancel")&&(c=this.get("oncancel").call(void 0,a),"undefined"!=typeof c&&(a.cancel=!c))}}}}),"object"==typeof module&&"object"==typeof module.exports?module.exports=r:"function"==typeof define&&define.amd?define([],function(){return r}):a.alertify||(a.alertify=r)}("undefined"!=typeof window?window:this); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/customupload/customupload.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 500 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/customupload/customupload.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,143 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 1633 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 1,633 bytes. |
// ##################################
// ################################## // ##### CUSTOM UPLOAD BUTTON ##### // ##### josef 2019-04-01 ##### // ################################## // ################################## function apply_custom_fileinput() { // this will create an element with class name 'cstmupldimg' in every // input with attribute 'type' and value of 'file' $('input[type=file]:not(.cstmupldfile)').each(function(){ $(this).addClass("cstmupldfile"); jQuery(this).wrap("<div class='cstmupldimg'></div>"); var container = jQuery(this).closest('.cstmupldimg'); container.append('<i class="fa fa-upload" />') container.append('<span class="xfilename" />') var xfilename_container = container.find('.xfilename'); var choosefile_str = jQuery(this).data('input_label')!=undefined ? jQuery(this).data('input_label'):'Choose File'; xfilename_container.html(choosefile_str); $(this).change(function(e){ if(e.target.files[0]!=undefined) { var fileName = e.target.files[0].name; // $(this).siblings('.cstmupldimg').find('.xfilename').html(fileName); $(this).closest('.cstmupldimg').find('.xfilename').html(fileName); container.attr('title',fileName); } else { $(this).closest('.cstmupldimg').val(null); xfilename_container.html(choosefile_str); container.attr('title',''); } }) $(this).closest('.cstmupldimg').click(function(e) { if(e.originalEvent!=undefined) //20190404 gian karlo , determine that .cstmupldimg is click by the user and not programmatically { jQuery(this).find('.cstmupldfile').click(); } }) }) } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/fullcalendar/fullcalendar.js?v=20220209161352 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 500 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/fullcalendar/fullcalendar.js?v=20220209161352 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 394023 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 394,023 bytes. |
/*!
* FullCalendar v3.1.0 * Docs & License: http://fullcalendar.io/ * (c) 2016 Adam Shaw */ (function(factory) { if (typeof define === 'function' && define.amd) { define([ 'jquery', 'moment' ], factory); } else if (typeof exports === 'object') { // Node/CommonJS module.exports = factory(require('jquery'), require('moment')); } else { factory(jQuery, moment); } })(function($, moment) { ;; var FC = $.fullCalendar = { version: "3.1.0", internalApiVersion: 7 }; var fcViews = FC.views = {}; $.fn.fullCalendar = function(options) { var args = Array.prototype.slice.call(arguments, 1); // for a possible method call var res = this; // what this function will return (this jQuery object by default) this.each(function(i, _element) { // loop each DOM element involved var element = $(_element); var calendar = element.data('fullCalendar'); // get the existing calendar object (if any) var singleRes; // the returned value of this single method call // a method call if (typeof options === 'string') { if (calendar && $.isFunction(calendar[options])) { singleRes = calendar[options].apply(calendar, args); if (!i) { res = singleRes; // record the first method call result } if (options === 'destroy') { // for the destroy method, must remove Calendar object data element.removeData('fullCalendar'); } } } // a new calendar initialization else if (!calendar) { // don't initialize twice calendar = new Calendar(element, options); element.data('fullCalendar', calendar); calendar.render(); } }); return res; }; var complexOptions = [ // names of options that are objects whose properties should be combined 'header', 'footer', 'buttonText', 'buttonIcons', 'themeButtonIcons' ]; // Merges an array of option objects into a single object function mergeOptions(optionObjs) { return mergeProps(optionObjs, complexOptions); } ;; // exports FC.intersectRanges = intersectRanges; FC.applyAll = applyAll; FC.debounce = debounce; FC.isInt = isInt; FC.htmlEscape = htmlEscape; FC.cssToStr = cssToStr; FC.proxy = proxy; FC.capitaliseFirstLetter = capitaliseFirstLetter; /* FullCalendar-specific DOM Utilities ----------------------------------------------------------------------------------------------------------------------*/ // Given the scrollbar widths of some other container, create borders/margins on rowEls in order to match the left // and right space that was offset by the scrollbars. A 1-pixel border first, then margin beyond that. function compensateScroll(rowEls, scrollbarWidths) { if (scrollbarWidths.left) { rowEls.css({ 'border-left-width': 1, 'margin-left': scrollbarWidths.left - 1 }); } if (scrollbarWidths.right) { rowEls.css({ 'border-right-width': 1, 'margin-right': scrollbarWidths.right - 1 }); } } // Undoes compensateScroll and restores all borders/margins function uncompensateScroll(rowEls) { rowEls.css({ 'margin-left': '', 'margin-right': '', 'border-left-width': '', 'border-right-width': '' }); } // Make the mouse cursor express that an event is not allowed in the current area function disableCursor() { $('body').addClass('fc-not-allowed'); } // Returns the mouse cursor to its original look function enableCursor() { $('body').removeClass('fc-not-allowed'); } // Given a total available height to fill, have `els` (essentially child rows) expand to accomodate. // By default, all elements that are shorter than the recommended height are expanded uniformly, not considering // any other els that are already too tall. if `shouldRedistribute` is on, it considers these tall rows and // reduces the available height. function distributeHeight(els, availableHeight, shouldRedistribute) { // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions, // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars. var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE* var flexEls = []; // elements that are allowed to expand. array of DOM nodes var flexOffsets = []; // amount of vertical space it takes up var flexHeights = []; // actual css height var usedHeight = 0; undistributeHeight(els); // give all elements their natural height // find elements that are below the recommended height (expandable). // important to query for heights in a single first pass (to avoid reflow oscillation). els.each(function(i, el) { var minOffset = i === els.length - 1 ? minOffset2 : minOffset1; var naturalOffset = $(el).outerHeight(true); if (naturalOffset < minOffset) { flexEls.push(el); flexOffsets.push(naturalOffset); flexHeights.push($(el).height()); } else { // this element stretches past recommended height (non-expandable). mark the space as occupied. usedHeight += naturalOffset; } }); // readjust the recommended height to only consider the height available to non-maxed-out rows. if (shouldRedistribute) { availableHeight -= usedHeight; minOffset1 = Math.floor(availableHeight / flexEls.length); minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE* } // assign heights to all expandable elements $(flexEls).each(function(i, el) { var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1; var naturalOffset = flexOffsets[i]; var naturalHeight = flexHeights[i]; var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things $(el).height(newHeight); } }); } // Undoes distrubuteHeight, restoring all els to their natural height function undistributeHeight(els) { els.height(''); } // Given `els`, a jQuery set of <td> cells, find the cell with the largest natural width and set the widths of all the // cells to be that width. // PREREQUISITE: if you want a cell to take up width, it needs to have a single inner element w/ display:inline function matchCellWidths(els) { var maxInnerWidth = 0; els.find('> *').each(function(i, innerEl) { var innerWidth = $(innerEl).outerWidth(); if (innerWidth > maxInnerWidth) { maxInnerWidth = innerWidth; } }); maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance els.width(maxInnerWidth); return maxInnerWidth; } // Given one element that resides inside another, // Subtracts the height of the inner element from the outer element. function subtractInnerElHeight(outerEl, innerEl) { var both = outerEl.add(innerEl); var diff; // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked both.css({ position: 'relative', // cause a reflow, which will force fresh dimension recalculation left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll }); diff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions both.css({ position: '', left: '' }); // undo hack return diff; } /* Element Geom Utilities ----------------------------------------------------------------------------------------------------------------------*/ FC.getOuterRect = getOuterRect; FC.getClientRect = getClientRect; FC.getContentRect = getContentRect; FC.getScrollbarWidths = getScrollbarWidths; // borrowed from https://github.com/jquery/jquery-ui/blob/1.11.0/ui/core.js#L51 function getScrollParent(el) { var position = el.css('position'), scrollParent = el.parents().filter(function() { var parent = $(this); return (/(auto|scroll)/).test( parent.css('overflow') + parent.css('overflow-y') + parent.css('overflow-x') ); }).eq(0); return position === 'fixed' || !scrollParent.length ? $(el[0].ownerDocument || document) : scrollParent; } // Queries the outer bounding area of a jQuery element. // Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive). // Origin is optional. function getOuterRect(el, origin) { var offset = el.offset(); var left = offset.left - (origin ? origin.left : 0); var top = offset.top - (origin ? origin.top : 0); return { left: left, right: left + el.outerWidth(), top: top, bottom: top + el.outerHeight() }; } // Queries the area within the margin/border/scrollbars of a jQuery element. Does not go within the padding. // Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive). // Origin is optional. // NOTE: should use clientLeft/clientTop, but very unreliable cross-browser. function getClientRect(el, origin) { var offset = el.offset(); var scrollbarWidths = getScrollbarWidths(el); var left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0); var top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0); return { left: left, right: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars top: top, bottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars }; } // Queries the area within the margin/border/padding of a jQuery element. Assumed not to have scrollbars. // Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive). // Origin is optional. function getContentRect(el, origin) { var offset = el.offset(); // just outside of border, margin not included var left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') - (origin ? origin.left : 0); var top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') - (origin ? origin.top : 0); return { left: left, right: left + el.width(), top: top, bottom: top + el.height() }; } // Returns the computed left/right/top/bottom scrollbar widths for the given jQuery element. // NOTE: should use clientLeft/clientTop, but very unreliable cross-browser. function getScrollbarWidths(el) { var leftRightWidth = el.innerWidth() - el[0].clientWidth; // the paddings cancel out, leaving the scrollbars var widths = { left: 0, right: 0, top: 0, bottom: el.innerHeight() - el[0].clientHeight // the paddings cancel out, leaving the bottom scrollbar }; if (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side? widths.left = leftRightWidth; } else { widths.right = leftRightWidth; } return widths; } // Logic for determining if, when the element is right-to-left, the scrollbar appears on the left side var _isLeftRtlScrollbars = null; function getIsLeftRtlScrollbars() { // responsible for caching the computation if (_isLeftRtlScrollbars === null) { _isLeftRtlScrollbars = computeIsLeftRtlScrollbars(); } return _isLeftRtlScrollbars; } function computeIsLeftRtlScrollbars() { // creates an offscreen test element, then removes it var el = $('<div><div/></div>') .css({ position: 'absolute', top: -1000, left: 0, border: 0, padding: 0, overflow: 'scroll', direction: 'rtl' }) .appendTo('body'); var innerEl = el.children(); var res = innerEl.offset().left > el.offset().left; // is the inner div shifted to accommodate a left scrollbar? el.remove(); return res; } // Retrieves a jQuery element's computed CSS value as a floating-point number. // If the queried value is non-numeric (ex: IE can return "medium" for border width), will just return zero. function getCssFloat(el, prop) { return parseFloat(el.css(prop)) || 0; } /* Mouse / Touch Utilities ----------------------------------------------------------------------------------------------------------------------*/ FC.preventDefault = preventDefault; // Returns a boolean whether this was a left mouse click and no ctrl key (which means right click on Mac) function isPrimaryMouseButton(ev) { return ev.which == 1 && !ev.ctrlKey; } function getEvX(ev) { if (ev.pageX !== undefined) { return ev.pageX; } var touches = ev.originalEvent.touches; if (touches) { return touches[0].pageX; } } function getEvY(ev) { if (ev.pageY !== undefined) { return ev.pageY; } var touches = ev.originalEvent.touches; if (touches) { return touches[0].pageY; } } function getEvIsTouch(ev) { return /^touch/.test(ev.type); } function preventSelection(el) { el.addClass('fc-unselectable') .on('selectstart', preventDefault); } // Stops a mouse/touch event from doing it's native browser action function preventDefault(ev) { ev.preventDefault(); } // attach a handler to get called when ANY scroll action happens on the page. // this was impossible to do with normal on/off because 'scroll' doesn't bubble. // http://stackoverflow.com/a/32954565/96342 // returns `true` on success. function bindAnyScroll(handler) { if (window.addEventListener) { window.addEventListener('scroll', handler, true); // useCapture=true return true; } return false; } // undoes bindAnyScroll. must pass in the original function. // returns `true` on success. function unbindAnyScroll(handler) { if (window.removeEventListener) { window.removeEventListener('scroll', handler, true); // useCapture=true return true; } return false; } /* General Geometry Utils ----------------------------------------------------------------------------------------------------------------------*/ FC.intersectRects = intersectRects; // Returns a new rectangle that is the intersection of the two rectangles. If they don't intersect, returns false function intersectRects(rect1, rect2) { var res = { left: Math.max(rect1.left, rect2.left), right: Math.min(rect1.right, rect2.right), top: Math.max(rect1.top, rect2.top), bottom: Math.min(rect1.bottom, rect2.bottom) }; if (res.left < res.right && res.top < res.bottom) { return res; } return false; } // Returns a new point that will have been moved to reside within the given rectangle function constrainPoint(point, rect) { return { left: Math.min(Math.max(point.left, rect.left), rect.right), top: Math.min(Math.max(point.top, rect.top), rect.bottom) }; } // Returns a point that is the center of the given rectangle function getRectCenter(rect) { return { left: (rect.left + rect.right) / 2, top: (rect.top + rect.bottom) / 2 }; } // Subtracts point2's coordinates from point1's coordinates, returning a delta function diffPoints(point1, point2) { return { left: point1.left - point2.left, top: point1.top - point2.top }; } /* Object Ordering by Field ----------------------------------------------------------------------------------------------------------------------*/ FC.parseFieldSpecs = parseFieldSpecs; FC.compareByFieldSpecs = compareByFieldSpecs; FC.compareByFieldSpec = compareByFieldSpec; FC.flexibleCompare = flexibleCompare; function parseFieldSpecs(input) { var specs = []; var tokens = []; var i, token; if (typeof input === 'string') { tokens = input.split(/\s*,\s*/); } else if (typeof input === 'function') { tokens = [ input ]; } else if ($.isArray(input)) { tokens = input; } for (i = 0; i < tokens.length; i++) { token = tokens[i]; if (typeof token === 'string') { specs.push( token.charAt(0) == '-' ? { field: token.substring(1), order: -1 } : { field: token, order: 1 } ); } else if (typeof token === 'function') { specs.push({ func: token }); } } return specs; } function compareByFieldSpecs(obj1, obj2, fieldSpecs) { var i; var cmp; for (i = 0; i < fieldSpecs.length; i++) { cmp = compareByFieldSpec(obj1, obj2, fieldSpecs[i]); if (cmp) { return cmp; } } return 0; } function compareByFieldSpec(obj1, obj2, fieldSpec) { if (fieldSpec.func) { return fieldSpec.func(obj1, obj2); } return flexibleCompare(obj1[fieldSpec.field], obj2[fieldSpec.field]) * (fieldSpec.order || 1); } function flexibleCompare(a, b) { if (!a && !b) { return 0; } if (b == null) { return -1; } if (a == null) { return 1; } if ($.type(a) === 'string' || $.type(b) === 'string') { return String(a).localeCompare(String(b)); } return a - b; } /* FullCalendar-specific Misc Utilities ----------------------------------------------------------------------------------------------------------------------*/ // Computes the intersection of the two ranges. Will return fresh date clones in a range. // Returns undefined if no intersection. // Expects all dates to be normalized to the same timezone beforehand. // TODO: move to date section? function intersectRanges(subjectRange, constraintRange) { var subjectStart = subjectRange.start; var subjectEnd = subjectRange.end; var constraintStart = constraintRange.start; var constraintEnd = constraintRange.end; var segStart, segEnd; var isStart, isEnd; if (subjectEnd > constraintStart && subjectStart < constraintEnd) { // in bounds at all? if (subjectStart >= constraintStart) { segStart = subjectStart.clone(); isStart = true; } else { segStart = constraintStart.clone(); isStart = false; } if (subjectEnd <= constraintEnd) { segEnd = subjectEnd.clone(); isEnd = true; } else { segEnd = constraintEnd.clone(); isEnd = false; } return { start: segStart, end: segEnd, isStart: isStart, isEnd: isEnd }; } } /* Date Utilities ----------------------------------------------------------------------------------------------------------------------*/ FC.computeIntervalUnit = computeIntervalUnit; FC.divideRangeByDuration = divideRangeByDuration; FC.divideDurationByDuration = divideDurationByDuration; FC.multiplyDuration = multiplyDuration; FC.durationHasTime = durationHasTime; var dayIDs = [ 'sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat' ]; var intervalUnits = [ 'year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond' ]; // Diffs the two moments into a Duration where full-days are recorded first, then the remaining time. // Moments will have their timezones normalized. function diffDayTime(a, b) { return moment.duration({ days: a.clone().stripTime().diff(b.clone().stripTime(), 'days'), ms: a.time() - b.time() // time-of-day from day start. disregards timezone }); } // Diffs the two moments via their start-of-day (regardless of timezone). Produces whole-day durations. function diffDay(a, b) { return moment.duration({ days: a.clone().stripTime().diff(b.clone().stripTime(), 'days') }); } // Diffs two moments, producing a duration, made of a whole-unit-increment of the given unit. Uses rounding. function diffByUnit(a, b, unit) { return moment.duration( Math.round(a.diff(b, unit, true)), // returnFloat=true unit ); } // Computes the unit name of the largest whole-unit period of time. // For example, 48 hours will be "days" whereas 49 hours will be "hours". // Accepts start/end, a range object, or an original duration object. function computeIntervalUnit(start, end) { var i, unit; var val; for (i = 0; i < intervalUnits.length; i++) { unit = intervalUnits[i]; val = computeRangeAs(unit, start, end); if (val >= 1 && isInt(val)) { break; } } return unit; // will be "milliseconds" if nothing else matches } // Computes the number of units (like "hours") in the given range. // Range can be a {start,end} object, separate start/end args, or a Duration. // Results are based on Moment's .as() and .diff() methods, so results can depend on internal handling // of month-diffing logic (which tends to vary from version to version). function computeRangeAs(unit, start, end) { if (end != null) { // given start, end return end.diff(start, unit, true); } else if (moment.isDuration(start)) { // given duration return start.as(unit); } else { // given { start, end } range object return start.end.diff(start.start, unit, true); } } // Intelligently divides a range (specified by a start/end params) by a duration function divideRangeByDuration(start, end, dur) { var months; if (durationHasTime(dur)) { return (end - start) / dur; } months = dur.asMonths(); if (Math.abs(months) >= 1 && isInt(months)) { return end.diff(start, 'months', true) / months; } return end.diff(start, 'days', true) / dur.asDays(); } // Intelligently divides one duration by another function divideDurationByDuration(dur1, dur2) { var months1, months2; if (durationHasTime(dur1) || durationHasTime(dur2)) { return dur1 / dur2; } months1 = dur1.asMonths(); months2 = dur2.asMonths(); if ( Math.abs(months1) >= 1 && isInt(months1) && Math.abs(months2) >= 1 && isInt(months2) ) { return months1 / months2; } return dur1.asDays() / dur2.asDays(); } // Intelligently multiplies a duration by a number function multiplyDuration(dur, n) { var months; if (durationHasTime(dur)) { return moment.duration(dur * n); } months = dur.asMonths(); if (Math.abs(months) >= 1 && isInt(months)) { return moment.duration({ months: months * n }); } return moment.duration({ days: dur.asDays() * n }); } // Returns a boolean about whether the given duration has any time parts (hours/minutes/seconds/ms) function durationHasTime(dur) { return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds()); } function isNativeDate(input) { return Object.prototype.toString.call(input) === '[object Date]' || input instanceof Date; } // Returns a boolean about whether the given input is a time string, like "06:40:00" or "06:00" function isTimeString(str) { return /^\d+\:\d+(?:\:\d+\.?(?:\d{3})?)?$/.test(str); } /* Logging and Debug ----------------------------------------------------------------------------------------------------------------------*/ FC.log = function() { var console = window.console; if (console && console.log) { return console.log.apply(console, arguments); } }; FC.warn = function() { var console = window.console; if (console && console.warn) { return console.warn.apply(console, arguments); } else { return FC.log.apply(FC, arguments); } }; /* General Utilities ----------------------------------------------------------------------------------------------------------------------*/ var hasOwnPropMethod = {}.hasOwnProperty; // Merges an array of objects into a single object. // The second argument allows for an array of property names who's object values will be merged together. function mergeProps(propObjs, complexProps) { var dest = {}; var i, name; var complexObjs; var j, val; var props; if (complexProps) { for (i = 0; i < complexProps.length; i++) { name = complexProps[i]; complexObjs = []; // collect the trailing object values, stopping when a non-object is discovered for (j = propObjs.length - 1; j >= 0; j--) { val = propObjs[j][name]; if (typeof val === 'object') { complexObjs.unshift(val); } else if (val !== undefined) { dest[name] = val; // if there were no objects, this value will be used break; } } // if the trailing values were objects, use the merged value if (complexObjs.length) { dest[name] = mergeProps(complexObjs); } } } // copy values into the destination, going from last to first for (i = propObjs.length - 1; i >= 0; i--) { props = propObjs[i]; for (name in props) { if (!(name in dest)) { // if already assigned by previous props or complex props, don't reassign dest[name] = props[name]; } } } return dest; } // Create an object that has the given prototype. Just like Object.create function createObject(proto) { var f = function() {}; f.prototype = proto; return new f(); } FC.createObject = createObject; function copyOwnProps(src, dest) { for (var name in src) { if (hasOwnProp(src, name)) { dest[name] = src[name]; } } } function hasOwnProp(obj, name) { return hasOwnPropMethod.call(obj, name); } // Is the given value a non-object non-function value? function isAtomic(val) { return /undefined|null|boolean|number|string/.test($.type(val)); } function applyAll(functions, thisObj, args) { if ($.isFunction(functions)) { functions = [ functions ]; } if (functions) { var i; var ret; for (i=0; i<functions.length; i++) { ret = functions[i].apply(thisObj, args) || ret; } return ret; } } function firstDefined() { for (var i=0; i<arguments.length; i++) { if (arguments[i] !== undefined) { return arguments[i]; } } } function htmlEscape(s) { return (s + '').replace(/&/g, '&') .replace(/</g, '<') .replace(/>/g, '>') .replace(/'/g, ''') .replace(/"/g, '"') .replace(/\n/g, '<br />'); } function stripHtmlEntities(text) { return text.replace(/&.*?;/g, ''); } // Given a hash of CSS properties, returns a string of CSS. // Uses property names as-is (no camel-case conversion). Will not make statements for null/undefined values. function cssToStr(cssProps) { var statements = []; $.each(cssProps, function(name, val) { if (val != null) { statements.push(name + ':' + val); } }); return statements.join(';'); } // Given an object hash of HTML attribute names to values, // generates a string that can be injected between < > in HTML function attrsToStr(attrs) { var parts = []; $.each(attrs, function(name, val) { if (val != null) { parts.push(name + '="' + htmlEscape(val) + '"'); } }); return parts.join(' '); } function capitaliseFirstLetter(str) { return str.charAt(0).toUpperCase() + str.slice(1); } function compareNumbers(a, b) { // for .sort() return a - b; } function isInt(n) { return n % 1 === 0; } // Returns a method bound to the given object context. // Just like one of the jQuery.proxy signatures, but without the undesired behavior of treating the same method with // different contexts as identical when binding/unbinding events. function proxy(obj, methodName) { var method = obj[methodName]; return function() { return method.apply(obj, arguments); }; } // Returns a function, that, as long as it continues to be invoked, will not // be triggered. The function will be called after it stops being called for // N milliseconds. If `immediate` is passed, trigger the function on the // leading edge, instead of the trailing. // https://github.com/jashkenas/underscore/blob/1.6.0/underscore.js#L714 function debounce(func, wait, immediate) { var timeout, args, context, timestamp, result; var later = function() { var last = +new Date() - timestamp; if (last < wait) { timeout = setTimeout(later, wait - last); } else { timeout = null; if (!immediate) { result = func.apply(context, args); context = args = null; } } }; return function() { context = this; args = arguments; timestamp = +new Date(); var callNow = immediate && !timeout; if (!timeout) { timeout = setTimeout(later, wait); } if (callNow) { result = func.apply(context, args); context = args = null; } return result; }; } ;; /* GENERAL NOTE on moments throughout the *entire rest* of the codebase: All moments are assumed to be ambiguously-zoned unless otherwise noted, with the NOTABLE EXCEOPTION of start/end dates that live on *Event Objects*. Ambiguously-TIMED moments are assumed to be ambiguously-zoned by nature. */ var ambigDateOfMonthRegex = /^\s*\d{4}-\d\d$/; var ambigTimeOrZoneRegex = /^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?)?$/; var newMomentProto = moment.fn; // where we will attach our new methods var oldMomentProto = $.extend({}, newMomentProto); // copy of original moment methods // tell momentjs to transfer these properties upon clone var momentProperties = moment.momentProperties; momentProperties.push('_fullCalendar'); momentProperties.push('_ambigTime'); momentProperties.push('_ambigZone'); // Creating // ------------------------------------------------------------------------------------------------- // Creates a new moment, similar to the vanilla moment(...) constructor, but with // extra features (ambiguous time, enhanced formatting). When given an existing moment, // it will function as a clone (and retain the zone of the moment). Anything else will // result in a moment in the local zone. FC.moment = function() { return makeMoment(arguments); }; // Sames as FC.moment, but forces the resulting moment to be in the UTC timezone. FC.moment.utc = function() { var mom = makeMoment(arguments, true); // Force it into UTC because makeMoment doesn't guarantee it // (if given a pre-existing moment for example) if (mom.hasTime()) { // don't give ambiguously-timed moments a UTC zone mom.utc(); } return mom; }; // Same as FC.moment, but when given an ISO8601 string, the timezone offset is preserved. // ISO8601 strings with no timezone offset will become ambiguously zoned. FC.moment.parseZone = function() { return makeMoment(arguments, true, true); }; // Builds an enhanced moment from args. When given an existing moment, it clones. When given a // native Date, or called with no arguments (the current time), the resulting moment will be local. // Anything else needs to be "parsed" (a string or an array), and will be affected by: // parseAsUTC - if there is no zone information, should we parse the input in UTC? // parseZone - if there is zone information, should we force the zone of the moment? function makeMoment(args, parseAsUTC, parseZone) { var input = args[0]; var isSingleString = args.length == 1 && typeof input === 'string'; var isAmbigTime; var isAmbigZone; var ambigMatch; var mom; if (moment.isMoment(input) || isNativeDate(input) || input === undefined) { mom = moment.apply(null, args); } else { // "parsing" is required isAmbigTime = false; isAmbigZone = false; if (isSingleString) { if (ambigDateOfMonthRegex.test(input)) { // accept strings like '2014-05', but convert to the first of the month input += '-01'; args = [ input ]; // for when we pass it on to moment's constructor isAmbigTime = true; isAmbigZone = true; } else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) { isAmbigTime = !ambigMatch[5]; // no time part? isAmbigZone = true; } } else if ($.isArray(input)) { // arrays have no timezone information, so assume ambiguous zone isAmbigZone = true; } // otherwise, probably a string with a format if (parseAsUTC || isAmbigTime) { mom = moment.utc.apply(moment, args); } else { mom = moment.apply(null, args); } if (isAmbigTime) { mom._ambigTime = true; mom._ambigZone = true; // ambiguous time always means ambiguous zone } else if (parseZone) { // let's record the inputted zone somehow if (isAmbigZone) { mom._ambigZone = true; } else if (isSingleString) { mom.utcOffset(input); // if not a valid zone, will assign UTC } } } mom._fullCalendar = true; // flag for extended functionality return mom; } // Week Number // ------------------------------------------------------------------------------------------------- // Returns the week number, considering the locale's custom week number calcuation // `weeks` is an alias for `week` newMomentProto.week = newMomentProto.weeks = function(input) { var weekCalc = this._locale._fullCalendar_weekCalc; if (input == null && typeof weekCalc === 'function') { // custom function only works for getter return weekCalc(this); } else if (weekCalc === 'ISO') { return oldMomentProto.isoWeek.apply(this, arguments); // ISO getter/setter } return oldMomentProto.week.apply(this, arguments); // local getter/setter }; // Time-of-day // ------------------------------------------------------------------------------------------------- // GETTER // Returns a Duration with the hours/minutes/seconds/ms values of the moment. // If the moment has an ambiguous time, a duration of 00:00 will be returned. // // SETTER // You can supply a Duration, a Moment, or a Duration-like argument. // When setting the time, and the moment has an ambiguous time, it then becomes unambiguous. newMomentProto.time = function(time) { // Fallback to the original method (if there is one) if this moment wasn't created via FullCalendar. // `time` is a generic enough method name where this precaution is necessary to avoid collisions w/ other plugins. if (!this._fullCalendar) { return oldMomentProto.time.apply(this, arguments); } if (time == null) { // getter return moment.duration({ hours: this.hours(), minutes: this.minutes(), seconds: this.seconds(), milliseconds: this.milliseconds() }); } else { // setter this._ambigTime = false; // mark that the moment now has a time if (!moment.isDuration(time) && !moment.isMoment(time)) { time = moment.duration(time); } // The day value should cause overflow (so 24 hours becomes 00:00:00 of next day). // Only for Duration times, not Moment times. var dayHours = 0; if (moment.isDuration(time)) { dayHours = Math.floor(time.asDays()) * 24; } // We need to set the individual fields. // Can't use startOf('day') then add duration. In case of DST at start of day. return this.hours(dayHours + time.hours()) .minutes(time.minutes()) .seconds(time.seconds()) .milliseconds(time.milliseconds()); } }; // Converts the moment to UTC, stripping out its time-of-day and timezone offset, // but preserving its YMD. A moment with a stripped time will display no time // nor timezone offset when .format() is called. newMomentProto.stripTime = function() { if (!this._ambigTime) { this.utc(true); // keepLocalTime=true (for keeping *date* value) // set time to zero this.set({ hours: 0, minutes: 0, seconds: 0, ms: 0 }); // Mark the time as ambiguous. This needs to happen after the .utc() call, which might call .utcOffset(), // which clears all ambig flags. this._ambigTime = true; this._ambigZone = true; // if ambiguous time, also ambiguous timezone offset } return this; // for chaining }; // Returns if the moment has a non-ambiguous time (boolean) newMomentProto.hasTime = function() { return !this._ambigTime; }; // Timezone // ------------------------------------------------------------------------------------------------- // Converts the moment to UTC, stripping out its timezone offset, but preserving its // YMD and time-of-day. A moment with a stripped timezone offset will display no // timezone offset when .format() is called. newMomentProto.stripZone = function() { var wasAmbigTime; if (!this._ambigZone) { wasAmbigTime = this._ambigTime; this.utc(true); // keepLocalTime=true (for keeping date and time values) // the above call to .utc()/.utcOffset() unfortunately might clear the ambig flags, so restore this._ambigTime = wasAmbigTime || false; // Mark the zone as ambiguous. This needs to happen after the .utc() call, which might call .utcOffset(), // which clears the ambig flags. this._ambigZone = true; } return this; // for chaining }; // Returns of the moment has a non-ambiguous timezone offset (boolean) newMomentProto.hasZone = function() { return !this._ambigZone; }; // implicitly marks a zone newMomentProto.local = function(keepLocalTime) { // for when converting from ambiguously-zoned to local, // keep the time values when converting from UTC -> local oldMomentProto.local.call(this, this._ambigZone || keepLocalTime); // ensure non-ambiguous // this probably already happened via local() -> utcOffset(), but don't rely on Moment's internals this._ambigTime = false; this._ambigZone = false; return this; // for chaining }; // implicitly marks a zone newMomentProto.utc = function(keepLocalTime) { oldMomentProto.utc.call(this, keepLocalTime); // ensure non-ambiguous // this probably already happened via utc() -> utcOffset(), but don't rely on Moment's internals this._ambigTime = false; this._ambigZone = false; return this; }; // implicitly marks a zone (will probably get called upon .utc() and .local()) newMomentProto.utcOffset = function(tzo) { if (tzo != null) { // setter // these assignments needs to happen before the original zone method is called. // I forget why, something to do with a browser crash. this._ambigTime = false; this._ambigZone = false; } return oldMomentProto.utcOffset.apply(this, arguments); }; // Formatting // ------------------------------------------------------------------------------------------------- newMomentProto.format = function() { if (this._fullCalendar && arguments[0]) { // an enhanced moment? and a format string provided? return formatDate(this, arguments[0]); // our extended formatting } if (this._ambigTime) { return oldMomentFormat(this, 'YYYY-MM-DD'); } if (this._ambigZone) { return oldMomentFormat(this, 'YYYY-MM-DD[T]HH:mm:ss'); } return oldMomentProto.format.apply(this, arguments); }; newMomentProto.toISOString = function() { if (this._ambigTime) { return oldMomentFormat(this, 'YYYY-MM-DD'); } if (this._ambigZone) { return oldMomentFormat(this, 'YYYY-MM-DD[T]HH:mm:ss'); } return oldMomentProto.toISOString.apply(this, arguments); }; ;; // Single Date Formatting // ------------------------------------------------------------------------------------------------- // call this if you want Moment's original format method to be used function oldMomentFormat(mom, formatStr) { return oldMomentProto.format.call(mom, formatStr); // oldMomentProto defined in moment-ext.js } // Formats `date` with a Moment formatting string, but allow our non-zero areas and // additional token. function formatDate(date, formatStr) { return formatDateWithChunks(date, getFormatStringChunks(formatStr)); } function formatDateWithChunks(date, chunks) { var s = ''; var i; for (i=0; i<chunks.length; i++) { s += formatDateWithChunk(date, chunks[i]); } return s; } // addition formatting tokens we want recognized var tokenOverrides = { t: function(date) { // "a" or "p" return oldMomentFormat(date, 'a').charAt(0); }, T: function(date) { // "A" or "P" return oldMomentFormat(date, 'A').charAt(0); } }; function formatDateWithChunk(date, chunk) { var token; var maybeStr; if (typeof chunk === 'string') { // a literal string return chunk; } else if ((token = chunk.token)) { // a token, like "YYYY" if (tokenOverrides[token]) { return tokenOverrides[token](date); // use our custom token } return oldMomentFormat(date, token); } else if (chunk.maybe) { // a grouping of other chunks that must be non-zero maybeStr = formatDateWithChunks(date, chunk.maybe); if (maybeStr.match(/[1-9]/)) { return maybeStr; } } return ''; } // Date Range Formatting // ------------------------------------------------------------------------------------------------- // TODO: make it work with timezone offset // Using a formatting string meant for a single date, generate a range string, like // "Sep 2 - 9 2013", that intelligently inserts a separator where the dates differ. // If the dates are the same as far as the format string is concerned, just return a single // rendering of one date, without any separator. function formatRange(date1, date2, formatStr, separator, isRTL) { var localeData; date1 = FC.moment.parseZone(date1); date2 = FC.moment.parseZone(date2); localeData = date1.localeData(); // Expand localized format strings, like "LL" -> "MMMM D YYYY" formatStr = localeData.longDateFormat(formatStr) || formatStr; // BTW, this is not important for `formatDate` because it is impossible to put custom tokens // or non-zero areas in Moment's localized format strings. separator = separator || ' - '; return formatRangeWithChunks( date1, date2, getFormatStringChunks(formatStr), separator, isRTL ); } FC.formatRange = formatRange; // expose function formatRangeWithChunks(date1, date2, chunks, separator, isRTL) { var unzonedDate1 = date1.clone().stripZone(); // for formatSimilarChunk var unzonedDate2 = date2.clone().stripZone(); // " var chunkStr; // the rendering of the chunk var leftI; var leftStr = ''; var rightI; var rightStr = ''; var middleI; var middleStr1 = ''; var middleStr2 = ''; var middleStr = ''; // Start at the leftmost side of the formatting string and continue until you hit a token // that is not the same between dates. for (leftI=0; leftI<chunks.length; leftI++) { chunkStr = formatSimilarChunk(date1, date2, unzonedDate1, unzonedDate2, chunks[leftI]); if (chunkStr === false) { break; } leftStr += chunkStr; } // Similarly, start at the rightmost side of the formatting string and move left for (rightI=chunks.length-1; rightI>leftI; rightI--) { chunkStr = formatSimilarChunk(date1, date2, unzonedDate1, unzonedDate2, chunks[rightI]); if (chunkStr === false) { break; } rightStr = chunkStr + rightStr; } // The area in the middle is different for both of the dates. // Collect them distinctly so we can jam them together later. for (middleI=leftI; middleI<=rightI; middleI++) { middleStr1 += formatDateWithChunk(date1, chunks[middleI]); middleStr2 += formatDateWithChunk(date2, chunks[middleI]); } if (middleStr1 || middleStr2) { if (isRTL) { middleStr = middleStr2 + separator + middleStr1; } else { middleStr = middleStr1 + separator + middleStr2; } } return leftStr + middleStr + rightStr; } var similarUnitMap = { Y: 'year', M: 'month', D: 'day', // day of month d: 'day', // day of week // prevents a separator between anything time-related... A: 'second', // AM/PM a: 'second', // am/pm T: 'second', // A/P t: 'second', // a/p H: 'second', // hour (24) h: 'second', // hour (12) m: 'second', // minute s: 'second' // second }; // TODO: week maybe? // Given a formatting chunk, and given that both dates are similar in the regard the // formatting chunk is concerned, format date1 against `chunk`. Otherwise, return `false`. function formatSimilarChunk(date1, date2, unzonedDate1, unzonedDate2, chunk) { var token; var unit; if (typeof chunk === 'string') { // a literal string return chunk; } else if ((token = chunk.token)) { unit = similarUnitMap[token.charAt(0)]; // are the dates the same for this unit of measurement? // use the unzoned dates for this calculation because unreliable when near DST (bug #2396) if (unit && unzonedDate1.isSame(unzonedDate2, unit)) { return oldMomentFormat(date1, token); // would be the same if we used `date2` // BTW, don't support custom tokens } } return false; // the chunk is NOT the same for the two dates // BTW, don't support splitting on non-zero areas } // Chunking Utils // ------------------------------------------------------------------------------------------------- var formatStringChunkCache = {}; function getFormatStringChunks(formatStr) { if (formatStr in formatStringChunkCache) { return formatStringChunkCache[formatStr]; } return (formatStringChunkCache[formatStr] = chunkFormatString(formatStr)); } // Break the formatting string into an array of chunks function chunkFormatString(formatStr) { var chunks = []; var chunker = /\[([^\]]*)\]|\(([^\)]*)\)|(LTS|LT|(\w)\4*o?)|([^\w\[\(]+)/g; // TODO: more descrimination var match; while ((match = chunker.exec(formatStr))) { if (match[1]) { // a literal string inside [ ... ] chunks.push(match[1]); } else if (match[2]) { // non-zero formatting inside ( ... ) chunks.push({ maybe: chunkFormatString(match[2]) }); } else if (match[3]) { // a formatting token chunks.push({ token: match[3] }); } else if (match[5]) { // an unenclosed literal string chunks.push(match[5]); } } return chunks; } // Misc Utils // ------------------------------------------------------------------------------------------------- // granularity only goes up until day // TODO: unify with similarUnitMap var tokenGranularities = { Y: { value: 1, unit: 'year' }, M: { value: 2, unit: 'month' }, W: { value: 3, unit: 'week' }, w: { value: 3, unit: 'week' }, D: { value: 4, unit: 'day' }, // day of month d: { value: 4, unit: 'day' } // day of week }; // returns a unit string, either 'year', 'month', 'day', or null // for the most granular formatting token in the string. FC.queryMostGranularFormatUnit = function(formatStr) { var chunks = getFormatStringChunks(formatStr); var i, chunk; var candidate; var best; for (i = 0; i < chunks.length; i++) { chunk = chunks[i]; if (chunk.token) { candidate = tokenGranularities[chunk.token.charAt(0)]; if (candidate) { if (!best || candidate.value > best.value) { best = candidate; } } } } if (best) { return best.unit; } return null; }; ;; FC.Class = Class; // export // Class that all other classes will inherit from function Class() { } // Called on a class to create a subclass. // Last argument contains instance methods. Any argument before the last are considered mixins. Class.extend = function() { var len = arguments.length; var i; var members; for (i = 0; i < len; i++) { members = arguments[i]; if (i < len - 1) { // not the last argument? mixIntoClass(this, members); } } return extendClass(this, members || {}); // members will be undefined if no arguments }; // Adds new member variables/methods to the class's prototype. // Can be called with another class, or a plain object hash containing new members. Class.mixin = function(members) { mixIntoClass(this, members); }; function extendClass(superClass, members) { var subClass; // ensure a constructor for the subclass, forwarding all arguments to the super-constructor if it doesn't exist if (hasOwnProp(members, 'constructor')) { subClass = members.constructor; } if (typeof subClass !== 'function') { subClass = members.constructor = function() { superClass.apply(this, arguments); }; } // build the base prototype for the subclass, which is an new object chained to the superclass's prototype subClass.prototype = createObject(superClass.prototype); // copy each member variable/method onto the the subclass's prototype copyOwnProps(members, subClass.prototype); // copy over all class variables/methods to the subclass, such as `extend` and `mixin` copyOwnProps(superClass, subClass); return subClass; } function mixIntoClass(theClass, members) { copyOwnProps(members, theClass.prototype); } ;; /* Wrap jQuery's Deferred Promise object to be slightly more Promise/A+ compliant. With the added non-standard feature of synchronously executing handlers on resolved promises, which doesn't always happen otherwise (esp with nested .then handlers!?), so, this makes things a lot easier, esp because jQuery 3 changed the synchronicity for Deferred objects. TODO: write tests and more comments */ function Promise(executor) { var deferred = $.Deferred(); var promise = deferred.promise(); if (typeof executor === 'function') { executor( function(value) { // resolve if (Promise.immediate) { promise._value = value; } deferred.resolve(value); }, function() { // reject deferred.reject(); } ); } if (Promise.immediate) { var origThen = promise.then; promise.then = function(onFulfilled, onRejected) { var state = promise.state(); if (state === 'resolved') { if (typeof onFulfilled === 'function') { return Promise.resolve(onFulfilled(promise._value)); } } else if (state === 'rejected') { if (typeof onRejected === 'function') { onRejected(); return promise; // already rejected } } return origThen.call(promise, onFulfilled, onRejected); }; } return promise; // instanceof Promise will break :( TODO: make Promise a real class } FC.Promise = Promise; Promise.immediate = true; Promise.resolve = function(value) { if (value && typeof value.resolve === 'function') { return value.promise(); } if (value && typeof value.then === 'function') { return value; } else { var deferred = $.Deferred().resolve(value); var promise = deferred.promise(); if (Promise.immediate) { var origThen = promise.then; promise._value = value; promise.then = function(onFulfilled, onRejected) { if (typeof onFulfilled === 'function') { return Promise.resolve(onFulfilled(value)); } return origThen.call(promise, onFulfilled, onRejected); }; } return promise; } }; Promise.reject = function() { return $.Deferred().reject().promise(); }; Promise.all = function(inputs) { var hasAllValues = false; var values; var i, input; if (Promise.immediate) { hasAllValues = true; values = []; for (i = 0; i < inputs.length; i++) { input = inputs[i]; if (input && typeof input.state === 'function' && input.state() === 'resolved' && ('_value' in input)) { values.push(input._value); } else if (input && typeof input.then === 'function') { hasAllValues = false; break; } else { values.push(input); } } } if (hasAllValues) { return Promise.resolve(values); } else { return $.when.apply($.when, inputs).then(function() { return $.when($.makeArray(arguments)); }); } }; ;; // TODO: write tests and clean up code function TaskQueue(debounceWait) { var q = []; // array of runFuncs function addTask(taskFunc) { return new Promise(function(resolve) { // should run this function when it's taskFunc's turn to run. // responsible for popping itself off the queue. var runFunc = function() { Promise.resolve(taskFunc()) // result might be async, coerce to promise .then(resolve) // resolve TaskQueue::push's promise, for the caller. will receive result of taskFunc. .then(function() { q.shift(); // pop itself off // run the next task, if any if (q.length) { q[0](); } }); }; // always put the task at the end of the queue, BEFORE running the task q.push(runFunc); // if it's the only task in the queue, run immediately if (q.length === 1) { runFunc(); } }); } this.add = // potentially debounce, for the public method typeof debounceWait === 'number' ? debounce(addTask, debounceWait) : addTask; // if not a number (null/undefined/false), no debounce at all this.addQuickly = addTask; // guaranteed no debounce } FC.TaskQueue = TaskQueue; /* q = new TaskQueue(); function work(i) { return q.push(function() { trigger(); console.log('work' + i); }); } var cnt = 0; function trigger() { if (cnt < 5) { cnt++; work(cnt); } } work(9); */ ;; var EmitterMixin = FC.EmitterMixin = { // jQuery-ification via $(this) allows a non-DOM object to have // the same event handling capabilities (including namespaces). on: function(types, handler) { $(this).on(types, this._prepareIntercept(handler)); return this; // for chaining }, one: function(types, handler) { $(this).one(types, this._prepareIntercept(handler)); return this; // for chaining }, _prepareIntercept: function(handler) { // handlers are always called with an "event" object as their first param. // sneak the `this` context and arguments into the extra parameter object // and forward them on to the original handler. var intercept = function(ev, extra) { return handler.apply( extra.context || this, extra.args || [] ); }; // mimick jQuery's internal "proxy" system (risky, I know) // causing all functions with the same .guid to appear to be the same. // https://github.com/jquery/jquery/blob/2.2.4/src/core.js#L448 // this is needed for calling .off with the original non-intercept handler. if (!handler.guid) { handler.guid = $.guid++; } intercept.guid = handler.guid; return intercept; }, off: function(types, handler) { $(this).off(types, handler); return this; // for chaining }, trigger: function(types) { var args = Array.prototype.slice.call(arguments, 1); // arguments after the first // pass in "extra" info to the intercept $(this).triggerHandler(types, { args: args }); return this; // for chaining }, triggerWith: function(types, context, args) { // `triggerHandler` is less reliant on the DOM compared to `trigger`. // pass in "extra" info to the intercept. $(this).triggerHandler(types, { context: context, args: args }); return this; // for chaining } }; ;; /* Utility methods for easily listening to events on another object, and more importantly, easily unlistening from them. */ var ListenerMixin = FC.ListenerMixin = (function() { var guid = 0; var ListenerMixin = { listenerId: null, /* Given an `other` object that has on/off methods, bind the given `callback` to an event by the given name. The `callback` will be called with the `this` context of the object that .listenTo is being called on. Can be called: .listenTo(other, eventName, callback) OR .listenTo(other, { eventName1: callback1, eventName2: callback2 }) */ listenTo: function(other, arg, callback) { if (typeof arg === 'object') { // given dictionary of callbacks for (var eventName in arg) { if (arg.hasOwnProperty(eventName)) { this.listenTo(other, eventName, arg[eventName]); } } } else if (typeof arg === 'string') { other.on( arg + '.' + this.getListenerNamespace(), // use event namespacing to identify this object $.proxy(callback, this) // always use `this` context // the usually-undesired jQuery guid behavior doesn't matter, // because we always unbind via namespace ); } }, /* Causes the current object to stop listening to events on the `other` object. `eventName` is optional. If omitted, will stop listening to ALL events on `other`. */ stopListeningTo: function(other, eventName) { other.off((eventName || '') + '.' + this.getListenerNamespace()); }, /* Returns a string, unique to this object, to be used for event namespacing */ getListenerNamespace: function() { if (this.listenerId == null) { this.listenerId = guid++; } return '_listener' + this.listenerId; } }; return ListenerMixin; })(); ;; // simple class for toggle a `isIgnoringMouse` flag on delay // initMouseIgnoring must first be called, with a millisecond delay setting. var MouseIgnorerMixin = { isIgnoringMouse: false, // bool delayUnignoreMouse: null, // method initMouseIgnoring: function(delay) { this.delayUnignoreMouse = debounce(proxy(this, 'unignoreMouse'), delay || 1000); }, // temporarily ignore mouse actions on segments tempIgnoreMouse: function() { this.isIgnoringMouse = true; this.delayUnignoreMouse(); }, // delayUnignoreMouse eventually calls this unignoreMouse: function() { this.isIgnoringMouse = false; } }; ;; /* A rectangular panel that is absolutely positioned over other content ------------------------------------------------------------------------------------------------------------------------ Options: - className (string) - content (HTML string or jQuery element set) - parentEl - top - left - right (the x coord of where the right edge should be. not a "CSS" right) - autoHide (boolean) - show (callback) - hide (callback) */ var Popover = Class.extend(ListenerMixin, { isHidden: true, options: null, el: null, // the container element for the popover. generated by this object margin: 10, // the space required between the popover and the edges of the scroll container constructor: function(options) { this.options = options || {}; }, // Shows the popover on the specified position. Renders it if not already show: function() { if (this.isHidden) { if (!this.el) { this.render(); } this.el.show(); this.position(); this.isHidden = false; this.trigger('show'); } }, // Hides the popover, through CSS, but does not remove it from the DOM hide: function() { if (!this.isHidden) { this.el.hide(); this.isHidden = true; this.trigger('hide'); } }, // Creates `this.el` and renders content inside of it render: function() { var _this = this; var options = this.options; this.el = $('<div class="fc-popover"/>') .addClass(options.className || '') .css({ // position initially to the top left to avoid creating scrollbars top: 0, left: 0 }) .append(options.content) .appendTo(options.parentEl); // when a click happens on anything inside with a 'fc-close' className, hide the popover this.el.on('click', '.fc-close', function() { _this.hide(); }); if (options.autoHide) { this.listenTo($(document), 'mousedown', this.documentMousedown); } }, // Triggered when the user clicks *anywhere* in the document, for the autoHide feature documentMousedown: function(ev) { // only hide the popover if the click happened outside the popover if (this.el && !$(ev.target).closest(this.el).length) { this.hide(); } }, // Hides and unregisters any handlers removeElement: function() { this.hide(); if (this.el) { this.el.remove(); this.el = null; } this.stopListeningTo($(document), 'mousedown'); }, // Positions the popover optimally, using the top/left/right options position: function() { var options = this.options; var origin = this.el.offsetParent().offset(); var width = this.el.outerWidth(); var height = this.el.outerHeight(); var windowEl = $(window); var viewportEl = getScrollParent(this.el); var viewportTop; var viewportLeft; var viewportOffset; var top; // the "position" (not "offset") values for the popover var left; // // compute top and left top = options.top || 0; if (options.left !== undefined) { left = options.left; } else if (options.right !== undefined) { left = options.right - width; // derive the left value from the right value } else { left = 0; } if (viewportEl.is(window) || viewportEl.is(document)) { // normalize getScrollParent's result viewportEl = windowEl; viewportTop = 0; // the window is always at the top left viewportLeft = 0; // (and .offset() won't work if called here) } else { viewportOffset = viewportEl.offset(); viewportTop = viewportOffset.top; viewportLeft = viewportOffset.left; } // if the window is scrolled, it causes the visible area to be further down viewportTop += windowEl.scrollTop(); viewportLeft += windowEl.scrollLeft(); // constrain to the view port. if constrained by two edges, give precedence to top/left if (options.viewportConstrain !== false) { top = Math.min(top, viewportTop + viewportEl.outerHeight() - height - this.margin); top = Math.max(top, viewportTop + this.margin); left = Math.min(left, viewportLeft + viewportEl.outerWidth() - width - this.margin); left = Math.max(left, viewportLeft + this.margin); } this.el.css({ top: top - origin.top, left: left - origin.left }); }, // Triggers a callback. Calls a function in the option hash of the same name. // Arguments beyond the first `name` are forwarded on. // TODO: better code reuse for this. Repeat code trigger: function(name) { if (this.options[name]) { this.options[name].apply(this, Array.prototype.slice.call(arguments, 1)); } } }); ;; /* A cache for the left/right/top/bottom/width/height values for one or more elements. Works with both offset (from topleft document) and position (from offsetParent). options: - els - isHorizontal - isVertical */ var CoordCache = FC.CoordCache = Class.extend({ els: null, // jQuery set (assumed to be siblings) forcedOffsetParentEl: null, // options can override the natural offsetParent origin: null, // {left,top} position of offsetParent of els boundingRect: null, // constrain cordinates to this rectangle. {left,right,top,bottom} or null isHorizontal: false, // whether to query for left/right/width isVertical: false, // whether to query for top/bottom/height // arrays of coordinates (offsets from topleft of document) lefts: null, rights: null, tops: null, bottoms: null, constructor: function(options) { this.els = $(options.els); this.isHorizontal = options.isHorizontal; this.isVertical = options.isVertical; this.forcedOffsetParentEl = options.offsetParent ? $(options.offsetParent) : null; }, // Queries the els for coordinates and stores them. // Call this method before using and of the get* methods below. build: function() { var offsetParentEl = this.forcedOffsetParentEl; if (!offsetParentEl && this.els.length > 0) { offsetParentEl = this.els.eq(0).offsetParent(); } this.origin = offsetParentEl ? offsetParentEl.offset() : null; this.boundingRect = this.queryBoundingRect(); if (this.isHorizontal) { this.buildElHorizontals(); } if (this.isVertical) { this.buildElVerticals(); } }, // Destroys all internal data about coordinates, freeing memory clear: function() { this.origin = null; this.boundingRect = null; this.lefts = null; this.rights = null; this.tops = null; this.bottoms = null; }, // When called, if coord caches aren't built, builds them ensureBuilt: function() { if (!this.origin) { this.build(); } }, // Populates the left/right internal coordinate arrays buildElHorizontals: function() { var lefts = []; var rights = []; this.els.each(function(i, node) { var el = $(node); var left = el.offset().left; var width = el.outerWidth(); lefts.push(left); rights.push(left + width); }); this.lefts = lefts; this.rights = rights; }, // Populates the top/bottom internal coordinate arrays buildElVerticals: function() { var tops = []; var bottoms = []; this.els.each(function(i, node) { var el = $(node); var top = el.offset().top; var height = el.outerHeight(); tops.push(top); bottoms.push(top + height); }); this.tops = tops; this.bottoms = bottoms; }, // Given a left offset (from document left), returns the index of the el that it horizontally intersects. // If no intersection is made, returns undefined. getHorizontalIndex: function(leftOffset) { this.ensureBuilt(); var lefts = this.lefts; var rights = this.rights; var len = lefts.length; var i; for (i = 0; i < len; i++) { if (leftOffset >= lefts[i] && leftOffset < rights[i]) { return i; } } }, // Given a top offset (from document top), returns the index of the el that it vertically intersects. // If no intersection is made, returns undefined. getVerticalIndex: function(topOffset) { this.ensureBuilt(); var tops = this.tops; var bottoms = this.bottoms; var len = tops.length; var i; for (i = 0; i < len; i++) { if (topOffset >= tops[i] && topOffset < bottoms[i]) { return i; } } }, // Gets the left offset (from document left) of the element at the given index getLeftOffset: function(leftIndex) { this.ensureBuilt(); return this.lefts[leftIndex]; }, // Gets the left position (from offsetParent left) of the element at the given index getLeftPosition: function(leftIndex) { this.ensureBuilt(); return this.lefts[leftIndex] - this.origin.left; }, // Gets the right offset (from document left) of the element at the given index. // This value is NOT relative to the document's right edge, like the CSS concept of "right" would be. getRightOffset: function(leftIndex) { this.ensureBuilt(); return this.rights[leftIndex]; }, // Gets the right position (from offsetParent left) of the element at the given index. // This value is NOT relative to the offsetParent's right edge, like the CSS concept of "right" would be. getRightPosition: function(leftIndex) { this.ensureBuilt(); return this.rights[leftIndex] - this.origin.left; }, // Gets the width of the element at the given index getWidth: function(leftIndex) { this.ensureBuilt(); return this.rights[leftIndex] - this.lefts[leftIndex]; }, // Gets the top offset (from document top) of the element at the given index getTopOffset: function(topIndex) { this.ensureBuilt(); return this.tops[topIndex]; }, // Gets the top position (from offsetParent top) of the element at the given position getTopPosition: function(topIndex) { this.ensureBuilt(); return this.tops[topIndex] - this.origin.top; }, // Gets the bottom offset (from the document top) of the element at the given index. // This value is NOT relative to the offsetParent's bottom edge, like the CSS concept of "bottom" would be. getBottomOffset: function(topIndex) { this.ensureBuilt(); return this.bottoms[topIndex]; }, // Gets the bottom position (from the offsetParent top) of the element at the given index. // This value is NOT relative to the offsetParent's bottom edge, like the CSS concept of "bottom" would be. getBottomPosition: function(topIndex) { this.ensureBuilt(); return this.bottoms[topIndex] - this.origin.top; }, // Gets the height of the element at the given index getHeight: function(topIndex) { this.ensureBuilt(); return this.bottoms[topIndex] - this.tops[topIndex]; }, // Bounding Rect // TODO: decouple this from CoordCache // Compute and return what the elements' bounding rectangle is, from the user's perspective. // Right now, only returns a rectangle if constrained by an overflow:scroll element. // Returns null if there are no elements queryBoundingRect: function() { var scrollParentEl; if (this.els.length > 0) { scrollParentEl = getScrollParent(this.els.eq(0)); if (!scrollParentEl.is(document)) { return getClientRect(scrollParentEl); } } return null; }, isPointInBounds: function(leftOffset, topOffset) { return this.isLeftInBounds(leftOffset) && this.isTopInBounds(topOffset); }, isLeftInBounds: function(leftOffset) { return !this.boundingRect || (leftOffset >= this.boundingRect.left && leftOffset < this.boundingRect.right); }, isTopInBounds: function(topOffset) { return !this.boundingRect || (topOffset >= this.boundingRect.top && topOffset < this.boundingRect.bottom); } }); ;; /* Tracks a drag's mouse movement, firing various handlers ----------------------------------------------------------------------------------------------------------------------*/ // TODO: use Emitter var DragListener = FC.DragListener = Class.extend(ListenerMixin, MouseIgnorerMixin, { options: null, subjectEl: null, // coordinates of the initial mousedown originX: null, originY: null, // the wrapping element that scrolls, or MIGHT scroll if there's overflow. // TODO: do this for wrappers that have overflow:hidden as well. scrollEl: null, isInteracting: false, isDistanceSurpassed: false, isDelayEnded: false, isDragging: false, isTouch: false, delay: null, delayTimeoutId: null, minDistance: null, handleTouchScrollProxy: null, // calls handleTouchScroll, always bound to `this` constructor: function(options) { this.options = options || {}; this.handleTouchScrollProxy = proxy(this, 'handleTouchScroll'); this.initMouseIgnoring(500); }, // Interaction (high-level) // ----------------------------------------------------------------------------------------------------------------- startInteraction: function(ev, extraOptions) { var isTouch = getEvIsTouch(ev); if (ev.type === 'mousedown') { if (this.isIgnoringMouse) { return; } else if (!isPrimaryMouseButton(ev)) { return; } else { ev.preventDefault(); // prevents native selection in most browsers } } if (!this.isInteracting) { // process options extraOptions = extraOptions || {}; this.delay = firstDefined(extraOptions.delay, this.options.delay, 0); this.minDistance = firstDefined(extraOptions.distance, this.options.distance, 0); this.subjectEl = this.options.subjectEl; this.isInteracting = true; this.isTouch = isTouch; this.isDelayEnded = false; this.isDistanceSurpassed = false; this.originX = getEvX(ev); this.originY = getEvY(ev); this.scrollEl = getScrollParent($(ev.target)); this.bindHandlers(); this.initAutoScroll(); this.handleInteractionStart(ev); this.startDelay(ev); if (!this.minDistance) { this.handleDistanceSurpassed(ev); } } }, handleInteractionStart: function(ev) { this.trigger('interactionStart', ev); }, endInteraction: function(ev, isCancelled) { if (this.isInteracting) { this.endDrag(ev); if (this.delayTimeoutId) { clearTimeout(this.delayTimeoutId); this.delayTimeoutId = null; } this.destroyAutoScroll(); this.unbindHandlers(); this.isInteracting = false; this.handleInteractionEnd(ev, isCancelled); // a touchstart+touchend on the same element will result in the following addition simulated events: // mouseover + mouseout + click // let's ignore these bogus events if (this.isTouch) { this.tempIgnoreMouse(); } } }, handleInteractionEnd: function(ev, isCancelled) { this.trigger('interactionEnd', ev, isCancelled || false); }, // Binding To DOM // ----------------------------------------------------------------------------------------------------------------- bindHandlers: function() { var _this = this; var touchStartIgnores = 1; if (this.isTouch) { this.listenTo($(document), { touchmove: this.handleTouchMove, touchend: this.endInteraction, touchcancel: this.endInteraction, // Sometimes touchend doesn't fire // (can't figure out why. touchcancel doesn't fire either. has to do with scrolling?) // If another touchstart happens, we know it's bogus, so cancel the drag. // touchend will continue to be broken until user does a shorttap/scroll, but this is best we can do. touchstart: function(ev) { if (touchStartIgnores) { // bindHandlers is called from within a touchstart, touchStartIgnores--; // and we don't want this to fire immediately, so ignore. } else { _this.endInteraction(ev, true); // isCancelled=true } } }); // listen to ALL scroll actions on the page if ( !bindAnyScroll(this.handleTouchScrollProxy) && // hopefully this works and short-circuits the rest this.scrollEl // otherwise, attach a single handler to this ) { this.listenTo(this.scrollEl, 'scroll', this.handleTouchScroll); } } else { this.listenTo($(document), { mousemove: this.handleMouseMove, mouseup: this.endInteraction }); } this.listenTo($(document), { selectstart: preventDefault, // don't allow selection while dragging contextmenu: preventDefault // long taps would open menu on Chrome dev tools }); }, unbindHandlers: function() { this.stopListeningTo($(document)); // unbind scroll listening unbindAnyScroll(this.handleTouchScrollProxy); if (this.scrollEl) { this.stopListeningTo(this.scrollEl, 'scroll'); } }, // Drag (high-level) // ----------------------------------------------------------------------------------------------------------------- // extraOptions ignored if drag already started startDrag: function(ev, extraOptions) { this.startInteraction(ev, extraOptions); // ensure interaction began if (!this.isDragging) { this.isDragging = true; this.handleDragStart(ev); } }, handleDragStart: function(ev) { this.trigger('dragStart', ev); }, handleMove: function(ev) { var dx = getEvX(ev) - this.originX; var dy = getEvY(ev) - this.originY; var minDistance = this.minDistance; var distanceSq; // current distance from the origin, squared if (!this.isDistanceSurpassed) { distanceSq = dx * dx + dy * dy; if (distanceSq >= minDistance * minDistance) { // use pythagorean theorem this.handleDistanceSurpassed(ev); } } if (this.isDragging) { this.handleDrag(dx, dy, ev); } }, // Called while the mouse is being moved and when we know a legitimate drag is taking place handleDrag: function(dx, dy, ev) { this.trigger('drag', dx, dy, ev); this.updateAutoScroll(ev); // will possibly cause scrolling }, endDrag: function(ev) { if (this.isDragging) { this.isDragging = false; this.handleDragEnd(ev); } }, handleDragEnd: function(ev) { this.trigger('dragEnd', ev); }, // Delay // ----------------------------------------------------------------------------------------------------------------- startDelay: function(initialEv) { var _this = this; if (this.delay) { this.delayTimeoutId = setTimeout(function() { _this.handleDelayEnd(initialEv); }, this.delay); } else { this.handleDelayEnd(initialEv); } }, handleDelayEnd: function(initialEv) { this.isDelayEnded = true; if (this.isDistanceSurpassed) { this.startDrag(initialEv); } }, // Distance // ----------------------------------------------------------------------------------------------------------------- handleDistanceSurpassed: function(ev) { this.isDistanceSurpassed = true; if (this.isDelayEnded) { this.startDrag(ev); } }, // Mouse / Touch // ----------------------------------------------------------------------------------------------------------------- handleTouchMove: function(ev) { // prevent inertia and touchmove-scrolling while dragging if (this.isDragging) { ev.preventDefault(); } this.handleMove(ev); }, handleMouseMove: function(ev) { this.handleMove(ev); }, // Scrolling (unrelated to auto-scroll) // ----------------------------------------------------------------------------------------------------------------- handleTouchScroll: function(ev) { // if the drag is being initiated by touch, but a scroll happens before // the drag-initiating delay is over, cancel the drag if (!this.isDragging) { this.endInteraction(ev, true); // isCancelled=true } }, // Utils // ----------------------------------------------------------------------------------------------------------------- // Triggers a callback. Calls a function in the option hash of the same name. // Arguments beyond the first `name` are forwarded on. trigger: function(name) { if (this.options[name]) { this.options[name].apply(this, Array.prototype.slice.call(arguments, 1)); } // makes _methods callable by event name. TODO: kill this if (this['_' + name]) { this['_' + name].apply(this, Array.prototype.slice.call(arguments, 1)); } } }); ;; /* this.scrollEl is set in DragListener */ DragListener.mixin({ isAutoScroll: false, scrollBounds: null, // { top, bottom, left, right } scrollTopVel: null, // pixels per second scrollLeftVel: null, // pixels per second scrollIntervalId: null, // ID of setTimeout for scrolling animation loop // defaults scrollSensitivity: 30, // pixels from edge for scrolling to start scrollSpeed: 200, // pixels per second, at maximum speed scrollIntervalMs: 50, // millisecond wait between scroll increment initAutoScroll: function() { var scrollEl = this.scrollEl; this.isAutoScroll = this.options.scroll && scrollEl && !scrollEl.is(window) && !scrollEl.is(document); if (this.isAutoScroll) { // debounce makes sure rapid calls don't happen this.listenTo(scrollEl, 'scroll', debounce(this.handleDebouncedScroll, 100)); } }, destroyAutoScroll: function() { this.endAutoScroll(); // kill any animation loop // remove the scroll handler if there is a scrollEl if (this.isAutoScroll) { this.stopListeningTo(this.scrollEl, 'scroll'); // will probably get removed by unbindHandlers too :( } }, // Computes and stores the bounding rectangle of scrollEl computeScrollBounds: function() { if (this.isAutoScroll) { this.scrollBounds = getOuterRect(this.scrollEl); // TODO: use getClientRect in future. but prevents auto scrolling when on top of scrollbars } }, // Called when the dragging is in progress and scrolling should be updated updateAutoScroll: function(ev) { var sensitivity = this.scrollSensitivity; var bounds = this.scrollBounds; var topCloseness, bottomCloseness; var leftCloseness, rightCloseness; var topVel = 0; var leftVel = 0; if (bounds) { // only scroll if scrollEl exists // compute closeness to edges. valid range is from 0.0 - 1.0 topCloseness = (sensitivity - (getEvY(ev) - bounds.top)) / sensitivity; bottomCloseness = (sensitivity - (bounds.bottom - getEvY(ev))) / sensitivity; leftCloseness = (sensitivity - (getEvX(ev) - bounds.left)) / sensitivity; rightCloseness = (sensitivity - (bounds.right - getEvX(ev))) / sensitivity; // translate vertical closeness into velocity. // mouse must be completely in bounds for velocity to happen. if (topCloseness >= 0 && topCloseness <= 1) { topVel = topCloseness * this.scrollSpeed * -1; // negative. for scrolling up } else if (bottomCloseness >= 0 && bottomCloseness <= 1) { topVel = bottomCloseness * this.scrollSpeed; } // translate horizontal closeness into velocity if (leftCloseness >= 0 && leftCloseness <= 1) { leftVel = leftCloseness * this.scrollSpeed * -1; // negative. for scrolling left } else if (rightCloseness >= 0 && rightCloseness <= 1) { leftVel = rightCloseness * this.scrollSpeed; } } this.setScrollVel(topVel, leftVel); }, // Sets the speed-of-scrolling for the scrollEl setScrollVel: function(topVel, leftVel) { this.scrollTopVel = topVel; this.scrollLeftVel = leftVel; this.constrainScrollVel(); // massages into realistic values // if there is non-zero velocity, and an animation loop hasn't already started, then START if ((this.scrollTopVel || this.scrollLeftVel) && !this.scrollIntervalId) { this.scrollIntervalId = setInterval( proxy(this, 'scrollIntervalFunc'), // scope to `this` this.scrollIntervalMs ); } }, // Forces scrollTopVel and scrollLeftVel to be zero if scrolling has already gone all the way constrainScrollVel: function() { var el = this.scrollEl; if (this.scrollTopVel < 0) { // scrolling up? if (el.scrollTop() <= 0) { // already scrolled all the way up? this.scrollTopVel = 0; } } else if (this.scrollTopVel > 0) { // scrolling down? if (el.scrollTop() + el[0].clientHeight >= el[0].scrollHeight) { // already scrolled all the way down? this.scrollTopVel = 0; } } if (this.scrollLeftVel < 0) { // scrolling left? if (el.scrollLeft() <= 0) { // already scrolled all the left? this.scrollLeftVel = 0; } } else if (this.scrollLeftVel > 0) { // scrolling right? if (el.scrollLeft() + el[0].clientWidth >= el[0].scrollWidth) { // already scrolled all the way right? this.scrollLeftVel = 0; } } }, // This function gets called during every iteration of the scrolling animation loop scrollIntervalFunc: function() { var el = this.scrollEl; var frac = this.scrollIntervalMs / 1000; // considering animation frequency, what the vel should be mult'd by // change the value of scrollEl's scroll if (this.scrollTopVel) { el.scrollTop(el.scrollTop() + this.scrollTopVel * frac); } if (this.scrollLeftVel) { el.scrollLeft(el.scrollLeft() + this.scrollLeftVel * frac); } this.constrainScrollVel(); // since the scroll values changed, recompute the velocities // if scrolled all the way, which causes the vels to be zero, stop the animation loop if (!this.scrollTopVel && !this.scrollLeftVel) { this.endAutoScroll(); } }, // Kills any existing scrolling animation loop endAutoScroll: function() { if (this.scrollIntervalId) { clearInterval(this.scrollIntervalId); this.scrollIntervalId = null; this.handleScrollEnd(); } }, // Get called when the scrollEl is scrolled (NOTE: this is delayed via debounce) handleDebouncedScroll: function() { // recompute all coordinates, but *only* if this is *not* part of our scrolling animation if (!this.scrollIntervalId) { this.handleScrollEnd(); } }, // Called when scrolling has stopped, whether through auto scroll, or the user scrolling handleScrollEnd: function() { } }); ;; /* Tracks mouse movements over a component and raises events about which hit the mouse is over. ------------------------------------------------------------------------------------------------------------------------ options: - subjectEl - subjectCenter */ var HitDragListener = DragListener.extend({ component: null, // converts coordinates to hits // methods: prepareHits, releaseHits, queryHit origHit: null, // the hit the mouse was over when listening started hit: null, // the hit the mouse is over coordAdjust: null, // delta that will be added to the mouse coordinates when computing collisions constructor: function(component, options) { DragListener.call(this, options); // call the super-constructor this.component = component; }, // Called when drag listening starts (but a real drag has not necessarily began). // ev might be undefined if dragging was started manually. handleInteractionStart: function(ev) { var subjectEl = this.subjectEl; var subjectRect; var origPoint; var point; this.computeCoords(); if (ev) { origPoint = { left: getEvX(ev), top: getEvY(ev) }; point = origPoint; // constrain the point to bounds of the element being dragged if (subjectEl) { subjectRect = getOuterRect(subjectEl); // used for centering as well point = constrainPoint(point, subjectRect); } this.origHit = this.queryHit(point.left, point.top); // treat the center of the subject as the collision point? if (subjectEl && this.options.subjectCenter) { // only consider the area the subject overlaps the hit. best for large subjects. // TODO: skip this if hit didn't supply left/right/top/bottom if (this.origHit) { subjectRect = intersectRects(this.origHit, subjectRect) || subjectRect; // in case there is no intersection } point = getRectCenter(subjectRect); } this.coordAdjust = diffPoints(point, origPoint); // point - origPoint } else { this.origHit = null; this.coordAdjust = null; } // call the super-method. do it after origHit has been computed DragListener.prototype.handleInteractionStart.apply(this, arguments); }, // Recomputes the drag-critical positions of elements computeCoords: function() { this.component.prepareHits(); this.computeScrollBounds(); // why is this here?????? }, // Called when the actual drag has started handleDragStart: function(ev) { var hit; DragListener.prototype.handleDragStart.apply(this, arguments); // call the super-method // might be different from this.origHit if the min-distance is large hit = this.queryHit(getEvX(ev), getEvY(ev)); // report the initial hit the mouse is over // especially important if no min-distance and drag starts immediately if (hit) { this.handleHitOver(hit); } }, // Called when the drag moves handleDrag: function(dx, dy, ev) { var hit; DragListener.prototype.handleDrag.apply(this, arguments); // call the super-method hit = this.queryHit(getEvX(ev), getEvY(ev)); if (!isHitsEqual(hit, this.hit)) { // a different hit than before? if (this.hit) { this.handleHitOut(); } if (hit) { this.handleHitOver(hit); } } }, // Called when dragging has been stopped handleDragEnd: function() { this.handleHitDone(); DragListener.prototype.handleDragEnd.apply(this, arguments); // call the super-method }, // Called when a the mouse has just moved over a new hit handleHitOver: function(hit) { var isOrig = isHitsEqual(hit, this.origHit); this.hit = hit; this.trigger('hitOver', this.hit, isOrig, this.origHit); }, // Called when the mouse has just moved out of a hit handleHitOut: function() { if (this.hit) { this.trigger('hitOut', this.hit); this.handleHitDone(); this.hit = null; } }, // Called after a hitOut. Also called before a dragStop handleHitDone: function() { if (this.hit) { this.trigger('hitDone', this.hit); } }, // Called when the interaction ends, whether there was a real drag or not handleInteractionEnd: function() { DragListener.prototype.handleInteractionEnd.apply(this, arguments); // call the super-method this.origHit = null; this.hit = null; this.component.releaseHits(); }, // Called when scrolling has stopped, whether through auto scroll, or the user scrolling handleScrollEnd: function() { DragListener.prototype.handleScrollEnd.apply(this, arguments); // call the super-method this.computeCoords(); // hits' absolute positions will be in new places. recompute }, // Gets the hit underneath the coordinates for the given mouse event queryHit: function(left, top) { if (this.coordAdjust) { left += this.coordAdjust.left; top += this.coordAdjust.top; } return this.component.queryHit(left, top); } }); // Returns `true` if the hits are identically equal. `false` otherwise. Must be from the same component. // Two null values will be considered equal, as two "out of the component" states are the same. function isHitsEqual(hit0, hit1) { if (!hit0 && !hit1) { return true; } if (hit0 && hit1) { return hit0.component === hit1.component && isHitPropsWithin(hit0, hit1) && isHitPropsWithin(hit1, hit0); // ensures all props are identical } return false; } // Returns true if all of subHit's non-standard properties are within superHit function isHitPropsWithin(subHit, superHit) { for (var propName in subHit) { if (!/^(component|left|right|top|bottom)$/.test(propName)) { if (subHit[propName] !== superHit[propName]) { return false; } } } return true; } ;; /* Creates a clone of an element and lets it track the mouse as it moves ----------------------------------------------------------------------------------------------------------------------*/ var MouseFollower = Class.extend(ListenerMixin, { options: null, sourceEl: null, // the element that will be cloned and made to look like it is dragging el: null, // the clone of `sourceEl` that will track the mouse parentEl: null, // the element that `el` (the clone) will be attached to // the initial position of el, relative to the offset parent. made to match the initial offset of sourceEl top0: null, left0: null, // the absolute coordinates of the initiating touch/mouse action y0: null, x0: null, // the number of pixels the mouse has moved from its initial position topDelta: null, leftDelta: null, isFollowing: false, isHidden: false, isAnimating: false, // doing the revert animation? constructor: function(sourceEl, options) { this.options = options = options || {}; this.sourceEl = sourceEl; this.parentEl = options.parentEl ? $(options.parentEl) : sourceEl.parent(); // default to sourceEl's parent }, // Causes the element to start following the mouse start: function(ev) { if (!this.isFollowing) { this.isFollowing = true; this.y0 = getEvY(ev); this.x0 = getEvX(ev); this.topDelta = 0; this.leftDelta = 0; if (!this.isHidden) { this.updatePosition(); } if (getEvIsTouch(ev)) { this.listenTo($(document), 'touchmove', this.handleMove); } else { this.listenTo($(document), 'mousemove', this.handleMove); } } }, // Causes the element to stop following the mouse. If shouldRevert is true, will animate back to original position. // `callback` gets invoked when the animation is complete. If no animation, it is invoked immediately. stop: function(shouldRevert, callback) { var _this = this; var revertDuration = this.options.revertDuration; function complete() { // might be called by .animate(), which might change `this` context _this.isAnimating = false; _this.removeElement(); _this.top0 = _this.left0 = null; // reset state for future updatePosition calls if (callback) { callback(); } } if (this.isFollowing && !this.isAnimating) { // disallow more than one stop animation at a time this.isFollowing = false; this.stopListeningTo($(document)); if (shouldRevert && revertDuration && !this.isHidden) { // do a revert animation? this.isAnimating = true; this.el.animate({ top: this.top0, left: this.left0 }, { duration: revertDuration, complete: complete }); } else { complete(); } } }, // Gets the tracking element. Create it if necessary getEl: function() { var el = this.el; if (!el) { el = this.el = this.sourceEl.clone() .addClass(this.options.additionalClass || '') .css({ position: 'absolute', visibility: '', // in case original element was hidden (commonly through hideEvents()) display: this.isHidden ? 'none' : '', // for when initially hidden margin: 0, right: 'auto', // erase and set width instead bottom: 'auto', // erase and set height instead width: this.sourceEl.width(), // explicit height in case there was a 'right' value height: this.sourceEl.height(), // explicit width in case there was a 'bottom' value opacity: this.options.opacity || '', zIndex: this.options.zIndex }); // we don't want long taps or any mouse interaction causing selection/menus. // would use preventSelection(), but that prevents selectstart, causing problems. el.addClass('fc-unselectable'); el.appendTo(this.parentEl); } return el; }, // Removes the tracking element if it has already been created removeElement: function() { if (this.el) { this.el.remove(); this.el = null; } }, // Update the CSS position of the tracking element updatePosition: function() { var sourceOffset; var origin; this.getEl(); // ensure this.el // make sure origin info was computed if (this.top0 === null) { sourceOffset = this.sourceEl.offset(); origin = this.el.offsetParent().offset(); this.top0 = sourceOffset.top - origin.top; this.left0 = sourceOffset.left - origin.left; } this.el.css({ top: this.top0 + this.topDelta, left: this.left0 + this.leftDelta }); }, // Gets called when the user moves the mouse handleMove: function(ev) { this.topDelta = getEvY(ev) - this.y0; this.leftDelta = getEvX(ev) - this.x0; if (!this.isHidden) { this.updatePosition(); } }, // Temporarily makes the tracking element invisible. Can be called before following starts hide: function() { if (!this.isHidden) { this.isHidden = true; if (this.el) { this.el.hide(); } } }, // Show the tracking element after it has been temporarily hidden show: function() { if (this.isHidden) { this.isHidden = false; this.updatePosition(); this.getEl().show(); } } }); ;; /* An abstract class comprised of a "grid" of areas that each represent a specific datetime ----------------------------------------------------------------------------------------------------------------------*/ var Grid = FC.Grid = Class.extend(ListenerMixin, MouseIgnorerMixin, { // self-config, overridable by subclasses hasDayInteractions: true, // can user click/select ranges of time? view: null, // a View object isRTL: null, // shortcut to the view's isRTL option start: null, end: null, el: null, // the containing element elsByFill: null, // a hash of jQuery element sets used for rendering each fill. Keyed by fill name. // derived from options eventTimeFormat: null, displayEventTime: null, displayEventEnd: null, minResizeDuration: null, // TODO: hack. set by subclasses. minumum event resize duration // if defined, holds the unit identified (ex: "year" or "month") that determines the level of granularity // of the date areas. if not defined, assumes to be day and time granularity. // TODO: port isTimeScale into same system? largeUnit: null, dayDragListener: null, segDragListener: null, segResizeListener: null, externalDragListener: null, constructor: function(view) { this.view = view; this.isRTL = view.opt('isRTL'); this.elsByFill = {}; this.dayDragListener = this.buildDayDragListener(); this.initMouseIgnoring(); }, /* Options ------------------------------------------------------------------------------------------------------------------*/ // Generates the format string used for event time text, if not explicitly defined by 'timeFormat' computeEventTimeFormat: function() { return this.view.opt('smallTimeFormat'); }, // Determines whether events should have their end times displayed, if not explicitly defined by 'displayEventTime'. // Only applies to non-all-day events. computeDisplayEventTime: function() { return true; }, // Determines whether events should have their end times displayed, if not explicitly defined by 'displayEventEnd' computeDisplayEventEnd: function() { return true; }, /* Dates ------------------------------------------------------------------------------------------------------------------*/ // Tells the grid about what period of time to display. // Any date-related internal data should be generated. setRange: function(range) { this.start = range.start.clone(); this.end = range.end.clone(); this.rangeUpdated(); this.processRangeOptions(); }, // Called when internal variables that rely on the range should be updated rangeUpdated: function() { }, // Updates values that rely on options and also relate to range processRangeOptions: function() { var view = this.view; var displayEventTime; var displayEventEnd; this.eventTimeFormat = view.opt('eventTimeFormat') || view.opt('timeFormat') || // deprecated this.computeEventTimeFormat(); displayEventTime = view.opt('displayEventTime'); if (displayEventTime == null) { displayEventTime = this.computeDisplayEventTime(); // might be based off of range } displayEventEnd = view.opt('displayEventEnd'); if (displayEventEnd == null) { displayEventEnd = this.computeDisplayEventEnd(); // might be based off of range } this.displayEventTime = displayEventTime; this.displayEventEnd = displayEventEnd; }, // Converts a span (has unzoned start/end and any other grid-specific location information) // into an array of segments (pieces of events whose format is decided by the grid). spanToSegs: function(span) { // subclasses must implement }, // Diffs the two dates, returning a duration, based on granularity of the grid // TODO: port isTimeScale into this system? diffDates: function(a, b) { if (this.largeUnit) { return diffByUnit(a, b, this.largeUnit); } else { return diffDayTime(a, b); } }, /* Hit Area ------------------------------------------------------------------------------------------------------------------*/ // Called before one or more queryHit calls might happen. Should prepare any cached coordinates for queryHit prepareHits: function() { }, // Called when queryHit calls have subsided. Good place to clear any coordinate caches. releaseHits: function() { }, // Given coordinates from the topleft of the document, return data about the date-related area underneath. // Can return an object with arbitrary properties (although top/right/left/bottom are encouraged). // Must have a `grid` property, a reference to this current grid. TODO: avoid this // The returned object will be processed by getHitSpan and getHitEl. queryHit: function(leftOffset, topOffset) { }, // Given position-level information about a date-related area within the grid, // should return an object with at least a start/end date. Can provide other information as well. getHitSpan: function(hit) { }, // Given position-level information about a date-related area within the grid, // should return a jQuery element that best represents it. passed to dayClick callback. getHitEl: function(hit) { }, /* Rendering ------------------------------------------------------------------------------------------------------------------*/ // Sets the container element that the grid should render inside of. // Does other DOM-related initializations. setElement: function(el) { this.el = el; if (this.hasDayInteractions) { preventSelection(el); this.bindDayHandler('touchstart', this.dayTouchStart); this.bindDayHandler('mousedown', this.dayMousedown); } // attach event-element-related handlers. in Grid.events // same garbage collection note as above. this.bindSegHandlers(); this.bindGlobalHandlers(); }, bindDayHandler: function(name, handler) { var _this = this; // attach a handler to the grid's root element. // jQuery will take care of unregistering them when removeElement gets called. this.el.on(name, function(ev) { if ( !$(ev.target).is( _this.segSelector + ',' + // directly on an event element _this.segSelector + ' *,' + // within an event element '.fc-more,' + // a "more.." link 'a[data-goto]' // a clickable nav link ) ) { return handler.call(_this, ev); } }); }, // Removes the grid's container element from the DOM. Undoes any other DOM-related attachments. // DOES NOT remove any content beforehand (doesn't clear events or call unrenderDates), unlike View removeElement: function() { this.unbindGlobalHandlers(); this.clearDragListeners(); this.el.remove(); // NOTE: we don't null-out this.el for the same reasons we don't do it within View::removeElement }, // Renders the basic structure of grid view before any content is rendered renderSkeleton: function() { // subclasses should implement }, // Renders the grid's date-related content (like areas that represent days/times). // Assumes setRange has already been called and the skeleton has already been rendered. renderDates: function() { // subclasses should implement }, // Unrenders the grid's date-related content unrenderDates: function() { // subclasses should implement }, /* Handlers ------------------------------------------------------------------------------------------------------------------*/ // Binds DOM handlers to elements that reside outside the grid, such as the document bindGlobalHandlers: function() { this.listenTo($(document), { dragstart: this.externalDragStart, // jqui sortstart: this.externalDragStart // jqui }); }, // Unbinds DOM handlers from elements that reside outside the grid unbindGlobalHandlers: function() { this.stopListeningTo($(document)); }, // Process a mousedown on an element that represents a day. For day clicking and selecting. dayMousedown: function(ev) { if (!this.isIgnoringMouse) { this.dayDragListener.startInteraction(ev, { //distance: 5, // needs more work if we want dayClick to fire correctly }); } }, dayTouchStart: function(ev) { var view = this.view; var selectLongPressDelay = view.opt('selectLongPressDelay'); // HACK to prevent a user's clickaway for unselecting a range or an event // from causing a dayClick. if (view.isSelected || view.selectedEvent) { this.tempIgnoreMouse(); } if (selectLongPressDelay == null) { selectLongPressDelay = view.opt('longPressDelay'); // fallback } this.dayDragListener.startInteraction(ev, { delay: selectLongPressDelay }); }, // Creates a listener that tracks the user's drag across day elements. // For day clicking and selecting. buildDayDragListener: function() { var _this = this; var view = this.view; var isSelectable = view.opt('selectable'); var dayClickHit; // null if invalid dayClick var selectionSpan; // null if invalid selection // this listener tracks a mousedown on a day element, and a subsequent drag. // if the drag ends on the same day, it is a 'dayClick'. // if 'selectable' is enabled, this listener also detects selections. var dragListener = new HitDragListener(this, { scroll: view.opt('dragScroll'), interactionStart: function() { dayClickHit = dragListener.origHit; // for dayClick, where no dragging happens selectionSpan = null; }, dragStart: function() { view.unselect(); // since we could be rendering a new selection, we want to clear any old one }, hitOver: function(hit, isOrig, origHit) { if (origHit) { // click needs to have started on a hit // if user dragged to another cell at any point, it can no longer be a dayClick if (!isOrig) { dayClickHit = null; } if (isSelectable) { selectionSpan = _this.computeSelection( _this.getHitSpan(origHit), _this.getHitSpan(hit) ); if (selectionSpan) { _this.renderSelection(selectionSpan); } else if (selectionSpan === false) { disableCursor(); } } } }, hitOut: function() { // called before mouse moves to a different hit OR moved out of all hits dayClickHit = null; selectionSpan = null; _this.unrenderSelection(); }, hitDone: function() { // called after a hitOut OR before a dragEnd enableCursor(); }, interactionEnd: function(ev, isCancelled) { if (!isCancelled) { if ( dayClickHit && !_this.isIgnoringMouse // see hack in dayTouchStart ) { view.triggerDayClick( _this.getHitSpan(dayClickHit), _this.getHitEl(dayClickHit), ev ); } if (selectionSpan) { // the selection will already have been rendered. just report it view.reportSelection(selectionSpan, ev); } } } }); return dragListener; }, // Kills all in-progress dragging. // Useful for when public API methods that result in re-rendering are invoked during a drag. // Also useful for when touch devices misbehave and don't fire their touchend. clearDragListeners: function() { this.dayDragListener.endInteraction(); if (this.segDragListener) { this.segDragListener.endInteraction(); // will clear this.segDragListener } if (this.segResizeListener) { this.segResizeListener.endInteraction(); // will clear this.segResizeListener } if (this.externalDragListener) { this.externalDragListener.endInteraction(); // will clear this.externalDragListener } }, /* Event Helper ------------------------------------------------------------------------------------------------------------------*/ // TODO: should probably move this to Grid.events, like we did event dragging / resizing // Renders a mock event at the given event location, which contains zoned start/end properties. // Returns all mock event elements. renderEventLocationHelper: function(eventLocation, sourceSeg) { var fakeEvent = this.fabricateHelperEvent(eventLocation, sourceSeg); return this.renderHelper(fakeEvent, sourceSeg); // do the actual rendering }, // Builds a fake event given zoned event date properties and a segment is should be inspired from. // The range's end can be null, in which case the mock event that is rendered will have a null end time. // `sourceSeg` is the internal segment object involved in the drag. If null, something external is dragging. fabricateHelperEvent: function(eventLocation, sourceSeg) { var fakeEvent = sourceSeg ? createObject(sourceSeg.event) : {}; // mask the original event object if possible fakeEvent.start = eventLocation.start.clone(); fakeEvent.end = eventLocation.end ? eventLocation.end.clone() : null; fakeEvent.allDay = null; // force it to be freshly computed by normalizeEventDates this.view.calendar.normalizeEventDates(fakeEvent); // this extra className will be useful for differentiating real events from mock events in CSS fakeEvent.className = (fakeEvent.className || []).concat('fc-helper'); // if something external is being dragged in, don't render a resizer if (!sourceSeg) { fakeEvent.editable = false; } return fakeEvent; }, // Renders a mock event. Given zoned event date properties. // Must return all mock event elements. renderHelper: function(eventLocation, sourceSeg) { // subclasses must implement }, // Unrenders a mock event unrenderHelper: function() { // subclasses must implement }, /* Selection ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of a selection. Will highlight by default but can be overridden by subclasses. // Given a span (unzoned start/end and other misc data) renderSelection: function(span) { this.renderHighlight(span); }, // Unrenders any visual indications of a selection. Will unrender a highlight by default. unrenderSelection: function() { this.unrenderHighlight(); }, // Given the first and last date-spans of a selection, returns another date-span object. // Subclasses can override and provide additional data in the span object. Will be passed to renderSelection(). // Will return false if the selection is invalid and this should be indicated to the user. // Will return null/undefined if a selection invalid but no error should be reported. computeSelection: function(span0, span1) { var span = this.computeSelectionSpan(span0, span1); if (span && !this.view.calendar.isSelectionSpanAllowed(span)) { return false; } return span; }, // Given two spans, must return the combination of the two. // TODO: do this separation of concerns (combining VS validation) for event dnd/resize too. computeSelectionSpan: function(span0, span1) { var dates = [ span0.start, span0.end, span1.start, span1.end ]; dates.sort(compareNumbers); // sorts chronologically. works with Moments return { start: dates[0].clone(), end: dates[3].clone() }; }, /* Highlight ------------------------------------------------------------------------------------------------------------------*/ // Renders an emphasis on the given date range. Given a span (unzoned start/end and other misc data) renderHighlight: function(span) { this.renderFill('highlight', this.spanToSegs(span)); }, // Unrenders the emphasis on a date range unrenderHighlight: function() { this.unrenderFill('highlight'); }, // Generates an array of classNames for rendering the highlight. Used by the fill system. highlightSegClasses: function() { return [ 'fc-highlight' ]; }, /* Business Hours ------------------------------------------------------------------------------------------------------------------*/ renderBusinessHours: function() { }, unrenderBusinessHours: function() { }, /* Now Indicator ------------------------------------------------------------------------------------------------------------------*/ getNowIndicatorUnit: function() { }, renderNowIndicator: function(date) { }, unrenderNowIndicator: function() { }, /* Fill System (highlight, background events, business hours) -------------------------------------------------------------------------------------------------------------------- TODO: remove this system. like we did in TimeGrid */ // Renders a set of rectangles over the given segments of time. // MUST RETURN a subset of segs, the segs that were actually rendered. // Responsible for populating this.elsByFill. TODO: better API for expressing this requirement renderFill: function(type, segs) { // subclasses must implement }, // Unrenders a specific type of fill that is currently rendered on the grid unrenderFill: function(type) { var el = this.elsByFill[type]; if (el) { el.remove(); delete this.elsByFill[type]; } }, // Renders and assigns an `el` property for each fill segment. Generic enough to work with different types. // Only returns segments that successfully rendered. // To be harnessed by renderFill (implemented by subclasses). // Analagous to renderFgSegEls. renderFillSegEls: function(type, segs) { var _this = this; var segElMethod = this[type + 'SegEl']; var html = ''; var renderedSegs = []; var i; if (segs.length) { // build a large concatenation of segment HTML for (i = 0; i < segs.length; i++) { html += this.fillSegHtml(type, segs[i]); } // Grab individual elements from the combined HTML string. Use each as the default rendering. // Then, compute the 'el' for each segment. $(html).each(function(i, node) { var seg = segs[i]; var el = $(node); // allow custom filter methods per-type if (segElMethod) { el = segElMethod.call(_this, seg, el); } if (el) { // custom filters did not cancel the render el = $(el); // allow custom filter to return raw DOM node // correct element type? (would be bad if a non-TD were inserted into a table for example) if (el.is(_this.fillSegTag)) { seg.el = el; renderedSegs.push(seg); } } }); } return renderedSegs; }, fillSegTag: 'div', // subclasses can override // Builds the HTML needed for one fill segment. Generic enough to work with different types. fillSegHtml: function(type, seg) { // custom hooks per-type var classesMethod = this[type + 'SegClasses']; var cssMethod = this[type + 'SegCss']; var classes = classesMethod ? classesMethod.call(this, seg) : []; var css = cssToStr(cssMethod ? cssMethod.call(this, seg) : {}); return '<' + this.fillSegTag + (classes.length ? ' class="' + classes.join(' ') + '"' : '') + (css ? ' style="' + css + '"' : '') + ' />'; }, /* Generic rendering utilities for subclasses ------------------------------------------------------------------------------------------------------------------*/ // Computes HTML classNames for a single-day element getDayClasses: function(date, noThemeHighlight) { var view = this.view; var today = view.calendar.getNow(); var classes = [ 'fc-' + dayIDs[date.day()] ]; if ( view.intervalDuration.as('months') == 1 && date.month() != view.intervalStart.month() ) { classes.push('fc-other-month'); } if (date.isSame(today, 'day')) { classes.push('fc-today'); if (noThemeHighlight !== true) { classes.push(view.highlightStateClass); } } else if (date < today) { classes.push('fc-past'); } else { classes.push('fc-future'); } return classes; } }); ;; /* Event-rendering and event-interaction methods for the abstract Grid class ----------------------------------------------------------------------------------------------------------------------*/ Grid.mixin({ // self-config, overridable by subclasses segSelector: '.fc-event-container > *', // what constitutes an event element? mousedOverSeg: null, // the segment object the user's mouse is over. null if over nothing isDraggingSeg: false, // is a segment being dragged? boolean isResizingSeg: false, // is a segment being resized? boolean isDraggingExternal: false, // jqui-dragging an external element? boolean segs: null, // the *event* segments currently rendered in the grid. TODO: rename to `eventSegs` // Renders the given events onto the grid renderEvents: function(events) { var bgEvents = []; var fgEvents = []; var i; for (i = 0; i < events.length; i++) { (isBgEvent(events[i]) ? bgEvents : fgEvents).push(events[i]); } this.segs = [].concat( // record all segs this.renderBgEvents(bgEvents), this.renderFgEvents(fgEvents) ); }, renderBgEvents: function(events) { var segs = this.eventsToSegs(events); // renderBgSegs might return a subset of segs, segs that were actually rendered return this.renderBgSegs(segs) || segs; }, renderFgEvents: function(events) { var segs = this.eventsToSegs(events); // renderFgSegs might return a subset of segs, segs that were actually rendered return this.renderFgSegs(segs) || segs; }, // Unrenders all events currently rendered on the grid unrenderEvents: function() { this.handleSegMouseout(); // trigger an eventMouseout if user's mouse is over an event this.clearDragListeners(); this.unrenderFgSegs(); this.unrenderBgSegs(); this.segs = null; }, // Retrieves all rendered segment objects currently rendered on the grid getEventSegs: function() { return this.segs || []; }, /* Foreground Segment Rendering ------------------------------------------------------------------------------------------------------------------*/ // Renders foreground event segments onto the grid. May return a subset of segs that were rendered. renderFgSegs: function(segs) { // subclasses must implement }, // Unrenders all currently rendered foreground segments unrenderFgSegs: function() { // subclasses must implement }, // Renders and assigns an `el` property for each foreground event segment. // Only returns segments that successfully rendered. // A utility that subclasses may use. renderFgSegEls: function(segs, disableResizing) { var view = this.view; var html = ''; var renderedSegs = []; var i; if (segs.length) { // don't build an empty html string // build a large concatenation of event segment HTML for (i = 0; i < segs.length; i++) { html += this.fgSegHtml(segs[i], disableResizing); } // Grab individual elements from the combined HTML string. Use each as the default rendering. // Then, compute the 'el' for each segment. An el might be null if the eventRender callback returned false. $(html).each(function(i, node) { var seg = segs[i]; var el = view.resolveEventEl(seg.event, $(node)); if (el) { el.data('fc-seg', seg); // used by handlers seg.el = el; renderedSegs.push(seg); } }); } return renderedSegs; }, // Generates the HTML for the default rendering of a foreground event segment. Used by renderFgSegEls() fgSegHtml: function(seg, disableResizing) { // subclasses should implement }, /* Background Segment Rendering ------------------------------------------------------------------------------------------------------------------*/ // Renders the given background event segments onto the grid. // Returns a subset of the segs that were actually rendered. renderBgSegs: function(segs) { return this.renderFill('bgEvent', segs); }, // Unrenders all the currently rendered background event segments unrenderBgSegs: function() { this.unrenderFill('bgEvent'); }, // Renders a background event element, given the default rendering. Called by the fill system. bgEventSegEl: function(seg, el) { return this.view.resolveEventEl(seg.event, el); // will filter through eventRender }, // Generates an array of classNames to be used for the default rendering of a background event. // Called by fillSegHtml. bgEventSegClasses: function(seg) { var event = seg.event; var source = event.source || {}; return [ 'fc-bgevent' ].concat( event.className, source.className || [] ); }, // Generates a semicolon-separated CSS string to be used for the default rendering of a background event. // Called by fillSegHtml. bgEventSegCss: function(seg) { return { 'background-color': this.getSegSkinCss(seg)['background-color'] }; }, // Generates an array of classNames to be used for the rendering business hours overlay. Called by the fill system. // Called by fillSegHtml. businessHoursSegClasses: function(seg) { return [ 'fc-nonbusiness', 'fc-bgevent' ]; }, /* Business Hours ------------------------------------------------------------------------------------------------------------------*/ // Compute business hour segs for the grid's current date range. // Caller must ask if whole-day business hours are needed. // If no `businessHours` configuration value is specified, assumes the calendar default. buildBusinessHourSegs: function(wholeDay, businessHours) { return this.eventsToSegs( this.buildBusinessHourEvents(wholeDay, businessHours) ); }, // Compute business hour *events* for the grid's current date range. // Caller must ask if whole-day business hours are needed. // If no `businessHours` configuration value is specified, assumes the calendar default. buildBusinessHourEvents: function(wholeDay, businessHours) { var calendar = this.view.calendar; var events; if (businessHours == null) { // fallback // access from calendawr. don't access from view. doesn't update with dynamic options. businessHours = calendar.options.businessHours; } events = calendar.computeBusinessHourEvents(wholeDay, businessHours); // HACK. Eventually refactor business hours "events" system. // If no events are given, but businessHours is activated, this means the entire visible range should be // marked as *not* business-hours, via inverse-background rendering. if (!events.length && businessHours) { events = [ $.extend({}, BUSINESS_HOUR_EVENT_DEFAULTS, { start: this.view.end, // guaranteed out-of-range end: this.view.end, // " dow: null }) ]; } return events; }, /* Handlers ------------------------------------------------------------------------------------------------------------------*/ // Attaches event-element-related handlers for *all* rendered event segments of the view. bindSegHandlers: function() { this.bindSegHandlersToEl(this.el); }, // Attaches event-element-related handlers to an arbitrary container element. leverages bubbling. bindSegHandlersToEl: function(el) { this.bindSegHandlerToEl(el, 'touchstart', this.handleSegTouchStart); this.bindSegHandlerToEl(el, 'touchend', this.handleSegTouchEnd); this.bindSegHandlerToEl(el, 'mouseenter', this.handleSegMouseover); this.bindSegHandlerToEl(el, 'mouseleave', this.handleSegMouseout); this.bindSegHandlerToEl(el, 'mousedown', this.handleSegMousedown); this.bindSegHandlerToEl(el, 'click', this.handleSegClick); }, // Executes a handler for any a user-interaction on a segment. // Handler gets called with (seg, ev), and with the `this` context of the Grid bindSegHandlerToEl: function(el, name, handler) { var _this = this; el.on(name, this.segSelector, function(ev) { var seg = $(this).data('fc-seg'); // grab segment data. put there by View::renderEvents // only call the handlers if there is not a drag/resize in progress if (seg && !_this.isDraggingSeg && !_this.isResizingSeg) { return handler.call(_this, seg, ev); // context will be the Grid } }); }, handleSegClick: function(seg, ev) { var res = this.view.publiclyTrigger('eventClick', seg.el[0], seg.event, ev); // can return `false` to cancel if (res === false) { ev.preventDefault(); } }, // Updates internal state and triggers handlers for when an event element is moused over handleSegMouseover: function(seg, ev) { if ( !this.isIgnoringMouse && !this.mousedOverSeg ) { this.mousedOverSeg = seg; if (this.view.isEventResizable(seg.event)) { seg.el.addClass('fc-allow-mouse-resize'); } this.view.publiclyTrigger('eventMouseover', seg.el[0], seg.event, ev); } }, // Updates internal state and triggers handlers for when an event element is moused out. // Can be given no arguments, in which case it will mouseout the segment that was previously moused over. handleSegMouseout: function(seg, ev) { ev = ev || {}; // if given no args, make a mock mouse event if (this.mousedOverSeg) { seg = seg || this.mousedOverSeg; // if given no args, use the currently moused-over segment this.mousedOverSeg = null; if (this.view.isEventResizable(seg.event)) { seg.el.removeClass('fc-allow-mouse-resize'); } this.view.publiclyTrigger('eventMouseout', seg.el[0], seg.event, ev); } }, handleSegMousedown: function(seg, ev) { var isResizing = this.startSegResize(seg, ev, { distance: 5 }); if (!isResizing && this.view.isEventDraggable(seg.event)) { this.buildSegDragListener(seg) .startInteraction(ev, { distance: 5 }); } }, handleSegTouchStart: function(seg, ev) { var view = this.view; var event = seg.event; var isSelected = view.isEventSelected(event); var isDraggable = view.isEventDraggable(event); var isResizable = view.isEventResizable(event); var isResizing = false; var dragListener; var eventLongPressDelay; if (isSelected && isResizable) { // only allow resizing of the event is selected isResizing = this.startSegResize(seg, ev); } if (!isResizing && (isDraggable || isResizable)) { // allowed to be selected? eventLongPressDelay = view.opt('eventLongPressDelay'); if (eventLongPressDelay == null) { eventLongPressDelay = view.opt('longPressDelay'); // fallback } dragListener = isDraggable ? this.buildSegDragListener(seg) : this.buildSegSelectListener(seg); // seg isn't draggable, but still needs to be selected dragListener.startInteraction(ev, { // won't start if already started delay: isSelected ? 0 : eventLongPressDelay // do delay if not already selected }); } // a long tap simulates a mouseover. ignore this bogus mouseover. this.tempIgnoreMouse(); }, handleSegTouchEnd: function(seg, ev) { // touchstart+touchend = click, which simulates a mouseover. // ignore this bogus mouseover. this.tempIgnoreMouse(); }, // returns boolean whether resizing actually started or not. // assumes the seg allows resizing. // `dragOptions` are optional. startSegResize: function(seg, ev, dragOptions) { if ($(ev.target).is('.fc-resizer')) { this.buildSegResizeListener(seg, $(ev.target).is('.fc-start-resizer')) .startInteraction(ev, dragOptions); return true; } return false; }, /* Event Dragging ------------------------------------------------------------------------------------------------------------------*/ // Builds a listener that will track user-dragging on an event segment. // Generic enough to work with any type of Grid. // Has side effect of setting/unsetting `segDragListener` buildSegDragListener: function(seg) { var _this = this; var view = this.view; var calendar = view.calendar; var el = seg.el; var event = seg.event; var isDragging; var mouseFollower; // A clone of the original element that will move with the mouse var dropLocation; // zoned event date properties if (this.segDragListener) { return this.segDragListener; } // Tracks mouse movement over the *view's* coordinate map. Allows dragging and dropping between subcomponents // of the view. var dragListener = this.segDragListener = new HitDragListener(view, { scroll: view.opt('dragScroll'), subjectEl: el, subjectCenter: true, interactionStart: function(ev) { seg.component = _this; // for renderDrag isDragging = false; mouseFollower = new MouseFollower(seg.el, { additionalClass: 'fc-dragging', parentEl: view.el, opacity: dragListener.isTouch ? null : view.opt('dragOpacity'), revertDuration: view.opt('dragRevertDuration'), zIndex: 2 // one above the .fc-view }); mouseFollower.hide(); // don't show until we know this is a real drag mouseFollower.start(ev); }, dragStart: function(ev) { if (dragListener.isTouch && !view.isEventSelected(event)) { // if not previously selected, will fire after a delay. then, select the event view.selectEvent(event); } isDragging = true; _this.handleSegMouseout(seg, ev); // ensure a mouseout on the manipulated event has been reported _this.segDragStart(seg, ev); view.hideEvent(event); // hide all event segments. our mouseFollower will take over }, hitOver: function(hit, isOrig, origHit) { var dragHelperEls; // starting hit could be forced (DayGrid.limit) if (seg.hit) { origHit = seg.hit; } // since we are querying the parent view, might not belong to this grid dropLocation = _this.computeEventDrop( origHit.component.getHitSpan(origHit), hit.component.getHitSpan(hit), event ); if (dropLocation && !calendar.isEventSpanAllowed(_this.eventToSpan(dropLocation), event)) { disableCursor(); dropLocation = null; } // if a valid drop location, have the subclass render a visual indication if (dropLocation && (dragHelperEls = view.renderDrag(dropLocation, seg))) { dragHelperEls.addClass('fc-dragging'); if (!dragListener.isTouch) { _this.applyDragOpacity(dragHelperEls); } mouseFollower.hide(); // if the subclass is already using a mock event "helper", hide our own } else { mouseFollower.show(); // otherwise, have the helper follow the mouse (no snapping) } if (isOrig) { dropLocation = null; // needs to have moved hits to be a valid drop } }, hitOut: function() { // called before mouse moves to a different hit OR moved out of all hits view.unrenderDrag(); // unrender whatever was done in renderDrag mouseFollower.show(); // show in case we are moving out of all hits dropLocation = null; }, hitDone: function() { // Called after a hitOut OR before a dragEnd enableCursor(); }, interactionEnd: function(ev) { delete seg.component; // prevent side effects // do revert animation if hasn't changed. calls a callback when finished (whether animation or not) mouseFollower.stop(!dropLocation, function() { if (isDragging) { view.unrenderDrag(); _this.segDragStop(seg, ev); } if (dropLocation) { // no need to re-show original, will rerender all anyways. esp important if eventRenderWait view.reportEventDrop(event, dropLocation, _this.largeUnit, el, ev); } else { view.showEvent(event); } }); _this.segDragListener = null; } }); return dragListener; }, // seg isn't draggable, but let's use a generic DragListener // simply for the delay, so it can be selected. // Has side effect of setting/unsetting `segDragListener` buildSegSelectListener: function(seg) { var _this = this; var view = this.view; var event = seg.event; if (this.segDragListener) { return this.segDragListener; } var dragListener = this.segDragListener = new DragListener({ dragStart: function(ev) { if (dragListener.isTouch && !view.isEventSelected(event)) { // if not previously selected, will fire after a delay. then, select the event view.selectEvent(event); } }, interactionEnd: function(ev) { _this.segDragListener = null; } }); return dragListener; }, // Called before event segment dragging starts segDragStart: function(seg, ev) { this.isDraggingSeg = true; this.view.publiclyTrigger('eventDragStart', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy }, // Called after event segment dragging stops segDragStop: function(seg, ev) { this.isDraggingSeg = false; this.view.publiclyTrigger('eventDragStop', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy }, // Given the spans an event drag began, and the span event was dropped, calculates the new zoned start/end/allDay // values for the event. Subclasses may override and set additional properties to be used by renderDrag. // A falsy returned value indicates an invalid drop. // DOES NOT consider overlap/constraint. computeEventDrop: function(startSpan, endSpan, event) { var calendar = this.view.calendar; var dragStart = startSpan.start; var dragEnd = endSpan.start; var delta; var dropLocation; // zoned event date properties if (dragStart.hasTime() === dragEnd.hasTime()) { delta = this.diffDates(dragEnd, dragStart); // if an all-day event was in a timed area and it was dragged to a different time, // guarantee an end and adjust start/end to have times if (event.allDay && durationHasTime(delta)) { dropLocation = { start: event.start.clone(), end: calendar.getEventEnd(event), // will be an ambig day allDay: false // for normalizeEventTimes }; calendar.normalizeEventTimes(dropLocation); } // othewise, work off existing values else { dropLocation = pluckEventDateProps(event); } dropLocation.start.add(delta); if (dropLocation.end) { dropLocation.end.add(delta); } } else { // if switching from day <-> timed, start should be reset to the dropped date, and the end cleared dropLocation = { start: dragEnd.clone(), end: null, // end should be cleared allDay: !dragEnd.hasTime() }; } return dropLocation; }, // Utility for apply dragOpacity to a jQuery set applyDragOpacity: function(els) { var opacity = this.view.opt('dragOpacity'); if (opacity != null) { els.css('opacity', opacity); } }, /* External Element Dragging ------------------------------------------------------------------------------------------------------------------*/ // Called when a jQuery UI drag is initiated anywhere in the DOM externalDragStart: function(ev, ui) { var view = this.view; var el; var accept; if (view.opt('droppable')) { // only listen if this setting is on el = $((ui ? ui.item : null) || ev.target); // Test that the dragged element passes the dropAccept selector or filter function. // FYI, the default is "*" (matches all) accept = view.opt('dropAccept'); if ($.isFunction(accept) ? accept.call(el[0], el) : el.is(accept)) { if (!this.isDraggingExternal) { // prevent double-listening if fired twice this.listenToExternalDrag(el, ev, ui); } } } }, // Called when a jQuery UI drag starts and it needs to be monitored for dropping listenToExternalDrag: function(el, ev, ui) { var _this = this; var calendar = this.view.calendar; var meta = getDraggedElMeta(el); // extra data about event drop, including possible event to create var dropLocation; // a null value signals an unsuccessful drag // listener that tracks mouse movement over date-associated pixel regions var dragListener = _this.externalDragListener = new HitDragListener(this, { interactionStart: function() { _this.isDraggingExternal = true; }, hitOver: function(hit) { dropLocation = _this.computeExternalDrop( hit.component.getHitSpan(hit), // since we are querying the parent view, might not belong to this grid meta ); if ( // invalid hit? dropLocation && !calendar.isExternalSpanAllowed(_this.eventToSpan(dropLocation), dropLocation, meta.eventProps) ) { disableCursor(); dropLocation = null; } if (dropLocation) { _this.renderDrag(dropLocation); // called without a seg parameter } }, hitOut: function() { dropLocation = null; // signal unsuccessful }, hitDone: function() { // Called after a hitOut OR before a dragEnd enableCursor(); _this.unrenderDrag(); }, interactionEnd: function(ev) { if (dropLocation) { // element was dropped on a valid hit _this.view.reportExternalDrop(meta, dropLocation, el, ev, ui); } _this.isDraggingExternal = false; _this.externalDragListener = null; } }); dragListener.startDrag(ev); // start listening immediately }, // Given a hit to be dropped upon, and misc data associated with the jqui drag (guaranteed to be a plain object), // returns the zoned start/end dates for the event that would result from the hypothetical drop. end might be null. // Returning a null value signals an invalid drop hit. // DOES NOT consider overlap/constraint. computeExternalDrop: function(span, meta) { var calendar = this.view.calendar; var dropLocation = { start: calendar.applyTimezone(span.start), // simulate a zoned event start date end: null }; // if dropped on an all-day span, and element's metadata specified a time, set it if (meta.startTime && !dropLocation.start.hasTime()) { dropLocation.start.time(meta.startTime); } if (meta.duration) { dropLocation.end = dropLocation.start.clone().add(meta.duration); } return dropLocation; }, /* Drag Rendering (for both events and an external elements) ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of an event or external element being dragged. // `dropLocation` contains hypothetical start/end/allDay values the event would have if dropped. end can be null. // `seg` is the internal segment object that is being dragged. If dragging an external element, `seg` is null. // A truthy returned value indicates this method has rendered a helper element. // Must return elements used for any mock events. renderDrag: function(dropLocation, seg) { // subclasses must implement }, // Unrenders a visual indication of an event or external element being dragged unrenderDrag: function() { // subclasses must implement }, /* Resizing ------------------------------------------------------------------------------------------------------------------*/ // Creates a listener that tracks the user as they resize an event segment. // Generic enough to work with any type of Grid. buildSegResizeListener: function(seg, isStart) { var _this = this; var view = this.view; var calendar = view.calendar; var el = seg.el; var event = seg.event; var eventEnd = calendar.getEventEnd(event); var isDragging; var resizeLocation; // zoned event date properties. falsy if invalid resize // Tracks mouse movement over the *grid's* coordinate map var dragListener = this.segResizeListener = new HitDragListener(this, { scroll: view.opt('dragScroll'), subjectEl: el, interactionStart: function() { isDragging = false; }, dragStart: function(ev) { isDragging = true; _this.handleSegMouseout(seg, ev); // ensure a mouseout on the manipulated event has been reported _this.segResizeStart(seg, ev); }, hitOver: function(hit, isOrig, origHit) { var origHitSpan = _this.getHitSpan(origHit); var hitSpan = _this.getHitSpan(hit); resizeLocation = isStart ? _this.computeEventStartResize(origHitSpan, hitSpan, event) : _this.computeEventEndResize(origHitSpan, hitSpan, event); if (resizeLocation) { if (!calendar.isEventSpanAllowed(_this.eventToSpan(resizeLocation), event)) { disableCursor(); resizeLocation = null; } // no change? (FYI, event dates might have zones) else if ( resizeLocation.start.isSame(event.start.clone().stripZone()) && resizeLocation.end.isSame(eventEnd.clone().stripZone()) ) { resizeLocation = null; } } if (resizeLocation) { view.hideEvent(event); _this.renderEventResize(resizeLocation, seg); } }, hitOut: function() { // called before mouse moves to a different hit OR moved out of all hits resizeLocation = null; view.showEvent(event); // for when out-of-bounds. show original }, hitDone: function() { // resets the rendering to show the original event _this.unrenderEventResize(); enableCursor(); }, interactionEnd: function(ev) { if (isDragging) { _this.segResizeStop(seg, ev); } if (resizeLocation) { // valid date to resize to? // no need to re-show original, will rerender all anyways. esp important if eventRenderWait view.reportEventResize(event, resizeLocation, _this.largeUnit, el, ev); } else { view.showEvent(event); } _this.segResizeListener = null; } }); return dragListener; }, // Called before event segment resizing starts segResizeStart: function(seg, ev) { this.isResizingSeg = true; this.view.publiclyTrigger('eventResizeStart', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy }, // Called after event segment resizing stops segResizeStop: function(seg, ev) { this.isResizingSeg = false; this.view.publiclyTrigger('eventResizeStop', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy }, // Returns new date-information for an event segment being resized from its start computeEventStartResize: function(startSpan, endSpan, event) { return this.computeEventResize('start', startSpan, endSpan, event); }, // Returns new date-information for an event segment being resized from its end computeEventEndResize: function(startSpan, endSpan, event) { return this.computeEventResize('end', startSpan, endSpan, event); }, // Returns new zoned date information for an event segment being resized from its start OR end // `type` is either 'start' or 'end'. // DOES NOT consider overlap/constraint. computeEventResize: function(type, startSpan, endSpan, event) { var calendar = this.view.calendar; var delta = this.diffDates(endSpan[type], startSpan[type]); var resizeLocation; // zoned event date properties var defaultDuration; // build original values to work from, guaranteeing a start and end resizeLocation = { start: event.start.clone(), end: calendar.getEventEnd(event), allDay: event.allDay }; // if an all-day event was in a timed area and was resized to a time, adjust start/end to have times if (resizeLocation.allDay && durationHasTime(delta)) { resizeLocation.allDay = false; calendar.normalizeEventTimes(resizeLocation); } resizeLocation[type].add(delta); // apply delta to start or end // if the event was compressed too small, find a new reasonable duration for it if (!resizeLocation.start.isBefore(resizeLocation.end)) { defaultDuration = this.minResizeDuration || // TODO: hack (event.allDay ? calendar.defaultAllDayEventDuration : calendar.defaultTimedEventDuration); if (type == 'start') { // resizing the start? resizeLocation.start = resizeLocation.end.clone().subtract(defaultDuration); } else { // resizing the end? resizeLocation.end = resizeLocation.start.clone().add(defaultDuration); } } return resizeLocation; }, // Renders a visual indication of an event being resized. // `range` has the updated dates of the event. `seg` is the original segment object involved in the drag. // Must return elements used for any mock events. renderEventResize: function(range, seg) { // subclasses must implement }, // Unrenders a visual indication of an event being resized. unrenderEventResize: function() { // subclasses must implement }, /* Rendering Utils ------------------------------------------------------------------------------------------------------------------*/ // Compute the text that should be displayed on an event's element. // `range` can be the Event object itself, or something range-like, with at least a `start`. // If event times are disabled, or the event has no time, will return a blank string. // If not specified, formatStr will default to the eventTimeFormat setting, // and displayEnd will default to the displayEventEnd setting. getEventTimeText: function(range, formatStr, displayEnd) { if (formatStr == null) { formatStr = this.eventTimeFormat; } if (displayEnd == null) { displayEnd = this.displayEventEnd; } if (this.displayEventTime && range.start.hasTime()) { if (displayEnd && range.end) { return this.view.formatRange(range, formatStr); } else { return range.start.format(formatStr); } } return ''; }, // Generic utility for generating the HTML classNames for an event segment's element getSegClasses: function(seg, isDraggable, isResizable) { var view = this.view; var classes = [ 'fc-event', seg.isStart ? 'fc-start' : 'fc-not-start', seg.isEnd ? 'fc-end' : 'fc-not-end' ].concat(this.getSegCustomClasses(seg)); if (isDraggable) { classes.push('fc-draggable'); } if (isResizable) { classes.push('fc-resizable'); } // event is currently selected? attach a className. if (view.isEventSelected(seg.event)) { classes.push('fc-selected'); } return classes; }, // List of classes that were defined by the caller of the API in some way getSegCustomClasses: function(seg) { var event = seg.event; return [].concat( event.className, // guaranteed to be an array event.source ? event.source.className : [] ); }, // Utility for generating event skin-related CSS properties getSegSkinCss: function(seg) { return { 'background-color': this.getSegBackgroundColor(seg), 'border-color': this.getSegBorderColor(seg), color: this.getSegTextColor(seg) }; }, // Queries for caller-specified color, then falls back to default getSegBackgroundColor: function(seg) { return seg.event.backgroundColor || seg.event.color || this.getSegDefaultBackgroundColor(seg); }, getSegDefaultBackgroundColor: function(seg) { var source = seg.event.source || {}; return source.backgroundColor || source.color || this.view.opt('eventBackgroundColor') || this.view.opt('eventColor'); }, // Queries for caller-specified color, then falls back to default getSegBorderColor: function(seg) { return seg.event.borderColor || seg.event.color || this.getSegDefaultBorderColor(seg); }, getSegDefaultBorderColor: function(seg) { var source = seg.event.source || {}; return source.borderColor || source.color || this.view.opt('eventBorderColor') || this.view.opt('eventColor'); }, // Queries for caller-specified color, then falls back to default getSegTextColor: function(seg) { return seg.event.textColor || this.getSegDefaultTextColor(seg); }, getSegDefaultTextColor: function(seg) { var source = seg.event.source || {}; return source.textColor || this.view.opt('eventTextColor'); }, /* Converting events -> eventRange -> eventSpan -> eventSegs ------------------------------------------------------------------------------------------------------------------*/ // Generates an array of segments for the given single event // Can accept an event "location" as well (which only has start/end and no allDay) eventToSegs: function(event) { return this.eventsToSegs([ event ]); }, eventToSpan: function(event) { return this.eventToSpans(event)[0]; }, // Generates spans (always unzoned) for the given event. // Does not do any inverting for inverse-background events. // Can accept an event "location" as well (which only has start/end and no allDay) eventToSpans: function(event) { var range = this.eventToRange(event); return this.eventRangeToSpans(range, event); }, // Converts an array of event objects into an array of event segment objects. // A custom `segSliceFunc` may be given for arbitrarily slicing up events. // Doesn't guarantee an order for the resulting array. eventsToSegs: function(allEvents, segSliceFunc) { var _this = this; var eventsById = groupEventsById(allEvents); var segs = []; $.each(eventsById, function(id, events) { var ranges = []; var i; for (i = 0; i < events.length; i++) { ranges.push(_this.eventToRange(events[i])); } // inverse-background events (utilize only the first event in calculations) if (isInverseBgEvent(events[0])) { ranges = _this.invertRanges(ranges); for (i = 0; i < ranges.length; i++) { segs.push.apply(segs, // append to _this.eventRangeToSegs(ranges[i], events[0], segSliceFunc)); } } // normal event ranges else { for (i = 0; i < ranges.length; i++) { segs.push.apply(segs, // append to _this.eventRangeToSegs(ranges[i], events[i], segSliceFunc)); } } }); return segs; }, // Generates the unzoned start/end dates an event appears to occupy // Can accept an event "location" as well (which only has start/end and no allDay) eventToRange: function(event) { var calendar = this.view.calendar; var start = event.start.clone().stripZone(); var end = ( event.end ? event.end.clone() : // derive the end from the start and allDay. compute allDay if necessary calendar.getDefaultEventEnd( event.allDay != null ? event.allDay : !event.start.hasTime(), event.start ) ).stripZone(); // hack: dynamic locale change forgets to upate stored event localed calendar.localizeMoment(start); calendar.localizeMoment(end); return { start: start, end: end }; }, // Given an event's range (unzoned start/end), and the event itself, // slice into segments (using the segSliceFunc function if specified) eventRangeToSegs: function(range, event, segSliceFunc) { var spans = this.eventRangeToSpans(range, event); var segs = []; var i; for (i = 0; i < spans.length; i++) { segs.push.apply(segs, // append to this.eventSpanToSegs(spans[i], event, segSliceFunc)); } return segs; }, // Given an event's unzoned date range, return an array of "span" objects. // Subclasses can override. eventRangeToSpans: function(range, event) { return [ $.extend({}, range) ]; // copy into a single-item array }, // Given an event's span (unzoned start/end and other misc data), and the event itself, // slices into segments and attaches event-derived properties to them. eventSpanToSegs: function(span, event, segSliceFunc) { var segs = segSliceFunc ? segSliceFunc(span) : this.spanToSegs(span); var i, seg; for (i = 0; i < segs.length; i++) { seg = segs[i]; seg.event = event; seg.eventStartMS = +span.start; // TODO: not the best name after making spans unzoned seg.eventDurationMS = span.end - span.start; } return segs; }, // Produces a new array of range objects that will cover all the time NOT covered by the given ranges. // SIDE EFFECT: will mutate the given array and will use its date references. invertRanges: function(ranges) { var view = this.view; var viewStart = view.start.clone(); // need a copy var viewEnd = view.end.clone(); // need a copy var inverseRanges = []; var start = viewStart; // the end of the previous range. the start of the new range var i, range; // ranges need to be in order. required for our date-walking algorithm ranges.sort(compareRanges); for (i = 0; i < ranges.length; i++) { range = ranges[i]; // add the span of time before the event (if there is any) if (range.start > start) { // compare millisecond time (skip any ambig logic) inverseRanges.push({ start: start, end: range.start }); } start = range.end; } // add the span of time after the last event (if there is any) if (start < viewEnd) { // compare millisecond time (skip any ambig logic) inverseRanges.push({ start: start, end: viewEnd }); } return inverseRanges; }, sortEventSegs: function(segs) { segs.sort(proxy(this, 'compareEventSegs')); }, // A cmp function for determining which segments should take visual priority compareEventSegs: function(seg1, seg2) { return seg1.eventStartMS - seg2.eventStartMS || // earlier events go first seg2.eventDurationMS - seg1.eventDurationMS || // tie? longer events go first seg2.event.allDay - seg1.event.allDay || // tie? put all-day events first (booleans cast to 0/1) compareByFieldSpecs(seg1.event, seg2.event, this.view.eventOrderSpecs); } }); /* Utilities ----------------------------------------------------------------------------------------------------------------------*/ function pluckEventDateProps(event) { return { start: event.start.clone(), end: event.end ? event.end.clone() : null, allDay: event.allDay // keep it the same }; } FC.pluckEventDateProps = pluckEventDateProps; function isBgEvent(event) { // returns true if background OR inverse-background var rendering = getEventRendering(event); return rendering === 'background' || rendering === 'inverse-background'; } FC.isBgEvent = isBgEvent; // export function isInverseBgEvent(event) { return getEventRendering(event) === 'inverse-background'; } function getEventRendering(event) { return firstDefined((event.source || {}).rendering, event.rendering); } function groupEventsById(events) { var eventsById = {}; var i, event; for (i = 0; i < events.length; i++) { event = events[i]; (eventsById[event._id] || (eventsById[event._id] = [])).push(event); } return eventsById; } // A cmp function for determining which non-inverted "ranges" (see above) happen earlier function compareRanges(range1, range2) { return range1.start - range2.start; // earlier ranges go first } /* External-Dragging-Element Data ----------------------------------------------------------------------------------------------------------------------*/ // Require all HTML5 data-* attributes used by FullCalendar to have this prefix. // A value of '' will query attributes like data-event. A value of 'fc' will query attributes like data-fc-event. FC.dataAttrPrefix = ''; // Given a jQuery element that might represent a dragged FullCalendar event, returns an intermediate data structure // to be used for Event Object creation. // A defined `.eventProps`, even when empty, indicates that an event should be created. function getDraggedElMeta(el) { var prefix = FC.dataAttrPrefix; var eventProps; // properties for creating the event, not related to date/time var startTime; // a Duration var duration; var stick; if (prefix) { prefix += '-'; } eventProps = el.data(prefix + 'event') || null; if (eventProps) { if (typeof eventProps === 'object') { eventProps = $.extend({}, eventProps); // make a copy } else { // something like 1 or true. still signal event creation eventProps = {}; } // pluck special-cased date/time properties startTime = eventProps.start; if (startTime == null) { startTime = eventProps.time; } // accept 'time' as well duration = eventProps.duration; stick = eventProps.stick; delete eventProps.start; delete eventProps.time; delete eventProps.duration; delete eventProps.stick; } // fallback to standalone attribute values for each of the date/time properties if (startTime == null) { startTime = el.data(prefix + 'start'); } if (startTime == null) { startTime = el.data(prefix + 'time'); } // accept 'time' as well if (duration == null) { duration = el.data(prefix + 'duration'); } if (stick == null) { stick = el.data(prefix + 'stick'); } // massage into correct data types startTime = startTime != null ? moment.duration(startTime) : null; duration = duration != null ? moment.duration(duration) : null; stick = Boolean(stick); return { eventProps: eventProps, startTime: startTime, duration: duration, stick: stick }; } ;; /* A set of rendering and date-related methods for a visual component comprised of one or more rows of day columns. Prerequisite: the object being mixed into needs to be a *Grid* */ var DayTableMixin = FC.DayTableMixin = { breakOnWeeks: false, // should create a new row for each week? dayDates: null, // whole-day dates for each column. left to right dayIndices: null, // for each day from start, the offset daysPerRow: null, rowCnt: null, colCnt: null, colHeadFormat: null, // Populates internal variables used for date calculation and rendering updateDayTable: function() { var view = this.view; var date = this.start.clone(); var dayIndex = -1; var dayIndices = []; var dayDates = []; var daysPerRow; var firstDay; var rowCnt; while (date.isBefore(this.end)) { // loop each day from start to end if (view.isHiddenDay(date)) { dayIndices.push(dayIndex + 0.5); // mark that it's between indices } else { dayIndex++; dayIndices.push(dayIndex); dayDates.push(date.clone()); } date.add(1, 'days'); } if (this.breakOnWeeks) { // count columns until the day-of-week repeats firstDay = dayDates[0].day(); for (daysPerRow = 1; daysPerRow < dayDates.length; daysPerRow++) { if (dayDates[daysPerRow].day() == firstDay) { break; } } rowCnt = Math.ceil(dayDates.length / daysPerRow); } else { rowCnt = 1; daysPerRow = dayDates.length; } this.dayDates = dayDates; this.dayIndices = dayIndices; this.daysPerRow = daysPerRow; this.rowCnt = rowCnt; this.updateDayTableCols(); }, // Computes and assigned the colCnt property and updates any options that may be computed from it updateDayTableCols: function() { this.colCnt = this.computeColCnt(); this.colHeadFormat = this.view.opt('columnFormat') || this.computeColHeadFormat(); }, // Determines how many columns there should be in the table computeColCnt: function() { return this.daysPerRow; }, // Computes the ambiguously-timed moment for the given cell getCellDate: function(row, col) { return this.dayDates[ this.getCellDayIndex(row, col) ].clone(); }, // Computes the ambiguously-timed date range for the given cell getCellRange: function(row, col) { var start = this.getCellDate(row, col); var end = start.clone().add(1, 'days'); return { start: start, end: end }; }, // Returns the number of day cells, chronologically, from the first of the grid (0-based) getCellDayIndex: function(row, col) { return row * this.daysPerRow + this.getColDayIndex(col); }, // Returns the numner of day cells, chronologically, from the first cell in *any given row* getColDayIndex: function(col) { if (this.isRTL) { return this.colCnt - 1 - col; } else { return col; } }, // Given a date, returns its chronolocial cell-index from the first cell of the grid. // If the date lies between cells (because of hiddenDays), returns a floating-point value between offsets. // If before the first offset, returns a negative number. // If after the last offset, returns an offset past the last cell offset. // Only works for *start* dates of cells. Will not work for exclusive end dates for cells. getDateDayIndex: function(date) { var dayIndices = this.dayIndices; var dayOffset = date.diff(this.start, 'days'); if (dayOffset < 0) { return dayIndices[0] - 1; } else if (dayOffset >= dayIndices.length) { return dayIndices[dayIndices.length - 1] + 1; } else { return dayIndices[dayOffset]; } }, /* Options ------------------------------------------------------------------------------------------------------------------*/ // Computes a default column header formatting string if `colFormat` is not explicitly defined computeColHeadFormat: function() { // if more than one week row, or if there are a lot of columns with not much space, // put just the day numbers will be in each cell if (this.rowCnt > 1 || this.colCnt > 10) { return 'ddd'; // "Sat" } // multiple days, so full single date string WON'T be in title text else if (this.colCnt > 1) { return this.view.opt('dayOfMonthFormat'); // "Sat 12/10" } // single day, so full single date string will probably be in title text else { return 'dddd'; // "Saturday" } }, /* Slicing ------------------------------------------------------------------------------------------------------------------*/ // Slices up a date range into a segment for every week-row it intersects with sliceRangeByRow: function(range) { var daysPerRow = this.daysPerRow; var normalRange = this.view.computeDayRange(range); // make whole-day range, considering nextDayThreshold var rangeFirst = this.getDateDayIndex(normalRange.start); // inclusive first index var rangeLast = this.getDateDayIndex(normalRange.end.clone().subtract(1, 'days')); // inclusive last index var segs = []; var row; var rowFirst, rowLast; // inclusive day-index range for current row var segFirst, segLast; // inclusive day-index range for segment for (row = 0; row < this.rowCnt; row++) { rowFirst = row * daysPerRow; rowLast = rowFirst + daysPerRow - 1; // intersect segment's offset range with the row's segFirst = Math.max(rangeFirst, rowFirst); segLast = Math.min(rangeLast, rowLast); // deal with in-between indices segFirst = Math.ceil(segFirst); // in-between starts round to next cell segLast = Math.floor(segLast); // in-between ends round to prev cell if (segFirst <= segLast) { // was there any intersection with the current row? segs.push({ row: row, // normalize to start of row firstRowDayIndex: segFirst - rowFirst, lastRowDayIndex: segLast - rowFirst, // must be matching integers to be the segment's start/end isStart: segFirst === rangeFirst, isEnd: segLast === rangeLast }); } } return segs; }, // Slices up a date range into a segment for every day-cell it intersects with. // TODO: make more DRY with sliceRangeByRow somehow. sliceRangeByDay: function(range) { var daysPerRow = this.daysPerRow; var normalRange = this.view.computeDayRange(range); // make whole-day range, considering nextDayThreshold var rangeFirst = this.getDateDayIndex(normalRange.start); // inclusive first index var rangeLast = this.getDateDayIndex(normalRange.end.clone().subtract(1, 'days')); // inclusive last index var segs = []; var row; var rowFirst, rowLast; // inclusive day-index range for current row var i; var segFirst, segLast; // inclusive day-index range for segment for (row = 0; row < this.rowCnt; row++) { rowFirst = row * daysPerRow; rowLast = rowFirst + daysPerRow - 1; for (i = rowFirst; i <= rowLast; i++) { // intersect segment's offset range with the row's segFirst = Math.max(rangeFirst, i); segLast = Math.min(rangeLast, i); // deal with in-between indices segFirst = Math.ceil(segFirst); // in-between starts round to next cell segLast = Math.floor(segLast); // in-between ends round to prev cell if (segFirst <= segLast) { // was there any intersection with the current row? segs.push({ row: row, // normalize to start of row firstRowDayIndex: segFirst - rowFirst, lastRowDayIndex: segLast - rowFirst, // must be matching integers to be the segment's start/end isStart: segFirst === rangeFirst, isEnd: segLast === rangeLast }); } } } return segs; }, /* Header Rendering ------------------------------------------------------------------------------------------------------------------*/ renderHeadHtml: function() { var view = this.view; return '' + '<div class="fc-row ' + view.widgetHeaderClass + '">' + '<table>' + '<thead>' + this.renderHeadTrHtml() + '</thead>' + '</table>' + '</div>'; }, renderHeadIntroHtml: function() { return this.renderIntroHtml(); // fall back to generic }, renderHeadTrHtml: function() { return '' + '<tr>' + (this.isRTL ? '' : this.renderHeadIntroHtml()) + this.renderHeadDateCellsHtml() + (this.isRTL ? this.renderHeadIntroHtml() : '') + '</tr>'; }, renderHeadDateCellsHtml: function() { var htmls = []; var col, date; for (col = 0; col < this.colCnt; col++) { date = this.getCellDate(0, col); htmls.push(this.renderHeadDateCellHtml(date)); } return htmls.join(''); }, // TODO: when internalApiVersion, accept an object for HTML attributes // (colspan should be no different) renderHeadDateCellHtml: function(date, colspan, otherAttrs) { var view = this.view; var classNames = [ 'fc-day-header', view.widgetHeaderClass ]; // if only one row of days, the classNames on the header can represent the specific days beneath if (this.rowCnt === 1) { classNames = classNames.concat( // includes the day-of-week class // noThemeHighlight=true (don't highlight the header) this.getDayClasses(date, true) ); } else { classNames.push('fc-' + dayIDs[date.day()]); // only add the day-of-week class } return '' + '<th class="' + classNames.join(' ') + '"' + (this.rowCnt === 1 ? ' data-date="' + date.format('YYYY-MM-DD') + '"' : '') + (colspan > 1 ? ' colspan="' + colspan + '"' : '') + (otherAttrs ? ' ' + otherAttrs : '') + '>' + // don't make a link if the heading could represent multiple days, or if there's only one day (forceOff) view.buildGotoAnchorHtml( { date: date, forceOff: this.rowCnt > 1 || this.colCnt === 1 }, htmlEscape(date.format(this.colHeadFormat)) // inner HTML ) + '</th>'; }, /* Background Rendering ------------------------------------------------------------------------------------------------------------------*/ renderBgTrHtml: function(row) { return '' + '<tr>' + (this.isRTL ? '' : this.renderBgIntroHtml(row)) + this.renderBgCellsHtml(row) + (this.isRTL ? this.renderBgIntroHtml(row) : '') + '</tr>'; }, renderBgIntroHtml: function(row) { return this.renderIntroHtml(); // fall back to generic }, renderBgCellsHtml: function(row) { var htmls = []; var col, date; for (col = 0; col < this.colCnt; col++) { date = this.getCellDate(row, col); htmls.push(this.renderBgCellHtml(date)); } return htmls.join(''); }, renderBgCellHtml: function(date, otherAttrs) { var view = this.view; var classes = this.getDayClasses(date); classes.unshift('fc-day', view.widgetContentClass); return '<td class="' + classes.join(' ') + '"' + ' data-date="' + date.format('YYYY-MM-DD') + '"' + // if date has a time, won't format it (otherAttrs ? ' ' + otherAttrs : '') + '></td>'; }, /* Generic ------------------------------------------------------------------------------------------------------------------*/ // Generates the default HTML intro for any row. User classes should override renderIntroHtml: function() { }, // TODO: a generic method for dealing with <tr>, RTL, intro // when increment internalApiVersion // wrapTr (scheduler) /* Utils ------------------------------------------------------------------------------------------------------------------*/ // Applies the generic "intro" and "outro" HTML to the given cells. // Intro means the leftmost cell when the calendar is LTR and the rightmost cell when RTL. Vice-versa for outro. bookendCells: function(trEl) { var introHtml = this.renderIntroHtml(); if (introHtml) { if (this.isRTL) { trEl.append(introHtml); } else { trEl.prepend(introHtml); } } } }; ;; /* A component that renders a grid of whole-days that runs horizontally. There can be multiple rows, one per week. ----------------------------------------------------------------------------------------------------------------------*/ var DayGrid = FC.DayGrid = Grid.extend(DayTableMixin, { numbersVisible: false, // should render a row for day/week numbers? set by outside view. TODO: make internal bottomCoordPadding: 0, // hack for extending the hit area for the last row of the coordinate grid rowEls: null, // set of fake row elements cellEls: null, // set of whole-day elements comprising the row's background helperEls: null, // set of cell skeleton elements for rendering the mock event "helper" rowCoordCache: null, colCoordCache: null, // Renders the rows and columns into the component's `this.el`, which should already be assigned. // isRigid determins whether the individual rows should ignore the contents and be a constant height. // Relies on the view's colCnt and rowCnt. In the future, this component should probably be self-sufficient. renderDates: function(isRigid) { var view = this.view; var rowCnt = this.rowCnt; var colCnt = this.colCnt; var html = ''; var row; var col; for (row = 0; row < rowCnt; row++) { html += this.renderDayRowHtml(row, isRigid); } this.el.html(html); this.rowEls = this.el.find('.fc-row'); this.cellEls = this.el.find('.fc-day'); this.rowCoordCache = new CoordCache({ els: this.rowEls, isVertical: true }); this.colCoordCache = new CoordCache({ els: this.cellEls.slice(0, this.colCnt), // only the first row isHorizontal: true }); // trigger dayRender with each cell's element for (row = 0; row < rowCnt; row++) { for (col = 0; col < colCnt; col++) { view.publiclyTrigger( 'dayRender', null, this.getCellDate(row, col), this.getCellEl(row, col) ); } } }, unrenderDates: function() { this.removeSegPopover(); }, renderBusinessHours: function() { var segs = this.buildBusinessHourSegs(true); // wholeDay=true this.renderFill('businessHours', segs, 'bgevent'); }, unrenderBusinessHours: function() { this.unrenderFill('businessHours'); }, // Generates the HTML for a single row, which is a div that wraps a table. // `row` is the row number. renderDayRowHtml: function(row, isRigid) { var view = this.view; var classes = [ 'fc-row', 'fc-week', view.widgetContentClass ]; if (isRigid) { classes.push('fc-rigid'); } return '' + '<div class="' + classes.join(' ') + '">' + '<div class="fc-bg">' + '<table>' + this.renderBgTrHtml(row) + '</table>' + '</div>' + '<div class="fc-content-skeleton">' + '<table>' + (this.numbersVisible ? '<thead>' + this.renderNumberTrHtml(row) + '</thead>' : '' ) + '</table>' + '</div>' + '</div>'; }, /* Grid Number Rendering ------------------------------------------------------------------------------------------------------------------*/ renderNumberTrHtml: function(row) { return '' + '<tr>' + (this.isRTL ? '' : this.renderNumberIntroHtml(row)) + this.renderNumberCellsHtml(row) + (this.isRTL ? this.renderNumberIntroHtml(row) : '') + '</tr>'; }, renderNumberIntroHtml: function(row) { return this.renderIntroHtml(); }, renderNumberCellsHtml: function(row) { var htmls = []; var col, date; for (col = 0; col < this.colCnt; col++) { date = this.getCellDate(row, col); htmls.push(this.renderNumberCellHtml(date)); } return htmls.join(''); }, // Generates the HTML for the <td>s of the "number" row in the DayGrid's content skeleton. // The number row will only exist if either day numbers or week numbers are turned on. renderNumberCellHtml: function(date) { var html = ''; var classes; var weekCalcFirstDoW; if (!this.view.dayNumbersVisible && !this.view.cellWeekNumbersVisible) { // no numbers in day cell (week number must be along the side) return '<td/>'; // will create an empty space above events :( } classes = this.getDayClasses(date); classes.unshift('fc-day-top'); if (this.view.cellWeekNumbersVisible) { // To determine the day of week number change under ISO, we cannot // rely on moment.js methods such as firstDayOfWeek() or weekday(), // because they rely on the locale's dow (possibly overridden by // our firstDay option), which may not be Monday. We cannot change // dow, because that would affect the calendar start day as well. if (date._locale._fullCalendar_weekCalc === 'ISO') { weekCalcFirstDoW = 1; // Monday by ISO 8601 definition } else { weekCalcFirstDoW = date._locale.firstDayOfWeek(); } } html += '<td class="' + classes.join(' ') + '" data-date="' + date.format() + '">'; if (this.view.cellWeekNumbersVisible && (date.day() == weekCalcFirstDoW)) { html += this.view.buildGotoAnchorHtml( { date: date, type: 'week' }, { 'class': 'fc-week-number' }, date.format('w') // inner HTML ); } if (this.view.dayNumbersVisible) { html += this.view.buildGotoAnchorHtml( date, { 'class': 'fc-day-number' }, date.date() // inner HTML ); } html += '</td>'; return html; }, /* Options ------------------------------------------------------------------------------------------------------------------*/ // Computes a default event time formatting string if `timeFormat` is not explicitly defined computeEventTimeFormat: function() { return this.view.opt('extraSmallTimeFormat'); // like "6p" or "6:30p" }, // Computes a default `displayEventEnd` value if one is not expliclty defined computeDisplayEventEnd: function() { return this.colCnt == 1; // we'll likely have space if there's only one day }, /* Dates ------------------------------------------------------------------------------------------------------------------*/ rangeUpdated: function() { this.updateDayTable(); }, // Slices up the given span (unzoned start/end with other misc data) into an array of segments spanToSegs: function(span) { var segs = this.sliceRangeByRow(span); var i, seg; for (i = 0; i < segs.length; i++) { seg = segs[i]; if (this.isRTL) { seg.leftCol = this.daysPerRow - 1 - seg.lastRowDayIndex; seg.rightCol = this.daysPerRow - 1 - seg.firstRowDayIndex; } else { seg.leftCol = seg.firstRowDayIndex; seg.rightCol = seg.lastRowDayIndex; } } return segs; }, /* Hit System ------------------------------------------------------------------------------------------------------------------*/ prepareHits: function() { this.colCoordCache.build(); this.rowCoordCache.build(); this.rowCoordCache.bottoms[this.rowCnt - 1] += this.bottomCoordPadding; // hack }, releaseHits: function() { this.colCoordCache.clear(); this.rowCoordCache.clear(); }, queryHit: function(leftOffset, topOffset) { if (this.colCoordCache.isLeftInBounds(leftOffset) && this.rowCoordCache.isTopInBounds(topOffset)) { var col = this.colCoordCache.getHorizontalIndex(leftOffset); var row = this.rowCoordCache.getVerticalIndex(topOffset); if (row != null && col != null) { return this.getCellHit(row, col); } } }, getHitSpan: function(hit) { return this.getCellRange(hit.row, hit.col); }, getHitEl: function(hit) { return this.getCellEl(hit.row, hit.col); }, /* Cell System ------------------------------------------------------------------------------------------------------------------*/ // FYI: the first column is the leftmost column, regardless of date getCellHit: function(row, col) { return { row: row, col: col, component: this, // needed unfortunately :( left: this.colCoordCache.getLeftOffset(col), right: this.colCoordCache.getRightOffset(col), top: this.rowCoordCache.getTopOffset(row), bottom: this.rowCoordCache.getBottomOffset(row) }; }, getCellEl: function(row, col) { return this.cellEls.eq(row * this.colCnt + col); }, /* Event Drag Visualization ------------------------------------------------------------------------------------------------------------------*/ // TODO: move to DayGrid.event, similar to what we did with Grid's drag methods // Renders a visual indication of an event or external element being dragged. // `eventLocation` has zoned start and end (optional) renderDrag: function(eventLocation, seg) { // always render a highlight underneath this.renderHighlight(this.eventToSpan(eventLocation)); // if a segment from the same calendar but another component is being dragged, render a helper event if (seg && seg.component !== this) { return this.renderEventLocationHelper(eventLocation, seg); // returns mock event elements } }, // Unrenders any visual indication of a hovering event unrenderDrag: function() { this.unrenderHighlight(); this.unrenderHelper(); }, /* Event Resize Visualization ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of an event being resized renderEventResize: function(eventLocation, seg) { this.renderHighlight(this.eventToSpan(eventLocation)); return this.renderEventLocationHelper(eventLocation, seg); // returns mock event elements }, // Unrenders a visual indication of an event being resized unrenderEventResize: function() { this.unrenderHighlight(); this.unrenderHelper(); }, /* Event Helper ------------------------------------------------------------------------------------------------------------------*/ // Renders a mock "helper" event. `sourceSeg` is the associated internal segment object. It can be null. renderHelper: function(event, sourceSeg) { var helperNodes = []; var segs = this.eventToSegs(event); var rowStructs; segs = this.renderFgSegEls(segs); // assigns each seg's el and returns a subset of segs that were rendered rowStructs = this.renderSegRows(segs); // inject each new event skeleton into each associated row this.rowEls.each(function(row, rowNode) { var rowEl = $(rowNode); // the .fc-row var skeletonEl = $('<div class="fc-helper-skeleton"><table/></div>'); // will be absolutely positioned var skeletonTop; // If there is an original segment, match the top position. Otherwise, put it at the row's top level if (sourceSeg && sourceSeg.row === row) { skeletonTop = sourceSeg.el.position().top; } else { skeletonTop = rowEl.find('.fc-content-skeleton tbody').position().top; } skeletonEl.css('top', skeletonTop) .find('table') .append(rowStructs[row].tbodyEl); rowEl.append(skeletonEl); helperNodes.push(skeletonEl[0]); }); return ( // must return the elements rendered this.helperEls = $(helperNodes) // array -> jQuery set ); }, // Unrenders any visual indication of a mock helper event unrenderHelper: function() { if (this.helperEls) { this.helperEls.remove(); this.helperEls = null; } }, /* Fill System (highlight, background events, business hours) ------------------------------------------------------------------------------------------------------------------*/ fillSegTag: 'td', // override the default tag name // Renders a set of rectangles over the given segments of days. // Only returns segments that successfully rendered. renderFill: function(type, segs, className) { var nodes = []; var i, seg; var skeletonEl; segs = this.renderFillSegEls(type, segs); // assignes `.el` to each seg. returns successfully rendered segs for (i = 0; i < segs.length; i++) { seg = segs[i]; skeletonEl = this.renderFillRow(type, seg, className); this.rowEls.eq(seg.row).append(skeletonEl); nodes.push(skeletonEl[0]); } this.elsByFill[type] = $(nodes); return segs; }, // Generates the HTML needed for one row of a fill. Requires the seg's el to be rendered. renderFillRow: function(type, seg, className) { var colCnt = this.colCnt; var startCol = seg.leftCol; var endCol = seg.rightCol + 1; var skeletonEl; var trEl; className = className || type.toLowerCase(); skeletonEl = $( '<div class="fc-' + className + '-skeleton">' + '<table><tr/></table>' + '</div>' ); trEl = skeletonEl.find('tr'); if (startCol > 0) { trEl.append('<td colspan="' + startCol + '"/>'); } trEl.append( seg.el.attr('colspan', endCol - startCol) ); if (endCol < colCnt) { trEl.append('<td colspan="' + (colCnt - endCol) + '"/>'); } this.bookendCells(trEl); return skeletonEl; } }); ;; /* Event-rendering methods for the DayGrid class ----------------------------------------------------------------------------------------------------------------------*/ DayGrid.mixin({ rowStructs: null, // an array of objects, each holding information about a row's foreground event-rendering // Unrenders all events currently rendered on the grid unrenderEvents: function() { this.removeSegPopover(); // removes the "more.." events popover Grid.prototype.unrenderEvents.apply(this, arguments); // calls the super-method }, // Retrieves all rendered segment objects currently rendered on the grid getEventSegs: function() { return Grid.prototype.getEventSegs.call(this) // get the segments from the super-method .concat(this.popoverSegs || []); // append the segments from the "more..." popover }, // Renders the given background event segments onto the grid renderBgSegs: function(segs) { // don't render timed background events var allDaySegs = $.grep(segs, function(seg) { return seg.event.allDay; }); return Grid.prototype.renderBgSegs.call(this, allDaySegs); // call the super-method }, // Renders the given foreground event segments onto the grid renderFgSegs: function(segs) { var rowStructs; // render an `.el` on each seg // returns a subset of the segs. segs that were actually rendered segs = this.renderFgSegEls(segs); rowStructs = this.rowStructs = this.renderSegRows(segs); // append to each row's content skeleton this.rowEls.each(function(i, rowNode) { $(rowNode).find('.fc-content-skeleton > table').append( rowStructs[i].tbodyEl ); }); return segs; // return only the segs that were actually rendered }, // Unrenders all currently rendered foreground event segments unrenderFgSegs: function() { var rowStructs = this.rowStructs || []; var rowStruct; while ((rowStruct = rowStructs.pop())) { rowStruct.tbodyEl.remove(); } this.rowStructs = null; }, // Uses the given events array to generate <tbody> elements that should be appended to each row's content skeleton. // Returns an array of rowStruct objects (see the bottom of `renderSegRow`). // PRECONDITION: each segment shoud already have a rendered and assigned `.el` renderSegRows: function(segs) { var rowStructs = []; var segRows; var row; segRows = this.groupSegRows(segs); // group into nested arrays // iterate each row of segment groupings for (row = 0; row < segRows.length; row++) { rowStructs.push( this.renderSegRow(row, segRows[row]) ); } return rowStructs; }, // Builds the HTML to be used for the default element for an individual segment fgSegHtml: function(seg, disableResizing) { var view = this.view; var event = seg.event; var isDraggable = view.isEventDraggable(event); var isResizableFromStart = !disableResizing && event.allDay && seg.isStart && view.isEventResizableFromStart(event); var isResizableFromEnd = !disableResizing && event.allDay && seg.isEnd && view.isEventResizableFromEnd(event); var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd); var skinCss = cssToStr(this.getSegSkinCss(seg)); var timeHtml = ''; var timeText; var titleHtml; classes.unshift('fc-day-grid-event', 'fc-h-event'); // Only display a timed events time if it is the starting segment if (seg.isStart) { timeText = this.getEventTimeText(event); if (timeText) { timeHtml = '<span class="fc-time">' + htmlEscape(timeText) + '</span>'; } } titleHtml = '<span class="fc-title">' + (htmlEscape(event.title || '') || ' ') + // we always want one line of height '</span>'; return '<a class="' + classes.join(' ') + '"' + (event.url ? ' href="' + htmlEscape(event.url) + '"' : '' ) + (skinCss ? ' style="' + skinCss + '"' : '' ) + '>' + '<div class="fc-content">' + (this.isRTL ? titleHtml + ' ' + timeHtml : // put a natural space in between timeHtml + ' ' + titleHtml // ) + '</div>' + (isResizableFromStart ? '<div class="fc-resizer fc-start-resizer" />' : '' ) + (isResizableFromEnd ? '<div class="fc-resizer fc-end-resizer" />' : '' ) + '</a>'; }, // Given a row # and an array of segments all in the same row, render a <tbody> element, a skeleton that contains // the segments. Returns object with a bunch of internal data about how the render was calculated. // NOTE: modifies rowSegs renderSegRow: function(row, rowSegs) { var colCnt = this.colCnt; var segLevels = this.buildSegLevels(rowSegs); // group into sub-arrays of levels var levelCnt = Math.max(1, segLevels.length); // ensure at least one level var tbody = $('<tbody/>'); var segMatrix = []; // lookup for which segments are rendered into which level+col cells var cellMatrix = []; // lookup for all <td> elements of the level+col matrix var loneCellMatrix = []; // lookup for <td> elements that only take up a single column var i, levelSegs; var col; var tr; var j, seg; var td; // populates empty cells from the current column (`col`) to `endCol` function emptyCellsUntil(endCol) { while (col < endCol) { // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell td = (loneCellMatrix[i - 1] || [])[col]; if (td) { td.attr( 'rowspan', parseInt(td.attr('rowspan') || 1, 10) + 1 ); } else { td = $('<td/>'); tr.append(td); } cellMatrix[i][col] = td; loneCellMatrix[i][col] = td; col++; } } for (i = 0; i < levelCnt; i++) { // iterate through all levels levelSegs = segLevels[i]; col = 0; tr = $('<tr/>'); segMatrix.push([]); cellMatrix.push([]); loneCellMatrix.push([]); // levelCnt might be 1 even though there are no actual levels. protect against this. // this single empty row is useful for styling. if (levelSegs) { for (j = 0; j < levelSegs.length; j++) { // iterate through segments in level seg = levelSegs[j]; emptyCellsUntil(seg.leftCol); // create a container that occupies or more columns. append the event element. td = $('<td class="fc-event-container"/>').append(seg.el); if (seg.leftCol != seg.rightCol) { td.attr('colspan', seg.rightCol - seg.leftCol + 1); } else { // a single-column segment loneCellMatrix[i][col] = td; } while (col <= seg.rightCol) { cellMatrix[i][col] = td; segMatrix[i][col] = seg; col++; } tr.append(td); } } emptyCellsUntil(colCnt); // finish off the row this.bookendCells(tr); tbody.append(tr); } return { // a "rowStruct" row: row, // the row number tbodyEl: tbody, cellMatrix: cellMatrix, segMatrix: segMatrix, segLevels: segLevels, segs: rowSegs }; }, // Stacks a flat array of segments, which are all assumed to be in the same row, into subarrays of vertical levels. // NOTE: modifies segs buildSegLevels: function(segs) { var levels = []; var i, seg; var j; // Give preference to elements with certain criteria, so they have // a chance to be closer to the top. this.sortEventSegs(segs); for (i = 0; i < segs.length; i++) { seg = segs[i]; // loop through levels, starting with the topmost, until the segment doesn't collide with other segments for (j = 0; j < levels.length; j++) { if (!isDaySegCollision(seg, levels[j])) { break; } } // `j` now holds the desired subrow index seg.level = j; // create new level array if needed and append segment (levels[j] || (levels[j] = [])).push(seg); } // order segments left-to-right. very important if calendar is RTL for (j = 0; j < levels.length; j++) { levels[j].sort(compareDaySegCols); } return levels; }, // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's row groupSegRows: function(segs) { var segRows = []; var i; for (i = 0; i < this.rowCnt; i++) { segRows.push([]); } for (i = 0; i < segs.length; i++) { segRows[segs[i].row].push(segs[i]); } return segRows; } }); // Computes whether two segments' columns collide. They are assumed to be in the same row. function isDaySegCollision(seg, otherSegs) { var i, otherSeg; for (i = 0; i < otherSegs.length; i++) { otherSeg = otherSegs[i]; if ( otherSeg.leftCol <= seg.rightCol && otherSeg.rightCol >= seg.leftCol ) { return true; } } return false; } // A cmp function for determining the leftmost event function compareDaySegCols(a, b) { return a.leftCol - b.leftCol; } ;; /* Methods relate to limiting the number events for a given day on a DayGrid ----------------------------------------------------------------------------------------------------------------------*/ // NOTE: all the segs being passed around in here are foreground segs DayGrid.mixin({ segPopover: null, // the Popover that holds events that can't fit in a cell. null when not visible popoverSegs: null, // an array of segment objects that the segPopover holds. null when not visible removeSegPopover: function() { if (this.segPopover) { this.segPopover.hide(); // in handler, will call segPopover's removeElement } }, // Limits the number of "levels" (vertically stacking layers of events) for each row of the grid. // `levelLimit` can be false (don't limit), a number, or true (should be computed). limitRows: function(levelLimit) { var rowStructs = this.rowStructs || []; var row; // row # var rowLevelLimit; for (row = 0; row < rowStructs.length; row++) { this.unlimitRow(row); if (!levelLimit) { rowLevelLimit = false; } else if (typeof levelLimit === 'number') { rowLevelLimit = levelLimit; } else { rowLevelLimit = this.computeRowLevelLimit(row); } if (rowLevelLimit !== false) { this.limitRow(row, rowLevelLimit); } } }, // Computes the number of levels a row will accomodate without going outside its bounds. // Assumes the row is "rigid" (maintains a constant height regardless of what is inside). // `row` is the row number. computeRowLevelLimit: function(row) { var rowEl = this.rowEls.eq(row); // the containing "fake" row div var rowHeight = rowEl.height(); // TODO: cache somehow? var trEls = this.rowStructs[row].tbodyEl.children(); var i, trEl; var trHeight; function iterInnerHeights(i, childNode) { trHeight = Math.max(trHeight, $(childNode).outerHeight()); } // Reveal one level <tr> at a time and stop when we find one out of bounds for (i = 0; i < trEls.length; i++) { trEl = trEls.eq(i).removeClass('fc-limited'); // reset to original state (reveal) // with rowspans>1 and IE8, trEl.outerHeight() would return the height of the largest cell, // so instead, find the tallest inner content element. trHeight = 0; trEl.find('> td > :first-child').each(iterInnerHeights); if (trEl.position().top + trHeight > rowHeight) { return i; } } return false; // should not limit at all }, // Limits the given grid row to the maximum number of levels and injects "more" links if necessary. // `row` is the row number. // `levelLimit` is a number for the maximum (inclusive) number of levels allowed. limitRow: function(row, levelLimit) { var _this = this; var rowStruct = this.rowStructs[row]; var moreNodes = []; // array of "more" <a> links and <td> DOM nodes var col = 0; // col #, left-to-right (not chronologically) var levelSegs; // array of segment objects in the last allowable level, ordered left-to-right var cellMatrix; // a matrix (by level, then column) of all <td> jQuery elements in the row var limitedNodes; // array of temporarily hidden level <tr> and segment <td> DOM nodes var i, seg; var segsBelow; // array of segment objects below `seg` in the current `col` var totalSegsBelow; // total number of segments below `seg` in any of the columns `seg` occupies var colSegsBelow; // array of segment arrays, below seg, one for each column (offset from segs's first column) var td, rowspan; var segMoreNodes; // array of "more" <td> cells that will stand-in for the current seg's cell var j; var moreTd, moreWrap, moreLink; // Iterates through empty level cells and places "more" links inside if need be function emptyCellsUntil(endCol) { // goes from current `col` to `endCol` while (col < endCol) { segsBelow = _this.getCellSegs(row, col, levelLimit); if (segsBelow.length) { td = cellMatrix[levelLimit - 1][col]; moreLink = _this.renderMoreLink(row, col, segsBelow); moreWrap = $('<div/>').append(moreLink); td.append(moreWrap); moreNodes.push(moreWrap[0]); } col++; } } if (levelLimit && levelLimit < rowStruct.segLevels.length) { // is it actually over the limit? levelSegs = rowStruct.segLevels[levelLimit - 1]; cellMatrix = rowStruct.cellMatrix; limitedNodes = rowStruct.tbodyEl.children().slice(levelLimit) // get level <tr> elements past the limit .addClass('fc-limited').get(); // hide elements and get a simple DOM-nodes array // iterate though segments in the last allowable level for (i = 0; i < levelSegs.length; i++) { seg = levelSegs[i]; emptyCellsUntil(seg.leftCol); // process empty cells before the segment // determine *all* segments below `seg` that occupy the same columns colSegsBelow = []; totalSegsBelow = 0; while (col <= seg.rightCol) { segsBelow = this.getCellSegs(row, col, levelLimit); colSegsBelow.push(segsBelow); totalSegsBelow += segsBelow.length; col++; } if (totalSegsBelow) { // do we need to replace this segment with one or many "more" links? td = cellMatrix[levelLimit - 1][seg.leftCol]; // the segment's parent cell rowspan = td.attr('rowspan') || 1; segMoreNodes = []; // make a replacement <td> for each column the segment occupies. will be one for each colspan for (j = 0; j < colSegsBelow.length; j++) { moreTd = $('<td class="fc-more-cell"/>').attr('rowspan', rowspan); segsBelow = colSegsBelow[j]; moreLink = this.renderMoreLink( row, seg.leftCol + j, [ seg ].concat(segsBelow) // count seg as hidden too ); moreWrap = $('<div/>').append(moreLink); moreTd.append(moreWrap); segMoreNodes.push(moreTd[0]); moreNodes.push(moreTd[0]); } td.addClass('fc-limited').after($(segMoreNodes)); // hide original <td> and inject replacements limitedNodes.push(td[0]); } } emptyCellsUntil(this.colCnt); // finish off the level rowStruct.moreEls = $(moreNodes); // for easy undoing later rowStruct.limitedEls = $(limitedNodes); // for easy undoing later } }, // Reveals all levels and removes all "more"-related elements for a grid's row. // `row` is a row number. unlimitRow: function(row) { var rowStruct = this.rowStructs[row]; if (rowStruct.moreEls) { rowStruct.moreEls.remove(); rowStruct.moreEls = null; } if (rowStruct.limitedEls) { rowStruct.limitedEls.removeClass('fc-limited'); rowStruct.limitedEls = null; } }, // Renders an <a> element that represents hidden event element for a cell. // Responsible for attaching click handler as well. renderMoreLink: function(row, col, hiddenSegs) { var _this = this; var view = this.view; return $('<a class="fc-more"/>') .text( this.getMoreLinkText(hiddenSegs.length) ) .on('click', function(ev) { var clickOption = view.opt('eventLimitClick'); var date = _this.getCellDate(row, col); var moreEl = $(this); var dayEl = _this.getCellEl(row, col); var allSegs = _this.getCellSegs(row, col); // rescope the segments to be within the cell's date var reslicedAllSegs = _this.resliceDaySegs(allSegs, date); var reslicedHiddenSegs = _this.resliceDaySegs(hiddenSegs, date); if (typeof clickOption === 'function') { // the returned value can be an atomic option clickOption = view.publiclyTrigger('eventLimitClick', null, { date: date, dayEl: dayEl, moreEl: moreEl, segs: reslicedAllSegs, hiddenSegs: reslicedHiddenSegs }, ev); } if (clickOption === 'popover') { _this.showSegPopover(row, col, moreEl, reslicedAllSegs); } else if (typeof clickOption === 'string') { // a view name view.calendar.zoomTo(date, clickOption); } }); }, // Reveals the popover that displays all events within a cell showSegPopover: function(row, col, moreLink, segs) { var _this = this; var view = this.view; var moreWrap = moreLink.parent(); // the <div> wrapper around the <a> var topEl; // the element we want to match the top coordinate of var options; if (this.rowCnt == 1) { topEl = view.el; // will cause the popover to cover any sort of header } else { topEl = this.rowEls.eq(row); // will align with top of row } options = { className: 'fc-more-popover', content: this.renderSegPopoverContent(row, col, segs), parentEl: this.view.el, // attach to root of view. guarantees outside of scrollbars. top: topEl.offset().top, autoHide: true, // when the user clicks elsewhere, hide the popover viewportConstrain: view.opt('popoverViewportConstrain'), hide: function() { // kill everything when the popover is hidden // notify events to be removed if (_this.popoverSegs) { var seg; for (var i = 0; i < _this.popoverSegs.length; ++i) { seg = _this.popoverSegs[i]; view.publiclyTrigger('eventDestroy', seg.event, seg.event, seg.el); } } _this.segPopover.removeElement(); _this.segPopover = null; _this.popoverSegs = null; } }; // Determine horizontal coordinate. // We use the moreWrap instead of the <td> to avoid border confusion. if (this.isRTL) { options.right = moreWrap.offset().left + moreWrap.outerWidth() + 1; // +1 to be over cell border } else { options.left = moreWrap.offset().left - 1; // -1 to be over cell border } this.segPopover = new Popover(options); this.segPopover.show(); // the popover doesn't live within the grid's container element, and thus won't get the event // delegated-handlers for free. attach event-related handlers to the popover. this.bindSegHandlersToEl(this.segPopover.el); }, // Builds the inner DOM contents of the segment popover renderSegPopoverContent: function(row, col, segs) { var view = this.view; var isTheme = view.opt('theme'); var title = this.getCellDate(row, col).format(view.opt('dayPopoverFormat')); var content = $( '<div class="fc-header ' + view.widgetHeaderClass + '">' + '<span class="fc-close ' + (isTheme ? 'ui-icon ui-icon-closethick' : 'fc-icon fc-icon-x') + '"></span>' + '<span class="fc-title">' + htmlEscape(title) + '</span>' + '<div class="fc-clear"/>' + '</div>' + '<div class="fc-body ' + view.widgetContentClass + '">' + '<div class="fc-event-container"></div>' + '</div>' ); var segContainer = content.find('.fc-event-container'); var i; // render each seg's `el` and only return the visible segs segs = this.renderFgSegEls(segs, true); // disableResizing=true this.popoverSegs = segs; for (i = 0; i < segs.length; i++) { // because segments in the popover are not part of a grid coordinate system, provide a hint to any // grids that want to do drag-n-drop about which cell it came from this.prepareHits(); segs[i].hit = this.getCellHit(row, col); this.releaseHits(); segContainer.append(segs[i].el); } return content; }, // Given the events within an array of segment objects, reslice them to be in a single day resliceDaySegs: function(segs, dayDate) { // build an array of the original events var events = $.map(segs, function(seg) { return seg.event; }); var dayStart = dayDate.clone(); var dayEnd = dayStart.clone().add(1, 'days'); var dayRange = { start: dayStart, end: dayEnd }; // slice the events with a custom slicing function segs = this.eventsToSegs( events, function(range) { var seg = intersectRanges(range, dayRange); // undefind if no intersection return seg ? [ seg ] : []; // must return an array of segments } ); // force an order because eventsToSegs doesn't guarantee one this.sortEventSegs(segs); return segs; }, // Generates the text that should be inside a "more" link, given the number of events it represents getMoreLinkText: function(num) { var opt = this.view.opt('eventLimitText'); if (typeof opt === 'function') { return opt(num); } else { return '+' + num + ' ' + opt; } }, // Returns segments within a given cell. // If `startLevel` is specified, returns only events including and below that level. Otherwise returns all segs. getCellSegs: function(row, col, startLevel) { var segMatrix = this.rowStructs[row].segMatrix; var level = startLevel || 0; var segs = []; var seg; while (level < segMatrix.length) { seg = segMatrix[level][col]; if (seg) { segs.push(seg); } level++; } return segs; } }); ;; /* A component that renders one or more columns of vertical time slots ----------------------------------------------------------------------------------------------------------------------*/ // We mixin DayTable, even though there is only a single row of days var TimeGrid = FC.TimeGrid = Grid.extend(DayTableMixin, { slotDuration: null, // duration of a "slot", a distinct time segment on given day, visualized by lines snapDuration: null, // granularity of time for dragging and selecting snapsPerSlot: null, minTime: null, // Duration object that denotes the first visible time of any given day maxTime: null, // Duration object that denotes the exclusive visible end time of any given day labelFormat: null, // formatting string for times running along vertical axis labelInterval: null, // duration of how often a label should be displayed for a slot colEls: null, // cells elements in the day-row background slatContainerEl: null, // div that wraps all the slat rows slatEls: null, // elements running horizontally across all columns nowIndicatorEls: null, colCoordCache: null, slatCoordCache: null, constructor: function() { Grid.apply(this, arguments); // call the super-constructor this.processOptions(); }, // Renders the time grid into `this.el`, which should already be assigned. // Relies on the view's colCnt. In the future, this component should probably be self-sufficient. renderDates: function() { this.el.html(this.renderHtml()); this.colEls = this.el.find('.fc-day'); this.slatContainerEl = this.el.find('.fc-slats'); this.slatEls = this.slatContainerEl.find('tr'); this.colCoordCache = new CoordCache({ els: this.colEls, isHorizontal: true }); this.slatCoordCache = new CoordCache({ els: this.slatEls, isVertical: true }); this.renderContentSkeleton(); }, // Renders the basic HTML skeleton for the grid renderHtml: function() { return '' + '<div class="fc-bg">' + '<table>' + this.renderBgTrHtml(0) + // row=0 '</table>' + '</div>' + '<div class="fc-slats">' + '<table>' + this.renderSlatRowHtml() + '</table>' + '</div>'; }, // Generates the HTML for the horizontal "slats" that run width-wise. Has a time axis on a side. Depends on RTL. renderSlatRowHtml: function() { var view = this.view; var isRTL = this.isRTL; var html = ''; var slotTime = moment.duration(+this.minTime); // wish there was .clone() for durations var slotDate; // will be on the view's first day, but we only care about its time var isLabeled; var axisHtml; // Calculate the time for each slot while (slotTime < this.maxTime) { slotDate = this.start.clone().time(slotTime); isLabeled = isInt(divideDurationByDuration(slotTime, this.labelInterval)); axisHtml = '<td class="fc-axis fc-time ' + view.widgetContentClass + '" ' + view.axisStyleAttr() + '>' + (isLabeled ? '<span>' + // for matchCellWidths htmlEscape(slotDate.format(this.labelFormat)) + '</span>' : '' ) + '</td>'; html += '<tr data-time="' + slotDate.format('HH:mm:ss') + '"' + (isLabeled ? '' : ' class="fc-minor"') + '>' + (!isRTL ? axisHtml : '') + '<td class="' + view.widgetContentClass + '"/>' + (isRTL ? axisHtml : '') + "</tr>"; slotTime.add(this.slotDuration); } return html; }, /* Options ------------------------------------------------------------------------------------------------------------------*/ // Parses various options into properties of this object processOptions: function() { var view = this.view; var slotDuration = view.opt('slotDuration'); var snapDuration = view.opt('snapDuration'); var input; slotDuration = moment.duration(slotDuration); snapDuration = snapDuration ? moment.duration(snapDuration) : slotDuration; this.slotDuration = slotDuration; this.snapDuration = snapDuration; this.snapsPerSlot = slotDuration / snapDuration; // TODO: ensure an integer multiple? this.minResizeDuration = snapDuration; // hack this.minTime = moment.duration(view.opt('minTime')); this.maxTime = moment.duration(view.opt('maxTime')); // might be an array value (for TimelineView). // if so, getting the most granular entry (the last one probably). input = view.opt('slotLabelFormat'); if ($.isArray(input)) { input = input[input.length - 1]; } this.labelFormat = input || view.opt('smallTimeFormat'); // the computed default input = view.opt('slotLabelInterval'); this.labelInterval = input ? moment.duration(input) : this.computeLabelInterval(slotDuration); }, // Computes an automatic value for slotLabelInterval computeLabelInterval: function(slotDuration) { var i; var labelInterval; var slotsPerLabel; // find the smallest stock label interval that results in more than one slots-per-label for (i = AGENDA_STOCK_SUB_DURATIONS.length - 1; i >= 0; i--) { labelInterval = moment.duration(AGENDA_STOCK_SUB_DURATIONS[i]); slotsPerLabel = divideDurationByDuration(labelInterval, slotDuration); if (isInt(slotsPerLabel) && slotsPerLabel > 1) { return labelInterval; } } return moment.duration(slotDuration); // fall back. clone }, // Computes a default event time formatting string if `timeFormat` is not explicitly defined computeEventTimeFormat: function() { return this.view.opt('noMeridiemTimeFormat'); // like "6:30" (no AM/PM) }, // Computes a default `displayEventEnd` value if one is not expliclty defined computeDisplayEventEnd: function() { return true; }, /* Hit System ------------------------------------------------------------------------------------------------------------------*/ prepareHits: function() { this.colCoordCache.build(); this.slatCoordCache.build(); }, releaseHits: function() { this.colCoordCache.clear(); // NOTE: don't clear slatCoordCache because we rely on it for computeTimeTop }, queryHit: function(leftOffset, topOffset) { var snapsPerSlot = this.snapsPerSlot; var colCoordCache = this.colCoordCache; var slatCoordCache = this.slatCoordCache; if (colCoordCache.isLeftInBounds(leftOffset) && slatCoordCache.isTopInBounds(topOffset)) { var colIndex = colCoordCache.getHorizontalIndex(leftOffset); var slatIndex = slatCoordCache.getVerticalIndex(topOffset); if (colIndex != null && slatIndex != null) { var slatTop = slatCoordCache.getTopOffset(slatIndex); var slatHeight = slatCoordCache.getHeight(slatIndex); var partial = (topOffset - slatTop) / slatHeight; // floating point number between 0 and 1 var localSnapIndex = Math.floor(partial * snapsPerSlot); // the snap # relative to start of slat var snapIndex = slatIndex * snapsPerSlot + localSnapIndex; var snapTop = slatTop + (localSnapIndex / snapsPerSlot) * slatHeight; var snapBottom = slatTop + ((localSnapIndex + 1) / snapsPerSlot) * slatHeight; return { col: colIndex, snap: snapIndex, component: this, // needed unfortunately :( left: colCoordCache.getLeftOffset(colIndex), right: colCoordCache.getRightOffset(colIndex), top: snapTop, bottom: snapBottom }; } } }, getHitSpan: function(hit) { var start = this.getCellDate(0, hit.col); // row=0 var time = this.computeSnapTime(hit.snap); // pass in the snap-index var end; start.time(time); end = start.clone().add(this.snapDuration); return { start: start, end: end }; }, getHitEl: function(hit) { return this.colEls.eq(hit.col); }, /* Dates ------------------------------------------------------------------------------------------------------------------*/ rangeUpdated: function() { this.updateDayTable(); }, // Given a row number of the grid, representing a "snap", returns a time (Duration) from its start-of-day computeSnapTime: function(snapIndex) { return moment.duration(this.minTime + this.snapDuration * snapIndex); }, // Slices up the given span (unzoned start/end with other misc data) into an array of segments spanToSegs: function(span) { var segs = this.sliceRangeByTimes(span); var i; for (i = 0; i < segs.length; i++) { if (this.isRTL) { segs[i].col = this.daysPerRow - 1 - segs[i].dayIndex; } else { segs[i].col = segs[i].dayIndex; } } return segs; }, sliceRangeByTimes: function(range) { var segs = []; var seg; var dayIndex; var dayDate; var dayRange; for (dayIndex = 0; dayIndex < this.daysPerRow; dayIndex++) { dayDate = this.dayDates[dayIndex].clone(); // TODO: better API for this? dayRange = { start: dayDate.clone().time(this.minTime), end: dayDate.clone().time(this.maxTime) }; seg = intersectRanges(range, dayRange); // both will be ambig timezone if (seg) { seg.dayIndex = dayIndex; segs.push(seg); } } return segs; }, /* Coordinates ------------------------------------------------------------------------------------------------------------------*/ updateSize: function(isResize) { // NOT a standard Grid method this.slatCoordCache.build(); if (isResize) { this.updateSegVerticals( [].concat(this.fgSegs || [], this.bgSegs || [], this.businessSegs || []) ); } }, getTotalSlatHeight: function() { return this.slatContainerEl.outerHeight(); }, // Computes the top coordinate, relative to the bounds of the grid, of the given date. // A `startOfDayDate` must be given for avoiding ambiguity over how to treat midnight. computeDateTop: function(date, startOfDayDate) { return this.computeTimeTop( moment.duration( date - startOfDayDate.clone().stripTime() ) ); }, // Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration). computeTimeTop: function(time) { var len = this.slatEls.length; var slatCoverage = (time - this.minTime) / this.slotDuration; // floating-point value of # of slots covered var slatIndex; var slatRemainder; // compute a floating-point number for how many slats should be progressed through. // from 0 to number of slats (inclusive) // constrained because minTime/maxTime might be customized. slatCoverage = Math.max(0, slatCoverage); slatCoverage = Math.min(len, slatCoverage); // an integer index of the furthest whole slat // from 0 to number slats (*exclusive*, so len-1) slatIndex = Math.floor(slatCoverage); slatIndex = Math.min(slatIndex, len - 1); // how much further through the slatIndex slat (from 0.0-1.0) must be covered in addition. // could be 1.0 if slatCoverage is covering *all* the slots slatRemainder = slatCoverage - slatIndex; return this.slatCoordCache.getTopPosition(slatIndex) + this.slatCoordCache.getHeight(slatIndex) * slatRemainder; }, /* Event Drag Visualization ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of an event being dragged over the specified date(s). // A returned value of `true` signals that a mock "helper" event has been rendered. renderDrag: function(eventLocation, seg) { if (seg) { // if there is event information for this drag, render a helper event // returns mock event elements // signal that a helper has been rendered return this.renderEventLocationHelper(eventLocation, seg); } else { // otherwise, just render a highlight this.renderHighlight(this.eventToSpan(eventLocation)); } }, // Unrenders any visual indication of an event being dragged unrenderDrag: function() { this.unrenderHelper(); this.unrenderHighlight(); }, /* Event Resize Visualization ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of an event being resized renderEventResize: function(eventLocation, seg) { return this.renderEventLocationHelper(eventLocation, seg); // returns mock event elements }, // Unrenders any visual indication of an event being resized unrenderEventResize: function() { this.unrenderHelper(); }, /* Event Helper ------------------------------------------------------------------------------------------------------------------*/ // Renders a mock "helper" event. `sourceSeg` is the original segment object and might be null (an external drag) renderHelper: function(event, sourceSeg) { return this.renderHelperSegs(this.eventToSegs(event), sourceSeg); // returns mock event elements }, // Unrenders any mock helper event unrenderHelper: function() { this.unrenderHelperSegs(); }, /* Business Hours ------------------------------------------------------------------------------------------------------------------*/ renderBusinessHours: function() { this.renderBusinessSegs( this.buildBusinessHourSegs() ); }, unrenderBusinessHours: function() { this.unrenderBusinessSegs(); }, /* Now Indicator ------------------------------------------------------------------------------------------------------------------*/ getNowIndicatorUnit: function() { return 'minute'; // will refresh on the minute }, renderNowIndicator: function(date) { // seg system might be overkill, but it handles scenario where line needs to be rendered // more than once because of columns with the same date (resources columns for example) var segs = this.spanToSegs({ start: date, end: date }); var top = this.computeDateTop(date, date); var nodes = []; var i; // render lines within the columns for (i = 0; i < segs.length; i++) { nodes.push($('<div class="fc-now-indicator fc-now-indicator-line"></div>') .css('top', top) .appendTo(this.colContainerEls.eq(segs[i].col))[0]); } // render an arrow over the axis if (segs.length > 0) { // is the current time in view? nodes.push($('<div class="fc-now-indicator fc-now-indicator-arrow"></div>') .css('top', top) .appendTo(this.el.find('.fc-content-skeleton'))[0]); } this.nowIndicatorEls = $(nodes); }, unrenderNowIndicator: function() { if (this.nowIndicatorEls) { this.nowIndicatorEls.remove(); this.nowIndicatorEls = null; } }, /* Selection ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of a selection. Overrides the default, which was to simply render a highlight. renderSelection: function(span) { if (this.view.opt('selectHelper')) { // this setting signals that a mock helper event should be rendered // normally acceps an eventLocation, span has a start/end, which is good enough this.renderEventLocationHelper(span); } else { this.renderHighlight(span); } }, // Unrenders any visual indication of a selection unrenderSelection: function() { this.unrenderHelper(); this.unrenderHighlight(); }, /* Highlight ------------------------------------------------------------------------------------------------------------------*/ renderHighlight: function(span) { this.renderHighlightSegs(this.spanToSegs(span)); }, unrenderHighlight: function() { this.unrenderHighlightSegs(); } }); ;; /* Methods for rendering SEGMENTS, pieces of content that live on the view ( this file is no longer just for events ) ----------------------------------------------------------------------------------------------------------------------*/ TimeGrid.mixin({ colContainerEls: null, // containers for each column // inner-containers for each column where different types of segs live fgContainerEls: null, bgContainerEls: null, helperContainerEls: null, highlightContainerEls: null, businessContainerEls: null, // arrays of different types of displayed segments fgSegs: null, bgSegs: null, helperSegs: null, highlightSegs: null, businessSegs: null, // Renders the DOM that the view's content will live in renderContentSkeleton: function() { var cellHtml = ''; var i; var skeletonEl; for (i = 0; i < this.colCnt; i++) { cellHtml += '<td>' + '<div class="fc-content-col">' + '<div class="fc-event-container fc-helper-container"></div>' + '<div class="fc-event-container"></div>' + '<div class="fc-highlight-container"></div>' + '<div class="fc-bgevent-container"></div>' + '<div class="fc-business-container"></div>' + '</div>' + '</td>'; } skeletonEl = $( '<div class="fc-content-skeleton">' + '<table>' + '<tr>' + cellHtml + '</tr>' + '</table>' + '</div>' ); this.colContainerEls = skeletonEl.find('.fc-content-col'); this.helperContainerEls = skeletonEl.find('.fc-helper-container'); this.fgContainerEls = skeletonEl.find('.fc-event-container:not(.fc-helper-container)'); this.bgContainerEls = skeletonEl.find('.fc-bgevent-container'); this.highlightContainerEls = skeletonEl.find('.fc-highlight-container'); this.businessContainerEls = skeletonEl.find('.fc-business-container'); this.bookendCells(skeletonEl.find('tr')); // TODO: do this on string level this.el.append(skeletonEl); }, /* Foreground Events ------------------------------------------------------------------------------------------------------------------*/ renderFgSegs: function(segs) { segs = this.renderFgSegsIntoContainers(segs, this.fgContainerEls); this.fgSegs = segs; return segs; // needed for Grid::renderEvents }, unrenderFgSegs: function() { this.unrenderNamedSegs('fgSegs'); }, /* Foreground Helper Events ------------------------------------------------------------------------------------------------------------------*/ renderHelperSegs: function(segs, sourceSeg) { var helperEls = []; var i, seg; var sourceEl; segs = this.renderFgSegsIntoContainers(segs, this.helperContainerEls); // Try to make the segment that is in the same row as sourceSeg look the same for (i = 0; i < segs.length; i++) { seg = segs[i]; if (sourceSeg && sourceSeg.col === seg.col) { sourceEl = sourceSeg.el; seg.el.css({ left: sourceEl.css('left'), right: sourceEl.css('right'), 'margin-left': sourceEl.css('margin-left'), 'margin-right': sourceEl.css('margin-right') }); } helperEls.push(seg.el[0]); } this.helperSegs = segs; return $(helperEls); // must return rendered helpers }, unrenderHelperSegs: function() { this.unrenderNamedSegs('helperSegs'); }, /* Background Events ------------------------------------------------------------------------------------------------------------------*/ renderBgSegs: function(segs) { segs = this.renderFillSegEls('bgEvent', segs); // TODO: old fill system this.updateSegVerticals(segs); this.attachSegsByCol(this.groupSegsByCol(segs), this.bgContainerEls); this.bgSegs = segs; return segs; // needed for Grid::renderEvents }, unrenderBgSegs: function() { this.unrenderNamedSegs('bgSegs'); }, /* Highlight ------------------------------------------------------------------------------------------------------------------*/ renderHighlightSegs: function(segs) { segs = this.renderFillSegEls('highlight', segs); // TODO: old fill system this.updateSegVerticals(segs); this.attachSegsByCol(this.groupSegsByCol(segs), this.highlightContainerEls); this.highlightSegs = segs; }, unrenderHighlightSegs: function() { this.unrenderNamedSegs('highlightSegs'); }, /* Business Hours ------------------------------------------------------------------------------------------------------------------*/ renderBusinessSegs: function(segs) { segs = this.renderFillSegEls('businessHours', segs); // TODO: old fill system this.updateSegVerticals(segs); this.attachSegsByCol(this.groupSegsByCol(segs), this.businessContainerEls); this.businessSegs = segs; }, unrenderBusinessSegs: function() { this.unrenderNamedSegs('businessSegs'); }, /* Seg Rendering Utils ------------------------------------------------------------------------------------------------------------------*/ // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's col groupSegsByCol: function(segs) { var segsByCol = []; var i; for (i = 0; i < this.colCnt; i++) { segsByCol.push([]); } for (i = 0; i < segs.length; i++) { segsByCol[segs[i].col].push(segs[i]); } return segsByCol; }, // Given segments grouped by column, insert the segments' elements into a parallel array of container // elements, each living within a column. attachSegsByCol: function(segsByCol, containerEls) { var col; var segs; var i; for (col = 0; col < this.colCnt; col++) { // iterate each column grouping segs = segsByCol[col]; for (i = 0; i < segs.length; i++) { containerEls.eq(col).append(segs[i].el); } } }, // Given the name of a property of `this` object, assumed to be an array of segments, // loops through each segment and removes from DOM. Will null-out the property afterwards. unrenderNamedSegs: function(propName) { var segs = this[propName]; var i; if (segs) { for (i = 0; i < segs.length; i++) { segs[i].el.remove(); } this[propName] = null; } }, /* Foreground Event Rendering Utils ------------------------------------------------------------------------------------------------------------------*/ // Given an array of foreground segments, render a DOM element for each, computes position, // and attaches to the column inner-container elements. renderFgSegsIntoContainers: function(segs, containerEls) { var segsByCol; var col; segs = this.renderFgSegEls(segs); // will call fgSegHtml segsByCol = this.groupSegsByCol(segs); for (col = 0; col < this.colCnt; col++) { this.updateFgSegCoords(segsByCol[col]); } this.attachSegsByCol(segsByCol, containerEls); return segs; }, // Renders the HTML for a single event segment's default rendering fgSegHtml: function(seg, disableResizing) { var view = this.view; var event = seg.event; var isDraggable = view.isEventDraggable(event); var isResizableFromStart = !disableResizing && seg.isStart && view.isEventResizableFromStart(event); var isResizableFromEnd = !disableResizing && seg.isEnd && view.isEventResizableFromEnd(event); var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd); var skinCss = cssToStr(this.getSegSkinCss(seg)); var timeText; var fullTimeText; // more verbose time text. for the print stylesheet var startTimeText; // just the start time text classes.unshift('fc-time-grid-event', 'fc-v-event'); if (view.isMultiDayEvent(event)) { // if the event appears to span more than one day... // Don't display time text on segments that run entirely through a day. // That would appear as midnight-midnight and would look dumb. // Otherwise, display the time text for the *segment's* times (like 6pm-midnight or midnight-10am) if (seg.isStart || seg.isEnd) { timeText = this.getEventTimeText(seg); fullTimeText = this.getEventTimeText(seg, 'LT'); startTimeText = this.getEventTimeText(seg, null, false); // displayEnd=false } } else { // Display the normal time text for the *event's* times timeText = this.getEventTimeText(event); fullTimeText = this.getEventTimeText(event, 'LT'); startTimeText = this.getEventTimeText(event, null, false); // displayEnd=false } return '<a class="' + classes.join(' ') + '"' + (event.url ? ' href="' + htmlEscape(event.url) + '"' : '' ) + (skinCss ? ' style="' + skinCss + '"' : '' ) + '>' + '<div class="fc-content">' + (timeText ? '<div class="fc-time"' + ' data-start="' + htmlEscape(startTimeText) + '"' + ' data-full="' + htmlEscape(fullTimeText) + '"' + '>' + '<span>' + htmlEscape(timeText) + '</span>' + '</div>' : '' ) + (event.title ? '<div class="fc-title">' + htmlEscape(event.title) + '</div>' : '' ) + '</div>' + '<div class="fc-bg"/>' + /* TODO: write CSS for this (isResizableFromStart ? '<div class="fc-resizer fc-start-resizer" />' : '' ) + */ (isResizableFromEnd ? '<div class="fc-resizer fc-end-resizer" />' : '' ) + '</a>'; }, /* Seg Position Utils ------------------------------------------------------------------------------------------------------------------*/ // Refreshes the CSS top/bottom coordinates for each segment element. // Works when called after initial render, after a window resize/zoom for example. updateSegVerticals: function(segs) { this.computeSegVerticals(segs); this.assignSegVerticals(segs); }, // For each segment in an array, computes and assigns its top and bottom properties computeSegVerticals: function(segs) { var i, seg; for (i = 0; i < segs.length; i++) { seg = segs[i]; seg.top = this.computeDateTop(seg.start, seg.start); seg.bottom = this.computeDateTop(seg.end, seg.start); } }, // Given segments that already have their top/bottom properties computed, applies those values to // the segments' elements. assignSegVerticals: function(segs) { var i, seg; for (i = 0; i < segs.length; i++) { seg = segs[i]; seg.el.css(this.generateSegVerticalCss(seg)); } }, // Generates an object with CSS properties for the top/bottom coordinates of a segment element generateSegVerticalCss: function(seg) { return { top: seg.top, bottom: -seg.bottom // flipped because needs to be space beyond bottom edge of event container }; }, /* Foreground Event Positioning Utils ------------------------------------------------------------------------------------------------------------------*/ // Given segments that are assumed to all live in the *same column*, // compute their verical/horizontal coordinates and assign to their elements. updateFgSegCoords: function(segs) { this.computeSegVerticals(segs); // horizontals relies on this this.computeFgSegHorizontals(segs); // compute horizontal coordinates, z-index's, and reorder the array this.assignSegVerticals(segs); this.assignFgSegHorizontals(segs); }, // Given an array of segments that are all in the same column, sets the backwardCoord and forwardCoord on each. // NOTE: Also reorders the given array by date! computeFgSegHorizontals: function(segs) { var levels; var level0; var i; this.sortEventSegs(segs); // order by certain criteria levels = buildSlotSegLevels(segs); computeForwardSlotSegs(levels); if ((level0 = levels[0])) { for (i = 0; i < level0.length; i++) { computeSlotSegPressures(level0[i]); } for (i = 0; i < level0.length; i++) { this.computeFgSegForwardBack(level0[i], 0, 0); } } }, // Calculate seg.forwardCoord and seg.backwardCoord for the segment, where both values range // from 0 to 1. If the calendar is left-to-right, the seg.backwardCoord maps to "left" and // seg.forwardCoord maps to "right" (via percentage). Vice-versa if the calendar is right-to-left. // // The segment might be part of a "series", which means consecutive segments with the same pressure // who's width is unknown until an edge has been hit. `seriesBackwardPressure` is the number of // segments behind this one in the current series, and `seriesBackwardCoord` is the starting // coordinate of the first segment in the series. computeFgSegForwardBack: function(seg, seriesBackwardPressure, seriesBackwardCoord) { var forwardSegs = seg.forwardSegs; var i; if (seg.forwardCoord === undefined) { // not already computed if (!forwardSegs.length) { // if there are no forward segments, this segment should butt up against the edge seg.forwardCoord = 1; } else { // sort highest pressure first this.sortForwardSegs(forwardSegs); // this segment's forwardCoord will be calculated from the backwardCoord of the // highest-pressure forward segment. this.computeFgSegForwardBack(forwardSegs[0], seriesBackwardPressure + 1, seriesBackwardCoord); seg.forwardCoord = forwardSegs[0].backwardCoord; } // calculate the backwardCoord from the forwardCoord. consider the series seg.backwardCoord = seg.forwardCoord - (seg.forwardCoord - seriesBackwardCoord) / // available width for series (seriesBackwardPressure + 1); // # of segments in the series // use this segment's coordinates to computed the coordinates of the less-pressurized // forward segments for (i=0; i<forwardSegs.length; i++) { this.computeFgSegForwardBack(forwardSegs[i], 0, seg.forwardCoord); } } }, sortForwardSegs: function(forwardSegs) { forwardSegs.sort(proxy(this, 'compareForwardSegs')); }, // A cmp function for determining which forward segment to rely on more when computing coordinates. compareForwardSegs: function(seg1, seg2) { // put higher-pressure first return seg2.forwardPressure - seg1.forwardPressure || // put segments that are closer to initial edge first (and favor ones with no coords yet) (seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) || // do normal sorting... this.compareEventSegs(seg1, seg2); }, // Given foreground event segments that have already had their position coordinates computed, // assigns position-related CSS values to their elements. assignFgSegHorizontals: function(segs) { var i, seg; for (i = 0; i < segs.length; i++) { seg = segs[i]; seg.el.css(this.generateFgSegHorizontalCss(seg)); // if the height is short, add a className for alternate styling if (seg.bottom - seg.top < 30) { seg.el.addClass('fc-short'); } } }, // Generates an object with CSS properties/values that should be applied to an event segment element. // Contains important positioning-related properties that should be applied to any event element, customized or not. generateFgSegHorizontalCss: function(seg) { var shouldOverlap = this.view.opt('slotEventOverlap'); var backwardCoord = seg.backwardCoord; // the left side if LTR. the right side if RTL. floating-point var forwardCoord = seg.forwardCoord; // the right side if LTR. the left side if RTL. floating-point var props = this.generateSegVerticalCss(seg); // get top/bottom first var left; // amount of space from left edge, a fraction of the total width var right; // amount of space from right edge, a fraction of the total width if (shouldOverlap) { // double the width, but don't go beyond the maximum forward coordinate (1.0) forwardCoord = Math.min(1, backwardCoord + (forwardCoord - backwardCoord) * 2); } if (this.isRTL) { left = 1 - forwardCoord; right = backwardCoord; } else { left = backwardCoord; right = 1 - forwardCoord; } props.zIndex = seg.level + 1; // convert from 0-base to 1-based props.left = left * 100 + '%'; props.right = right * 100 + '%'; if (shouldOverlap && seg.forwardPressure) { // add padding to the edge so that forward stacked events don't cover the resizer's icon props[this.isRTL ? 'marginLeft' : 'marginRight'] = 10 * 2; // 10 is a guesstimate of the icon's width } return props; } }); // Builds an array of segments "levels". The first level will be the leftmost tier of segments if the calendar is // left-to-right, or the rightmost if the calendar is right-to-left. Assumes the segments are already ordered by date. function buildSlotSegLevels(segs) { var levels = []; var i, seg; var j; for (i=0; i<segs.length; i++) { seg = segs[i]; // go through all the levels and stop on the first level where there are no collisions for (j=0; j<levels.length; j++) { if (!computeSlotSegCollisions(seg, levels[j]).length) { break; } } seg.level = j; (levels[j] || (levels[j] = [])).push(seg); } return levels; } // For every segment, figure out the other segments that are in subsequent // levels that also occupy the same vertical space. Accumulate in seg.forwardSegs function computeForwardSlotSegs(levels) { var i, level; var j, seg; var k; for (i=0; i<levels.length; i++) { level = levels[i]; for (j=0; j<level.length; j++) { seg = level[j]; seg.forwardSegs = []; for (k=i+1; k<levels.length; k++) { computeSlotSegCollisions(seg, levels[k], seg.forwardSegs); } } } } // Figure out which path forward (via seg.forwardSegs) results in the longest path until // the furthest edge is reached. The number of segments in this path will be seg.forwardPressure function computeSlotSegPressures(seg) { var forwardSegs = seg.forwardSegs; var forwardPressure = 0; var i, forwardSeg; if (seg.forwardPressure === undefined) { // not already computed for (i=0; i<forwardSegs.length; i++) { forwardSeg = forwardSegs[i]; // figure out the child's maximum forward path computeSlotSegPressures(forwardSeg); // either use the existing maximum, or use the child's forward pressure // plus one (for the forwardSeg itself) forwardPressure = Math.max( forwardPressure, 1 + forwardSeg.forwardPressure ); } seg.forwardPressure = forwardPressure; } } // Find all the segments in `otherSegs` that vertically collide with `seg`. // Append into an optionally-supplied `results` array and return. function computeSlotSegCollisions(seg, otherSegs, results) { results = results || []; for (var i=0; i<otherSegs.length; i++) { if (isSlotSegCollision(seg, otherSegs[i])) { results.push(otherSegs[i]); } } return results; } // Do these segments occupy the same vertical space? function isSlotSegCollision(seg1, seg2) { return seg1.bottom > seg2.top && seg1.top < seg2.bottom; } ;; /* An abstract class from which other views inherit from ----------------------------------------------------------------------------------------------------------------------*/ var View = FC.View = Class.extend(EmitterMixin, ListenerMixin, { type: null, // subclass' view name (string) name: null, // deprecated. use `type` instead title: null, // the text that will be displayed in the header's title calendar: null, // owner Calendar object options: null, // hash containing all options. already merged with view-specific-options el: null, // the view's containing element. set by Calendar isDateSet: false, isDateRendered: false, dateRenderQueue: null, isEventsBound: false, isEventsSet: false, isEventsRendered: false, eventRenderQueue: null, // range the view is actually displaying (moments) start: null, end: null, // exclusive // range the view is formally responsible for (moments) // may be different from start/end. for example, a month view might have 1st-31st, excluding padded dates intervalStart: null, intervalEnd: null, // exclusive intervalDuration: null, intervalUnit: null, // name of largest unit being displayed, like "month" or "week" isRTL: false, isSelected: false, // boolean whether a range of time is user-selected or not selectedEvent: null, eventOrderSpecs: null, // criteria for ordering events when they have same date/time // classNames styled by jqui themes widgetHeaderClass: null, widgetContentClass: null, highlightStateClass: null, // for date utils, computed from options nextDayThreshold: null, isHiddenDayHash: null, // now indicator isNowIndicatorRendered: null, initialNowDate: null, // result first getNow call initialNowQueriedMs: null, // ms time the getNow was called nowIndicatorTimeoutID: null, // for refresh timing of now indicator nowIndicatorIntervalID: null, // " constructor: function(calendar, type, options, intervalDuration) { this.calendar = calendar; this.type = this.name = type; // .name is deprecated this.options = options; this.intervalDuration = intervalDuration || moment.duration(1, 'day'); this.nextDayThreshold = moment.duration(this.opt('nextDayThreshold')); this.initThemingProps(); this.initHiddenDays(); this.isRTL = this.opt('isRTL'); this.eventOrderSpecs = parseFieldSpecs(this.opt('eventOrder')); this.dateRenderQueue = new TaskQueue(); this.eventRenderQueue = new TaskQueue(this.opt('eventRenderWait')); this.initialize(); }, // A good place for subclasses to initialize member variables initialize: function() { // subclasses can implement }, // Retrieves an option with the given name opt: function(name) { return this.options[name]; }, // Triggers handlers that are view-related. Modifies args before passing to calendar. publiclyTrigger: function(name, thisObj) { // arguments beyond thisObj are passed along var calendar = this.calendar; return calendar.publiclyTrigger.apply( calendar, [name, thisObj || this].concat( Array.prototype.slice.call(arguments, 2), // arguments beyond thisObj [ this ] // always make the last argument a reference to the view. TODO: deprecate ) ); }, // Returns a proxy of the given promise that will be rejected if the given event fires // before the promise resolves. rejectOn: function(eventName, promise) { var _this = this; return new Promise(function(resolve, reject) { _this.one(eventName, reject); function cleanup() { _this.off(eventName, reject); } promise.then(function(res) { // success cleanup(); resolve(res); }, function() { // failure cleanup(); reject(); }); }); }, /* Date Computation ------------------------------------------------------------------------------------------------------------------*/ // Updates all internal dates for displaying the given unzoned range. setRange: function(range) { $.extend(this, range); // assigns every property to this object's member variables this.updateTitle(); }, // Given a single current unzoned date, produce information about what range to display. // Subclasses can override. Must return all properties. computeRange: function(date) { var intervalUnit = computeIntervalUnit(this.intervalDuration); var intervalStart = date.clone().startOf(intervalUnit); var intervalEnd = intervalStart.clone().add(this.intervalDuration); var start, end; // normalize the range's time-ambiguity if (/year|month|week|day/.test(intervalUnit)) { // whole-days? intervalStart.stripTime(); intervalEnd.stripTime(); } else { // needs to have a time? if (!intervalStart.hasTime()) { intervalStart = this.calendar.time(0); // give 00:00 time } if (!intervalEnd.hasTime()) { intervalEnd = this.calendar.time(0); // give 00:00 time } } start = intervalStart.clone(); start = this.skipHiddenDays(start); end = intervalEnd.clone(); end = this.skipHiddenDays(end, -1, true); // exclusively move backwards return { intervalUnit: intervalUnit, intervalStart: intervalStart, intervalEnd: intervalEnd, start: start, end: end }; }, // Computes the new date when the user hits the prev button, given the current date computePrevDate: function(date) { return this.massageCurrentDate( date.clone().startOf(this.intervalUnit).subtract(this.intervalDuration), -1 ); }, // Computes the new date when the user hits the next button, given the current date computeNextDate: function(date) { return this.massageCurrentDate( date.clone().startOf(this.intervalUnit).add(this.intervalDuration) ); }, // Given an arbitrarily calculated current date of the calendar, returns a date that is ensured to be completely // visible. `direction` is optional and indicates which direction the current date was being // incremented or decremented (1 or -1). massageCurrentDate: function(date, direction) { if (this.intervalDuration.as('days') <= 1) { // if the view displays a single day or smaller if (this.isHiddenDay(date)) { date = this.skipHiddenDays(date, direction); date.startOf('day'); } } return date; }, /* Title and Date Formatting ------------------------------------------------------------------------------------------------------------------*/ // Sets the view's title property to the most updated computed value updateTitle: function() { this.title = this.computeTitle(); this.calendar.setToolbarsTitle(this.title); }, // Computes what the title at the top of the calendar should be for this view computeTitle: function() { return this.formatRange( { // in case intervalStart/End has a time, make sure timezone is correct start: this.calendar.applyTimezone(this.intervalStart), end: this.calendar.applyTimezone(this.intervalEnd) }, this.opt('titleFormat') || this.computeTitleFormat(), this.opt('titleRangeSeparator') ); }, // Generates the format string that should be used to generate the title for the current date range. // Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`. computeTitleFormat: function() { if (this.intervalUnit == 'year') { return 'YYYY'; } else if (this.intervalUnit == 'month') { return this.opt('monthYearFormat'); // like "September 2014" } else if (this.intervalDuration.as('days') > 1) { return 'll'; // multi-day range. shorter, like "Sep 9 - 10 2014" } else { return 'LL'; // one day. longer, like "September 9 2014" } }, // Utility for formatting a range. Accepts a range object, formatting string, and optional separator. // Displays all-day ranges naturally, with an inclusive end. Takes the current isRTL into account. // The timezones of the dates within `range` will be respected. formatRange: function(range, formatStr, separator) { var end = range.end; if (!end.hasTime()) { // all-day? end = end.clone().subtract(1); // convert to inclusive. last ms of previous day } return formatRange(range.start, end, formatStr, separator, this.opt('isRTL')); }, getAllDayHtml: function() { return this.opt('allDayHtml') || htmlEscape(this.opt('allDayText')); }, /* Navigation ------------------------------------------------------------------------------------------------------------------*/ // Generates HTML for an anchor to another view into the calendar. // Will either generate an <a> tag or a non-clickable <span> tag, depending on enabled settings. // `gotoOptions` can either be a moment input, or an object with the form: // { date, type, forceOff } // `type` is a view-type like "day" or "week". default value is "day". // `attrs` and `innerHtml` are use to generate the rest of the HTML tag. buildGotoAnchorHtml: function(gotoOptions, attrs, innerHtml) { var date, type, forceOff; var finalOptions; if ($.isPlainObject(gotoOptions)) { date = gotoOptions.date; type = gotoOptions.type; forceOff = gotoOptions.forceOff; } else { date = gotoOptions; // a single moment input } date = FC.moment(date); // if a string, parse it finalOptions = { // for serialization into the link date: date.format('YYYY-MM-DD'), type: type || 'day' }; if (typeof attrs === 'string') { innerHtml = attrs; attrs = null; } attrs = attrs ? ' ' + attrsToStr(attrs) : ''; // will have a leading space innerHtml = innerHtml || ''; if (!forceOff && this.opt('navLinks')) { return '<a' + attrs + ' data-goto="' + htmlEscape(JSON.stringify(finalOptions)) + '">' + innerHtml + '</a>'; } else { return '<span' + attrs + '>' + innerHtml + '</span>'; } }, // Rendering Non-date-related Content // ----------------------------------------------------------------------------------------------------------------- // Sets the container element that the view should render inside of, does global DOM-related initializations, // and renders all the non-date-related content inside. setElement: function(el) { this.el = el; this.bindGlobalHandlers(); this.renderSkeleton(); }, // Removes the view's container element from the DOM, clearing any content beforehand. // Undoes any other DOM-related attachments. removeElement: function() { this.unsetDate(); this.unrenderSkeleton(); this.unbindGlobalHandlers(); this.el.remove(); // NOTE: don't null-out this.el in case the View was destroyed within an API callback. // We don't null-out the View's other jQuery element references upon destroy, // so we shouldn't kill this.el either. }, // Renders the basic structure of the view before any content is rendered renderSkeleton: function() { // subclasses should implement }, // Unrenders the basic structure of the view unrenderSkeleton: function() { // subclasses should implement }, // Date Setting/Unsetting // ----------------------------------------------------------------------------------------------------------------- setDate: function(date) { var isReset = this.isDateSet; this.isDateSet = true; this.handleDate(date, isReset); this.trigger(isReset ? 'dateReset' : 'dateSet', date); }, unsetDate: function() { if (this.isDateSet) { this.isDateSet = false; this.handleDateUnset(); this.trigger('dateUnset'); } }, // Date Handling // ----------------------------------------------------------------------------------------------------------------- handleDate: function(date, isReset) { var _this = this; this.unbindEvents(); // will do nothing if not already bound this.requestDateRender(date).then(function() { // wish we could start earlier, but setRange/computeRange needs to execute first _this.bindEvents(); // will request events }); }, handleDateUnset: function() { this.unbindEvents(); this.requestDateUnrender(); }, // Date Render Queuing // ----------------------------------------------------------------------------------------------------------------- // if date not specified, uses current requestDateRender: function(date) { var _this = this; return this.dateRenderQueue.add(function() { return _this.executeDateRender(date); }); }, requestDateUnrender: function() { var _this = this; return this.dateRenderQueue.add(function() { return _this.executeDateUnrender(); }); }, // Date High-level Rendering // ----------------------------------------------------------------------------------------------------------------- // if date not specified, uses current executeDateRender: function(date) { var _this = this; // if rendering a new date, reset scroll to initial state (scrollTime) if (date) { this.captureInitialScroll(); } else { this.captureScroll(); // a rerender of the current date } this.freezeHeight(); return this.executeDateUnrender().then(function() { if (date) { _this.setRange(_this.computeRange(date)); } if (_this.render) { _this.render(); // TODO: deprecate } _this.renderDates(); _this.updateSize(); _this.renderBusinessHours(); // might need coordinates, so should go after updateSize() _this.startNowIndicator(); _this.thawHeight(); _this.releaseScroll(); _this.isDateRendered = true; _this.onDateRender(); _this.trigger('dateRender'); }); }, executeDateUnrender: function() { var _this = this; if (_this.isDateRendered) { return this.requestEventsUnrender().then(function() { _this.unselect(); _this.stopNowIndicator(); _this.triggerUnrender(); _this.unrenderBusinessHours(); _this.unrenderDates(); if (_this.destroy) { _this.destroy(); // TODO: deprecate } _this.isDateRendered = false; _this.trigger('dateUnrender'); }); } else { return Promise.resolve(); } }, // Date Rendering Triggers // ----------------------------------------------------------------------------------------------------------------- onDateRender: function() { this.triggerRender(); }, // Date Low-level Rendering // ----------------------------------------------------------------------------------------------------------------- // date-cell content only renderDates: function() { // subclasses should implement }, // date-cell content only unrenderDates: function() { // subclasses should override }, // Misc view rendering utils // ------------------------- // Signals that the view's content has been rendered triggerRender: function() { this.publiclyTrigger('viewRender', this, this, this.el); }, // Signals that the view's content is about to be unrendered triggerUnrender: function() { this.publiclyTrigger('viewDestroy', this, this, this.el); }, // Binds DOM handlers to elements that reside outside the view container, such as the document bindGlobalHandlers: function() { this.listenTo($(document), 'mousedown', this.handleDocumentMousedown); this.listenTo($(document), 'touchstart', this.processUnselect); }, // Unbinds DOM handlers from elements that reside outside the view container unbindGlobalHandlers: function() { this.stopListeningTo($(document)); }, // Initializes internal variables related to theming initThemingProps: function() { var tm = this.opt('theme') ? 'ui' : 'fc'; this.widgetHeaderClass = tm + '-widget-header'; this.widgetContentClass = tm + '-widget-content'; this.highlightStateClass = tm + '-state-highlight'; }, /* Business Hours ------------------------------------------------------------------------------------------------------------------*/ // Renders business-hours onto the view. Assumes updateSize has already been called. renderBusinessHours: function() { // subclasses should implement }, // Unrenders previously-rendered business-hours unrenderBusinessHours: function() { // subclasses should implement }, /* Now Indicator ------------------------------------------------------------------------------------------------------------------*/ // Immediately render the current time indicator and begins re-rendering it at an interval, // which is defined by this.getNowIndicatorUnit(). // TODO: somehow do this for the current whole day's background too startNowIndicator: function() { var _this = this; var unit; var update; var delay; // ms wait value if (this.opt('nowIndicator')) { unit = this.getNowIndicatorUnit(); if (unit) { update = proxy(this, 'updateNowIndicator'); // bind to `this` this.initialNowDate = this.calendar.getNow(); this.initialNowQueriedMs = +new Date(); this.renderNowIndicator(this.initialNowDate); this.isNowIndicatorRendered = true; // wait until the beginning of the next interval delay = this.initialNowDate.clone().startOf(unit).add(1, unit) - this.initialNowDate; this.nowIndicatorTimeoutID = setTimeout(function() { _this.nowIndicatorTimeoutID = null; update(); delay = +moment.duration(1, unit); delay = Math.max(100, delay); // prevent too frequent _this.nowIndicatorIntervalID = setInterval(update, delay); // update every interval }, delay); } } }, // rerenders the now indicator, computing the new current time from the amount of time that has passed // since the initial getNow call. updateNowIndicator: function() { if (this.isNowIndicatorRendered) { this.unrenderNowIndicator(); this.renderNowIndicator( this.initialNowDate.clone().add(new Date() - this.initialNowQueriedMs) // add ms ); } }, // Immediately unrenders the view's current time indicator and stops any re-rendering timers. // Won't cause side effects if indicator isn't rendered. stopNowIndicator: function() { if (this.isNowIndicatorRendered) { if (this.nowIndicatorTimeoutID) { clearTimeout(this.nowIndicatorTimeoutID); this.nowIndicatorTimeoutID = null; } if (this.nowIndicatorIntervalID) { clearTimeout(this.nowIndicatorIntervalID); this.nowIndicatorIntervalID = null; } this.unrenderNowIndicator(); this.isNowIndicatorRendered = false; } }, // Returns a string unit, like 'second' or 'minute' that defined how often the current time indicator // should be refreshed. If something falsy is returned, no time indicator is rendered at all. getNowIndicatorUnit: function() { // subclasses should implement }, // Renders a current time indicator at the given datetime renderNowIndicator: function(date) { // subclasses should implement }, // Undoes the rendering actions from renderNowIndicator unrenderNowIndicator: function() { // subclasses should implement }, /* Dimensions ------------------------------------------------------------------------------------------------------------------*/ // Refreshes anything dependant upon sizing of the container element of the grid updateSize: function(isResize) { if (isResize) { this.captureScroll(); } this.updateHeight(isResize); this.updateWidth(isResize); this.updateNowIndicator(); if (isResize) { this.releaseScroll(); } }, // Refreshes the horizontal dimensions of the calendar updateWidth: function(isResize) { // subclasses should implement }, // Refreshes the vertical dimensions of the calendar updateHeight: function(isResize) { var calendar = this.calendar; // we poll the calendar for height information this.setHeight( calendar.getSuggestedViewHeight(), calendar.isHeightAuto() ); }, // Updates the vertical dimensions of the calendar to the specified height. // if `isAuto` is set to true, height becomes merely a suggestion and the view should use its "natural" height. setHeight: function(height, isAuto) { // subclasses should implement }, /* Scroller ------------------------------------------------------------------------------------------------------------------*/ capturedScroll: null, capturedScrollDepth: 0, captureScroll: function() { if (!(this.capturedScrollDepth++)) { this.capturedScroll = this.isDateRendered ? this.queryScroll() : {}; // require a render first return true; // root? } return false; }, captureInitialScroll: function(forcedScroll) { if (this.captureScroll()) { // root? this.capturedScroll.isInitial = true; if (forcedScroll) { $.extend(this.capturedScroll, forcedScroll); } else { this.capturedScroll.isComputed = true; } } }, releaseScroll: function() { var scroll = this.capturedScroll; var isRoot = this.discardScroll(); if (scroll.isComputed) { if (isRoot) { // only compute initial scroll if it will actually be used (is the root capture) $.extend(scroll, this.computeInitialScroll()); } else { scroll = null; // scroll couldn't be computed. don't apply it to the DOM } } if (scroll) { // we act immediately on a releaseScroll operation, as opposed to captureScroll. // if capture/release wraps a render operation that screws up the scroll, // we still want to restore it a good state after, regardless of depth. if (scroll.isInitial) { this.hardSetScroll(scroll); // outsmart how browsers set scroll on initial DOM } else { this.setScroll(scroll); } } }, discardScroll: function() { if (!(--this.capturedScrollDepth)) { this.capturedScroll = null; return true; // root? } return false; }, computeInitialScroll: function() { return {}; }, queryScroll: function() { return {}; }, hardSetScroll: function(scroll) { var _this = this; var exec = function() { _this.setScroll(scroll); }; exec(); setTimeout(exec, 0); // to surely clear the browser's initial scroll for the DOM }, setScroll: function(scroll) { }, /* Height Freezing ------------------------------------------------------------------------------------------------------------------*/ freezeHeight: function() { this.calendar.freezeContentHeight(); }, thawHeight: function() { this.calendar.thawContentHeight(); }, // Event Binding/Unbinding // ----------------------------------------------------------------------------------------------------------------- bindEvents: function() { var _this = this; if (!this.isEventsBound) { this.isEventsBound = true; this.rejectOn('eventsUnbind', this.requestEvents()).then(function(events) { // TODO: test rejection _this.listenTo(_this.calendar, 'eventsReset', _this.setEvents); _this.setEvents(events); }); } }, unbindEvents: function() { if (this.isEventsBound) { this.isEventsBound = false; this.stopListeningTo(this.calendar, 'eventsReset'); this.unsetEvents(); this.trigger('eventsUnbind'); } }, // Event Setting/Unsetting // ----------------------------------------------------------------------------------------------------------------- setEvents: function(events) { var isReset = this.isEventSet; this.isEventsSet = true; this.handleEvents(events, isReset); this.trigger(isReset ? 'eventsReset' : 'eventsSet', events); }, unsetEvents: function() { if (this.isEventsSet) { this.isEventsSet = false; this.handleEventsUnset(); this.trigger('eventsUnset'); } }, whenEventsSet: function() { var _this = this; if (this.isEventsSet) { return Promise.resolve(this.getCurrentEvents()); } else { return new Promise(function(resolve) { _this.one('eventsSet', resolve); }); } }, // Event Handling // ----------------------------------------------------------------------------------------------------------------- handleEvents: function(events, isReset) { this.requestEventsRender(events); }, handleEventsUnset: function() { this.requestEventsUnrender(); }, // Event Render Queuing // ----------------------------------------------------------------------------------------------------------------- // assumes any previous event renders have been cleared already requestEventsRender: function(events) { var _this = this; return this.eventRenderQueue.add(function() { // might not return a promise if debounced!? bad return _this.executeEventsRender(events); }); }, requestEventsUnrender: function() { var _this = this; if (this.isEventsRendered) { return this.eventRenderQueue.addQuickly(function() { return _this.executeEventsUnrender(); }); } else { return Promise.resolve(); } }, requestCurrentEventsRender: function() { if (this.isEventsSet) { this.requestEventsRender(this.getCurrentEvents()); } else { return Promise.reject(); } }, // Event High-level Rendering // ----------------------------------------------------------------------------------------------------------------- executeEventsRender: function(events) { var _this = this; this.captureScroll(); this.freezeHeight(); return this.executeEventsUnrender().then(function() { _this.renderEvents(events); _this.thawHeight(); _this.releaseScroll(); _this.isEventsRendered = true; _this.onEventsRender(); _this.trigger('eventsRender'); }); }, executeEventsUnrender: function() { if (this.isEventsRendered) { this.onBeforeEventsUnrender(); this.captureScroll(); this.freezeHeight(); if (this.destroyEvents) { this.destroyEvents(); // TODO: deprecate } this.unrenderEvents(); this.thawHeight(); this.releaseScroll(); this.isEventsRendered = false; this.trigger('eventsUnrender'); } return Promise.resolve(); // always synchronous }, // Event Rendering Triggers // ----------------------------------------------------------------------------------------------------------------- // Signals that all events have been rendered onEventsRender: function() { this.renderedEventSegEach(function(seg) { this.publiclyTrigger('eventAfterRender', seg.event, seg.event, seg.el); }); this.publiclyTrigger('eventAfterAllRender'); }, // Signals that all event elements are about to be removed onBeforeEventsUnrender: function() { this.renderedEventSegEach(function(seg) { this.publiclyTrigger('eventDestroy', seg.event, seg.event, seg.el); }); }, // Event Low-level Rendering // ----------------------------------------------------------------------------------------------------------------- // Renders the events onto the view. renderEvents: function(events) { // subclasses should implement }, // Removes event elements from the view. unrenderEvents: function() { // subclasses should implement }, // Event Data Access // ----------------------------------------------------------------------------------------------------------------- requestEvents: function() { return this.calendar.requestEvents(this.start, this.end); }, getCurrentEvents: function() { return this.calendar.getPrunedEventCache(); }, // Event Rendering Utils // ----------------------------------------------------------------------------------------------------------------- // Given an event and the default element used for rendering, returns the element that should actually be used. // Basically runs events and elements through the eventRender hook. resolveEventEl: function(event, el) { var custom = this.publiclyTrigger('eventRender', event, event, el); if (custom === false) { // means don't render at all el = null; } else if (custom && custom !== true) { el = $(custom); } return el; }, // Hides all rendered event segments linked to the given event showEvent: function(event) { this.renderedEventSegEach(function(seg) { seg.el.css('visibility', ''); }, event); }, // Shows all rendered event segments linked to the given event hideEvent: function(event) { this.renderedEventSegEach(function(seg) { seg.el.css('visibility', 'hidden'); }, event); }, // Iterates through event segments that have been rendered (have an el). Goes through all by default. // If the optional `event` argument is specified, only iterates through segments linked to that event. // The `this` value of the callback function will be the view. renderedEventSegEach: function(func, event) { var segs = this.getEventSegs(); var i; for (i = 0; i < segs.length; i++) { if (!event || segs[i].event._id === event._id) { if (segs[i].el) { func.call(this, segs[i]); } } } }, // Retrieves all the rendered segment objects for the view getEventSegs: function() { // subclasses must implement return []; }, /* Event Drag-n-Drop ------------------------------------------------------------------------------------------------------------------*/ // Computes if the given event is allowed to be dragged by the user isEventDraggable: function(event) { return this.isEventStartEditable(event); }, isEventStartEditable: function(event) { return firstDefined( event.startEditable, (event.source || {}).startEditable, this.opt('eventStartEditable'), this.isEventGenerallyEditable(event) ); }, isEventGenerallyEditable: function(event) { return firstDefined( event.editable, (event.source || {}).editable, this.opt('editable') ); }, // Must be called when an event in the view is dropped onto new location. // `dropLocation` is an object that contains the new zoned start/end/allDay values for the event. reportEventDrop: function(event, dropLocation, largeUnit, el, ev) { var calendar = this.calendar; var mutateResult = calendar.mutateEvent(event, dropLocation, largeUnit); var undoFunc = function() { mutateResult.undo(); calendar.reportEventChange(); }; this.triggerEventDrop(event, mutateResult.dateDelta, undoFunc, el, ev); calendar.reportEventChange(); // will rerender events }, // Triggers event-drop handlers that have subscribed via the API triggerEventDrop: function(event, dateDelta, undoFunc, el, ev) { this.publiclyTrigger('eventDrop', el[0], event, dateDelta, undoFunc, ev, {}); // {} = jqui dummy }, /* External Element Drag-n-Drop ------------------------------------------------------------------------------------------------------------------*/ // Must be called when an external element, via jQuery UI, has been dropped onto the calendar. // `meta` is the parsed data that has been embedded into the dragging event. // `dropLocation` is an object that contains the new zoned start/end/allDay values for the event. reportExternalDrop: function(meta, dropLocation, el, ev, ui) { var eventProps = meta.eventProps; var eventInput; var event; // Try to build an event object and render it. TODO: decouple the two if (eventProps) { eventInput = $.extend({}, eventProps, dropLocation); event = this.calendar.renderEvent(eventInput, meta.stick)[0]; // renderEvent returns an array } this.triggerExternalDrop(event, dropLocation, el, ev, ui); }, // Triggers external-drop handlers that have subscribed via the API triggerExternalDrop: function(event, dropLocation, el, ev, ui) { // trigger 'drop' regardless of whether element represents an event this.publiclyTrigger('drop', el[0], dropLocation.start, ev, ui); if (event) { this.publiclyTrigger('eventReceive', null, event); // signal an external event landed } }, /* Drag-n-Drop Rendering (for both events and external elements) ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of a event or external-element drag over the given drop zone. // If an external-element, seg will be `null`. // Must return elements used for any mock events. renderDrag: function(dropLocation, seg) { // subclasses must implement }, // Unrenders a visual indication of an event or external-element being dragged. unrenderDrag: function() { // subclasses must implement }, /* Event Resizing ------------------------------------------------------------------------------------------------------------------*/ // Computes if the given event is allowed to be resized from its starting edge isEventResizableFromStart: function(event) { return this.opt('eventResizableFromStart') && this.isEventResizable(event); }, // Computes if the given event is allowed to be resized from its ending edge isEventResizableFromEnd: function(event) { return this.isEventResizable(event); }, // Computes if the given event is allowed to be resized by the user at all isEventResizable: function(event) { var source = event.source || {}; return firstDefined( event.durationEditable, source.durationEditable, this.opt('eventDurationEditable'), event.editable, source.editable, this.opt('editable') ); }, // Must be called when an event in the view has been resized to a new length reportEventResize: function(event, resizeLocation, largeUnit, el, ev) { var calendar = this.calendar; var mutateResult = calendar.mutateEvent(event, resizeLocation, largeUnit); var undoFunc = function() { mutateResult.undo(); calendar.reportEventChange(); }; this.triggerEventResize(event, mutateResult.durationDelta, undoFunc, el, ev); calendar.reportEventChange(); // will rerender events }, // Triggers event-resize handlers that have subscribed via the API triggerEventResize: function(event, durationDelta, undoFunc, el, ev) { this.publiclyTrigger('eventResize', el[0], event, durationDelta, undoFunc, ev, {}); // {} = jqui dummy }, /* Selection (time range) ------------------------------------------------------------------------------------------------------------------*/ // Selects a date span on the view. `start` and `end` are both Moments. // `ev` is the native mouse event that begin the interaction. select: function(span, ev) { this.unselect(ev); this.renderSelection(span); this.reportSelection(span, ev); }, // Renders a visual indication of the selection renderSelection: function(span) { // subclasses should implement }, // Called when a new selection is made. Updates internal state and triggers handlers. reportSelection: function(span, ev) { this.isSelected = true; this.triggerSelect(span, ev); }, // Triggers handlers to 'select' triggerSelect: function(span, ev) { this.publiclyTrigger( 'select', null, this.calendar.applyTimezone(span.start), // convert to calendar's tz for external API this.calendar.applyTimezone(span.end), // " ev ); }, // Undoes a selection. updates in the internal state and triggers handlers. // `ev` is the native mouse event that began the interaction. unselect: function(ev) { if (this.isSelected) { this.isSelected = false; if (this.destroySelection) { this.destroySelection(); // TODO: deprecate } this.unrenderSelection(); this.publiclyTrigger('unselect', null, ev); } }, // Unrenders a visual indication of selection unrenderSelection: function() { // subclasses should implement }, /* Event Selection ------------------------------------------------------------------------------------------------------------------*/ selectEvent: function(event) { if (!this.selectedEvent || this.selectedEvent !== event) { this.unselectEvent(); this.renderedEventSegEach(function(seg) { seg.el.addClass('fc-selected'); }, event); this.selectedEvent = event; } }, unselectEvent: function() { if (this.selectedEvent) { this.renderedEventSegEach(function(seg) { seg.el.removeClass('fc-selected'); }, this.selectedEvent); this.selectedEvent = null; } }, isEventSelected: function(event) { // event references might change on refetchEvents(), while selectedEvent doesn't, // so compare IDs return this.selectedEvent && this.selectedEvent._id === event._id; }, /* Mouse / Touch Unselecting (time range & event unselection) ------------------------------------------------------------------------------------------------------------------*/ // TODO: move consistently to down/start or up/end? // TODO: don't kill previous selection if touch scrolling handleDocumentMousedown: function(ev) { if (isPrimaryMouseButton(ev)) { this.processUnselect(ev); } }, processUnselect: function(ev) { this.processRangeUnselect(ev); this.processEventUnselect(ev); }, processRangeUnselect: function(ev) { var ignore; // is there a time-range selection? if (this.isSelected && this.opt('unselectAuto')) { // only unselect if the clicked element is not identical to or inside of an 'unselectCancel' element ignore = this.opt('unselectCancel'); if (!ignore || !$(ev.target).closest(ignore).length) { this.unselect(ev); } } }, processEventUnselect: function(ev) { if (this.selectedEvent) { if (!$(ev.target).closest('.fc-selected').length) { this.unselectEvent(); } } }, /* Day Click ------------------------------------------------------------------------------------------------------------------*/ // Triggers handlers to 'dayClick' // Span has start/end of the clicked area. Only the start is useful. triggerDayClick: function(span, dayEl, ev) { this.publiclyTrigger( 'dayClick', dayEl, this.calendar.applyTimezone(span.start), // convert to calendar's timezone for external API ev ); }, /* Date Utils ------------------------------------------------------------------------------------------------------------------*/ // Initializes internal variables related to calculating hidden days-of-week initHiddenDays: function() { var hiddenDays = this.opt('hiddenDays') || []; // array of day-of-week indices that are hidden var isHiddenDayHash = []; // is the day-of-week hidden? (hash with day-of-week-index -> bool) var dayCnt = 0; var i; if (this.opt('weekends') === false) { hiddenDays.push(0, 6); // 0=sunday, 6=saturday } for (i = 0; i < 7; i++) { if ( !(isHiddenDayHash[i] = $.inArray(i, hiddenDays) !== -1) ) { dayCnt++; } } if (!dayCnt) { throw 'invalid hiddenDays'; // all days were hidden? bad. } this.isHiddenDayHash = isHiddenDayHash; }, // Is the current day hidden? // `day` is a day-of-week index (0-6), or a Moment isHiddenDay: function(day) { if (moment.isMoment(day)) { day = day.day(); } return this.isHiddenDayHash[day]; }, // Incrementing the current day until it is no longer a hidden day, returning a copy. // If the initial value of `date` is not a hidden day, don't do anything. // Pass `isExclusive` as `true` if you are dealing with an end date. // `inc` defaults to `1` (increment one day forward each time) skipHiddenDays: function(date, inc, isExclusive) { var out = date.clone(); inc = inc || 1; while ( this.isHiddenDayHash[(out.day() + (isExclusive ? inc : 0) + 7) % 7] ) { out.add(inc, 'days'); } return out; }, // Returns the date range of the full days the given range visually appears to occupy. // Returns a new range object. computeDayRange: function(range) { var startDay = range.start.clone().stripTime(); // the beginning of the day the range starts var end = range.end; var endDay = null; var endTimeMS; if (end) { endDay = end.clone().stripTime(); // the beginning of the day the range exclusively ends endTimeMS = +end.time(); // # of milliseconds into `endDay` // If the end time is actually inclusively part of the next day and is equal to or // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`. // Otherwise, leaving it as inclusive will cause it to exclude `endDay`. if (endTimeMS && endTimeMS >= this.nextDayThreshold) { endDay.add(1, 'days'); } } // If no end was specified, or if it is within `startDay` but not past nextDayThreshold, // assign the default duration of one day. if (!end || endDay <= startDay) { endDay = startDay.clone().add(1, 'days'); } return { start: startDay, end: endDay }; }, // Does the given event visually appear to occupy more than one day? isMultiDayEvent: function(event) { var range = this.computeDayRange(event); // event is range-ish return range.end.diff(range.start, 'days') > 1; } }); ;; /* Embodies a div that has potential scrollbars */ var Scroller = FC.Scroller = Class.extend({ el: null, // the guaranteed outer element scrollEl: null, // the element with the scrollbars overflowX: null, overflowY: null, constructor: function(options) { options = options || {}; this.overflowX = options.overflowX || options.overflow || 'auto'; this.overflowY = options.overflowY || options.overflow || 'auto'; }, render: function() { this.el = this.renderEl(); this.applyOverflow(); }, renderEl: function() { return (this.scrollEl = $('<div class="fc-scroller"></div>')); }, // sets to natural height, unlocks overflow clear: function() { this.setHeight('auto'); this.applyOverflow(); }, destroy: function() { this.el.remove(); }, // Overflow // ----------------------------------------------------------------------------------------------------------------- applyOverflow: function() { this.scrollEl.css({ 'overflow-x': this.overflowX, 'overflow-y': this.overflowY }); }, // Causes any 'auto' overflow values to resolves to 'scroll' or 'hidden'. // Useful for preserving scrollbar widths regardless of future resizes. // Can pass in scrollbarWidths for optimization. lockOverflow: function(scrollbarWidths) { var overflowX = this.overflowX; var overflowY = this.overflowY; scrollbarWidths = scrollbarWidths || this.getScrollbarWidths(); if (overflowX === 'auto') { overflowX = ( scrollbarWidths.top || scrollbarWidths.bottom || // horizontal scrollbars? // OR scrolling pane with massless scrollbars? this.scrollEl[0].scrollWidth - 1 > this.scrollEl[0].clientWidth // subtract 1 because of IE off-by-one issue ) ? 'scroll' : 'hidden'; } if (overflowY === 'auto') { overflowY = ( scrollbarWidths.left || scrollbarWidths.right || // vertical scrollbars? // OR scrolling pane with massless scrollbars? this.scrollEl[0].scrollHeight - 1 > this.scrollEl[0].clientHeight // subtract 1 because of IE off-by-one issue ) ? 'scroll' : 'hidden'; } this.scrollEl.css({ 'overflow-x': overflowX, 'overflow-y': overflowY }); }, // Getters / Setters // ----------------------------------------------------------------------------------------------------------------- setHeight: function(height) { this.scrollEl.height(height); }, getScrollTop: function() { return this.scrollEl.scrollTop(); }, setScrollTop: function(top) { this.scrollEl.scrollTop(top); }, getClientWidth: function() { return this.scrollEl[0].clientWidth; }, getClientHeight: function() { return this.scrollEl[0].clientHeight; }, getScrollbarWidths: function() { return getScrollbarWidths(this.scrollEl); } }); ;; function Iterator(items) { this.items = items || []; } /* Calls a method on every item passing the arguments through */ Iterator.prototype.proxyCall = function(methodName) { var args = Array.prototype.slice.call(arguments, 1); var results = []; this.items.forEach(function(item) { results.push(item[methodName].apply(item, args)); }); return results; }; ;; /* Toolbar with buttons and title ----------------------------------------------------------------------------------------------------------------------*/ function Toolbar(calendar, toolbarOptions) { var t = this; // exports t.setToolbarOptions = setToolbarOptions; t.render = render; t.removeElement = removeElement; t.updateTitle = updateTitle; t.activateButton = activateButton; t.deactivateButton = deactivateButton; t.disableButton = disableButton; t.enableButton = enableButton; t.getViewsWithButtons = getViewsWithButtons; t.el = null; // mirrors local `el` // locals var el; var viewsWithButtons = []; var tm; // method to update toolbar-specific options, not calendar-wide options function setToolbarOptions(newToolbarOptions) { toolbarOptions = newToolbarOptions; } // can be called repeatedly and will rerender function render() { var sections = toolbarOptions.layout; tm = calendar.options.theme ? 'ui' : 'fc'; if (sections) { if (!el) { el = this.el = $("<div class='fc-toolbar "+ toolbarOptions.extraClasses + "'/>"); } else { el.empty(); } el.append(renderSection('left')) .append(renderSection('right')) .append(renderSection('center')) .append('<div class="fc-clear"/>'); } else { removeElement(); } } function removeElement() { if (el) { el.remove(); el = t.el = null; } } function renderSection(position) { var sectionEl = $('<div class="fc-' + position + '"/>'); var buttonStr = toolbarOptions.layout[position]; if (buttonStr) { $.each(buttonStr.split(' '), function(i) { var groupChildren = $(); var isOnlyButtons = true; var groupEl; $.each(this.split(','), function(j, buttonName) { var customButtonProps; var viewSpec; var buttonClick; var overrideText; // text explicitly set by calendar's constructor options. overcomes icons var defaultText; var themeIcon; var normalIcon; var innerHtml; var classes; var button; // the element if (buttonName == 'title') { groupChildren = groupChildren.add($('<h2> </h2>')); // we always want it to take up height isOnlyButtons = false; } else { if ((customButtonProps = (calendar.options.customButtons || {})[buttonName])) { buttonClick = function(ev) { if (customButtonProps.click) { customButtonProps.click.call(button[0], ev); } }; overrideText = ''; // icons will override text defaultText = customButtonProps.text; } else if ((viewSpec = calendar.getViewSpec(buttonName))) { buttonClick = function() { calendar.changeView(buttonName); }; viewsWithButtons.push(buttonName); overrideText = viewSpec.buttonTextOverride; defaultText = viewSpec.buttonTextDefault; } else if (calendar[buttonName]) { // a calendar method buttonClick = function() { calendar[buttonName](); }; overrideText = (calendar.overrides.buttonText || {})[buttonName]; defaultText = calendar.options.buttonText[buttonName]; // everything else is considered default } if (buttonClick) { themeIcon = customButtonProps ? customButtonProps.themeIcon : calendar.options.themeButtonIcons[buttonName]; normalIcon = customButtonProps ? customButtonProps.icon : calendar.options.buttonIcons[buttonName]; if (overrideText) { innerHtml = htmlEscape(overrideText); } else if (themeIcon && calendar.options.theme) { innerHtml = "<span class='ui-icon ui-icon-" + themeIcon + "'></span>"; } else if (normalIcon && !calendar.options.theme) { innerHtml = "<span class='fc-icon fc-icon-" + normalIcon + "'></span>"; } else { innerHtml = htmlEscape(defaultText); } classes = [ 'fc-' + buttonName + '-button', tm + '-button', tm + '-state-default' ]; button = $( // type="button" so that it doesn't submit a form '<button type="button" class="' + classes.join(' ') + '">' + innerHtml + '</button>' ) .click(function(ev) { // don't process clicks for disabled buttons if (!button.hasClass(tm + '-state-disabled')) { buttonClick(ev); // after the click action, if the button becomes the "active" tab, or disabled, // it should never have a hover class, so remove it now. if ( button.hasClass(tm + '-state-active') || button.hasClass(tm + '-state-disabled') ) { button.removeClass(tm + '-state-hover'); } } }) .mousedown(function() { // the *down* effect (mouse pressed in). // only on buttons that are not the "active" tab, or disabled button .not('.' + tm + '-state-active') .not('.' + tm + '-state-disabled') .addClass(tm + '-state-down'); }) .mouseup(function() { // undo the *down* effect button.removeClass(tm + '-state-down'); }) .hover( function() { // the *hover* effect. // only on buttons that are not the "active" tab, or disabled button .not('.' + tm + '-state-active') .not('.' + tm + '-state-disabled') .addClass(tm + '-state-hover'); }, function() { // undo the *hover* effect button .removeClass(tm + '-state-hover') .removeClass(tm + '-state-down'); // if mouseleave happens before mouseup } ); groupChildren = groupChildren.add(button); } } }); if (isOnlyButtons) { groupChildren .first().addClass(tm + '-corner-left').end() .last().addClass(tm + '-corner-right').end(); } if (groupChildren.length > 1) { groupEl = $('<div/>'); if (isOnlyButtons) { groupEl.addClass('fc-button-group'); } groupEl.append(groupChildren); sectionEl.append(groupEl); } else { sectionEl.append(groupChildren); // 1 or 0 children } }); } return sectionEl; } function updateTitle(text) { if (el) { el.find('h2').text(text); } } function activateButton(buttonName) { if (el) { el.find('.fc-' + buttonName + '-button') .addClass(tm + '-state-active'); } } function deactivateButton(buttonName) { if (el) { el.find('.fc-' + buttonName + '-button') .removeClass(tm + '-state-active'); } } function disableButton(buttonName) { if (el) { el.find('.fc-' + buttonName + '-button') .prop('disabled', true) .addClass(tm + '-state-disabled'); } } function enableButton(buttonName) { if (el) { el.find('.fc-' + buttonName + '-button') .prop('disabled', false) .removeClass(tm + '-state-disabled'); } } function getViewsWithButtons() { return viewsWithButtons; } } ;; var Calendar = FC.Calendar = Class.extend({ dirDefaults: null, // option defaults related to LTR or RTL localeDefaults: null, // option defaults related to current locale overrides: null, // option overrides given to the fullCalendar constructor dynamicOverrides: null, // options set with dynamic setter method. higher precedence than view overrides. options: null, // all defaults combined with overrides viewSpecCache: null, // cache of view definitions view: null, // current View object header: null, footer: null, loadingLevel: 0, // number of simultaneous loading tasks // a lot of this class' OOP logic is scoped within this constructor function, // but in the future, write individual methods on the prototype. constructor: Calendar_constructor, // Subclasses can override this for initialization logic after the constructor has been called initialize: function() { }, // Computes the flattened options hash for the calendar and assigns to `this.options`. // Assumes this.overrides and this.dynamicOverrides have already been initialized. populateOptionsHash: function() { var locale, localeDefaults; var isRTL, dirDefaults; locale = firstDefined( // explicit locale option given? this.dynamicOverrides.locale, this.overrides.locale ); localeDefaults = localeOptionHash[locale]; if (!localeDefaults) { // explicit locale option not given or invalid? locale = Calendar.defaults.locale; localeDefaults = localeOptionHash[locale] || {}; } isRTL = firstDefined( // based on options computed so far, is direction RTL? this.dynamicOverrides.isRTL, this.overrides.isRTL, localeDefaults.isRTL, Calendar.defaults.isRTL ); dirDefaults = isRTL ? Calendar.rtlDefaults : {}; this.dirDefaults = dirDefaults; this.localeDefaults = localeDefaults; this.options = mergeOptions([ // merge defaults and overrides. lowest to highest precedence Calendar.defaults, // global defaults dirDefaults, localeDefaults, this.overrides, this.dynamicOverrides ]); populateInstanceComputableOptions(this.options); // fill in gaps with computed options }, // Gets information about how to create a view. Will use a cache. getViewSpec: function(viewType) { var cache = this.viewSpecCache; return cache[viewType] || (cache[viewType] = this.buildViewSpec(viewType)); }, // Given a duration singular unit, like "week" or "day", finds a matching view spec. // Preference is given to views that have corresponding buttons. getUnitViewSpec: function(unit) { var viewTypes; var i; var spec; if ($.inArray(unit, intervalUnits) != -1) { // put views that have buttons first. there will be duplicates, but oh well viewTypes = this.header.getViewsWithButtons(); // TODO: include footer as well? $.each(FC.views, function(viewType) { // all views viewTypes.push(viewType); }); for (i = 0; i < viewTypes.length; i++) { spec = this.getViewSpec(viewTypes[i]); if (spec) { if (spec.singleUnit == unit) { return spec; } } } } }, // Builds an object with information on how to create a given view buildViewSpec: function(requestedViewType) { var viewOverrides = this.overrides.views || {}; var specChain = []; // for the view. lowest to highest priority var defaultsChain = []; // for the view. lowest to highest priority var overridesChain = []; // for the view. lowest to highest priority var viewType = requestedViewType; var spec; // for the view var overrides; // for the view var duration; var unit; // iterate from the specific view definition to a more general one until we hit an actual View class while (viewType) { spec = fcViews[viewType]; overrides = viewOverrides[viewType]; viewType = null; // clear. might repopulate for another iteration if (typeof spec === 'function') { // TODO: deprecate spec = { 'class': spec }; } if (spec) { specChain.unshift(spec); defaultsChain.unshift(spec.defaults || {}); duration = duration || spec.duration; viewType = viewType || spec.type; } if (overrides) { overridesChain.unshift(overrides); // view-specific option hashes have options at zero-level duration = duration || overrides.duration; viewType = viewType || overrides.type; } } spec = mergeProps(specChain); spec.type = requestedViewType; if (!spec['class']) { return false; } if (duration) { duration = moment.duration(duration); if (duration.valueOf()) { // valid? spec.duration = duration; unit = computeIntervalUnit(duration); // view is a single-unit duration, like "week" or "day" // incorporate options for this. lowest priority if (duration.as(unit) === 1) { spec.singleUnit = unit; overridesChain.unshift(viewOverrides[unit] || {}); } } } spec.defaults = mergeOptions(defaultsChain); spec.overrides = mergeOptions(overridesChain); this.buildViewSpecOptions(spec); this.buildViewSpecButtonText(spec, requestedViewType); return spec; }, // Builds and assigns a view spec's options object from its already-assigned defaults and overrides buildViewSpecOptions: function(spec) { spec.options = mergeOptions([ // lowest to highest priority Calendar.defaults, // global defaults spec.defaults, // view's defaults (from ViewSubclass.defaults) this.dirDefaults, this.localeDefaults, // locale and dir take precedence over view's defaults! this.overrides, // calendar's overrides (options given to constructor) spec.overrides, // view's overrides (view-specific options) this.dynamicOverrides // dynamically set via setter. highest precedence ]); populateInstanceComputableOptions(spec.options); }, // Computes and assigns a view spec's buttonText-related options buildViewSpecButtonText: function(spec, requestedViewType) { // given an options object with a possible `buttonText` hash, lookup the buttonText for the // requested view, falling back to a generic unit entry like "week" or "day" function queryButtonText(options) { var buttonText = options.buttonText || {}; return buttonText[requestedViewType] || // view can decide to look up a certain key (spec.buttonTextKey ? buttonText[spec.buttonTextKey] : null) || // a key like "month" (spec.singleUnit ? buttonText[spec.singleUnit] : null); } // highest to lowest priority spec.buttonTextOverride = queryButtonText(this.dynamicOverrides) || queryButtonText(this.overrides) || // constructor-specified buttonText lookup hash takes precedence spec.overrides.buttonText; // `buttonText` for view-specific options is a string // highest to lowest priority. mirrors buildViewSpecOptions spec.buttonTextDefault = queryButtonText(this.localeDefaults) || queryButtonText(this.dirDefaults) || spec.defaults.buttonText || // a single string. from ViewSubclass.defaults queryButtonText(Calendar.defaults) || (spec.duration ? this.humanizeDuration(spec.duration) : null) || // like "3 days" requestedViewType; // fall back to given view name }, // Given a view name for a custom view or a standard view, creates a ready-to-go View object instantiateView: function(viewType) { var spec = this.getViewSpec(viewType); return new spec['class'](this, viewType, spec.options, spec.duration); }, // Returns a boolean about whether the view is okay to instantiate at some point isValidViewType: function(viewType) { return Boolean(this.getViewSpec(viewType)); }, // Should be called when any type of async data fetching begins pushLoading: function() { if (!(this.loadingLevel++)) { this.publiclyTrigger('loading', null, true, this.view); } }, // Should be called when any type of async data fetching completes popLoading: function() { if (!(--this.loadingLevel)) { this.publiclyTrigger('loading', null, false, this.view); } }, // Given arguments to the select method in the API, returns a span (unzoned start/end and other info) buildSelectSpan: function(zonedStartInput, zonedEndInput) { var start = this.moment(zonedStartInput).stripZone(); var end; if (zonedEndInput) { end = this.moment(zonedEndInput).stripZone(); } else if (start.hasTime()) { end = start.clone().add(this.defaultTimedEventDuration); } else { end = start.clone().add(this.defaultAllDayEventDuration); } return { start: start, end: end }; } }); Calendar.mixin(EmitterMixin); function Calendar_constructor(element, overrides) { var t = this; // Exports // ----------------------------------------------------------------------------------- t.render = render; t.destroy = destroy; t.rerenderEvents = rerenderEvents; t.changeView = renderView; // `renderView` will switch to another view t.select = select; t.unselect = unselect; t.prev = prev; t.next = next; t.prevYear = prevYear; t.nextYear = nextYear; t.today = today; t.gotoDate = gotoDate; t.incrementDate = incrementDate; t.zoomTo = zoomTo; t.getDate = getDate; t.getCalendar = getCalendar; t.getView = getView; t.option = option; // getter/setter method t.publiclyTrigger = publiclyTrigger; // Options // ----------------------------------------------------------------------------------- t.dynamicOverrides = {}; t.viewSpecCache = {}; t.optionHandlers = {}; // for Calendar.options.js t.overrides = $.extend({}, overrides); // make a copy t.populateOptionsHash(); // sets this.options // Locale-data Internals // ----------------------------------------------------------------------------------- // Apply overrides to the current locale's data var localeData; // Called immediately, and when any of the options change. // Happens before any internal objects rebuild or rerender, because this is very core. t.bindOptions([ 'locale', 'monthNames', 'monthNamesShort', 'dayNames', 'dayNamesShort', 'firstDay', 'weekNumberCalculation' ], function(locale, monthNames, monthNamesShort, dayNames, dayNamesShort, firstDay, weekNumberCalculation) { // normalize if (weekNumberCalculation === 'iso') { weekNumberCalculation = 'ISO'; // normalize } localeData = createObject( // make a cheap copy getMomentLocaleData(locale) // will fall back to en ); if (monthNames) { localeData._months = monthNames; } if (monthNamesShort) { localeData._monthsShort = monthNamesShort; } if (dayNames) { localeData._weekdays = dayNames; } if (dayNamesShort) { localeData._weekdaysShort = dayNamesShort; } if (firstDay == null && weekNumberCalculation === 'ISO') { firstDay = 1; } if (firstDay != null) { var _week = createObject(localeData._week); // _week: { dow: # } _week.dow = firstDay; localeData._week = _week; } if ( // whitelist certain kinds of input weekNumberCalculation === 'ISO' || weekNumberCalculation === 'local' || typeof weekNumberCalculation === 'function' ) { localeData._fullCalendar_weekCalc = weekNumberCalculation; // moment-ext will know what to do with it } // If the internal current date object already exists, move to new locale. // We do NOT need to do this technique for event dates, because this happens when converting to "segments". if (date) { localizeMoment(date); // sets to localeData } }); // Calendar-specific Date Utilities // ----------------------------------------------------------------------------------- t.defaultAllDayEventDuration = moment.duration(t.options.defaultAllDayEventDuration); t.defaultTimedEventDuration = moment.duration(t.options.defaultTimedEventDuration); // Builds a moment using the settings of the current calendar: timezone and locale. // Accepts anything the vanilla moment() constructor accepts. t.moment = function() { var mom; if (t.options.timezone === 'local') { mom = FC.moment.apply(null, arguments); // Force the moment to be local, because FC.moment doesn't guarantee it. if (mom.hasTime()) { // don't give ambiguously-timed moments a local zone mom.local(); } } else if (t.options.timezone === 'UTC') { mom = FC.moment.utc.apply(null, arguments); // process as UTC } else { mom = FC.moment.parseZone.apply(null, arguments); // let the input decide the zone } localizeMoment(mom); return mom; }; // Updates the given moment's locale settings to the current calendar locale settings. function localizeMoment(mom) { mom._locale = localeData; } t.localizeMoment = localizeMoment; // Returns a boolean about whether or not the calendar knows how to calculate // the timezone offset of arbitrary dates in the current timezone. t.getIsAmbigTimezone = function() { return t.options.timezone !== 'local' && t.options.timezone !== 'UTC'; }; // Returns a copy of the given date in the current timezone. Has no effect on dates without times. t.applyTimezone = function(date) { if (!date.hasTime()) { return date.clone(); } var zonedDate = t.moment(date.toArray()); var timeAdjust = date.time() - zonedDate.time(); var adjustedZonedDate; // Safari sometimes has problems with this coersion when near DST. Adjust if necessary. (bug #2396) if (timeAdjust) { // is the time result different than expected? adjustedZonedDate = zonedDate.clone().add(timeAdjust); // add milliseconds if (date.time() - adjustedZonedDate.time() === 0) { // does it match perfectly now? zonedDate = adjustedZonedDate; } } return zonedDate; }; // Returns a moment for the current date, as defined by the client's computer or from the `now` option. // Will return an moment with an ambiguous timezone. t.getNow = function() { var now = t.options.now; if (typeof now === 'function') { now = now(); } return t.moment(now).stripZone(); }; // Get an event's normalized end date. If not present, calculate it from the defaults. t.getEventEnd = function(event) { if (event.end) { return event.end.clone(); } else { return t.getDefaultEventEnd(event.allDay, event.start); } }; // Given an event's allDay status and start date, return what its fallback end date should be. // TODO: rename to computeDefaultEventEnd t.getDefaultEventEnd = function(allDay, zonedStart) { var end = zonedStart.clone(); if (allDay) { end.stripTime().add(t.defaultAllDayEventDuration); } else { end.add(t.defaultTimedEventDuration); } if (t.getIsAmbigTimezone()) { end.stripZone(); // we don't know what the tzo should be } return end; }; // Produces a human-readable string for the given duration. // Side-effect: changes the locale of the given duration. t.humanizeDuration = function(duration) { return duration.locale(t.options.locale).humanize(); }; // Imports // ----------------------------------------------------------------------------------- EventManager.call(t); // Locals // ----------------------------------------------------------------------------------- var _element = element[0]; var toolbarsManager; var header; var footer; var content; var tm; // for making theme classes var currentView; // NOTE: keep this in sync with this.view var viewsByType = {}; // holds all instantiated view instances, current or not var suggestedViewHeight; var windowResizeProxy; // wraps the windowResize function var ignoreWindowResize = 0; var date; // unzoned // Main Rendering // ----------------------------------------------------------------------------------- // compute the initial ambig-timezone date if (t.options.defaultDate != null) { date = t.moment(t.options.defaultDate).stripZone(); } else { date = t.getNow(); // getNow already returns unzoned } function render() { if (!content) { initialRender(); } else if (elementVisible()) { // mainly for the public API calcSize(); renderView(); } } function initialRender() { element.addClass('fc'); // event delegation for nav links element.on('click.fc', 'a[data-goto]', function(ev) { var anchorEl = $(this); var gotoOptions = anchorEl.data('goto'); // will automatically parse JSON var date = t.moment(gotoOptions.date); var viewType = gotoOptions.type; // property like "navLinkDayClick". might be a string or a function var customAction = currentView.opt('navLink' + capitaliseFirstLetter(viewType) + 'Click'); if (typeof customAction === 'function') { customAction(date, ev); } else { if (typeof customAction === 'string') { viewType = customAction; } zoomTo(date, viewType); } }); // called immediately, and upon option change t.bindOption('theme', function(theme) { tm = theme ? 'ui' : 'fc'; // affects a larger scope element.toggleClass('ui-widget', theme); element.toggleClass('fc-unthemed', !theme); }); // called immediately, and upon option change. // HACK: locale often affects isRTL, so we explicitly listen to that too. t.bindOptions([ 'isRTL', 'locale' ], function(isRTL) { element.toggleClass('fc-ltr', !isRTL); element.toggleClass('fc-rtl', isRTL); }); content = $("<div class='fc-view-container'/>").prependTo(element); var toolbars = buildToolbars(); toolbarsManager = new Iterator(toolbars); header = t.header = toolbars[0]; footer = t.footer = toolbars[1]; renderHeader(); renderFooter(); renderView(t.options.defaultView); if (t.options.handleWindowResize) { windowResizeProxy = debounce(windowResize, t.options.windowResizeDelay); // prevents rapid calls $(window).resize(windowResizeProxy); } } function destroy() { if (currentView) { currentView.removeElement(); // NOTE: don't null-out currentView/t.view in case API methods are called after destroy. // It is still the "current" view, just not rendered. } toolbarsManager.proxyCall('removeElement'); content.remove(); element.removeClass('fc fc-ltr fc-rtl fc-unthemed ui-widget'); element.off('.fc'); // unbind nav link handlers if (windowResizeProxy) { $(window).unbind('resize', windowResizeProxy); } } function elementVisible() { return element.is(':visible'); } // View Rendering // ----------------------------------------------------------------------------------- // Renders a view because of a date change, view-type change, or for the first time. // If not given a viewType, keep the current view but render different dates. // Accepts an optional scroll state to restore to. function renderView(viewType, forcedScroll) { ignoreWindowResize++; var needsClearView = currentView && viewType && currentView.type !== viewType; // if viewType is changing, remove the old view's rendering if (needsClearView) { freezeContentHeight(); // prevent a scroll jump when view element is removed clearView(); } // if viewType changed, or the view was never created, create a fresh view if (!currentView && viewType) { currentView = t.view = viewsByType[viewType] || (viewsByType[viewType] = t.instantiateView(viewType)); currentView.setElement( $("<div class='fc-view fc-" + viewType + "-view' />").appendTo(content) ); toolbarsManager.proxyCall('activateButton', viewType); } if (currentView) { // in case the view should render a period of time that is completely hidden date = currentView.massageCurrentDate(date); // render or rerender the view if ( !currentView.isDateSet || !( // NOT within interval range signals an implicit date window change date >= currentView.intervalStart && date < currentView.intervalEnd ) ) { if (elementVisible()) { if (forcedScroll) { currentView.captureInitialScroll(forcedScroll); } currentView.setDate(date, forcedScroll); if (forcedScroll) { currentView.releaseScroll(); } // need to do this after View::render, so dates are calculated // NOTE: view updates title text proactively updateToolbarsTodayButton(); } } } if (needsClearView) { thawContentHeight(); } ignoreWindowResize--; } // Unrenders the current view and reflects this change in the Header. // Unregsiters the `currentView`, but does not remove from viewByType hash. function clearView() { toolbarsManager.proxyCall('deactivateButton', currentView.type); currentView.removeElement(); currentView = t.view = null; } // Destroys the view, including the view object. Then, re-instantiates it and renders it. // Maintains the same scroll state. // TODO: maintain any other user-manipulated state. function reinitView() { ignoreWindowResize++; freezeContentHeight(); var viewType = currentView.type; var scrollState = currentView.queryScroll(); clearView(); calcSize(); renderView(viewType, scrollState); thawContentHeight(); ignoreWindowResize--; } // Resizing // ----------------------------------------------------------------------------------- t.getSuggestedViewHeight = function() { if (suggestedViewHeight === undefined) { calcSize(); } return suggestedViewHeight; }; t.isHeightAuto = function() { return t.options.contentHeight === 'auto' || t.options.height === 'auto'; }; function updateSize(shouldRecalc) { if (elementVisible()) { if (shouldRecalc) { _calcSize(); } ignoreWindowResize++; currentView.updateSize(true); // isResize=true. will poll getSuggestedViewHeight() and isHeightAuto() ignoreWindowResize--; return true; // signal success } } function calcSize() { if (elementVisible()) { _calcSize(); } } function _calcSize() { // assumes elementVisible var contentHeightInput = t.options.contentHeight; var heightInput = t.options.height; if (typeof contentHeightInput === 'number') { // exists and not 'auto' suggestedViewHeight = contentHeightInput; } else if (typeof contentHeightInput === 'function') { // exists and is a function suggestedViewHeight = contentHeightInput(); } else if (typeof heightInput === 'number') { // exists and not 'auto' suggestedViewHeight = heightInput - queryToolbarsHeight(); } else if (typeof heightInput === 'function') { // exists and is a function suggestedViewHeight = heightInput() - queryToolbarsHeight(); } else if (heightInput === 'parent') { // set to height of parent element suggestedViewHeight = element.parent().height() - queryToolbarsHeight(); } else { suggestedViewHeight = Math.round(content.width() / Math.max(t.options.aspectRatio, .5)); } } function queryToolbarsHeight() { return toolbarsManager.items.reduce(function(accumulator, toolbar) { var toolbarHeight = toolbar.el ? toolbar.el.outerHeight(true) : 0; // includes margin return accumulator + toolbarHeight; }, 0); } function windowResize(ev) { if ( !ignoreWindowResize && ev.target === window && // so we don't process jqui "resize" events that have bubbled up currentView.start // view has already been rendered ) { if (updateSize(true)) { currentView.publiclyTrigger('windowResize', _element); } } } /* Event Rendering -----------------------------------------------------------------------------*/ function rerenderEvents() { // API method. destroys old events if previously rendered. if (elementVisible()) { t.reportEventChange(); // will re-trasmit events to the view, causing a rerender } } /* Toolbars -----------------------------------------------------------------------------*/ function buildToolbars() { return [ new Toolbar(t, computeHeaderOptions()), new Toolbar(t, computeFooterOptions()) ]; } function computeHeaderOptions() { return { extraClasses: 'fc-header-toolbar', layout: t.options.header }; } function computeFooterOptions() { return { extraClasses: 'fc-footer-toolbar', layout: t.options.footer }; } // can be called repeatedly and Header will rerender function renderHeader() { header.setToolbarOptions(computeHeaderOptions()); header.render(); if (header.el) { element.prepend(header.el); } } // can be called repeatedly and Footer will rerender function renderFooter() { footer.setToolbarOptions(computeFooterOptions()); footer.render(); if (footer.el) { element.append(footer.el); } } t.setToolbarsTitle = function(title) { toolbarsManager.proxyCall('updateTitle', title); }; function updateToolbarsTodayButton() { var now = t.getNow(); if (now >= currentView.intervalStart && now < currentView.intervalEnd) { toolbarsManager.proxyCall('disableButton', 'today'); } else { toolbarsManager.proxyCall('enableButton', 'today'); } } /* Selection -----------------------------------------------------------------------------*/ // this public method receives start/end dates in any format, with any timezone function select(zonedStartInput, zonedEndInput) { currentView.select( t.buildSelectSpan.apply(t, arguments) ); } function unselect() { // safe to be called before renderView if (currentView) { currentView.unselect(); } } /* Date -----------------------------------------------------------------------------*/ function prev() { date = currentView.computePrevDate(date); renderView(); } function next() { date = currentView.computeNextDate(date); renderView(); } function prevYear() { date.add(-1, 'years'); renderView(); } function nextYear() { date.add(1, 'years'); renderView(); } function today() { date = t.getNow(); renderView(); } function gotoDate(zonedDateInput) { date = t.moment(zonedDateInput).stripZone(); renderView(); } function incrementDate(delta) { date.add(moment.duration(delta)); renderView(); } // Forces navigation to a view for the given date. // `viewType` can be a specific view name or a generic one like "week" or "day". function zoomTo(newDate, viewType) { var spec; viewType = viewType || 'day'; // day is default zoom spec = t.getViewSpec(viewType) || t.getUnitViewSpec(viewType); date = newDate.clone(); renderView(spec ? spec.type : null); } // for external API function getDate() { return t.applyTimezone(date); // infuse the calendar's timezone } /* Height "Freezing" -----------------------------------------------------------------------------*/ t.freezeContentHeight = freezeContentHeight; t.thawContentHeight = thawContentHeight; var freezeContentHeightDepth = 0; function freezeContentHeight() { if (!(freezeContentHeightDepth++)) { content.css({ width: '100%', height: content.height(), overflow: 'hidden' }); } } function thawContentHeight() { if (!(--freezeContentHeightDepth)) { content.css({ width: '', height: '', overflow: '' }); } } /* Misc -----------------------------------------------------------------------------*/ function getCalendar() { return t; } function getView() { return currentView; } function option(name, value) { var newOptionHash; if (typeof name === 'string') { if (value === undefined) { // getter return t.options[name]; } else { // setter for individual option newOptionHash = {}; newOptionHash[name] = value; setOptions(newOptionHash); } } else if (typeof name === 'object') { // compound setter with object input setOptions(name); } } function setOptions(newOptionHash) { var optionCnt = 0; var optionName; for (optionName in newOptionHash) { t.dynamicOverrides[optionName] = newOptionHash[optionName]; } t.viewSpecCache = {}; // the dynamic override invalidates the options in this cache, so just clear it t.populateOptionsHash(); // this.options needs to be recomputed after the dynamic override // trigger handlers after this.options has been updated for (optionName in newOptionHash) { t.triggerOptionHandlers(optionName); // recall bindOption/bindOptions optionCnt++; } // special-case handling of single option change. // if only one option change, `optionName` will be its name. if (optionCnt === 1) { if (optionName === 'height' || optionName === 'contentHeight' || optionName === 'aspectRatio') { updateSize(true); // true = allow recalculation of height return; } else if (optionName === 'defaultDate') { return; // can't change date this way. use gotoDate instead } else if (optionName === 'businessHours') { if (currentView) { currentView.unrenderBusinessHours(); currentView.renderBusinessHours(); } return; } else if (optionName === 'timezone') { t.rezoneArrayEventSources(); t.refetchEvents(); return; } } // catch-all. rerender the header and footer and rebuild/rerender the current view renderHeader(); renderFooter(); viewsByType = {}; // even non-current views will be affected by this option change. do before rerender reinitView(); } function publiclyTrigger(name, thisObj) { var args = Array.prototype.slice.call(arguments, 2); thisObj = thisObj || _element; this.triggerWith(name, thisObj, args); // Emitter's method if (t.options[name]) { return t.options[name].apply(thisObj, args); } } t.initialize(); } ;; /* Options binding/triggering system. */ Calendar.mixin({ // A map of option names to arrays of handler objects. Initialized to {} in Calendar. // Format for a handler object: // { // func // callback function to be called upon change // names // option names whose values should be given to func // } optionHandlers: null, // Calls handlerFunc immediately, and when the given option has changed. // handlerFunc will be given the option value. bindOption: function(optionName, handlerFunc) { this.bindOptions([ optionName ], handlerFunc); }, // Calls handlerFunc immediately, and when any of the given options change. // handlerFunc will be given each option value as ordered function arguments. bindOptions: function(optionNames, handlerFunc) { var handlerObj = { func: handlerFunc, names: optionNames }; var i; for (i = 0; i < optionNames.length; i++) { this.registerOptionHandlerObj(optionNames[i], handlerObj); } this.triggerOptionHandlerObj(handlerObj); }, // Puts the given handler object into the internal hash registerOptionHandlerObj: function(optionName, handlerObj) { (this.optionHandlers[optionName] || (this.optionHandlers[optionName] = [])) .push(handlerObj); }, // Reports that the given option has changed, and calls all appropriate handlers. triggerOptionHandlers: function(optionName) { var handlerObjs = this.optionHandlers[optionName] || []; var i; for (i = 0; i < handlerObjs.length; i++) { this.triggerOptionHandlerObj(handlerObjs[i]); } }, // Calls the callback for a specific handler object, passing in the appropriate arguments. triggerOptionHandlerObj: function(handlerObj) { var optionNames = handlerObj.names; var optionValues = []; var i; for (i = 0; i < optionNames.length; i++) { optionValues.push(this.options[optionNames[i]]); } handlerObj.func.apply(this, optionValues); // maintain the Calendar's `this` context } }); ;; Calendar.defaults = { titleRangeSeparator: ' \u2013 ', // en dash monthYearFormat: 'MMMM YYYY', // required for en. other locales rely on datepicker computable option defaultTimedEventDuration: '02:00:00', defaultAllDayEventDuration: { days: 1 }, forceEventDuration: false, nextDayThreshold: '09:00:00', // 9am // display defaultView: 'month', aspectRatio: 1.35, header: { left: 'title', center: '', right: 'today prev,next' }, weekends: true, weekNumbers: false, weekNumberTitle: 'W', weekNumberCalculation: 'local', //editable: false, //nowIndicator: false, scrollTime: '06:00:00', // event ajax lazyFetching: true, startParam: 'start', endParam: 'end', timezoneParam: 'timezone', timezone: false, //allDayDefault: undefined, // locale isRTL: false, buttonText: { prev: "prev", next: "next", prevYear: "prev year", nextYear: "next year", year: 'year', // TODO: locale files need to specify this today: 'today', month: 'month', week: 'week', day: 'day' }, buttonIcons: { prev: 'left-single-arrow', next: 'right-single-arrow', prevYear: 'left-double-arrow', nextYear: 'right-double-arrow' }, allDayText: 'all-day', // jquery-ui theming theme: false, themeButtonIcons: { prev: 'circle-triangle-w', next: 'circle-triangle-e', prevYear: 'seek-prev', nextYear: 'seek-next' }, //eventResizableFromStart: false, dragOpacity: .75, dragRevertDuration: 500, dragScroll: true, //selectable: false, unselectAuto: true, dropAccept: '*', eventOrder: 'title', //eventRenderWait: null, eventLimit: false, eventLimitText: 'more', eventLimitClick: 'popover', dayPopoverFormat: 'LL', handleWindowResize: true, windowResizeDelay: 100, // milliseconds before an updateSize happens longPressDelay: 1000 }; Calendar.englishDefaults = { // used by locale.js dayPopoverFormat: 'dddd, MMMM D' }; Calendar.rtlDefaults = { // right-to-left defaults header: { // TODO: smarter solution (first/center/last ?) left: 'next,prev today', center: '', right: 'title' }, buttonIcons: { prev: 'right-single-arrow', next: 'left-single-arrow', prevYear: 'right-double-arrow', nextYear: 'left-double-arrow' }, themeButtonIcons: { prev: 'circle-triangle-e', next: 'circle-triangle-w', nextYear: 'seek-prev', prevYear: 'seek-next' } }; ;; var localeOptionHash = FC.locales = {}; // initialize and expose // TODO: document the structure and ordering of a FullCalendar locale file // Initialize jQuery UI datepicker translations while using some of the translations // Will set this as the default locales for datepicker. FC.datepickerLocale = function(localeCode, dpLocaleCode, dpOptions) { // get the FullCalendar internal option hash for this locale. create if necessary var fcOptions = localeOptionHash[localeCode] || (localeOptionHash[localeCode] = {}); // transfer some simple options from datepicker to fc fcOptions.isRTL = dpOptions.isRTL; fcOptions.weekNumberTitle = dpOptions.weekHeader; // compute some more complex options from datepicker $.each(dpComputableOptions, function(name, func) { fcOptions[name] = func(dpOptions); }); // is jQuery UI Datepicker is on the page? if ($.datepicker) { // Register the locale data. // FullCalendar and MomentJS use locale codes like "pt-br" but Datepicker // does it like "pt-BR" or if it doesn't have the locale, maybe just "pt". // Make an alias so the locale can be referenced either way. $.datepicker.regional[dpLocaleCode] = $.datepicker.regional[localeCode] = // alias dpOptions; // Alias 'en' to the default locale data. Do this every time. $.datepicker.regional.en = $.datepicker.regional['']; // Set as Datepicker's global defaults. $.datepicker.setDefaults(dpOptions); } }; // Sets FullCalendar-specific translations. Will set the locales as the global default. FC.locale = function(localeCode, newFcOptions) { var fcOptions; var momOptions; // get the FullCalendar internal option hash for this locale. create if necessary fcOptions = localeOptionHash[localeCode] || (localeOptionHash[localeCode] = {}); // provided new options for this locales? merge them in if (newFcOptions) { fcOptions = localeOptionHash[localeCode] = mergeOptions([ fcOptions, newFcOptions ]); } // compute locale options that weren't defined. // always do this. newFcOptions can be undefined when initializing from i18n file, // so no way to tell if this is an initialization or a default-setting. momOptions = getMomentLocaleData(localeCode); // will fall back to en $.each(momComputableOptions, function(name, func) { if (fcOptions[name] == null) { fcOptions[name] = func(momOptions, fcOptions); } }); // set it as the default locale for FullCalendar Calendar.defaults.locale = localeCode; }; // NOTE: can't guarantee any of these computations will run because not every locale has datepicker // configs, so make sure there are English fallbacks for these in the defaults file. var dpComputableOptions = { buttonText: function(dpOptions) { return { // the translations sometimes wrongly contain HTML entities prev: stripHtmlEntities(dpOptions.prevText), next: stripHtmlEntities(dpOptions.nextText), today: stripHtmlEntities(dpOptions.currentText) }; }, // Produces format strings like "MMMM YYYY" -> "September 2014" monthYearFormat: function(dpOptions) { return dpOptions.showMonthAfterYear ? 'YYYY[' + dpOptions.yearSuffix + '] MMMM' : 'MMMM YYYY[' + dpOptions.yearSuffix + ']'; } }; var momComputableOptions = { // Produces format strings like "ddd M/D" -> "Fri 9/15" dayOfMonthFormat: function(momOptions, fcOptions) { var format = momOptions.longDateFormat('l'); // for the format like "M/D/YYYY" // strip the year off the edge, as well as other misc non-whitespace chars format = format.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g, ''); if (fcOptions.isRTL) { format += ' ddd'; // for RTL, add day-of-week to end } else { format = 'ddd ' + format; // for LTR, add day-of-week to beginning } return format; }, // Produces format strings like "h:mma" -> "6:00pm" mediumTimeFormat: function(momOptions) { // can't be called `timeFormat` because collides with option return momOptions.longDateFormat('LT') .replace(/\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand }, // Produces format strings like "h(:mm)a" -> "6pm" / "6:30pm" smallTimeFormat: function(momOptions) { return momOptions.longDateFormat('LT') .replace(':mm', '(:mm)') .replace(/(\Wmm)$/, '($1)') // like above, but for foreign locales .replace(/\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand }, // Produces format strings like "h(:mm)t" -> "6p" / "6:30p" extraSmallTimeFormat: function(momOptions) { return momOptions.longDateFormat('LT') .replace(':mm', '(:mm)') .replace(/(\Wmm)$/, '($1)') // like above, but for foreign locales .replace(/\s*a$/i, 't'); // convert to AM/PM/am/pm to lowercase one-letter. remove any spaces beforehand }, // Produces format strings like "ha" / "H" -> "6pm" / "18" hourFormat: function(momOptions) { return momOptions.longDateFormat('LT') .replace(':mm', '') .replace(/(\Wmm)$/, '') // like above, but for foreign locales .replace(/\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand }, // Produces format strings like "h:mm" -> "6:30" (with no AM/PM) noMeridiemTimeFormat: function(momOptions) { return momOptions.longDateFormat('LT') .replace(/\s*a$/i, ''); // remove trailing AM/PM } }; // options that should be computed off live calendar options (considers override options) // TODO: best place for this? related to locale? // TODO: flipping text based on isRTL is a bad idea because the CSS `direction` might want to handle it var instanceComputableOptions = { // Produces format strings for results like "Mo 16" smallDayDateFormat: function(options) { return options.isRTL ? 'D dd' : 'dd D'; }, // Produces format strings for results like "Wk 5" weekFormat: function(options) { return options.isRTL ? 'w[ ' + options.weekNumberTitle + ']' : '[' + options.weekNumberTitle + ' ]w'; }, // Produces format strings for results like "Wk5" smallWeekFormat: function(options) { return options.isRTL ? 'w[' + options.weekNumberTitle + ']' : '[' + options.weekNumberTitle + ']w'; } }; function populateInstanceComputableOptions(options) { $.each(instanceComputableOptions, function(name, func) { if (options[name] == null) { options[name] = func(options); } }); } // Returns moment's internal locale data. If doesn't exist, returns English. function getMomentLocaleData(localeCode) { return moment.localeData(localeCode) || moment.localeData('en'); } // Initialize English by forcing computation of moment-derived options. // Also, sets it as the default. FC.locale('en', Calendar.englishDefaults); ;; FC.sourceNormalizers = []; FC.sourceFetchers = []; var ajaxDefaults = { dataType: 'json', cache: false }; var eventGUID = 1; function EventManager() { // assumed to be a calendar var t = this; // exports t.requestEvents = requestEvents; t.reportEventChange = reportEventChange; t.isFetchNeeded = isFetchNeeded; t.fetchEvents = fetchEvents; t.fetchEventSources = fetchEventSources; t.refetchEvents = refetchEvents; t.refetchEventSources = refetchEventSources; t.getEventSources = getEventSources; t.getEventSourceById = getEventSourceById; t.addEventSource = addEventSource; t.removeEventSource = removeEventSource; t.removeEventSources = removeEventSources; t.updateEvent = updateEvent; t.updateEvents = updateEvents; t.renderEvent = renderEvent; t.renderEvents = renderEvents; t.removeEvents = removeEvents; t.clientEvents = clientEvents; t.mutateEvent = mutateEvent; t.normalizeEventDates = normalizeEventDates; t.normalizeEventTimes = normalizeEventTimes; // locals var stickySource = { events: [] }; var sources = [ stickySource ]; var rangeStart, rangeEnd; var pendingSourceCnt = 0; // outstanding fetch requests, max one per source var cache = []; // holds events that have already been expanded var prunedCache; // like cache, but only events that intersect with rangeStart/rangeEnd $.each( (t.options.events ? [ t.options.events ] : []).concat(t.options.eventSources || []), function(i, sourceInput) { var source = buildEventSource(sourceInput); if (source) { sources.push(source); } } ); function requestEvents(start, end) { if (!t.options.lazyFetching || isFetchNeeded(start, end)) { return fetchEvents(start, end); } else { return Promise.resolve(prunedCache); } } function reportEventChange() { prunedCache = filterEventsWithinRange(cache); t.trigger('eventsReset', prunedCache); } function filterEventsWithinRange(events) { var filteredEvents = []; var i, event; for (i = 0; i < events.length; i++) { event = events[i]; if ( event.start.clone().stripZone() < rangeEnd && t.getEventEnd(event).stripZone() > rangeStart ) { filteredEvents.push(event); } } return filteredEvents; } t.getEventCache = function() { return cache; }; t.getPrunedEventCache = function() { return prunedCache; }; /* Fetching -----------------------------------------------------------------------------*/ // start and end are assumed to be unzoned function isFetchNeeded(start, end) { return !rangeStart || // nothing has been fetched yet? start < rangeStart || end > rangeEnd; // is part of the new range outside of the old range? } function fetchEvents(start, end) { rangeStart = start; rangeEnd = end; return refetchEvents(); } // poorly named. fetches all sources with current `rangeStart` and `rangeEnd`. function refetchEvents() { return fetchEventSources(sources, 'reset'); } // poorly named. fetches a subset of event sources. function refetchEventSources(matchInputs) { return fetchEventSources(getEventSourcesByMatchArray(matchInputs)); } // expects an array of event source objects (the originals, not copies) // `specialFetchType` is an optimization parameter that affects purging of the event cache. function fetchEventSources(specificSources, specialFetchType) { var i, source; if (specialFetchType === 'reset') { cache = []; } else if (specialFetchType !== 'add') { cache = excludeEventsBySources(cache, specificSources); } for (i = 0; i < specificSources.length; i++) { source = specificSources[i]; // already-pending sources have already been accounted for in pendingSourceCnt if (source._status !== 'pending') { pendingSourceCnt++; } source._fetchId = (source._fetchId || 0) + 1; source._status = 'pending'; } for (i = 0; i < specificSources.length; i++) { source = specificSources[i]; tryFetchEventSource(source, source._fetchId); } if (pendingSourceCnt) { return new Promise(function(resolve) { t.one('eventsReceived', resolve); // will send prunedCache }); } else { // executed all synchronously, or no sources at all return Promise.resolve(prunedCache); } } // fetches an event source and processes its result ONLY if it is still the current fetch. // caller is responsible for incrementing pendingSourceCnt first. function tryFetchEventSource(source, fetchId) { _fetchEventSource(source, function(eventInputs) { var isArraySource = $.isArray(source.events); var i, eventInput; var abstractEvent; if ( // is this the source's most recent fetch? // if not, rely on an upcoming fetch of this source to decrement pendingSourceCnt fetchId === source._fetchId && // event source no longer valid? source._status !== 'rejected' ) { source._status = 'resolved'; if (eventInputs) { for (i = 0; i < eventInputs.length; i++) { eventInput = eventInputs[i]; if (isArraySource) { // array sources have already been convert to Event Objects abstractEvent = eventInput; } else { abstractEvent = buildEventFromInput(eventInput, source); } if (abstractEvent) { // not false (an invalid event) cache.push.apply( // append cache, expandEvent(abstractEvent) // add individual expanded events to the cache ); } } } decrementPendingSourceCnt(); } }); } function rejectEventSource(source) { var wasPending = source._status === 'pending'; source._status = 'rejected'; if (wasPending) { decrementPendingSourceCnt(); } } function decrementPendingSourceCnt() { pendingSourceCnt--; if (!pendingSourceCnt) { reportEventChange(cache); // updates prunedCache t.trigger('eventsReceived', prunedCache); } } function _fetchEventSource(source, callback) { var i; var fetchers = FC.sourceFetchers; var res; for (i=0; i<fetchers.length; i++) { res = fetchers[i].call( t, // this, the Calendar object source, rangeStart.clone(), rangeEnd.clone(), t.options.timezone, callback ); if (res === true) { // the fetcher is in charge. made its own async request return; } else if (typeof res == 'object') { // the fetcher returned a new source. process it _fetchEventSource(res, callback); return; } } var events = source.events; if (events) { if ($.isFunction(events)) { t.pushLoading(); events.call( t, // this, the Calendar object rangeStart.clone(), rangeEnd.clone(), t.options.timezone, function(events) { callback(events); t.popLoading(); } ); } else if ($.isArray(events)) { callback(events); } else { callback(); } }else{ var url = source.url; if (url) { var success = source.success; var error = source.error; var complete = source.complete; // retrieve any outbound GET/POST $.ajax data from the options var customData; if ($.isFunction(source.data)) { // supplied as a function that returns a key/value object customData = source.data(); } else { // supplied as a straight key/value object customData = source.data; } // use a copy of the custom data so we can modify the parameters // and not affect the passed-in object. var data = $.extend({}, customData || {}); var startParam = firstDefined(source.startParam, t.options.startParam); var endParam = firstDefined(source.endParam, t.options.endParam); var timezoneParam = firstDefined(source.timezoneParam, t.options.timezoneParam); if (startParam) { data[startParam] = rangeStart.format(); } if (endParam) { data[endParam] = rangeEnd.format(); } if (t.options.timezone && t.options.timezone != 'local') { data[timezoneParam] = t.options.timezone; } t.pushLoading(); $.ajax($.extend({}, ajaxDefaults, source, { data: data, success: function(events) { events = events || []; var res = applyAll(success, this, arguments); if ($.isArray(res)) { events = res; } callback(events); }, error: function() { applyAll(error, this, arguments); callback(); }, complete: function() { applyAll(complete, this, arguments); t.popLoading(); } })); }else{ callback(); } } } /* Sources -----------------------------------------------------------------------------*/ function addEventSource(sourceInput) { var source = buildEventSource(sourceInput); if (source) { sources.push(source); fetchEventSources([ source ], 'add'); // will eventually call reportEventChange } } function buildEventSource(sourceInput) { // will return undefined if invalid source var normalizers = FC.sourceNormalizers; var source; var i; if ($.isFunction(sourceInput) || $.isArray(sourceInput)) { source = { events: sourceInput }; } else if (typeof sourceInput === 'string') { source = { url: sourceInput }; } else if (typeof sourceInput === 'object') { source = $.extend({}, sourceInput); // shallow copy } if (source) { // TODO: repeat code, same code for event classNames if (source.className) { if (typeof source.className === 'string') { source.className = source.className.split(/\s+/); } // otherwise, assumed to be an array } else { source.className = []; } // for array sources, we convert to standard Event Objects up front if ($.isArray(source.events)) { source.origArray = source.events; // for removeEventSource source.events = $.map(source.events, function(eventInput) { return buildEventFromInput(eventInput, source); }); } for (i=0; i<normalizers.length; i++) { normalizers[i].call(t, source); } return source; } } function removeEventSource(matchInput) { removeSpecificEventSources( getEventSourcesByMatch(matchInput) ); } // if called with no arguments, removes all. function removeEventSources(matchInputs) { if (matchInputs == null) { removeSpecificEventSources(sources, true); // isAll=true } else { removeSpecificEventSources( getEventSourcesByMatchArray(matchInputs) ); } } function removeSpecificEventSources(targetSources, isAll) { var i; // cancel pending requests for (i = 0; i < targetSources.length; i++) { rejectEventSource(targetSources[i]); } if (isAll) { // an optimization sources = []; cache = []; } else { // remove from persisted source list sources = $.grep(sources, function(source) { for (i = 0; i < targetSources.length; i++) { if (source === targetSources[i]) { return false; // exclude } } return true; // include }); cache = excludeEventsBySources(cache, targetSources); } reportEventChange(); } function getEventSources() { return sources.slice(1); // returns a shallow copy of sources with stickySource removed } function getEventSourceById(id) { return $.grep(sources, function(source) { return source.id && source.id === id; })[0]; } // like getEventSourcesByMatch, but accepts multple match criteria (like multiple IDs) function getEventSourcesByMatchArray(matchInputs) { // coerce into an array if (!matchInputs) { matchInputs = []; } else if (!$.isArray(matchInputs)) { matchInputs = [ matchInputs ]; } var matchingSources = []; var i; // resolve raw inputs to real event source objects for (i = 0; i < matchInputs.length; i++) { matchingSources.push.apply( // append matchingSources, getEventSourcesByMatch(matchInputs[i]) ); } return matchingSources; } // matchInput can either by a real event source object, an ID, or the function/URL for the source. // returns an array of matching source objects. function getEventSourcesByMatch(matchInput) { var i, source; // given an proper event source object for (i = 0; i < sources.length; i++) { source = sources[i]; if (source === matchInput) { return [ source ]; } } // an ID match source = getEventSourceById(matchInput); if (source) { return [ source ]; } return $.grep(sources, function(source) { return isSourcesEquivalent(matchInput, source); }); } function isSourcesEquivalent(source1, source2) { return source1 && source2 && getSourcePrimitive(source1) == getSourcePrimitive(source2); } function getSourcePrimitive(source) { return ( (typeof source === 'object') ? // a normalized event source? (source.origArray || source.googleCalendarId || source.url || source.events) : // get the primitive null ) || source; // the given argument *is* the primitive } // util // returns a filtered array without events that are part of any of the given sources function excludeEventsBySources(specificEvents, specificSources) { return $.grep(specificEvents, function(event) { for (var i = 0; i < specificSources.length; i++) { if (event.source === specificSources[i]) { return false; // exclude } } return true; // keep }); } /* Manipulation -----------------------------------------------------------------------------*/ // Only ever called from the externally-facing API function updateEvent(event) { updateEvents([ event ]); } // Only ever called from the externally-facing API function updateEvents(events) { var i, event; for (i = 0; i < events.length; i++) { event = events[i]; // massage start/end values, even if date string values event.start = t.moment(event.start); if (event.end) { event.end = t.moment(event.end); } else { event.end = null; } mutateEvent(event, getMiscEventProps(event)); // will handle start/end/allDay normalization } reportEventChange(); // reports event modifications (so we can redraw) } // Returns a hash of misc event properties that should be copied over to related events. function getMiscEventProps(event) { var props = {}; $.each(event, function(name, val) { if (isMiscEventPropName(name)) { if (val !== undefined && isAtomic(val)) { // a defined non-object props[name] = val; } } }); return props; } // non-date-related, non-id-related, non-secret function isMiscEventPropName(name) { return !/^_|^(id|allDay|start|end)$/.test(name); } // returns the expanded events that were created function renderEvent(eventInput, stick) { return renderEvents([ eventInput ], stick); } // returns the expanded events that were created function renderEvents(eventInputs, stick) { var renderedEvents = []; var renderableEvents; var abstractEvent; var i, j, event; for (i = 0; i < eventInputs.length; i++) { abstractEvent = buildEventFromInput(eventInputs[i]); if (abstractEvent) { // not false (a valid input) renderableEvents = expandEvent(abstractEvent); for (j = 0; j < renderableEvents.length; j++) { event = renderableEvents[j]; if (!event.source) { if (stick) { stickySource.events.push(event); event.source = stickySource; } cache.push(event); } } renderedEvents = renderedEvents.concat(renderableEvents); } } if (renderedEvents.length) { // any new events rendered? reportEventChange(); } return renderedEvents; } function removeEvents(filter) { var eventID; var i; if (filter == null) { // null or undefined. remove all events filter = function() { return true; }; // will always match } else if (!$.isFunction(filter)) { // an event ID eventID = filter + ''; filter = function(event) { return event._id == eventID; }; } // Purge event(s) from our local cache cache = $.grep(cache, filter, true); // inverse=true // Remove events from array sources. // This works because they have been converted to official Event Objects up front. // (and as a result, event._id has been calculated). for (i=0; i<sources.length; i++) { if ($.isArray(sources[i].events)) { sources[i].events = $.grep(sources[i].events, filter, true); } } reportEventChange(); } function clientEvents(filter) { if ($.isFunction(filter)) { return $.grep(cache, filter); } else if (filter != null) { // not null, not undefined. an event ID filter += ''; return $.grep(cache, function(e) { return e._id == filter; }); } return cache; // else, return all } // Makes sure all array event sources have their internal event objects // converted over to the Calendar's current timezone. t.rezoneArrayEventSources = function() { var i; var events; var j; for (i = 0; i < sources.length; i++) { events = sources[i].events; if ($.isArray(events)) { for (j = 0; j < events.length; j++) { rezoneEventDates(events[j]); } } } }; function rezoneEventDates(event) { event.start = t.moment(event.start); if (event.end) { event.end = t.moment(event.end); } backupEventDates(event); } /* Event Normalization -----------------------------------------------------------------------------*/ // Given a raw object with key/value properties, returns an "abstract" Event object. // An "abstract" event is an event that, if recurring, will not have been expanded yet. // Will return `false` when input is invalid. // `source` is optional function buildEventFromInput(input, source) { var out = {}; var start, end; var allDay; if (t.options.eventDataTransform) { input = t.options.eventDataTransform(input); } if (source && source.eventDataTransform) { input = source.eventDataTransform(input); } // Copy all properties over to the resulting object. // The special-case properties will be copied over afterwards. $.extend(out, input); if (source) { out.source = source; } out._id = input._id || (input.id === undefined ? '_fc' + eventGUID++ : input.id + ''); if (input.className) { if (typeof input.className == 'string') { out.className = input.className.split(/\s+/); } else { // assumed to be an array out.className = input.className; } } else { out.className = []; } start = input.start || input.date; // "date" is an alias for "start" end = input.end; // parse as a time (Duration) if applicable if (isTimeString(start)) { start = moment.duration(start); } if (isTimeString(end)) { end = moment.duration(end); } if (input.dow || moment.isDuration(start) || moment.isDuration(end)) { // the event is "abstract" (recurring) so don't calculate exact start/end dates just yet out.start = start ? moment.duration(start) : null; // will be a Duration or null out.end = end ? moment.duration(end) : null; // will be a Duration or null out._recurring = true; // our internal marker } else { if (start) { start = t.moment(start); if (!start.isValid()) { return false; } } if (end) { end = t.moment(end); if (!end.isValid()) { end = null; // let defaults take over } } allDay = input.allDay; if (allDay === undefined) { // still undefined? fallback to default allDay = firstDefined( source ? source.allDayDefault : undefined, t.options.allDayDefault ); // still undefined? normalizeEventDates will calculate it } assignDatesToEvent(start, end, allDay, out); } t.normalizeEvent(out); // hook for external use. a prototype method return out; } t.buildEventFromInput = buildEventFromInput; // Normalizes and assigns the given dates to the given partially-formed event object. // NOTE: mutates the given start/end moments. does not make a copy. function assignDatesToEvent(start, end, allDay, event) { event.start = start; event.end = end; event.allDay = allDay; normalizeEventDates(event); backupEventDates(event); } // Ensures proper values for allDay/start/end. Accepts an Event object, or a plain object with event-ish properties. // NOTE: Will modify the given object. function normalizeEventDates(eventProps) { normalizeEventTimes(eventProps); if (eventProps.end && !eventProps.end.isAfter(eventProps.start)) { eventProps.end = null; } if (!eventProps.end) { if (t.options.forceEventDuration) { eventProps.end = t.getDefaultEventEnd(eventProps.allDay, eventProps.start); } else { eventProps.end = null; } } } // Ensures the allDay property exists and the timeliness of the start/end dates are consistent function normalizeEventTimes(eventProps) { if (eventProps.allDay == null) { eventProps.allDay = !(eventProps.start.hasTime() || (eventProps.end && eventProps.end.hasTime())); } if (eventProps.allDay) { eventProps.start.stripTime(); if (eventProps.end) { // TODO: consider nextDayThreshold here? If so, will require a lot of testing and adjustment eventProps.end.stripTime(); } } else { if (!eventProps.start.hasTime()) { eventProps.start = t.applyTimezone(eventProps.start.time(0)); // will assign a 00:00 time } if (eventProps.end && !eventProps.end.hasTime()) { eventProps.end = t.applyTimezone(eventProps.end.time(0)); // will assign a 00:00 time } } } // If the given event is a recurring event, break it down into an array of individual instances. // If not a recurring event, return an array with the single original event. // If given a falsy input (probably because of a failed buildEventFromInput call), returns an empty array. // HACK: can override the recurring window by providing custom rangeStart/rangeEnd (for businessHours). function expandEvent(abstractEvent, _rangeStart, _rangeEnd) { var events = []; var dowHash; var dow; var i; var date; var startTime, endTime; var start, end; var event; _rangeStart = _rangeStart || rangeStart; _rangeEnd = _rangeEnd || rangeEnd; if (abstractEvent) { if (abstractEvent._recurring) { // make a boolean hash as to whether the event occurs on each day-of-week if ((dow = abstractEvent.dow)) { dowHash = {}; for (i = 0; i < dow.length; i++) { dowHash[dow[i]] = true; } } // iterate through every day in the current range date = _rangeStart.clone().stripTime(); // holds the date of the current day while (date.isBefore(_rangeEnd)) { if (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week startTime = abstractEvent.start; // the stored start and end properties are times (Durations) endTime = abstractEvent.end; // " start = date.clone(); end = null; if (startTime) { start = start.time(startTime); } if (endTime) { end = date.clone().time(endTime); } event = $.extend({}, abstractEvent); // make a copy of the original assignDatesToEvent( start, end, !startTime && !endTime, // allDay? event ); events.push(event); } date.add(1, 'days'); } } else { events.push(abstractEvent); // return the original event. will be a one-item array } } return events; } t.expandEvent = expandEvent; /* Event Modification Math -----------------------------------------------------------------------------------------*/ // Modifies an event and all related events by applying the given properties. // Special date-diffing logic is used for manipulation of dates. // If `props` does not contain start/end dates, the updated values are assumed to be the event's current start/end. // All date comparisons are done against the event's pristine _start and _end dates. // Returns an object with delta information and a function to undo all operations. // For making computations in a granularity greater than day/time, specify largeUnit. // NOTE: The given `newProps` might be mutated for normalization purposes. function mutateEvent(event, newProps, largeUnit) { var miscProps = {}; var oldProps; var clearEnd; var startDelta; var endDelta; var durationDelta; var undoFunc; // diffs the dates in the appropriate way, returning a duration function diffDates(date1, date0) { // date1 - date0 if (largeUnit) { return diffByUnit(date1, date0, largeUnit); } else if (newProps.allDay) { return diffDay(date1, date0); } else { return diffDayTime(date1, date0); } } newProps = newProps || {}; // normalize new date-related properties if (!newProps.start) { newProps.start = event.start.clone(); } if (newProps.end === undefined) { newProps.end = event.end ? event.end.clone() : null; } if (newProps.allDay == null) { // is null or undefined? newProps.allDay = event.allDay; } normalizeEventDates(newProps); // create normalized versions of the original props to compare against // need a real end value, for diffing oldProps = { start: event._start.clone(), end: event._end ? event._end.clone() : t.getDefaultEventEnd(event._allDay, event._start), allDay: newProps.allDay // normalize the dates in the same regard as the new properties }; normalizeEventDates(oldProps); // need to clear the end date if explicitly changed to null clearEnd = event._end !== null && newProps.end === null; // compute the delta for moving the start date startDelta = diffDates(newProps.start, oldProps.start); // compute the delta for moving the end date if (newProps.end) { endDelta = diffDates(newProps.end, oldProps.end); durationDelta = endDelta.subtract(startDelta); } else { durationDelta = null; } // gather all non-date-related properties $.each(newProps, function(name, val) { if (isMiscEventPropName(name)) { if (val !== undefined) { miscProps[name] = val; } } }); // apply the operations to the event and all related events undoFunc = mutateEvents( clientEvents(event._id), // get events with this ID clearEnd, newProps.allDay, startDelta, durationDelta, miscProps ); return { dateDelta: startDelta, durationDelta: durationDelta, undo: undoFunc }; } // Modifies an array of events in the following ways (operations are in order): // - clear the event's `end` // - convert the event to allDay // - add `dateDelta` to the start and end // - add `durationDelta` to the event's duration // - assign `miscProps` to the event // // Returns a function that can be called to undo all the operations. // // TODO: don't use so many closures. possible memory issues when lots of events with same ID. // function mutateEvents(events, clearEnd, allDay, dateDelta, durationDelta, miscProps) { var isAmbigTimezone = t.getIsAmbigTimezone(); var undoFunctions = []; // normalize zero-length deltas to be null if (dateDelta && !dateDelta.valueOf()) { dateDelta = null; } if (durationDelta && !durationDelta.valueOf()) { durationDelta = null; } $.each(events, function(i, event) { var oldProps; var newProps; // build an object holding all the old values, both date-related and misc. // for the undo function. oldProps = { start: event.start.clone(), end: event.end ? event.end.clone() : null, allDay: event.allDay }; $.each(miscProps, function(name) { oldProps[name] = event[name]; }); // new date-related properties. work off the original date snapshot. // ok to use references because they will be thrown away when backupEventDates is called. newProps = { start: event._start, end: event._end, allDay: allDay // normalize the dates in the same regard as the new properties }; normalizeEventDates(newProps); // massages start/end/allDay // strip or ensure the end date if (clearEnd) { newProps.end = null; } else if (durationDelta && !newProps.end) { // the duration translation requires an end date newProps.end = t.getDefaultEventEnd(newProps.allDay, newProps.start); } if (dateDelta) { newProps.start.add(dateDelta); if (newProps.end) { newProps.end.add(dateDelta); } } if (durationDelta) { newProps.end.add(durationDelta); // end already ensured above } // if the dates have changed, and we know it is impossible to recompute the // timezone offsets, strip the zone. if ( isAmbigTimezone && !newProps.allDay && (dateDelta || durationDelta) ) { newProps.start.stripZone(); if (newProps.end) { newProps.end.stripZone(); } } $.extend(event, miscProps, newProps); // copy over misc props, then date-related props backupEventDates(event); // regenerate internal _start/_end/_allDay undoFunctions.push(function() { $.extend(event, oldProps); backupEventDates(event); // regenerate internal _start/_end/_allDay }); }); return function() { for (var i = 0; i < undoFunctions.length; i++) { undoFunctions[i](); } }; } } // hook for external libs to manipulate event properties upon creation. // should manipulate the event in-place. Calendar.prototype.normalizeEvent = function(event) { }; // Does the given span (start, end, and other location information) // fully contain the other? Calendar.prototype.spanContainsSpan = function(outerSpan, innerSpan) { var eventStart = outerSpan.start.clone().stripZone(); var eventEnd = this.getEventEnd(outerSpan).stripZone(); return innerSpan.start >= eventStart && innerSpan.end <= eventEnd; }; // Returns a list of events that the given event should be compared against when being considered for a move to // the specified span. Attached to the Calendar's prototype because EventManager is a mixin for a Calendar. Calendar.prototype.getPeerEvents = function(span, event) { var cache = this.getEventCache(); var peerEvents = []; var i, otherEvent; for (i = 0; i < cache.length; i++) { otherEvent = cache[i]; if ( !event || event._id !== otherEvent._id // don't compare the event to itself or other related [repeating] events ) { peerEvents.push(otherEvent); } } return peerEvents; }; // updates the "backup" properties, which are preserved in order to compute diffs later on. function backupEventDates(event) { event._allDay = event.allDay; event._start = event.start.clone(); event._end = event.end ? event.end.clone() : null; } /* Overlapping / Constraining -----------------------------------------------------------------------------------------*/ // Determines if the given event can be relocated to the given span (unzoned start/end with other misc data) Calendar.prototype.isEventSpanAllowed = function(span, event) { var source = event.source || {}; var constraint = firstDefined( event.constraint, source.constraint, this.options.eventConstraint ); var overlap = firstDefined( event.overlap, source.overlap, this.options.eventOverlap ); return this.isSpanAllowed(span, constraint, overlap, event) && (!this.options.eventAllow || this.options.eventAllow(span, event) !== false); }; // Determines if an external event can be relocated to the given span (unzoned start/end with other misc data) Calendar.prototype.isExternalSpanAllowed = function(eventSpan, eventLocation, eventProps) { var eventInput; var event; // note: very similar logic is in View's reportExternalDrop if (eventProps) { eventInput = $.extend({}, eventProps, eventLocation); event = this.expandEvent( this.buildEventFromInput(eventInput) )[0]; } if (event) { return this.isEventSpanAllowed(eventSpan, event); } else { // treat it as a selection return this.isSelectionSpanAllowed(eventSpan); } }; // Determines the given span (unzoned start/end with other misc data) can be selected. Calendar.prototype.isSelectionSpanAllowed = function(span) { return this.isSpanAllowed(span, this.options.selectConstraint, this.options.selectOverlap) && (!this.options.selectAllow || this.options.selectAllow(span) !== false); }; // Returns true if the given span (caused by an event drop/resize or a selection) is allowed to exist // according to the constraint/overlap settings. // `event` is not required if checking a selection. Calendar.prototype.isSpanAllowed = function(span, constraint, overlap, event) { var constraintEvents; var anyContainment; var peerEvents; var i, peerEvent; var peerOverlap; // the range must be fully contained by at least one of produced constraint events if (constraint != null) { // not treated as an event! intermediate data structure // TODO: use ranges in the future constraintEvents = this.constraintToEvents(constraint); if (constraintEvents) { // not invalid anyContainment = false; for (i = 0; i < constraintEvents.length; i++) { if (this.spanContainsSpan(constraintEvents[i], span)) { anyContainment = true; break; } } if (!anyContainment) { return false; } } } peerEvents = this.getPeerEvents(span, event); for (i = 0; i < peerEvents.length; i++) { peerEvent = peerEvents[i]; // there needs to be an actual intersection before disallowing anything if (this.eventIntersectsRange(peerEvent, span)) { // evaluate overlap for the given range and short-circuit if necessary if (overlap === false) { return false; } // if the event's overlap is a test function, pass the peer event in question as the first param else if (typeof overlap === 'function' && !overlap(peerEvent, event)) { return false; } // if we are computing if the given range is allowable for an event, consider the other event's // EventObject-specific or Source-specific `overlap` property if (event) { peerOverlap = firstDefined( peerEvent.overlap, (peerEvent.source || {}).overlap // we already considered the global `eventOverlap` ); if (peerOverlap === false) { return false; } // if the peer event's overlap is a test function, pass the subject event as the first param if (typeof peerOverlap === 'function' && !peerOverlap(event, peerEvent)) { return false; } } } } return true; }; // Given an event input from the API, produces an array of event objects. Possible event inputs: // 'businessHours' // An event ID (number or string) // An object with specific start/end dates or a recurring event (like what businessHours accepts) Calendar.prototype.constraintToEvents = function(constraintInput) { if (constraintInput === 'businessHours') { return this.getCurrentBusinessHourEvents(); } if (typeof constraintInput === 'object') { if (constraintInput.start != null) { // needs to be event-like input return this.expandEvent(this.buildEventFromInput(constraintInput)); } else { return null; // invalid } } return this.clientEvents(constraintInput); // probably an ID }; // Does the event's date range intersect with the given range? // start/end already assumed to have stripped zones :( Calendar.prototype.eventIntersectsRange = function(event, range) { var eventStart = event.start.clone().stripZone(); var eventEnd = this.getEventEnd(event).stripZone(); return range.start < eventEnd && range.end > eventStart; }; /* Business Hours -----------------------------------------------------------------------------------------*/ var BUSINESS_HOUR_EVENT_DEFAULTS = { id: '_fcBusinessHours', // will relate events from different calls to expandEvent start: '09:00', end: '17:00', dow: [ 1, 2, 3, 4, 5 ], // monday - friday rendering: 'inverse-background' // classNames are defined in businessHoursSegClasses }; // Return events objects for business hours within the current view. // Abuse of our event system :( Calendar.prototype.getCurrentBusinessHourEvents = function(wholeDay) { return this.computeBusinessHourEvents(wholeDay, this.options.businessHours); }; // Given a raw input value from options, return events objects for business hours within the current view. Calendar.prototype.computeBusinessHourEvents = function(wholeDay, input) { if (input === true) { return this.expandBusinessHourEvents(wholeDay, [ {} ]); } else if ($.isPlainObject(input)) { return this.expandBusinessHourEvents(wholeDay, [ input ]); } else if ($.isArray(input)) { return this.expandBusinessHourEvents(wholeDay, input, true); } else { return []; } }; // inputs expected to be an array of objects. // if ignoreNoDow is true, will ignore entries that don't specify a day-of-week (dow) key. Calendar.prototype.expandBusinessHourEvents = function(wholeDay, inputs, ignoreNoDow) { var view = this.getView(); var events = []; var i, input; for (i = 0; i < inputs.length; i++) { input = inputs[i]; if (ignoreNoDow && !input.dow) { continue; } // give defaults. will make a copy input = $.extend({}, BUSINESS_HOUR_EVENT_DEFAULTS, input); // if a whole-day series is requested, clear the start/end times if (wholeDay) { input.start = null; input.end = null; } events.push.apply(events, // append this.expandEvent( this.buildEventFromInput(input), view.start, view.end ) ); } return events; }; ;; /* An abstract class for the "basic" views, as well as month view. Renders one or more rows of day cells. ----------------------------------------------------------------------------------------------------------------------*/ // It is a manager for a DayGrid subcomponent, which does most of the heavy lifting. // It is responsible for managing width/height. var BasicView = FC.BasicView = View.extend({ scroller: null, dayGridClass: DayGrid, // class the dayGrid will be instantiated from (overridable by subclasses) dayGrid: null, // the main subcomponent that does most of the heavy lifting dayNumbersVisible: false, // display day numbers on each day cell? colWeekNumbersVisible: false, // display week numbers along the side? cellWeekNumbersVisible: false, // display week numbers in day cell? weekNumberWidth: null, // width of all the week-number cells running down the side headContainerEl: null, // div that hold's the dayGrid's rendered date header headRowEl: null, // the fake row element of the day-of-week header initialize: function() { this.dayGrid = this.instantiateDayGrid(); this.scroller = new Scroller({ overflowX: 'hidden', overflowY: 'auto' }); }, // Generates the DayGrid object this view needs. Draws from this.dayGridClass instantiateDayGrid: function() { // generate a subclass on the fly with BasicView-specific behavior // TODO: cache this subclass var subclass = this.dayGridClass.extend(basicDayGridMethods); return new subclass(this); }, // Sets the display range and computes all necessary dates setRange: function(range) { View.prototype.setRange.call(this, range); // call the super-method this.dayGrid.breakOnWeeks = /year|month|week/.test(this.intervalUnit); // do before setRange this.dayGrid.setRange(range); }, // Compute the value to feed into setRange. Overrides superclass. computeRange: function(date) { var range = View.prototype.computeRange.call(this, date); // get value from the super-method // year and month views should be aligned with weeks. this is already done for week if (/year|month/.test(range.intervalUnit)) { range.start.startOf('week'); range.start = this.skipHiddenDays(range.start); // make end-of-week if not already if (range.end.weekday()) { range.end.add(1, 'week').startOf('week'); range.end = this.skipHiddenDays(range.end, -1, true); // exclusively move backwards } } return range; }, // Renders the view into `this.el`, which should already be assigned renderDates: function() { this.dayNumbersVisible = this.dayGrid.rowCnt > 1; // TODO: make grid responsible if (this.opt('weekNumbers')) { if (this.opt('weekNumbersWithinDays')) { this.cellWeekNumbersVisible = true; this.colWeekNumbersVisible = false; } else { this.cellWeekNumbersVisible = false; this.colWeekNumbersVisible = true; }; } this.dayGrid.numbersVisible = this.dayNumbersVisible || this.cellWeekNumbersVisible || this.colWeekNumbersVisible; this.el.addClass('fc-basic-view').html(this.renderSkeletonHtml()); this.renderHead(); this.scroller.render(); var dayGridContainerEl = this.scroller.el.addClass('fc-day-grid-container'); var dayGridEl = $('<div class="fc-day-grid" />').appendTo(dayGridContainerEl); this.el.find('.fc-body > tr > td').append(dayGridContainerEl); this.dayGrid.setElement(dayGridEl); this.dayGrid.renderDates(this.hasRigidRows()); }, // render the day-of-week headers renderHead: function() { this.headContainerEl = this.el.find('.fc-head-container') .html(this.dayGrid.renderHeadHtml()); this.headRowEl = this.headContainerEl.find('.fc-row'); }, // Unrenders the content of the view. Since we haven't separated skeleton rendering from date rendering, // always completely kill the dayGrid's rendering. unrenderDates: function() { this.dayGrid.unrenderDates(); this.dayGrid.removeElement(); this.scroller.destroy(); }, renderBusinessHours: function() { this.dayGrid.renderBusinessHours(); }, unrenderBusinessHours: function() { this.dayGrid.unrenderBusinessHours(); }, // Builds the HTML skeleton for the view. // The day-grid component will render inside of a container defined by this HTML. renderSkeletonHtml: function() { return '' + '<table>' + '<thead class="fc-head">' + '<tr>' + '<td class="fc-head-container ' + this.widgetHeaderClass + '"></td>' + '</tr>' + '</thead>' + '<tbody class="fc-body">' + '<tr>' + '<td class="' + this.widgetContentClass + '"></td>' + '</tr>' + '</tbody>' + '</table>'; }, // Generates an HTML attribute string for setting the width of the week number column, if it is known weekNumberStyleAttr: function() { if (this.weekNumberWidth !== null) { return 'style="width:' + this.weekNumberWidth + 'px"'; } return ''; }, // Determines whether each row should have a constant height hasRigidRows: function() { var eventLimit = this.opt('eventLimit'); return eventLimit && typeof eventLimit !== 'number'; }, /* Dimensions ------------------------------------------------------------------------------------------------------------------*/ // Refreshes the horizontal dimensions of the view updateWidth: function() { if (this.colWeekNumbersVisible) { // Make sure all week number cells running down the side have the same width. // Record the width for cells created later. this.weekNumberWidth = matchCellWidths( this.el.find('.fc-week-number') ); } }, // Adjusts the vertical dimensions of the view to the specified values setHeight: function(totalHeight, isAuto) { var eventLimit = this.opt('eventLimit'); var scrollerHeight; var scrollbarWidths; // reset all heights to be natural this.scroller.clear(); uncompensateScroll(this.headRowEl); this.dayGrid.removeSegPopover(); // kill the "more" popover if displayed // is the event limit a constant level number? if (eventLimit && typeof eventLimit === 'number') { this.dayGrid.limitRows(eventLimit); // limit the levels first so the height can redistribute after } // distribute the height to the rows // (totalHeight is a "recommended" value if isAuto) scrollerHeight = this.computeScrollerHeight(totalHeight); this.setGridHeight(scrollerHeight, isAuto); // is the event limit dynamically calculated? if (eventLimit && typeof eventLimit !== 'number') { this.dayGrid.limitRows(eventLimit); // limit the levels after the grid's row heights have been set } if (!isAuto) { // should we force dimensions of the scroll container? this.scroller.setHeight(scrollerHeight); scrollbarWidths = this.scroller.getScrollbarWidths(); if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars? compensateScroll(this.headRowEl, scrollbarWidths); // doing the scrollbar compensation might have created text overflow which created more height. redo scrollerHeight = this.computeScrollerHeight(totalHeight); this.scroller.setHeight(scrollerHeight); } // guarantees the same scrollbar widths this.scroller.lockOverflow(scrollbarWidths); } }, // given a desired total height of the view, returns what the height of the scroller should be computeScrollerHeight: function(totalHeight) { return totalHeight - subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller }, // Sets the height of just the DayGrid component in this view setGridHeight: function(height, isAuto) { if (isAuto) { undistributeHeight(this.dayGrid.rowEls); // let the rows be their natural height with no expanding } else { distributeHeight(this.dayGrid.rowEls, height, true); // true = compensate for height-hogging rows } }, /* Scroll ------------------------------------------------------------------------------------------------------------------*/ computeInitialScroll: function() { return { top: 0 }; }, queryScroll: function() { return { top: this.scroller.getScrollTop() }; }, setScroll: function(scroll) { this.scroller.setScrollTop(scroll.top); }, /* Hit Areas ------------------------------------------------------------------------------------------------------------------*/ // forward all hit-related method calls to dayGrid prepareHits: function() { this.dayGrid.prepareHits(); }, releaseHits: function() { this.dayGrid.releaseHits(); }, queryHit: function(left, top) { return this.dayGrid.queryHit(left, top); }, getHitSpan: function(hit) { return this.dayGrid.getHitSpan(hit); }, getHitEl: function(hit) { return this.dayGrid.getHitEl(hit); }, /* Events ------------------------------------------------------------------------------------------------------------------*/ // Renders the given events onto the view and populates the segments array renderEvents: function(events) { this.dayGrid.renderEvents(events); this.updateHeight(); // must compensate for events that overflow the row }, // Retrieves all segment objects that are rendered in the view getEventSegs: function() { return this.dayGrid.getEventSegs(); }, // Unrenders all event elements and clears internal segment data unrenderEvents: function() { this.dayGrid.unrenderEvents(); // we DON'T need to call updateHeight() because // a renderEvents() call always happens after this, which will eventually call updateHeight() }, /* Dragging (for both events and external elements) ------------------------------------------------------------------------------------------------------------------*/ // A returned value of `true` signals that a mock "helper" event has been rendered. renderDrag: function(dropLocation, seg) { return this.dayGrid.renderDrag(dropLocation, seg); }, unrenderDrag: function() { this.dayGrid.unrenderDrag(); }, /* Selection ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of a selection renderSelection: function(span) { this.dayGrid.renderSelection(span); }, // Unrenders a visual indications of a selection unrenderSelection: function() { this.dayGrid.unrenderSelection(); } }); // Methods that will customize the rendering behavior of the BasicView's dayGrid var basicDayGridMethods = { // Generates the HTML that will go before the day-of week header cells renderHeadIntroHtml: function() { var view = this.view; if (view.colWeekNumbersVisible) { return '' + '<th class="fc-week-number ' + view.widgetHeaderClass + '" ' + view.weekNumberStyleAttr() + '>' + '<span>' + // needed for matchCellWidths htmlEscape(view.opt('weekNumberTitle')) + '</span>' + '</th>'; } return ''; }, // Generates the HTML that will go before content-skeleton cells that display the day/week numbers renderNumberIntroHtml: function(row) { var view = this.view; var weekStart = this.getCellDate(row, 0); if (view.colWeekNumbersVisible) { return '' + '<td class="fc-week-number" ' + view.weekNumberStyleAttr() + '>' + view.buildGotoAnchorHtml( // aside from link, important for matchCellWidths { date: weekStart, type: 'week', forceOff: this.colCnt === 1 }, weekStart.format('w') // inner HTML ) + '</td>'; } return ''; }, // Generates the HTML that goes before the day bg cells for each day-row renderBgIntroHtml: function() { var view = this.view; if (view.colWeekNumbersVisible) { return '<td class="fc-week-number ' + view.widgetContentClass + '" ' + view.weekNumberStyleAttr() + '></td>'; } return ''; }, // Generates the HTML that goes before every other type of row generated by DayGrid. // Affects helper-skeleton and highlight-skeleton rows. renderIntroHtml: function() { var view = this.view; if (view.colWeekNumbersVisible) { return '<td class="fc-week-number" ' + view.weekNumberStyleAttr() + '></td>'; } return ''; } }; ;; /* A month view with day cells running in rows (one-per-week) and columns ----------------------------------------------------------------------------------------------------------------------*/ var MonthView = FC.MonthView = BasicView.extend({ // Produces information about what range to display computeRange: function(date) { var range = BasicView.prototype.computeRange.call(this, date); // get value from super-method var rowCnt; // ensure 6 weeks if (this.isFixedWeeks()) { rowCnt = Math.ceil(range.end.diff(range.start, 'weeks', true)); // could be partial weeks due to hiddenDays range.end.add(6 - rowCnt, 'weeks'); } return range; }, // Overrides the default BasicView behavior to have special multi-week auto-height logic setGridHeight: function(height, isAuto) { // if auto, make the height of each row the height that it would be if there were 6 weeks if (isAuto) { height *= this.rowCnt / 6; } distributeHeight(this.dayGrid.rowEls, height, !isAuto); // if auto, don't compensate for height-hogging rows }, isFixedWeeks: function() { return this.opt('fixedWeekCount'); } }); ;; fcViews.basic = { 'class': BasicView }; fcViews.basicDay = { type: 'basic', duration: { days: 1 } }; fcViews.basicWeek = { type: 'basic', duration: { weeks: 1 } }; fcViews.month = { 'class': MonthView, duration: { months: 1 }, // important for prev/next defaults: { fixedWeekCount: true } }; ;; /* An abstract class for all agenda-related views. Displays one more columns with time slots running vertically. ----------------------------------------------------------------------------------------------------------------------*/ // Is a manager for the TimeGrid subcomponent and possibly the DayGrid subcomponent (if allDaySlot is on). // Responsible for managing width/height. var AgendaView = FC.AgendaView = View.extend({ scroller: null, timeGridClass: TimeGrid, // class used to instantiate the timeGrid. subclasses can override timeGrid: null, // the main time-grid subcomponent of this view dayGridClass: DayGrid, // class used to instantiate the dayGrid. subclasses can override dayGrid: null, // the "all-day" subcomponent. if all-day is turned off, this will be null axisWidth: null, // the width of the time axis running down the side headContainerEl: null, // div that hold's the timeGrid's rendered date header noScrollRowEls: null, // set of fake row elements that must compensate when scroller has scrollbars // when the time-grid isn't tall enough to occupy the given height, we render an <hr> underneath bottomRuleEl: null, initialize: function() { this.timeGrid = this.instantiateTimeGrid(); if (this.opt('allDaySlot')) { // should we display the "all-day" area? this.dayGrid = this.instantiateDayGrid(); // the all-day subcomponent of this view } this.scroller = new Scroller({ overflowX: 'hidden', overflowY: 'auto' }); }, // Instantiates the TimeGrid object this view needs. Draws from this.timeGridClass instantiateTimeGrid: function() { var subclass = this.timeGridClass.extend(agendaTimeGridMethods); return new subclass(this); }, // Instantiates the DayGrid object this view might need. Draws from this.dayGridClass instantiateDayGrid: function() { var subclass = this.dayGridClass.extend(agendaDayGridMethods); return new subclass(this); }, /* Rendering ------------------------------------------------------------------------------------------------------------------*/ // Sets the display range and computes all necessary dates setRange: function(range) { View.prototype.setRange.call(this, range); // call the super-method this.timeGrid.setRange(range); if (this.dayGrid) { this.dayGrid.setRange(range); } }, // Renders the view into `this.el`, which has already been assigned renderDates: function() { this.el.addClass('fc-agenda-view').html(this.renderSkeletonHtml()); this.renderHead(); this.scroller.render(); var timeGridWrapEl = this.scroller.el.addClass('fc-time-grid-container'); var timeGridEl = $('<div class="fc-time-grid" />').appendTo(timeGridWrapEl); this.el.find('.fc-body > tr > td').append(timeGridWrapEl); this.timeGrid.setElement(timeGridEl); this.timeGrid.renderDates(); // the <hr> that sometimes displays under the time-grid this.bottomRuleEl = $('<hr class="fc-divider ' + this.widgetHeaderClass + '"/>') .appendTo(this.timeGrid.el); // inject it into the time-grid if (this.dayGrid) { this.dayGrid.setElement(this.el.find('.fc-day-grid')); this.dayGrid.renderDates(); // have the day-grid extend it's coordinate area over the <hr> dividing the two grids this.dayGrid.bottomCoordPadding = this.dayGrid.el.next('hr').outerHeight(); } this.noScrollRowEls = this.el.find('.fc-row:not(.fc-scroller *)'); // fake rows not within the scroller }, // render the day-of-week headers renderHead: function() { this.headContainerEl = this.el.find('.fc-head-container') .html(this.timeGrid.renderHeadHtml()); }, // Unrenders the content of the view. Since we haven't separated skeleton rendering from date rendering, // always completely kill each grid's rendering. unrenderDates: function() { this.timeGrid.unrenderDates(); this.timeGrid.removeElement(); if (this.dayGrid) { this.dayGrid.unrenderDates(); this.dayGrid.removeElement(); } this.scroller.destroy(); }, // Builds the HTML skeleton for the view. // The day-grid and time-grid components will render inside containers defined by this HTML. renderSkeletonHtml: function() { return '' + '<table>' + '<thead class="fc-head">' + '<tr>' + '<td class="fc-head-container ' + this.widgetHeaderClass + '"></td>' + '</tr>' + '</thead>' + '<tbody class="fc-body">' + '<tr>' + '<td class="' + this.widgetContentClass + '">' + (this.dayGrid ? '<div class="fc-day-grid"/>' + '<hr class="fc-divider ' + this.widgetHeaderClass + '"/>' : '' ) + '</td>' + '</tr>' + '</tbody>' + '</table>'; }, // Generates an HTML attribute string for setting the width of the axis, if it is known axisStyleAttr: function() { if (this.axisWidth !== null) { return 'style="width:' + this.axisWidth + 'px"'; } return ''; }, /* Business Hours ------------------------------------------------------------------------------------------------------------------*/ renderBusinessHours: function() { this.timeGrid.renderBusinessHours(); if (this.dayGrid) { this.dayGrid.renderBusinessHours(); } }, unrenderBusinessHours: function() { this.timeGrid.unrenderBusinessHours(); if (this.dayGrid) { this.dayGrid.unrenderBusinessHours(); } }, /* Now Indicator ------------------------------------------------------------------------------------------------------------------*/ getNowIndicatorUnit: function() { return this.timeGrid.getNowIndicatorUnit(); }, renderNowIndicator: function(date) { this.timeGrid.renderNowIndicator(date); }, unrenderNowIndicator: function() { this.timeGrid.unrenderNowIndicator(); }, /* Dimensions ------------------------------------------------------------------------------------------------------------------*/ updateSize: function(isResize) { this.timeGrid.updateSize(isResize); View.prototype.updateSize.call(this, isResize); // call the super-method }, // Refreshes the horizontal dimensions of the view updateWidth: function() { // make all axis cells line up, and record the width so newly created axis cells will have it this.axisWidth = matchCellWidths(this.el.find('.fc-axis')); }, // Adjusts the vertical dimensions of the view to the specified values setHeight: function(totalHeight, isAuto) { var eventLimit; var scrollerHeight; var scrollbarWidths; // reset all dimensions back to the original state this.bottomRuleEl.hide(); // .show() will be called later if this <hr> is necessary this.scroller.clear(); // sets height to 'auto' and clears overflow uncompensateScroll(this.noScrollRowEls); // limit number of events in the all-day area if (this.dayGrid) { this.dayGrid.removeSegPopover(); // kill the "more" popover if displayed eventLimit = this.opt('eventLimit'); if (eventLimit && typeof eventLimit !== 'number') { eventLimit = AGENDA_ALL_DAY_EVENT_LIMIT; // make sure "auto" goes to a real number } if (eventLimit) { this.dayGrid.limitRows(eventLimit); } } if (!isAuto) { // should we force dimensions of the scroll container? scrollerHeight = this.computeScrollerHeight(totalHeight); this.scroller.setHeight(scrollerHeight); scrollbarWidths = this.scroller.getScrollbarWidths(); if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars? // make the all-day and header rows lines up compensateScroll(this.noScrollRowEls, scrollbarWidths); // the scrollbar compensation might have changed text flow, which might affect height, so recalculate // and reapply the desired height to the scroller. scrollerHeight = this.computeScrollerHeight(totalHeight); this.scroller.setHeight(scrollerHeight); } // guarantees the same scrollbar widths this.scroller.lockOverflow(scrollbarWidths); // if there's any space below the slats, show the horizontal rule. // this won't cause any new overflow, because lockOverflow already called. if (this.timeGrid.getTotalSlatHeight() < scrollerHeight) { this.bottomRuleEl.show(); } } }, // given a desired total height of the view, returns what the height of the scroller should be computeScrollerHeight: function(totalHeight) { return totalHeight - subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller }, /* Scroll ------------------------------------------------------------------------------------------------------------------*/ // Computes the initial pre-configured scroll state prior to allowing the user to change it computeInitialScroll: function() { var scrollTime = moment.duration(this.opt('scrollTime')); var top = this.timeGrid.computeTimeTop(scrollTime); // zoom can give weird floating-point values. rather scroll a little bit further top = Math.ceil(top); if (top) { top++; // to overcome top border that slots beyond the first have. looks better } return { top: top }; }, queryScroll: function() { return { top: this.scroller.getScrollTop() }; }, setScroll: function(scroll) { this.scroller.setScrollTop(scroll.top); }, /* Hit Areas ------------------------------------------------------------------------------------------------------------------*/ // forward all hit-related method calls to the grids (dayGrid might not be defined) prepareHits: function() { this.timeGrid.prepareHits(); if (this.dayGrid) { this.dayGrid.prepareHits(); } }, releaseHits: function() { this.timeGrid.releaseHits(); if (this.dayGrid) { this.dayGrid.releaseHits(); } }, queryHit: function(left, top) { var hit = this.timeGrid.queryHit(left, top); if (!hit && this.dayGrid) { hit = this.dayGrid.queryHit(left, top); } return hit; }, getHitSpan: function(hit) { // TODO: hit.component is set as a hack to identify where the hit came from return hit.component.getHitSpan(hit); }, getHitEl: function(hit) { // TODO: hit.component is set as a hack to identify where the hit came from return hit.component.getHitEl(hit); }, /* Events ------------------------------------------------------------------------------------------------------------------*/ // Renders events onto the view and populates the View's segment array renderEvents: function(events) { var dayEvents = []; var timedEvents = []; var daySegs = []; var timedSegs; var i; // separate the events into all-day and timed for (i = 0; i < events.length; i++) { if (events[i].allDay) { dayEvents.push(events[i]); } else { timedEvents.push(events[i]); } } // render the events in the subcomponents timedSegs = this.timeGrid.renderEvents(timedEvents); if (this.dayGrid) { daySegs = this.dayGrid.renderEvents(dayEvents); } // the all-day area is flexible and might have a lot of events, so shift the height this.updateHeight(); }, // Retrieves all segment objects that are rendered in the view getEventSegs: function() { return this.timeGrid.getEventSegs().concat( this.dayGrid ? this.dayGrid.getEventSegs() : [] ); }, // Unrenders all event elements and clears internal segment data unrenderEvents: function() { // unrender the events in the subcomponents this.timeGrid.unrenderEvents(); if (this.dayGrid) { this.dayGrid.unrenderEvents(); } // we DON'T need to call updateHeight() because // a renderEvents() call always happens after this, which will eventually call updateHeight() }, /* Dragging (for events and external elements) ------------------------------------------------------------------------------------------------------------------*/ // A returned value of `true` signals that a mock "helper" event has been rendered. renderDrag: function(dropLocation, seg) { if (dropLocation.start.hasTime()) { return this.timeGrid.renderDrag(dropLocation, seg); } else if (this.dayGrid) { return this.dayGrid.renderDrag(dropLocation, seg); } }, unrenderDrag: function() { this.timeGrid.unrenderDrag(); if (this.dayGrid) { this.dayGrid.unrenderDrag(); } }, /* Selection ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of a selection renderSelection: function(span) { if (span.start.hasTime() || span.end.hasTime()) { this.timeGrid.renderSelection(span); } else if (this.dayGrid) { this.dayGrid.renderSelection(span); } }, // Unrenders a visual indications of a selection unrenderSelection: function() { this.timeGrid.unrenderSelection(); if (this.dayGrid) { this.dayGrid.unrenderSelection(); } } }); // Methods that will customize the rendering behavior of the AgendaView's timeGrid // TODO: move into TimeGrid var agendaTimeGridMethods = { // Generates the HTML that will go before the day-of week header cells renderHeadIntroHtml: function() { var view = this.view; var weekText; if (view.opt('weekNumbers')) { weekText = this.start.format(view.opt('smallWeekFormat')); return '' + '<th class="fc-axis fc-week-number ' + view.widgetHeaderClass + '" ' + view.axisStyleAttr() + '>' + view.buildGotoAnchorHtml( // aside from link, important for matchCellWidths { date: this.start, type: 'week', forceOff: this.colCnt > 1 }, htmlEscape(weekText) // inner HTML ) + '</th>'; } else { return '<th class="fc-axis ' + view.widgetHeaderClass + '" ' + view.axisStyleAttr() + '></th>'; } }, // Generates the HTML that goes before the bg of the TimeGrid slot area. Long vertical column. renderBgIntroHtml: function() { var view = this.view; return '<td class="fc-axis ' + view.widgetContentClass + '" ' + view.axisStyleAttr() + '></td>'; }, // Generates the HTML that goes before all other types of cells. // Affects content-skeleton, helper-skeleton, highlight-skeleton for both the time-grid and day-grid. renderIntroHtml: function() { var view = this.view; return '<td class="fc-axis" ' + view.axisStyleAttr() + '></td>'; } }; // Methods that will customize the rendering behavior of the AgendaView's dayGrid var agendaDayGridMethods = { // Generates the HTML that goes before the all-day cells renderBgIntroHtml: function() { var view = this.view; return '' + '<td class="fc-axis ' + view.widgetContentClass + '" ' + view.axisStyleAttr() + '>' + '<span>' + // needed for matchCellWidths view.getAllDayHtml() + '</span>' + '</td>'; }, // Generates the HTML that goes before all other types of cells. // Affects content-skeleton, helper-skeleton, highlight-skeleton for both the time-grid and day-grid. renderIntroHtml: function() { var view = this.view; return '<td class="fc-axis" ' + view.axisStyleAttr() + '></td>'; } }; ;; var AGENDA_ALL_DAY_EVENT_LIMIT = 5; // potential nice values for the slot-duration and interval-duration // from largest to smallest var AGENDA_STOCK_SUB_DURATIONS = [ { hours: 1 }, { minutes: 30 }, { minutes: 15 }, { seconds: 30 }, { seconds: 15 } ]; fcViews.agenda = { 'class': AgendaView, defaults: { allDaySlot: true, slotDuration: '00:30:00', minTime: '00:00:00', maxTime: '24:00:00', slotEventOverlap: true // a bad name. confused with overlap/constraint system } }; fcViews.agendaDay = { type: 'agenda', duration: { days: 1 } }; fcViews.agendaWeek = { type: 'agenda', duration: { weeks: 1 } }; ;; /* Responsible for the scroller, and forwarding event-related actions into the "grid" */ var ListView = View.extend({ grid: null, scroller: null, initialize: function() { this.grid = new ListViewGrid(this); this.scroller = new Scroller({ overflowX: 'hidden', overflowY: 'auto' }); }, setRange: function(range) { View.prototype.setRange.call(this, range); // super this.grid.setRange(range); // needs to process range-related options }, renderSkeleton: function() { this.el.addClass( 'fc-list-view ' + this.widgetContentClass ); this.scroller.render(); this.scroller.el.appendTo(this.el); this.grid.setElement(this.scroller.scrollEl); }, unrenderSkeleton: function() { this.scroller.destroy(); // will remove the Grid too }, setHeight: function(totalHeight, isAuto) { this.scroller.setHeight(this.computeScrollerHeight(totalHeight)); }, computeScrollerHeight: function(totalHeight) { return totalHeight - subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller }, renderEvents: function(events) { this.grid.renderEvents(events); }, unrenderEvents: function() { this.grid.unrenderEvents(); }, isEventResizable: function(event) { return false; }, isEventDraggable: function(event) { return false; } }); /* Responsible for event rendering and user-interaction. Its "el" is the inner-content of the above view's scroller. */ var ListViewGrid = Grid.extend({ segSelector: '.fc-list-item', // which elements accept event actions hasDayInteractions: false, // no day selection or day clicking // slices by day spanToSegs: function(span) { var view = this.view; var dayStart = view.start.clone().time(0); // timed, so segs get times! var dayIndex = 0; var seg; var segs = []; while (dayStart < view.end) { seg = intersectRanges(span, { start: dayStart, end: dayStart.clone().add(1, 'day') }); if (seg) { seg.dayIndex = dayIndex; segs.push(seg); } dayStart.add(1, 'day'); dayIndex++; // detect when span won't go fully into the next day, // and mutate the latest seg to the be the end. if ( seg && !seg.isEnd && span.end.hasTime() && span.end < dayStart.clone().add(this.view.nextDayThreshold) ) { seg.end = span.end.clone(); seg.isEnd = true; break; } } return segs; }, // like "4:00am" computeEventTimeFormat: function() { return this.view.opt('mediumTimeFormat'); }, // for events with a url, the whole <tr> should be clickable, // but it's impossible to wrap with an <a> tag. simulate this. handleSegClick: function(seg, ev) { var url; Grid.prototype.handleSegClick.apply(this, arguments); // super. might prevent the default action // not clicking on or within an <a> with an href if (!$(ev.target).closest('a[href]').length) { url = seg.event.url; if (url && !ev.isDefaultPrevented()) { // jsEvent not cancelled in handler window.location.href = url; // simulate link click } } }, // returns list of foreground segs that were actually rendered renderFgSegs: function(segs) { segs = this.renderFgSegEls(segs); // might filter away hidden events if (!segs.length) { this.renderEmptyMessage(); } else { this.renderSegList(segs); } return segs; }, renderEmptyMessage: function() { this.el.html( '<div class="fc-list-empty-wrap2">' + // TODO: try less wraps '<div class="fc-list-empty-wrap1">' + '<div class="fc-list-empty">' + htmlEscape(this.view.opt('noEventsMessage')) + '</div>' + '</div>' + '</div>' ); }, // render the event segments in the view renderSegList: function(allSegs) { var segsByDay = this.groupSegsByDay(allSegs); // sparse array var dayIndex; var daySegs; var i; var tableEl = $('<table class="fc-list-table"><tbody/></table>'); var tbodyEl = tableEl.find('tbody'); for (dayIndex = 0; dayIndex < segsByDay.length; dayIndex++) { daySegs = segsByDay[dayIndex]; if (daySegs) { // sparse array, so might be undefined // append a day header tbodyEl.append(this.dayHeaderHtml( this.view.start.clone().add(dayIndex, 'days') )); this.sortEventSegs(daySegs); for (i = 0; i < daySegs.length; i++) { tbodyEl.append(daySegs[i].el); // append event row } } } this.el.empty().append(tableEl); }, // Returns a sparse array of arrays, segs grouped by their dayIndex groupSegsByDay: function(segs) { var segsByDay = []; // sparse array var i, seg; for (i = 0; i < segs.length; i++) { seg = segs[i]; (segsByDay[seg.dayIndex] || (segsByDay[seg.dayIndex] = [])) .push(seg); } return segsByDay; }, // generates the HTML for the day headers that live amongst the event rows dayHeaderHtml: function(dayDate) { var view = this.view; var mainFormat = view.opt('listDayFormat'); var altFormat = view.opt('listDayAltFormat'); return '<tr class="fc-list-heading" data-date="' + dayDate.format('YYYY-MM-DD') + '">' + '<td class="' + view.widgetHeaderClass + '" colspan="4">' + (mainFormat ? view.buildGotoAnchorHtml( dayDate, { 'class': 'fc-list-heading-main' }, htmlEscape(dayDate.format(mainFormat)) // inner HTML ) : '') + (altFormat ? view.buildGotoAnchorHtml( dayDate, { 'class': 'fc-list-heading-alt' }, htmlEscape(dayDate.format(altFormat)) // inner HTML ) : '') + '</td>' + '</tr>'; }, // generates the HTML for a single event row fgSegHtml: function(seg) { var view = this.view; var classes = [ 'fc-list-item' ].concat(this.getSegCustomClasses(seg)); var bgColor = this.getSegBackgroundColor(seg); var event = seg.event; var url = event.url; var timeHtml; if (event.allDay) { timeHtml = view.getAllDayHtml(); } else if (view.isMultiDayEvent(event)) { // if the event appears to span more than one day if (seg.isStart || seg.isEnd) { // outer segment that probably lasts part of the day timeHtml = htmlEscape(this.getEventTimeText(seg)); } else { // inner segment that lasts the whole day timeHtml = view.getAllDayHtml(); } } else { // Display the normal time text for the *event's* times timeHtml = htmlEscape(this.getEventTimeText(event)); } if (url) { classes.push('fc-has-url'); } return '<tr class="' + classes.join(' ') + '">' + (this.displayEventTime ? '<td class="fc-list-item-time ' + view.widgetContentClass + '">' + (timeHtml || '') + '</td>' : '') + '<td class="fc-list-item-marker ' + view.widgetContentClass + '">' + '<span class="fc-event-dot"' + (bgColor ? ' style="background-color:' + bgColor + '"' : '') + '></span>' + '</td>' + '<td class="fc-list-item-title ' + view.widgetContentClass + '">' + '<a' + (url ? ' href="' + htmlEscape(url) + '"' : '') + '>' + htmlEscape(seg.event.title || '') + '</a>' + '</td>' + '</tr>'; } }); ;; fcViews.list = { 'class': ListView, buttonTextKey: 'list', // what to lookup in locale files defaults: { buttonText: 'list', // text to display for English listDayFormat: 'LL', // like "January 1, 2016" noEventsMessage: 'No events to display' } }; fcViews.listDay = { type: 'list', duration: { days: 1 }, defaults: { listDayFormat: 'dddd' // day-of-week is all we need. full date is probably in header } }; fcViews.listWeek = { type: 'list', duration: { weeks: 1 }, defaults: { listDayFormat: 'dddd', // day-of-week is more important listDayAltFormat: 'LL' } }; fcViews.listMonth = { type: 'list', duration: { month: 1 }, defaults: { listDayAltFormat: 'dddd' // day-of-week is nice-to-have } }; fcViews.listYear = { type: 'list', duration: { year: 1 }, defaults: { listDayAltFormat: 'dddd' // day-of-week is nice-to-have } }; return FC; // export for Node/CommonJS }); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/fullcalendar/moment.min.js?v=20220209161352 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 498 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/fullcalendar/moment.min.js?v=20220209161352 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 61317 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 61,317 bytes. |
//! moment.js
//! version : 2.17.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com !function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return od.apply(null,arguments)} // This is done to register the method called with moment() // without creating circular dependencies. function b(a){od=a}function c(a){return a instanceof Array||"[object Array]"===Object.prototype.toString.call(a)}function d(a){ // IE8 will treat undefined and null as object if it wasn't for // input != null return null!=a&&"[object Object]"===Object.prototype.toString.call(a)}function e(a){var b;for(b in a) // even if its not own property I'd still call it non-empty return!1;return!0}function f(a){return"number"==typeof a||"[object Number]"===Object.prototype.toString.call(a)}function g(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function h(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function i(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function j(a,b){for(var c in b)i(b,c)&&(a[c]=b[c]);return i(b,"toString")&&(a.toString=b.toString),i(b,"valueOf")&&(a.valueOf=b.valueOf),a}function k(a,b,c,d){return rb(a,b,c,d,!0).utc()}function l(){ // We need to deep clone this object. return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function m(a){return null==a._pf&&(a._pf=l()),a._pf}function n(a){if(null==a._isValid){var b=m(a),c=qd.call(b.parsedDateParts,function(a){return null!=a}),d=!isNaN(a._d.getTime())&&b.overflow<0&&!b.empty&&!b.invalidMonth&&!b.invalidWeekday&&!b.nullInput&&!b.invalidFormat&&!b.userInvalidated&&(!b.meridiem||b.meridiem&&c);if(a._strict&&(d=d&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void 0===b.bigHour),null!=Object.isFrozen&&Object.isFrozen(a))return d;a._isValid=d}return a._isValid}function o(a){var b=k(NaN);return null!=a?j(m(b),a):m(b).userInvalidated=!0,b}function p(a){return void 0===a}function q(a,b){var c,d,e;if(p(b._isAMomentObject)||(a._isAMomentObject=b._isAMomentObject),p(b._i)||(a._i=b._i),p(b._f)||(a._f=b._f),p(b._l)||(a._l=b._l),p(b._strict)||(a._strict=b._strict),p(b._tzm)||(a._tzm=b._tzm),p(b._isUTC)||(a._isUTC=b._isUTC),p(b._offset)||(a._offset=b._offset),p(b._pf)||(a._pf=m(b)),p(b._locale)||(a._locale=b._locale),rd.length>0)for(c in rd)d=rd[c],e=b[d],p(e)||(a[d]=e);return a} // Moment prototype object function r(b){q(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)), // Prevent infinite loop in case updateOffset creates new moment // objects. sd===!1&&(sd=!0,a.updateOffset(this),sd=!1)}function s(a){return a instanceof r||null!=a&&null!=a._isAMomentObject}function t(a){return a<0?Math.ceil(a)||0:Math.floor(a)}function u(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=t(b)),c} // compare two arrays, return the number of differences function v(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;d<e;d++)(c&&a[d]!==b[d]||!c&&u(a[d])!==u(b[d]))&&g++;return g+f}function w(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function x(b,c){var d=!0;return j(function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,b),d){for(var e,f=[],g=0;g<arguments.length;g++){if(e="","object"==typeof arguments[g]){e+="\n["+g+"] ";for(var h in arguments[0])e+=h+": "+arguments[0][h]+", ";e=e.slice(0,-2)}else e=arguments[g];f.push(e)}w(b+"\nArguments: "+Array.prototype.slice.call(f).join("")+"\n"+(new Error).stack),d=!1}return c.apply(this,arguments)},c)}function y(b,c){null!=a.deprecationHandler&&a.deprecationHandler(b,c),td[b]||(w(c),td[b]=!0)}function z(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function A(a){var b,c;for(c in a)b=a[c],z(b)?this[c]=b:this["_"+c]=b;this._config=a, // Lenient ordinal parsing accepts just a number in addition to // number + (possibly) stuff coming from _ordinalParseLenient. this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function B(a,b){var c,e=j({},a);for(c in b)i(b,c)&&(d(a[c])&&d(b[c])?(e[c]={},j(e[c],a[c]),j(e[c],b[c])):null!=b[c]?e[c]=b[c]:delete e[c]);for(c in a)i(a,c)&&!i(b,c)&&d(a[c])&&( // make sure changes to properties don't modify parent config e[c]=j({},e[c]));return e}function C(a){null!=a&&this.set(a)}function D(a,b,c){var d=this._calendar[a]||this._calendar.sameElse;return z(d)?d.call(b,c):d}function E(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function F(){return this._invalidDate}function G(a){return this._ordinal.replace("%d",a)}function H(a,b,c,d){var e=this._relativeTime[c];return z(e)?e(a,b,c,d):e.replace(/%d/i,a)}function I(a,b){var c=this._relativeTime[a>0?"future":"past"];return z(c)?c(b):c.replace(/%s/i,b)}function J(a,b){var c=a.toLowerCase();Dd[c]=Dd[c+"s"]=Dd[b]=a}function K(a){return"string"==typeof a?Dd[a]||Dd[a.toLowerCase()]:void 0}function L(a){var b,c,d={};for(c in a)i(a,c)&&(b=K(c),b&&(d[b]=a[c]));return d}function M(a,b){Ed[a]=b}function N(a){var b=[];for(var c in a)b.push({unit:c,priority:Ed[c]});return b.sort(function(a,b){return a.priority-b.priority}),b}function O(b,c){return function(d){return null!=d?(Q(this,b,d),a.updateOffset(this,c),this):P(this,b)}}function P(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function Q(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)} // MOMENTS function R(a){return a=K(a),z(this[a])?this[a]():this}function S(a,b){if("object"==typeof a){a=L(a);for(var c=N(a),d=0;d<c.length;d++)this[c[d].unit](a[c[d].unit])}else if(a=K(a),z(this[a]))return this[a](b);return this}function T(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d} // token: 'M' // padded: ['MM', 2] // ordinal: 'Mo' // callback: function () { this.month() + 1 } function U(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Id[a]=e),b&&(Id[b[0]]=function(){return T(e.apply(this,arguments),b[1],b[2])}),c&&(Id[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function V(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function W(a){var b,c,d=a.match(Fd);for(b=0,c=d.length;b<c;b++)Id[d[b]]?d[b]=Id[d[b]]:d[b]=V(d[b]);return function(b){var e,f="";for(e=0;e<c;e++)f+=d[e]instanceof Function?d[e].call(b,a):d[e];return f}} // format date using native date object function X(a,b){return a.isValid()?(b=Y(b,a.localeData()),Hd[b]=Hd[b]||W(b),Hd[b](a)):a.localeData().invalidDate()}function Y(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Gd.lastIndex=0;d>=0&&Gd.test(a);)a=a.replace(Gd,c),Gd.lastIndex=0,d-=1;return a}function Z(a,b,c){$d[a]=z(b)?b:function(a,d){return a&&c?c:b}}function $(a,b){return i($d,a)?$d[a](b._strict,b._locale):new RegExp(_(a))} // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function _(a){return aa(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function aa(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ba(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),f(b)&&(d=function(a,c){c[b]=u(a)}),c=0;c<a.length;c++)_d[a[c]]=d}function ca(a,b){ba(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}function da(a,b,c){null!=b&&i(_d,a)&&_d[a](b,c._a,c,a)}function ea(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function fa(a,b){return a?c(this._months)?this._months[a.month()]:this._months[(this._months.isFormat||ke).test(b)?"format":"standalone"][a.month()]:this._months}function ga(a,b){return a?c(this._monthsShort)?this._monthsShort[a.month()]:this._monthsShort[ke.test(b)?"format":"standalone"][a.month()]:this._monthsShort}function ha(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._monthsParse)for( // this is not used this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],d=0;d<12;++d)f=k([2e3,d]),this._shortMonthsParse[d]=this.monthsShort(f,"").toLocaleLowerCase(),this._longMonthsParse[d]=this.months(f,"").toLocaleLowerCase();return c?"MMM"===b?(e=je.call(this._shortMonthsParse,g),e!==-1?e:null):(e=je.call(this._longMonthsParse,g),e!==-1?e:null):"MMM"===b?(e=je.call(this._shortMonthsParse,g),e!==-1?e:(e=je.call(this._longMonthsParse,g),e!==-1?e:null)):(e=je.call(this._longMonthsParse,g),e!==-1?e:(e=je.call(this._shortMonthsParse,g),e!==-1?e:null))}function ia(a,b,c){var d,e,f;if(this._monthsParseExact)return ha.call(this,a,b,c); // TODO: add sorting // Sorting makes sure if one month (or abbr) is a prefix of another // see sorting in computeMonthsParse for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;d<12;d++){ // test the regex if( // make the regex if we don't have it already e=k([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}} // MOMENTS function ja(a,b){var c;if(!a.isValid()) // No op return a;if("string"==typeof b)if(/^\d+$/.test(b))b=u(b);else // TODO: Another silent failure? if(b=a.localeData().monthsParse(b),!f(b))return a;return c=Math.min(a.date(),ea(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a}function ka(b){return null!=b?(ja(this,b),a.updateOffset(this,!0),this):P(this,"Month")}function la(){return ea(this.year(),this.month())}function ma(a){return this._monthsParseExact?(i(this,"_monthsRegex")||oa.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):(i(this,"_monthsShortRegex")||(this._monthsShortRegex=ne),this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex)}function na(a){return this._monthsParseExact?(i(this,"_monthsRegex")||oa.call(this),a?this._monthsStrictRegex:this._monthsRegex):(i(this,"_monthsRegex")||(this._monthsRegex=oe),this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex)}function oa(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;b<12;b++) // make the regex if we don't have it already c=k([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for( // Sorting makes sure if one month (or abbr) is a prefix of another it // will match the longer piece. d.sort(a),e.sort(a),f.sort(a),b=0;b<12;b++)d[b]=aa(d[b]),e[b]=aa(e[b]);for(b=0;b<24;b++)f[b]=aa(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")","i")} // HELPERS function pa(a){return qa(a)?366:365}function qa(a){return a%4===0&&a%100!==0||a%400===0}function ra(){return qa(this.year())}function sa(a,b,c,d,e,f,g){ //can't just apply() to create a date: //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var h=new Date(a,b,c,d,e,f,g); //the date constructor remaps years 0-99 to 1900-1999 return a<100&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function ta(a){var b=new Date(Date.UTC.apply(null,arguments)); //the Date.UTC function remaps years 0-99 to 1900-1999 return a<100&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b} // start-of-first-week - start-of-year function ua(a,b,c){var// first-week day -- which january is always in the first week (4 for iso, 1 for other) d=7+b-c, // first-week day local weekday -- which local weekday is fwd e=(7+ta(a,0,d).getUTCDay()-b)%7;return-e+d-1} //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday function va(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=ua(a,d,e),j=1+7*(b-1)+h+i;return j<=0?(f=a-1,g=pa(f)+j):j>pa(a)?(f=a+1,g=j-pa(a)):(f=a,g=j),{year:f,dayOfYear:g}}function wa(a,b,c){var d,e,f=ua(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return g<1?(e=a.year()-1,d=g+xa(e,b,c)):g>xa(a.year(),b,c)?(d=g-xa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function xa(a,b,c){var d=ua(a,b,c),e=ua(a+1,b,c);return(pa(a)-d+e)/7} // HELPERS // LOCALES function ya(a){return wa(a,this._week.dow,this._week.doy).week}function za(){return this._week.dow}function Aa(){return this._week.doy} // MOMENTS function Ba(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function Ca(a){var b=wa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")} // HELPERS function Da(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Ea(a,b){return"string"==typeof a?b.weekdaysParse(a)%7||7:isNaN(a)?null:a}function Fa(a,b){return a?c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]:this._weekdays}function Ga(a){return a?this._weekdaysShort[a.day()]:this._weekdaysShort}function Ha(a){return a?this._weekdaysMin[a.day()]:this._weekdaysMin}function Ia(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;d<7;++d)f=k([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(f,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(f,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(f,"").toLocaleLowerCase();return c?"dddd"===b?(e=je.call(this._weekdaysParse,g),e!==-1?e:null):"ddd"===b?(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:null):(e=je.call(this._minWeekdaysParse,g),e!==-1?e:null):"dddd"===b?(e=je.call(this._weekdaysParse,g),e!==-1?e:(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:(e=je.call(this._minWeekdaysParse,g),e!==-1?e:null))):"ddd"===b?(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:(e=je.call(this._weekdaysParse,g),e!==-1?e:(e=je.call(this._minWeekdaysParse,g),e!==-1?e:null))):(e=je.call(this._minWeekdaysParse,g),e!==-1?e:(e=je.call(this._weekdaysParse,g),e!==-1?e:(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:null)))}function Ja(a,b,c){var d,e,f;if(this._weekdaysParseExact)return Ia.call(this,a,b,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;d<7;d++){ // test the regex if( // make the regex if we don't have it already e=k([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}} // MOMENTS function Ka(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Da(a,this.localeData()),this.add(a-b,"d")):b}function La(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Ma(a){if(!this.isValid())return null!=a?this:NaN; // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. if(null!=a){var b=Ea(a,this.localeData());return this.day(this.day()%7?b:b-7)}return this.day()||7}function Na(a){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysStrictRegex:this._weekdaysRegex):(i(this,"_weekdaysRegex")||(this._weekdaysRegex=ue),this._weekdaysStrictRegex&&a?this._weekdaysStrictRegex:this._weekdaysRegex)}function Oa(a){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(i(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ve),this._weekdaysShortStrictRegex&&a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Pa(a){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(i(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=we),this._weekdaysMinStrictRegex&&a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Qa(){function a(a,b){return b.length-a.length}var b,c,d,e,f,g=[],h=[],i=[],j=[];for(b=0;b<7;b++) // make the regex if we don't have it already c=k([2e3,1]).day(b),d=this.weekdaysMin(c,""),e=this.weekdaysShort(c,""),f=this.weekdays(c,""),g.push(d),h.push(e),i.push(f),j.push(d),j.push(e),j.push(f);for( // Sorting makes sure if one weekday (or abbr) is a prefix of another it // will match the longer piece. g.sort(a),h.sort(a),i.sort(a),j.sort(a),b=0;b<7;b++)h[b]=aa(h[b]),i[b]=aa(i[b]),j[b]=aa(j[b]);this._weekdaysRegex=new RegExp("^("+j.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")} // FORMATTING function Ra(){return this.hours()%12||12}function Sa(){return this.hours()||24}function Ta(a,b){U(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})} // PARSING function Ua(a,b){return b._meridiemParse} // LOCALES function Va(a){ // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays // Using charAt should be more compatible. return"p"===(a+"").toLowerCase().charAt(0)}function Wa(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Xa(a){return a?a.toLowerCase().replace("_","-"):a} // pick the locale from the array // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split("-"),b=e.length,c=Xa(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=Za(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1) //the next array item is better than a shallower substring of this one break;b--}f++}return null}function Za(a){var b=null; // TODO: Find a better way to register and load all the locales in Node if(!Be[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=xe._abbr,require("./locale/"+a), // because defineLocale currently also sets the global locale, we // want to undo that for lazy loaded locales $a(b)}catch(a){}return Be[a]} // This function will load locale and then set the global locale. If // no arguments are passed in, it will simply return the current global // locale key. function $a(a,b){var c; // moment.duration._locale = moment._locale = data; return a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}function _a(a,b){if(null!==b){var c=Ae;if(b.abbr=a,null!=Be[a])y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),c=Be[a]._config;else if(null!=b.parentLocale){if(null==Be[b.parentLocale])return Ce[b.parentLocale]||(Ce[b.parentLocale]=[]),Ce[b.parentLocale].push({name:a,config:b}),null;c=Be[b.parentLocale]._config} // backwards compat for now: also set the locale // make sure we set the locale AFTER all child locales have been // created, so we won't end up with the child locale set. return Be[a]=new C(B(c,b)),Ce[a]&&Ce[a].forEach(function(a){_a(a.name,a.config)}),$a(a),Be[a]} // useful for testing return delete Be[a],null}function ab(a,b){if(null!=b){var c,d=Ae; // MERGE null!=Be[a]&&(d=Be[a]._config),b=B(d,b),c=new C(b),c.parentLocale=Be[a],Be[a]=c, // backwards compat for now: also set the locale $a(a)}else // pass null for config to unupdate, useful for tests null!=Be[a]&&(null!=Be[a].parentLocale?Be[a]=Be[a].parentLocale:null!=Be[a]&&delete Be[a]);return Be[a]} // returns locale data function bb(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return xe;if(!c(a)){if( //short-circuit everything else b=Za(a))return b;a=[a]}return Ya(a)}function cb(){return wd(Be)}function db(a){var b,c=a._a;return c&&m(a).overflow===-2&&(b=c[be]<0||c[be]>11?be:c[ce]<1||c[ce]>ea(c[ae],c[be])?ce:c[de]<0||c[de]>24||24===c[de]&&(0!==c[ee]||0!==c[fe]||0!==c[ge])?de:c[ee]<0||c[ee]>59?ee:c[fe]<0||c[fe]>59?fe:c[ge]<0||c[ge]>999?ge:-1,m(a)._overflowDayOfYear&&(b<ae||b>ce)&&(b=ce),m(a)._overflowWeeks&&b===-1&&(b=he),m(a)._overflowWeekday&&b===-1&&(b=ie),m(a).overflow=b),a} // date from iso format function eb(a){var b,c,d,e,f,g,h=a._i,i=De.exec(h)||Ee.exec(h);if(i){for(m(a).iso=!0,b=0,c=Ge.length;b<c;b++)if(Ge[b][1].exec(i[1])){e=Ge[b][0],d=Ge[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=He.length;b<c;b++)if(He[b][1].exec(i[3])){ // match[2] should be 'T' or space f=(i[2]||" ")+He[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Fe.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),kb(a)}else a._isValid=!1} // date from iso format or fallback function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))} // Pick the first defined of two or three arguments. function gb(a,b,c){return null!=a?a:null!=b?b:c}function hb(b){ // hooks is actually the exported moment object var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]} // convert an array to a date. // the array should mirror the parameters below // note: all values past the year are optional and will default to the lowest possible value. // [year, month, day , hour, minute, second, millisecond] function ib(a){var b,c,d,e,f=[];if(!a._d){ // Default to current date. // * if no year, month, day of month are given, default to today // * if day of month is given, default month and year // * if month is given, default only year // * if year is given, don't default anything for(d=hb(a), //compute day of the year from weeks and weekdays a._w&&null==a._a[ce]&&null==a._a[be]&&jb(a), //if the day of the year is set, figure out what it is a._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b]; // Zero out whatever was not defaulted, including time for(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b]; // Check for 24:00:00.000 24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f), // Apply timezone offset from input. The actual utcOffset can be changed // with parseZone. null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}function jb(a){var b,c,d,e,f,g,h,i;if(b=a._w,null!=b.GG||null!=b.W||null!=b.E)f=1,g=4, // TODO: We need to take the current isoWeekYear, but that depends on // how we interpret now (local, utc, fixed offset). So create // a now version of current config (take local/utc/offset flags, and // create now). c=gb(b.GG,a._a[ae],wa(sb(),1,4).year),d=gb(b.W,1),e=gb(b.E,1),(e<1||e>7)&&(i=!0);else{f=a._locale._week.dow,g=a._locale._week.doy;var j=wa(sb(),f,g);c=gb(b.gg,a._a[ae],j.year), // Default to current week. d=gb(b.w,j.week),null!=b.d?( // weekday -- low day numbers are considered next week e=b.d,(e<0||e>6)&&(i=!0)):null!=b.e?( // local weekday -- counting starts from begining of week e=b.e+f,(b.e<0||b.e>6)&&(i=!0)): // default to begining of week e=f}d<1||d>xa(c,f,g)?m(a)._overflowWeeks=!0:null!=i?m(a)._overflowWeekday=!0:(h=va(c,d,e,f,g),a._a[ae]=h.year,a._dayOfYear=h.dayOfYear)} // date from string and format string function kb(b){ // TODO: Move this to another part of the creation flow to prevent circular deps if(b._f===a.ISO_8601)return void eb(b);b._a=[],m(b).empty=!0; // This array is used to make a Date, either with `new Date` or `Date.UTC` var c,d,e,f,g,h=""+b._i,i=h.length,j=0;for(e=Y(b._f,b._locale).match(Fd)||[],c=0;c<e.length;c++)f=e[c],d=(h.match($(f,b))||[])[0], // console.log('token', token, 'parsedInput', parsedInput, // 'regex', getParseRegexForToken(token, config)); d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&m(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length), // don't parse if it's not a known token Id[f]?(d?m(b).empty=!1:m(b).unusedTokens.push(f),da(f,d,b)):b._strict&&!d&&m(b).unusedTokens.push(f); // add remaining unparsed input length to the string m(b).charsLeftOver=i-j,h.length>0&&m(b).unusedInput.push(h), // clear _12h flag if hour is <= 12 b._a[de]<=12&&m(b).bigHour===!0&&b._a[de]>0&&(m(b).bigHour=void 0),m(b).parsedDateParts=b._a.slice(0),m(b).meridiem=b._meridiem, // handle meridiem b._a[de]=lb(b._locale,b._a[de],b._meridiem),ib(b),db(b)}function lb(a,b,c){var d; // Fallback return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&b<12&&(b+=12),d||12!==b||(b=0),b):b} // date from string and array of format strings function mb(a){var b,c,d,e,f;if(0===a._f.length)return m(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;e<a._f.length;e++)f=0,b=q({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],kb(b),n(b)&&( // if there is any input that was not parsed add a penalty for that format f+=m(b).charsLeftOver, //or tokens f+=10*m(b).unusedTokens.length,m(b).score=f,(null==d||f<d)&&(d=f,c=b));j(a,c||b)}function nb(a){if(!a._d){var b=L(a._i);a._a=h([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),ib(a)}}function ob(a){var b=new r(db(pb(a))); // Adding is smart enough around DST return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function pb(a){var b=a._i,d=a._f;return a._locale=a._locale||bb(a._l),null===b||void 0===d&&""===b?o({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),s(b)?new r(db(b)):(g(b)?a._d=b:c(d)?mb(a):d?kb(a):qb(a),n(a)||(a._d=null),a))}function qb(b){var d=b._i;void 0===d?b._d=new Date(a.now()):g(d)?b._d=new Date(d.valueOf()):"string"==typeof d?fb(b):c(d)?(b._a=h(d.slice(0),function(a){return parseInt(a,10)}),ib(b)):"object"==typeof d?nb(b):f(d)? // from milliseconds b._d=new Date(d):a.createFromInputFallback(b)}function rb(a,b,f,g,h){var i={}; // object construction must be done this way. // https://github.com/moment/moment/issues/1423 return f!==!0&&f!==!1||(g=f,f=void 0),(d(a)&&e(a)||c(a)&&0===a.length)&&(a=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=h,i._l=f,i._i=a,i._f=b,i._strict=g,ob(i)}function sb(a,b,c,d){return rb(a,b,c,d,!1)} // Pick a moment m from moments so that m[fn](other) is true for all // other. This relies on the function fn to be transitive. // // moments should either be an array of moment objects or an array, whose // first element is an array of moment objects. function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d} // TODO: Use [].sort instead? function ub(){var a=[].slice.call(arguments,0);return tb("isBefore",a)}function vb(){var a=[].slice.call(arguments,0);return tb("isAfter",a)}function wb(a){var b=L(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0; // representation for dateAddRemove this._milliseconds=+k+1e3*j+// 1000 6e4*i+// 1000 * 60 1e3*h*60*60,//using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 // Because of dateAddRemove treats 24 hours as different from a // day when working around DST, we need to store them separately this._days=+g+7*f, // It is impossible translate months into days without knowing // which months you are are talking about, so we have to store // it separately. this._months=+e+3*d+12*c,this._data={},this._locale=bb(),this._bubble()}function xb(a){return a instanceof wb}function yb(a){return a<0?Math.round(-1*a)*-1:Math.round(a)} // FORMATTING function zb(a,b){U(a,0,0,function(){var a=this.utcOffset(),c="+";return a<0&&(a=-a,c="-"),c+T(~~(a/60),2)+b+T(~~a%60,2)})}function Ab(a,b){var c=(b||"").match(a);if(null===c)return null;var d=c[c.length-1]||[],e=(d+"").match(Me)||["-",0,0],f=+(60*e[1])+u(e[2]);return 0===f?0:"+"===e[0]?f:-f} // Return a moment from input, that is local/utc/zone equivalent to model. function Bb(b,c){var d,e; // Use low-level api, because this fn is low-level api. return c._isUTC?(d=c.clone(),e=(s(b)||g(b)?b.valueOf():sb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):sb(b).local()}function Cb(a){ // On Firefox.24 Date#getTimezoneOffset returns a floating point. // https://github.com/moment/moment/pull/1871 return 15*-Math.round(a._d.getTimezoneOffset()/15)} // MOMENTS // keepLocalTime = true means only change the timezone, without // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset // +0200, so we adjust the time as needed, to be valid. // // Keeping the time actually adds/subtracts (one hour) // from the actual represented time. That is why we call updateOffset // a second time. In case it wants us to change the offset again // _changeInProgress == true case, then we have to adjust, because // there is no such time in the given timezone. function Db(b,c){var d,e=this._offset||0;if(!this.isValid())return null!=b?this:NaN;if(null!=b){if("string"==typeof b){if(b=Ab(Xd,b),null===b)return this}else Math.abs(b)<16&&(b=60*b);return!this._isUTC&&c&&(d=Cb(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?Tb(this,Ob(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?e:Cb(this)}function Eb(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Fb(a){return this.utcOffset(0,a)}function Gb(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Cb(this),"m")),this}function Hb(){if(null!=this._tzm)this.utcOffset(this._tzm);else if("string"==typeof this._i){var a=Ab(Wd,this._i);null!=a?this.utcOffset(a):this.utcOffset(0,!0)}return this}function Ib(a){return!!this.isValid()&&(a=a?sb(a).utcOffset():0,(this.utcOffset()-a)%60===0)}function Jb(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Kb(){if(!p(this._isDSTShifted))return this._isDSTShifted;var a={};if(q(a,this),a=pb(a),a._a){var b=a._isUTC?k(a._a):sb(a._a);this._isDSTShifted=this.isValid()&&v(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Lb(){return!!this.isValid()&&!this._isUTC}function Mb(){return!!this.isValid()&&this._isUTC}function Nb(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Ob(a,b){var c,d,e,g=a, // matching against regexp is expensive, do it on demand h=null;// checks for null or undefined return xb(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:f(a)?(g={},b?g[b]=a:g.milliseconds=a):(h=Ne.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:u(h[ce])*c,h:u(h[de])*c,m:u(h[ee])*c,s:u(h[fe])*c,ms:u(yb(1e3*h[ge]))*c}):(h=Oe.exec(a))?(c="-"===h[1]?-1:1,g={y:Pb(h[2],c),M:Pb(h[3],c),w:Pb(h[4],c),d:Pb(h[5],c),h:Pb(h[6],c),m:Pb(h[7],c),s:Pb(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=Rb(sb(g.from),sb(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new wb(g),xb(a)&&i(a,"_locale")&&(d._locale=a._locale),d}function Pb(a,b){ // We'd normally use ~~inp for this, but unfortunately it also // converts floats to ints. // inp may be undefined, so careful calling replace on it. var c=a&&parseFloat(a.replace(",",".")); // apply sign while we're at it return(isNaN(c)?0:c)*b}function Qb(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function Rb(a,b){var c;return a.isValid()&&b.isValid()?(b=Bb(b,a),a.isBefore(b)?c=Qb(a,b):(c=Qb(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}} // TODO: remove 'name' arg after deprecation is removed function Sb(a,b){return function(c,d){var e,f; //invert the arguments, but complain about it return null===d||isNaN(+d)||(y(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}function Tb(b,c,d,e){var f=c._milliseconds,g=yb(c._days),h=yb(c._months);b.isValid()&&(e=null==e||e,f&&b._d.setTime(b._d.valueOf()+f*d),g&&Q(b,"Date",P(b,"Date")+g*d),h&&ja(b,P(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function Ub(a,b){var c=a.diff(b,"days",!0);return c<-6?"sameElse":c<-1?"lastWeek":c<0?"lastDay":c<1?"sameDay":c<2?"nextDay":c<7?"nextWeek":"sameElse"}function Vb(b,c){ // We want to compare the start of today, vs this. // Getting start-of-today depends on whether we're local/utc/offset or not. var d=b||sb(),e=Bb(d,this).startOf("day"),f=a.calendarFormat(this,e)||"sameElse",g=c&&(z(c[f])?c[f].call(this,d):c[f]);return this.format(g||this.localeData().calendar(f,this,sb(d)))}function Wb(){return new r(this)}function Xb(a,b){var c=s(a)?a:sb(a);return!(!this.isValid()||!c.isValid())&&(b=K(p(b)?"millisecond":b),"millisecond"===b?this.valueOf()>c.valueOf():c.valueOf()<this.clone().startOf(b).valueOf())}function Yb(a,b){var c=s(a)?a:sb(a);return!(!this.isValid()||!c.isValid())&&(b=K(p(b)?"millisecond":b),"millisecond"===b?this.valueOf()<c.valueOf():this.clone().endOf(b).valueOf()<c.valueOf())}function Zb(a,b,c,d){return d=d||"()",("("===d[0]?this.isAfter(a,c):!this.isBefore(a,c))&&(")"===d[1]?this.isBefore(b,c):!this.isAfter(b,c))}function $b(a,b){var c,d=s(a)?a:sb(a);return!(!this.isValid()||!d.isValid())&&(b=K(b||"millisecond"),"millisecond"===b?this.valueOf()===d.valueOf():(c=d.valueOf(),this.clone().startOf(b).valueOf()<=c&&c<=this.clone().endOf(b).valueOf()))}function _b(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function ac(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function bc(a,b,c){var d,e,f,g;// 1000 // 1000 * 60 // 1000 * 60 * 60 // 1000 * 60 * 60 * 24, negate dst // 1000 * 60 * 60 * 24 * 7, negate dst return this.isValid()?(d=Bb(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=K(b),"year"===b||"month"===b||"quarter"===b?(g=cc(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:t(g)):NaN):NaN}function cc(a,b){ // difference in months var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()), // b is in (anchor - 1 month, anchor + 1 month) f=a.clone().add(e,"months"); //check for negative zero, return zero if negative zero // linear across the month // linear across the month return b-f<0?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)||0}function dc(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ec(){var a=this.clone().utc();return 0<a.year()&&a.year()<=9999?z(Date.prototype.toISOString)?this.toDate().toISOString():X(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):X(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}/** * Return a human readable representation of a moment that can * also be evaluated to get a new moment which is the same * * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects */ function fc(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var a="moment",b="";this.isLocal()||(a=0===this.utcOffset()?"moment.utc":"moment.parseZone",b="Z");var c="["+a+'("]',d=0<this.year()&&this.year()<=9999?"YYYY":"YYYYYY",e="-MM-DD[T]HH:mm:ss.SSS",f=b+'[")]';return this.format(c+d+e+f)}function gc(b){b||(b=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var c=X(this,b);return this.localeData().postformat(c)}function hc(a,b){return this.isValid()&&(s(a)&&a.isValid()||sb(a).isValid())?Ob({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function ic(a){return this.from(sb(),a)}function jc(a,b){return this.isValid()&&(s(a)&&a.isValid()||sb(a).isValid())?Ob({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function kc(a){return this.to(sb(),a)} // If passed a locale key, it will set the locale for this // instance. Otherwise, it will return the locale configuration // variables for this instance. function lc(a){var b;return void 0===a?this._locale._abbr:(b=bb(a),null!=b&&(this._locale=b),this)}function mc(){return this._locale}function nc(a){ // the following switch intentionally omits break keywords // to utilize falling through the cases. switch(a=K(a)){case"year":this.month(0);/* falls through */ case"quarter":case"month":this.date(1);/* falls through */ case"week":case"isoWeek":case"day":case"date":this.hours(0);/* falls through */ case"hour":this.minutes(0);/* falls through */ case"minute":this.seconds(0);/* falls through */ case"second":this.milliseconds(0)} // weeks are a special case // quarters are also special return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function oc(a){ // 'date' is an alias for 'day', so it should be considered as such. return a=K(a),void 0===a||"millisecond"===a?this:("date"===a&&(a="day"),this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms"))}function pc(){return this._d.valueOf()-6e4*(this._offset||0)}function qc(){return Math.floor(this.valueOf()/1e3)}function rc(){return new Date(this.valueOf())}function sc(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function tc(){var a=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}function uc(){ // new Date(NaN).toJSON() === null return this.isValid()?this.toISOString():null}function vc(){return n(this)}function wc(){return j({},m(this))}function xc(){return m(this).overflow}function yc(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function zc(a,b){U(0,[a,a.length],0,b)} // MOMENTS function Ac(a){return Ec.call(this,a,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Bc(a){return Ec.call(this,a,this.isoWeek(),this.isoWeekday(),1,4)}function Cc(){return xa(this.year(),1,4)}function Dc(){var a=this.localeData()._week;return xa(this.year(),a.dow,a.doy)}function Ec(a,b,c,d,e){var f;return null==a?wa(this,d,e).year:(f=xa(a,d,e),b>f&&(b=f),Fc.call(this,a,b,c,d,e))}function Fc(a,b,c,d,e){var f=va(a,b,c,d,e),g=ta(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this} // MOMENTS function Gc(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)} // HELPERS // MOMENTS function Hc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function Ic(a,b){b[ge]=u(1e3*("0."+a))} // MOMENTS function Jc(){return this._isUTC?"UTC":""}function Kc(){return this._isUTC?"Coordinated Universal Time":""}function Lc(a){return sb(1e3*a)}function Mc(){return sb.apply(null,arguments).parseZone()}function Nc(a){return a}function Oc(a,b,c,d){var e=bb(),f=k().set(d,b);return e[c](f,a)}function Pc(a,b,c){if(f(a)&&(b=a,a=void 0),a=a||"",null!=b)return Oc(a,b,c,"month");var d,e=[];for(d=0;d<12;d++)e[d]=Oc(a,d,c,"month");return e} // () // (5) // (fmt, 5) // (fmt) // (true) // (true, 5) // (true, fmt, 5) // (true, fmt) function Qc(a,b,c,d){"boolean"==typeof a?(f(b)&&(c=b,b=void 0),b=b||""):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||"");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,"day");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,"day");return i}function Rc(a,b){return Pc(a,b,"months")}function Sc(a,b){return Pc(a,b,"monthsShort")}function Tc(a,b,c){return Qc(a,b,c,"weekdays")}function Uc(a,b,c){return Qc(a,b,c,"weekdaysShort")}function Vc(a,b,c){return Qc(a,b,c,"weekdaysMin")}function Wc(){var a=this._data;return this._milliseconds=Ze(this._milliseconds),this._days=Ze(this._days),this._months=Ze(this._months),a.milliseconds=Ze(a.milliseconds),a.seconds=Ze(a.seconds),a.minutes=Ze(a.minutes),a.hours=Ze(a.hours),a.months=Ze(a.months),a.years=Ze(a.years),this}function Xc(a,b,c,d){var e=Ob(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()} // supports only 2.0-style add(1, 's') or add(duration) function Yc(a,b){return Xc(this,a,b,1)} // supports only 2.0-style subtract(1, 's') or subtract(duration) function Zc(a,b){return Xc(this,a,b,-1)}function $c(a){return a<0?Math.floor(a):Math.ceil(a)}function _c(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data; // if we have a mix of positive and negative values, bubble down first // check: https://github.com/moment/moment/issues/2166 // The following code bubbles up values, see the tests for // examples of what that means. // convert days to months // 12 months -> 1 year return f>=0&&g>=0&&h>=0||f<=0&&g<=0&&h<=0||(f+=864e5*$c(bd(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=t(f/1e3),i.seconds=a%60,b=t(a/60),i.minutes=b%60,c=t(b/60),i.hours=c%24,g+=t(c/24),e=t(ad(g)),h+=e,g-=$c(bd(e)),d=t(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function ad(a){ // 400 years have 146097 days (taking into account leap year rules) // 400 years have 12 months === 4800 return 4800*a/146097}function bd(a){ // the reverse of daysToMonths return 146097*a/4800}function cd(a){var b,c,d=this._milliseconds;if(a=K(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+ad(b),"month"===a?c:c/12;switch( // handle milliseconds separately because of floating point math errors (issue #1867) b=this._days+Math.round(bd(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3; // Math.floor prevents floating point math errors here case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}} // TODO: Use this.as('ms')? function dd(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*u(this._months/12)}function ed(a){return function(){return this.as(a)}}function fd(a){return a=K(a),this[a+"s"]()}function gd(a){return function(){return this._data[a]}}function hd(){return t(this.days()/7)} // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize function id(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function jd(a,b,c){var d=Ob(a).abs(),e=of(d.as("s")),f=of(d.as("m")),g=of(d.as("h")),h=of(d.as("d")),i=of(d.as("M")),j=of(d.as("y")),k=e<pf.s&&["s",e]||f<=1&&["m"]||f<pf.m&&["mm",f]||g<=1&&["h"]||g<pf.h&&["hh",g]||h<=1&&["d"]||h<pf.d&&["dd",h]||i<=1&&["M"]||i<pf.M&&["MM",i]||j<=1&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,id.apply(null,k)} // This function allows you to set the rounding function for relative time strings function kd(a){return void 0===a?of:"function"==typeof a&&(of=a,!0)} // This function allows you to set a threshold for relative time strings function ld(a,b){return void 0!==pf[a]&&(void 0===b?pf[a]:(pf[a]=b,!0))}function md(a){var b=this.localeData(),c=jd(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function nd(){ // for ISO strings we do not use the normal bubbling rules: // * milliseconds bubble up until they become hours // * days do not bubble at all // * months bubble up until they become years // This is because there is no context-free conversion between hours and days // (think of clock changes) // and also not between days and months (28-31 days per month) var a,b,c,d=qf(this._milliseconds)/1e3,e=qf(this._days),f=qf(this._months); // 3600 seconds -> 60 minutes -> 1 hour a=t(d/60),b=t(a/60),d%=60,a%=60, // 12 months -> 1 year c=t(f/12),f%=12; // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(m<0?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var od,pd;pd=Array.prototype.some?Array.prototype.some:function(a){for(var b=Object(this),c=b.length>>>0,d=0;d<c;d++)if(d in b&&a.call(this,b[d],d,b))return!0;return!1};var qd=pd,rd=a.momentProperties=[],sd=!1,td={};a.suppressDeprecationWarnings=!1,a.deprecationHandler=null;var ud;ud=Object.keys?Object.keys:function(a){var b,c=[];for(b in a)i(a,b)&&c.push(b);return c};var vd,wd=ud,xd={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},yd={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},zd="Invalid date",Ad="%d",Bd=/\d{1,2}/,Cd={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Dd={},Ed={},Fd=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Gd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Hd={},Id={},Jd=/\d/,Kd=/\d\d/,Ld=/\d{3}/,Md=/\d{4}/,Nd=/[+-]?\d{6}/,Od=/\d\d?/,Pd=/\d\d\d\d?/,Qd=/\d\d\d\d\d\d?/,Rd=/\d{1,3}/,Sd=/\d{1,4}/,Td=/[+-]?\d{1,6}/,Ud=/\d+/,Vd=/[+-]?\d+/,Wd=/Z|[+-]\d\d:?\d\d/gi,Xd=/Z|[+-]\d\d(?::?\d\d)?/gi,Yd=/[+-]?\d+(\.\d{1,3})?/,Zd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,$d={},_d={},ae=0,be=1,ce=2,de=3,ee=4,fe=5,ge=6,he=7,ie=8;vd=Array.prototype.indexOf?Array.prototype.indexOf:function(a){ // I know var b;for(b=0;b<this.length;++b)if(this[b]===a)return b;return-1};var je=vd; // FORMATTING U("M",["MM",2],"Mo",function(){return this.month()+1}),U("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),U("MMMM",0,0,function(a){return this.localeData().months(this,a)}), // ALIASES J("month","M"), // PRIORITY M("month",8), // PARSING Z("M",Od),Z("MM",Od,Kd),Z("MMM",function(a,b){return b.monthsShortRegex(a)}),Z("MMMM",function(a,b){return b.monthsRegex(a)}),ba(["M","MM"],function(a,b){b[be]=u(a)-1}),ba(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict); // if we didn't find a month name, mark the date as invalid. null!=e?b[be]=e:m(c).invalidMonth=a}); // LOCALES var ke=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,le="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),me="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ne=Zd,oe=Zd; // FORMATTING U("Y",0,0,function(){var a=this.year();return a<=9999?""+a:"+"+a}),U(0,["YY",2],0,function(){return this.year()%100}),U(0,["YYYY",4],0,"year"),U(0,["YYYYY",5],0,"year"),U(0,["YYYYYY",6,!0],0,"year"), // ALIASES J("year","y"), // PRIORITIES M("year",1), // PARSING Z("Y",Vd),Z("YY",Od,Kd),Z("YYYY",Sd,Md),Z("YYYYY",Td,Nd),Z("YYYYYY",Td,Nd),ba(["YYYYY","YYYYYY"],ae),ba("YYYY",function(b,c){c[ae]=2===b.length?a.parseTwoDigitYear(b):u(b)}),ba("YY",function(b,c){c[ae]=a.parseTwoDigitYear(b)}),ba("Y",function(a,b){b[ae]=parseInt(a,10)}), // HOOKS a.parseTwoDigitYear=function(a){return u(a)+(u(a)>68?1900:2e3)}; // MOMENTS var pe=O("FullYear",!0); // FORMATTING U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"), // ALIASES J("week","w"),J("isoWeek","W"), // PRIORITIES M("week",5),M("isoWeek",5), // PARSING Z("w",Od),Z("ww",Od,Kd),Z("W",Od),Z("WW",Od,Kd),ca(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=u(a)});var qe={dow:0,// Sunday is the first day of the week. doy:6}; // FORMATTING U("d",0,"do","day"),U("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),U("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),U("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"), // ALIASES J("day","d"),J("weekday","e"),J("isoWeekday","E"), // PRIORITY M("day",11),M("weekday",11),M("isoWeekday",11), // PARSING Z("d",Od),Z("e",Od),Z("E",Od),Z("dd",function(a,b){return b.weekdaysMinRegex(a)}),Z("ddd",function(a,b){return b.weekdaysShortRegex(a)}),Z("dddd",function(a,b){return b.weekdaysRegex(a)}),ca(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict); // if we didn't get a weekday name, mark the date as invalid null!=e?b.d=e:m(c).invalidWeekday=a}),ca(["d","e","E"],function(a,b,c,d){b[d]=u(a)}); // LOCALES var re="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),se="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),te="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ue=Zd,ve=Zd,we=Zd;U("H",["HH",2],0,"hour"),U("h",["hh",2],0,Ra),U("k",["kk",2],0,Sa),U("hmm",0,0,function(){return""+Ra.apply(this)+T(this.minutes(),2)}),U("hmmss",0,0,function(){return""+Ra.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),U("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),U("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),Ta("a",!0),Ta("A",!1), // ALIASES J("hour","h"), // PRIORITY M("hour",13),Z("a",Ua),Z("A",Ua),Z("H",Od),Z("h",Od),Z("HH",Od,Kd),Z("hh",Od,Kd),Z("hmm",Pd),Z("hmmss",Qd),Z("Hmm",Pd),Z("Hmmss",Qd),ba(["H","HH"],de),ba(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),ba(["h","hh"],function(a,b,c){b[de]=u(a),m(c).bigHour=!0}),ba("hmm",function(a,b,c){var d=a.length-2;b[de]=u(a.substr(0,d)),b[ee]=u(a.substr(d)),m(c).bigHour=!0}),ba("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[de]=u(a.substr(0,d)),b[ee]=u(a.substr(d,2)),b[fe]=u(a.substr(e)),m(c).bigHour=!0}),ba("Hmm",function(a,b,c){var d=a.length-2;b[de]=u(a.substr(0,d)),b[ee]=u(a.substr(d))}),ba("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[de]=u(a.substr(0,d)),b[ee]=u(a.substr(d,2)),b[fe]=u(a.substr(e))});var xe,ye=/[ap]\.?m?\.?/i,ze=O("Hours",!0),Ae={calendar:xd,longDateFormat:yd,invalidDate:zd,ordinal:Ad,ordinalParse:Bd,relativeTime:Cd,months:le,monthsShort:me,week:qe,weekdays:re,weekdaysMin:te,weekdaysShort:se,meridiemParse:ye},Be={},Ce={},De=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ee=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Fe=/Z|[+-]\d\d(?::?\d\d)?/,Ge=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/], // YYYYMM is NOT allowed by the standard ["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],He=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ie=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=x("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}), // constant that refers to the ISO standard a.ISO_8601=function(){};var Je=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var a=sb.apply(null,arguments);return this.isValid()&&a.isValid()?a<this?this:a:o()}),Ke=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var a=sb.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:o()}),Le=function(){return Date.now?Date.now():+new Date};zb("Z",":"),zb("ZZ",""), // PARSING Z("Z",Xd),Z("ZZ",Xd),ba(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ab(Xd,a)}); // HELPERS // timezone chunker // '+10:00' > ['10', '00'] // '-1530' > ['-15', '30'] var Me=/([\+\-]|\d\d)/gi; // HOOKS // This function will be called whenever a moment is mutated. // It is intended to keep the offset in sync with the timezone. a.updateOffset=function(){}; // ASP.NET json date format regex var Ne=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Oe=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Ob.fn=wb.prototype;var Pe=Sb(1,"add"),Qe=Sb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Re=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)}); // FORMATTING U(0,["gg",2],0,function(){return this.weekYear()%100}),U(0,["GG",2],0,function(){return this.isoWeekYear()%100}),zc("gggg","weekYear"),zc("ggggg","weekYear"),zc("GGGG","isoWeekYear"),zc("GGGGG","isoWeekYear"), // ALIASES J("weekYear","gg"),J("isoWeekYear","GG"), // PRIORITY M("weekYear",1),M("isoWeekYear",1), // PARSING Z("G",Vd),Z("g",Vd),Z("GG",Od,Kd),Z("gg",Od,Kd),Z("GGGG",Sd,Md),Z("gggg",Sd,Md),Z("GGGGG",Td,Nd),Z("ggggg",Td,Nd),ca(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=u(a)}),ca(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}), // FORMATTING U("Q",0,"Qo","quarter"), // ALIASES J("quarter","Q"), // PRIORITY M("quarter",7), // PARSING Z("Q",Jd),ba("Q",function(a,b){b[be]=3*(u(a)-1)}), // FORMATTING U("D",["DD",2],"Do","date"), // ALIASES J("date","D"), // PRIOROITY M("date",9), // PARSING Z("D",Od),Z("DD",Od,Kd),Z("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),ba(["D","DD"],ce),ba("Do",function(a,b){b[ce]=u(a.match(Od)[0],10)}); // MOMENTS var Se=O("Date",!0); // FORMATTING U("DDD",["DDDD",3],"DDDo","dayOfYear"), // ALIASES J("dayOfYear","DDD"), // PRIORITY M("dayOfYear",4), // PARSING Z("DDD",Rd),Z("DDDD",Ld),ba(["DDD","DDDD"],function(a,b,c){c._dayOfYear=u(a)}), // FORMATTING U("m",["mm",2],0,"minute"), // ALIASES J("minute","m"), // PRIORITY M("minute",14), // PARSING Z("m",Od),Z("mm",Od,Kd),ba(["m","mm"],ee); // MOMENTS var Te=O("Minutes",!1); // FORMATTING U("s",["ss",2],0,"second"), // ALIASES J("second","s"), // PRIORITY M("second",15), // PARSING Z("s",Od),Z("ss",Od,Kd),ba(["s","ss"],fe); // MOMENTS var Ue=O("Seconds",!1); // FORMATTING U("S",0,0,function(){return~~(this.millisecond()/100)}),U(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,function(){return 10*this.millisecond()}),U(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),U(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),U(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),U(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),U(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}), // ALIASES J("millisecond","ms"), // PRIORITY M("millisecond",16), // PARSING Z("S",Rd,Jd),Z("SS",Rd,Kd),Z("SSS",Rd,Ld);var Ve;for(Ve="SSSS";Ve.length<=9;Ve+="S")Z(Ve,Ud);for(Ve="S";Ve.length<=9;Ve+="S")ba(Ve,Ic); // MOMENTS var We=O("Milliseconds",!1); // FORMATTING U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var Xe=r.prototype;Xe.add=Pe,Xe.calendar=Vb,Xe.clone=Wb,Xe.diff=bc,Xe.endOf=oc,Xe.format=gc,Xe.from=hc,Xe.fromNow=ic,Xe.to=jc,Xe.toNow=kc,Xe.get=R,Xe.invalidAt=xc,Xe.isAfter=Xb,Xe.isBefore=Yb,Xe.isBetween=Zb,Xe.isSame=$b,Xe.isSameOrAfter=_b,Xe.isSameOrBefore=ac,Xe.isValid=vc,Xe.lang=Re,Xe.locale=lc,Xe.localeData=mc,Xe.max=Ke,Xe.min=Je,Xe.parsingFlags=wc,Xe.set=S,Xe.startOf=nc,Xe.subtract=Qe,Xe.toArray=sc,Xe.toObject=tc,Xe.toDate=rc,Xe.toISOString=ec,Xe.inspect=fc,Xe.toJSON=uc,Xe.toString=dc,Xe.unix=qc,Xe.valueOf=pc,Xe.creationData=yc, // Year Xe.year=pe,Xe.isLeapYear=ra, // Week Year Xe.weekYear=Ac,Xe.isoWeekYear=Bc, // Quarter Xe.quarter=Xe.quarters=Gc, // Month Xe.month=ka,Xe.daysInMonth=la, // Week Xe.week=Xe.weeks=Ba,Xe.isoWeek=Xe.isoWeeks=Ca,Xe.weeksInYear=Dc,Xe.isoWeeksInYear=Cc, // Day Xe.date=Se,Xe.day=Xe.days=Ka,Xe.weekday=La,Xe.isoWeekday=Ma,Xe.dayOfYear=Hc, // Hour Xe.hour=Xe.hours=ze, // Minute Xe.minute=Xe.minutes=Te, // Second Xe.second=Xe.seconds=Ue, // Millisecond Xe.millisecond=Xe.milliseconds=We, // Offset Xe.utcOffset=Db,Xe.utc=Fb,Xe.local=Gb,Xe.parseZone=Hb,Xe.hasAlignedHourOffset=Ib,Xe.isDST=Jb,Xe.isLocal=Lb,Xe.isUtcOffset=Mb,Xe.isUtc=Nb,Xe.isUTC=Nb, // Timezone Xe.zoneAbbr=Jc,Xe.zoneName=Kc, // Deprecations Xe.dates=x("dates accessor is deprecated. Use date instead.",Se),Xe.months=x("months accessor is deprecated. Use month instead",ka),Xe.years=x("years accessor is deprecated. Use year instead",pe),Xe.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Eb),Xe.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Kb);var Ye=C.prototype;Ye.calendar=D,Ye.longDateFormat=E,Ye.invalidDate=F,Ye.ordinal=G,Ye.preparse=Nc,Ye.postformat=Nc,Ye.relativeTime=H,Ye.pastFuture=I,Ye.set=A, // Month Ye.months=fa,Ye.monthsShort=ga,Ye.monthsParse=ia,Ye.monthsRegex=na,Ye.monthsShortRegex=ma, // Week Ye.week=ya,Ye.firstDayOfYear=Aa,Ye.firstDayOfWeek=za, // Day of Week Ye.weekdays=Fa,Ye.weekdaysMin=Ha,Ye.weekdaysShort=Ga,Ye.weekdaysParse=Ja,Ye.weekdaysRegex=Na,Ye.weekdaysShortRegex=Oa,Ye.weekdaysMinRegex=Pa, // Hours Ye.isPM=Va,Ye.meridiem=Wa,$a("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===u(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}), // Side effect imports a.lang=x("moment.lang is deprecated. Use moment.locale instead.",$a),a.langData=x("moment.langData is deprecated. Use moment.localeData instead.",bb);var Ze=Math.abs,$e=ed("ms"),_e=ed("s"),af=ed("m"),bf=ed("h"),cf=ed("d"),df=ed("w"),ef=ed("M"),ff=ed("y"),gf=gd("milliseconds"),hf=gd("seconds"),jf=gd("minutes"),kf=gd("hours"),lf=gd("days"),mf=gd("months"),nf=gd("years"),of=Math.round,pf={s:45,// seconds to minute m:45,// minutes to hour h:22,// hours to day d:26,// days to month M:11},qf=Math.abs,rf=wb.prototype; // Deprecations // Side effect imports // FORMATTING // PARSING // Side effect imports return rf.abs=Wc,rf.add=Yc,rf.subtract=Zc,rf.as=cd,rf.asMilliseconds=$e,rf.asSeconds=_e,rf.asMinutes=af,rf.asHours=bf,rf.asDays=cf,rf.asWeeks=df,rf.asMonths=ef,rf.asYears=ff,rf.valueOf=dd,rf._bubble=_c,rf.get=fd,rf.milliseconds=gf,rf.seconds=hf,rf.minutes=jf,rf.hours=kf,rf.days=lf,rf.weeks=hd,rf.months=mf,rf.years=nf,rf.humanize=md,rf.toISOString=nd,rf.toString=nd,rf.toJSON=nd,rf.locale=lc,rf.localeData=mc,rf.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",nd),rf.lang=Re,U("X",0,0,"unix"),U("x",0,0,"valueOf"),Z("x",Vd),Z("X",Yd),ba("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),ba("x",function(a,b,c){c._d=new Date(u(a))}),a.version="2.17.1",b(sb),a.fn=Xe,a.min=ub,a.max=vb,a.now=Le,a.utc=k,a.unix=Lc,a.months=Rc,a.isDate=g,a.locale=$a,a.invalid=o,a.duration=Ob,a.isMoment=s,a.weekdays=Tc,a.parseZone=Mc,a.localeData=bb,a.isDuration=xb,a.monthsShort=Sc,a.weekdaysMin=Vc,a.defineLocale=_a,a.updateLocale=ab,a.locales=cb,a.weekdaysShort=Uc,a.normalizeUnits=K,a.relativeTimeRounding=kd,a.relativeTimeThreshold=ld,a.calendarFormat=Ub,a.prototype=Xe,a}); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 509 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:05 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 273199 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 273,199 bytes. |
/*!
* jQuery JavaScript Library v1.10.2 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03T13:48Z */ (function( window, undefined ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; var // The deferred used on DOM ready readyList, // A central reference to the root jQuery(document) rootjQuery, // Support: IE<10 // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined` core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) location = window.location, document = window.document, docElem = document.documentElement, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // [[Class]] -> type pairs class2type = {}, // List of deleted data cache ids, so we can reuse them core_deletedIds = [], core_version = "1.10.2", // Save a reference to some core methods core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Used for matching numbers core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, // Used for splitting on whitespace core_rnotwhite = /\S+/g, // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }, // The ready event handler completed = function( event ) { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } }, // Clean-up method for dom ready events detach = function() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: core_version, constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return core_slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }, slice: function() { return this.pushStack( core_slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: core_push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger("ready").off("ready"); } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { if ( obj == null ) { return String( obj ); } return typeof obj === "object" || typeof obj === "function" ? class2type[ core_toString.call(obj) ] || "object" : typeof obj; }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if ( jQuery.support.ownLast ) { for ( key in obj ) { return core_hasOwn.call( obj, key ); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string parseHTML: function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }, parseJSON: function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } if ( data === null ) { return data; } if ( typeof data === "string" ) { // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); if ( data ) { // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } } } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Use native String.trim function wherever possible trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { core_push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( core_indexOf ) { return core_indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var l = second.length, i = first.length, j = 0; if ( typeof l === "number" ) { for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var retVal, ret = [], i = 0, length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return core_concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = core_slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); }, // A method for quickly swapping in/out CSS properties to get correct calculations. // Note: this method belongs to the css module but it's needed here for the support module. // If support gets modularized, this method should be moved back to the css module. swap: function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || type !== "function" && ( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj ); } // All jQuery objects should point back to these rootjQuery = jQuery(document); /*! * Sizzle CSS Selector Engine v1.10.2 * http://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03 */ (function( window, undefined ) { var i, support, cachedruns, Expr, getText, isXML, compile, outermostContext, sortInput, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), hasDuplicate = false, sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; return 0; } return 0; }, // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Prefer arguments quoted, // then not containing pseudos/brackets, // then attribute selectors/non-parenthetical expressions, // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rsibling = new RegExp( whitespace + "*[+~]" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : // BMP codepoint high < 0 ? String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( documentIsHTML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // QSA path if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { nid = old = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && context.parentNode || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key += " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = attrs.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Detect xml * @param {Element|Object} elem An element or a document */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; // Expose support vars for convenience support = Sizzle.support = {}; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.defaultView; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsHTML = !isXML( doc ); // Support: IE>8 // If iframe document is assigned to "document" variable and if iframe has been reloaded, // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 // IE6-8 do not support the defaultView property so parent will be undefined if ( parent && parent.attachEvent && parent !== parent.top ) { parent.attachEvent( "onbeforeunload", function() { setDocument(); }); } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) support.attributes = assert(function( div ) { div.className = "i"; return !div.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if getElementsByClassName can be trusted support.getElementsByClassName = assert(function( div ) { div.innerHTML = "<div class='a'></div><div class='a i'></div>"; // Support: Safari<4 // Catch class over-caching div.firstChild.className = "i"; // Support: Opera<10 // Catch gEBCN failure to find non-leading classes return div.getElementsByClassName("i").length === 2; }); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !doc.getElementsByName || !doc.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && documentIsHTML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select><option selected=''></option></select>"; // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Support: Opera 10-12/IE8 // ^= $= *= and empty values // Should not select anything // Support: Windows 8 Native Apps // The type attribute is restricted during .innerHTML assignment var input = doc.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "t", "" ); if ( div.querySelectorAll("[t^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = docElem.compareDocumentPosition ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); if ( compare ) { // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === doc || contains(preferredDoc, a) ) { return -1; } if ( b === doc || contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } // Not directly comparable, sort on existence of method return a.compareDocumentPosition ? -1 : 1; } : function( a, b ) { var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; // Parentless nodes are either documents or disconnected } else if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return doc; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [elem] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val === undefined ? support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null : val; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array for ( ; (node = elem[i]); i++ ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[5] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] && match[4] !== undefined ) { match[2] = match[4]; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( tokens = [] ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); } function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var data, cache, outerCache, dirkey = dirruns + " " + doneName; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { if ( (data = cache[1]) === true || data === cachedruns ) { return data === true; } } else { cache = outerCache[ dir ] = [ dirkey ]; cache[1] = matcher( elem, context, xml ) || cachedruns; if ( cache[1] === true ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // A counter to specify which element is currently being matched var matcherCachedRuns = 0, bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, expandContext ) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, // We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); if ( outermost ) { outermostContext = context !== document && context; cachedruns = matcherCachedRuns; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below for ( ; (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; cachedruns = ++matcherCachedRuns; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !group ) { group = tokenize( selector ); } i = group.length; while ( i-- ) { cached = matcherFromTokens( group[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); } return cached; }; function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function select( selector, context, results, seed ) { var i, tokens, token, type, find, match = tokenize( selector ); if ( !seed ) { // Try to minimize operations if there is only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && context.parentNode || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } } // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile( selector, match )( seed, context, !documentIsHTML, results, rsibling.test( selector ) ); return results; } // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Support: Chrome<14 // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( document.createElement("div") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert(function( div ) { div.innerHTML = "<input/>"; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert(function( div ) { return div.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return (val = elem.getAttributeNode( name )) && val.specified ? val.value : elem[ name ] === true ? name.toLowerCase() : null; } }); } jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })( window ); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; firingLength = 0; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( list && ( !fired || stack ) ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var action = tuple[ 0 ], fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = core_slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; if( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); jQuery.support = (function( support ) { var all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); // Setup div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // Finish early in limited (non-browser) environments all = div.getElementsByTagName("*") || []; a = div.getElementsByTagName("a")[ 0 ]; if ( !a || !a.style || !all.length ) { return support; } // First batch of tests select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px;float:left;opacity:.5"; // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) support.getSetAttribute = div.className !== "t"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName("tbody").length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !!div.getElementsByTagName("link").length; // Get the style information from getAttribute // (IE uses .cssText instead) support.style = /top/.test( a.getAttribute("style") ); // Make sure that URLs aren't manipulated // (IE normalizes it by default) support.hrefNormalized = a.getAttribute("href") === "/a"; // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 support.opacity = /^0.5/.test( a.style.opacity ); // Verify style float existence // (IE uses styleFloat instead of cssFloat) support.cssFloat = !!a.style.cssFloat; // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) support.checkOn = !!input.value; // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) support.optSelected = opt.selected; // Tests for enctype support on a form (#6743) support.enctype = !!document.createElement("form").enctype; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>"; // Will be defined later support.inlineBlockNeedsLayout = false; support.shrinkWrapBlocks = false; support.pixelPosition = false; support.deleteExpando = true; support.noCloneEvent = true; support.reliableMarginRight = true; support.boxSizingReliable = true; // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE<9 try { delete div.test; } catch( e ) { support.deleteExpando = false; } // Check if we can trust getAttribute("value") input = document.createElement("input"); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "checked", "t" ); input.setAttribute( "name", "t" ); fragment = document.createDocumentFragment(); fragment.appendChild( input ); // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) for ( i in { submit: true, change: true, focusin: true }) { div.setAttribute( eventName = "on" + i, "t" ); support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; } div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Support: IE<9 // Iteration over object's inherited properties before its own. for ( i in jQuery( support ) ) { break; } support.ownLast = i !== "0"; // Run tests that need a body at doc ready jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } container = document.createElement("div"); container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; body.appendChild( container ).appendChild( div ); // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; tds = div.getElementsByTagName("td"); tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Support: IE8 // Check if empty table cells still have offsetWidth/Height support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check box-sizing and margin behavior. div.innerHTML = ""; div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; // Workaround failing boxSizing test due to offsetWidth returning wrong value // with some non-1 values of body zoom, ticket #13543 jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { support.boxSizing = div.offsetWidth === 4; }); // Use window.getComputedStyle because jsdom on node.js will break without it. if ( window.getComputedStyle ) { support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right marginDiv = div.appendChild( document.createElement("div") ); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; support.reliableMarginRight = !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== core_strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Support: IE6 // Check if elements with layout shrink-wrap their children div.style.display = "block"; div.innerHTML = "<div></div>"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); if ( support.inlineBlockNeedsLayout ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); // Null elements to avoid leaks in IE container = div = tds = marginDiv = null; }); // Null elements to avoid leaks in IE all = select = fragment = opt = a = input = null; return support; })({}); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData( elem, name, data, pvt /* Internal Use Only */ ){ if ( !jQuery.acceptData( elem ) ) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( typeof name === "string" ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } i = name.length; while ( i-- ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if ( jQuery.support.deleteExpando || cache != cache.window ) { /* jshint eqeqeq: true */ delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "applet": true, "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { // Do not set data on non-element because it will not be cleared (#8335). if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { return false; } var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; // nodes accept data unless otherwise specified; rejection can be conditional return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); jQuery.fn.extend({ data: function( key, value ) { var attrs, name, data = null, i = 0, elem = this[0]; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attrs = elem.attributes; for ( ; i < attrs.length; i++ ) { name = attrs[i].name; if ( name.indexOf("data-") === 0 ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return arguments.length > 1 ? // Sets one value this.each(function() { jQuery.data( this, key, value ); }) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var nodeHook, boolHook, rclass = /[\t\r\n\f]/g, rreturn = /\r/g, rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, getSetInput = jQuery.support.input; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } elem.className = jQuery.trim( cur ); } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } elem.className = value ? jQuery.trim( cur ) : ""; } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value; if ( typeof stateVal === "boolean" && type === "string" ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), classNames = value.match( core_rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( type === core_strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; }, val: function( value ) { var ret, hooks, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map(val, function ( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { // Use proper attribute retrieval(#6932, #12072) var val = jQuery.find.attr( elem, "value" ); return val != null ? val : elem.text; } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) { optionSet = true; } } // force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return values; } } }, attr: function( elem, name, value ) { var hooks, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === core_strundefined ) { return jQuery.prop( elem, name, value ); } // All attributes are lowercase // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( core_rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( jQuery.expr.match.bool.test( name ) ) { // Set corresponding property to false if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { elem[ propName ] = false; // Support: IE<9 // Also clear defaultChecked/defaultSelected (if appropriate) } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, propFix: { "for": "htmlFor", "class": "className" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? ret : ( elem[ name ] = value ); } else { return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? ret : elem[ name ]; } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); return tabindex ? parseInt( tabindex, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1; } } } }); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr; jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? function( elem, name, isXML ) { var fn = jQuery.expr.attrHandle[ name ], ret = isXML ? undefined : /* jshint eqeqeq: false */ (jQuery.expr.attrHandle[ name ] = undefined) != getter( elem, name, isXML ) ? name.toLowerCase() : null; jQuery.expr.attrHandle[ name ] = fn; return ret; } : function( elem, name, isXML ) { return isXML ? undefined : elem[ jQuery.camelCase( "default-" + name ) ] ? name.toLowerCase() : null; }; }); // fix oldIE attroperties if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = { set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) return name === "value" || value === elem.getAttribute( name ) ? value : undefined; } }; jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = // Some attributes are constructed with empty-string values when not defined function( elem, name, isXML ) { var ret; return isXML ? undefined : (ret = elem.getAttributeNode( name )) && ret.value !== "" ? ret.value : null; }; jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return ret && ret.specified ? ret.value : undefined; }, set: nodeHook.set }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }; }); } // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }; } jQuery.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; }); // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }; if ( !jQuery.support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { // Support: Webkit // "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; }; } }); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = core_hasOwn.call( event, "type" ) ? event.type : event, namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Even when returnValue equals to undefined Firefox will still show alert if ( event.result !== undefined ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === core_strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); var isSimple = /^.[^:#\[\.,]*$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var i, ret = [], self = this, len = self.length; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector || [], true) ); }, filter: function( selector ) { return this.pushStack( winnow(this, selector || [], false) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)) ) { cur = ret.push( cur ); break; } } } return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( jQuery.unique(all) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { ret = jQuery.unique( ret ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } return this.pushStack( ret ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; })); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; }); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; }); } if ( typeof qualifier === "string" ) { if ( isSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, manipulation_rcheckableType = /^(?:checkbox|radio)$/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], area: [ 1, "<map>", "</map>" ], param: [ 1, "<object>", "</object>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } }); }, prepend: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } }); }, before: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { var elem, elems = selector ? jQuery.filter( selector, this ) : this, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var // Snapshot the DOM in case .domManip sweeps something relevant into its fragment args = jQuery.map( this, function( elem ) { return [ elem.nextSibling, elem.parentNode ]; }), i = 0; // Make the changes, replacing each context element with the new content this.domManip( arguments, function( elem ) { var next = args[ i++ ], parent = args[ i++ ]; if ( parent ) { // Don't use the snapshot next if it has moved (#13810) if ( next && next.parentNode !== parent ) { next = this.nextSibling; } jQuery( this ).remove(); parent.insertBefore( elem, next ); } // Allow new content to include elements from the context set }, true ); // Force removal if there was no new content (e.g., from empty arguments) return i ? this : this.remove(); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, callback, allowIntersection ) { // Flatten any nested arrays args = core_concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, self.html() ); } self.domManip( args, callback, allowIntersection ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Hope ajax is available... jQuery._evalUrl( node.src ); } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() core_push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( manipulation_rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !jQuery.support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== core_strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } core_deletedIds.push( id ); } } } } }, _evalUrl: function( url ) { return jQuery.ajax({ url: url, type: "GET", dataType: "script", async: false, global: false, "throws": true }); } }); jQuery.fn.extend({ wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); } }); var iframe, getStyles, curCSS, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, rposition = /^(top|right|bottom|left)$/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), elemdisplay = { BODY: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400 }, cssExpand = [ "Top", "Right", "Bottom", "Left" ], cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function isHidden( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); } } else { if ( !values[ index ] ) { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } jQuery.fn.extend({ css: function( name, value ) { return jQuery.access( this, function( elem, name, value ) { var len, styles, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { if ( typeof state === "boolean" ) { return state ? this.show() : this.hide(); } return this.each(function() { if ( isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "columnCount": true, "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; } }); // NOTE: we've included the "window" in window.getComputedStyle // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { getStyles = function( elem ) { return window.getComputedStyle( elem, null ); }; curCSS = function( elem, name, _computed ) { var width, minWidth, maxWidth, computed = _computed || getStyles( elem ), // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, style = elem.style; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, _computed ) { var left, rs, rsLeft, computed = _computed || getStyles( elem ), ret = computed ? computed[ name ] : undefined, style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } // Try to determine the default display value of an element function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>") .css( "cssText", "display:block !important" ) ).appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; doc.write("<!doctype html><html><body>"); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } // Called ONLY from within css_defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[0], "display" ); elem.remove(); return display; } jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } // These hooks cannot be added until DOM ready because the support test // for it is not run until after DOM ready jQuery(function() { if ( !jQuery.support.reliableMarginRight ) { jQuery.cssHooks.marginRight = { get: function( elem, computed ) { if ( computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } }; } // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = { get: function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } }; }); } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; jQuery.fn.extend({ serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function(){ // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; }) .filter(function(){ var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !manipulation_rcheckableType.test( type ) ); }) .map(function( i, elem ){ var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ){ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); //Serialize an array of form elements or a set of //key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; }); jQuery.fn.extend({ hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); } }); var // Document location ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat("*"); // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( (dataType = dataTypes[i++]) ) { // Prepend if requested if ( dataType[0] === "+" ) { dataType = dataType.slice( 1 ) || "*"; (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); // Otherwise append } else { (structure[ dataType ] = structure[ dataType ] || []).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } }); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, response, type, self = this, off = url.indexOf(" "); if ( off >= 0 ) { selector = url.slice( off, url.length ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax({ url: url, // if "type" variable is undefined, then "GET" method will be used type: type, dataType: "html", data: params }).done(function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); }).complete( callback && function( jqXHR, status ) { self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); }); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ jQuery.fn[ type ] = function( fn ){ return this.on( type, fn ); }; }); jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( (match = rheaders.exec( responseHeadersString )) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to fireGlobals = s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger("ajaxStart"); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) : // Otherwise add one to the end cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader("Last-Modified"); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader("etag"); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); } }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ url: url, type: method, dataType: type, data: data, success: callback }); }; }); /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s[ "throws" ] ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery("head")[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement("script"); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } }); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) ); this[ callback ] = true; return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always(function() { // Restore preexisting value window[ callbackName ] = overwritten; // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; }); // Delegate to script return "script"; } }); var xhrCallbacks, xhrSupported, xhrId = 0, // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject && function() { // Abort all pending requests var key; for ( key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } }; // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties xhrSupported = jQuery.ajaxSettings.xhr(); jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = jQuery.support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport(function( s ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !s.crossDomain || jQuery.support.cors ) { var callback; return { send: function( headers, complete ) { // Get a new xhr var handle, i, xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open( s.type, s.url, s.async, s.username, s.password ); } else { xhr.open( s.type, s.url, s.async ); } // Apply custom fields if provided if ( s.xhrFields ) { for ( i in s.xhrFields ) { xhr[ i ] = s.xhrFields[ i ]; } } // Override mime type if needed if ( s.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( s.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !s.crossDomain && !headers["X-Requested-With"] ) { headers["X-Requested-With"] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } } catch( err ) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( s.hasContent && s.data ) || null ); // Listener callback = function( _, isAbort ) { var status, responseHeaders, statusText, responses; // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; if ( xhrOnUnloadAbort ) { delete xhrCallbacks[ handle ]; } } // If it's an abort if ( isAbort ) { // Abort it manually if needed if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); // When requesting binary data, IE6-9 will throw an exception // on any attempt to access responseText (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && s.isLocal && !s.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } } catch( firefoxAccessException ) { if ( !isAbort ) { complete( -1, firefoxAccessException ); } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, responseHeaders ); } }; if ( !s.async ) { // if we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback setTimeout( callback ); } else { handle = ++xhrId; if ( xhrOnUnloadAbort ) { // Create the active xhrs callbacks list if needed // and attach the unload handler if ( !xhrCallbacks ) { xhrCallbacks = {}; jQuery( window ).unload( xhrOnUnloadAbort ); } // Add to list of active xhrs callbacks xhrCallbacks[ handle ] = callback; } xhr.onreadystatechange = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } }); } var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), rrun = /queueHooks$/, animationPrefilters = [ defaultPrefilter ], tweeners = { "*": [function( prop, value ) { var tween = this.createTween( prop, value ), target = tween.cur(), parts = rfxnum.exec( value ), unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) && rfxnum.exec( jQuery.css( tween.elem, prop ) ), scale = 1, maxIterations = 20; if ( start && start[ 3 ] !== unit ) { // Trust units reported by jQuery.css unit = unit || start[ 3 ]; // Make sure we update the tween properties later on parts = parts || []; // Iteratively approximate from a nonzero starting point start = +target || 1; do { // If previous iteration zeroed out, double until we get *something* // Use a string for doubling factor so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply start = start / scale; jQuery.style( tween.elem, prop, start + unit ); // Update scale, tolerating zero or NaN from tween.cur() // And breaking the loop if scale is unchanged or perfect, or if we've just had enough } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); } // Update tween properties if ( parts ) { start = tween.start = +start || +target || 0; tween.unit = unit; // If a +=/-= token was provided, we're doing a relative animation tween.end = parts[ 1 ] ? start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : +parts[ 2 ]; } return tween; }] }; // Animations created synchronously will run synchronously function createFxNow() { setTimeout(function() { fxNow = undefined; }); return ( fxNow = jQuery.now() ); } function createTween( value, prop, animation ) { var tween, collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( (tween = collection[ index ].call( animation, prop, value )) ) { // we're done with this property return tween; } } } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; }), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ]); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise({ elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {} }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // resolve when we played the last frame // otherwise, reject if ( gotoEnd ) { deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } }), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { return result; } } jQuery.map( props, createTween, animation ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue }) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } function propFilter( props, specialEasing ) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } jQuery.Animation = jQuery.extend( Animation, { tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.split(" "); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; tweeners[ prop ] = tweeners[ prop ] || []; tweeners[ prop ].unshift( callback ); } }, prefilter: function( callback, prepend ) { if ( prepend ) { animationPrefilters.unshift( callback ); } else { animationPrefilters.push( callback ); } } }); function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ var prop, value, toggle, tween, hooks, oldfire, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHidden( elem ), dataShow = jQuery._data( elem, "fxshow" ); // handle queue: false promises if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always(function() { // doing this makes sure that the complete handler will be called // before this completes anim.always(function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } }); }); } // height/width overflow pass if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated if ( jQuery.css( elem, "display" ) === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; } } } if ( opts.overflow ) { style.overflow = "hidden"; if ( !jQuery.support.shrinkWrapBlocks ) { anim.always(function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; }); } } // show/hide pass for ( prop in props ) { value = props[ prop ]; if ( rfxtypes.exec( value ) ) { delete props[ prop ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { continue; } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); } } if ( !jQuery.isEmptyObject( orig ) ) { if ( dataShow ) { if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } } else { dataShow = jQuery._data( elem, "fxshow", {} ); } // store state if its toggle - enables .stop().toggle() to "reverse" if ( toggle ) { dataShow.hidden = !hidden; } if ( hidden ) { jQuery( elem ).show(); } else { anim.done(function() { jQuery( elem ).hide(); }); } anim.done(function() { var prop; jQuery._removeData( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } }); for ( prop in orig ) { tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = tween.start; if ( hidden ) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } } } function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || "swing"; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; if ( tween.elem[ tween.prop ] != null && (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { return tween.elem[ tween.prop ]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Support: IE <=9 // Panic based approach to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; }); jQuery.fn.extend({ fadeTo: function( speed, to, easing, callback ) { // show any hidden elements after setting opacity to 0 return this.filter( isHidden ).css( "opacity", 0 ).show() // animate to the value specified .end().animate({ opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each(function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } }); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each(function() { var index, data = jQuery._data( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.stop ) { hooks.stop.call( this, true ); } // look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // turn off finishing flag delete data.finish; }); } }); // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth? 1 : 0; for( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p*Math.PI ) / 2; } }; jQuery.timers = []; jQuery.fx = Tween.prototype.init; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { if ( timer() && jQuery.timers.push( timer ) ) { jQuery.fx.start(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { clearInterval( timerId ); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Back Compat <1.8 extension point jQuery.fx.step = {}; if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } jQuery.fn.offset = function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== core_strundefined ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }; jQuery.offset = { setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || docElem; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || docElem; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return jQuery.access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return jQuery.access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; }); }); // Limit scope pollution from any deprecated API // (function() { // The number of elements contained in the matched element set jQuery.fn.size = function() { return this.length; }; jQuery.fn.andSelf = jQuery.fn.addBack; // })(); if ( typeof module === "object" && module && typeof module.exports === "object" ) { // Expose jQuery as module.exports in loaders that implement the Node // module pattern (including browserify). Do not create the global, since // the user will be storing it themselves locally, and globals are frowned // upon in the Node module world. module.exports = jQuery; } else { // Otherwise expose jQuery to the global object as usual window.jQuery = window.$ = jQuery; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. if ( typeof define === "function" && define.amd ) { define( "jquery", [], function () { return jQuery; } ); } } })( window ); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 519 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:05 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 228560 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 228,560 bytes. |
/*! jQuery UI - v1.10.4 - 2014-03-02
* http://jqueryui.com * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ (function(e,t){function i(t,i){var s,a,o,r=t.nodeName.toLowerCase();return"area"===r?(s=t.parentNode,a=s.name,t.href&&a&&"map"===s.nodeName.toLowerCase()?(o=e("img[usemap=#"+a+"]")[0],!!o&&n(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,a=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,n){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),n&&n.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var n,s,a=e(this[0]);a.length&&a[0]!==document;){if(n=a.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(s=parseInt(a.css("zIndex"),10),!isNaN(s)&&0!==s))return s;a=a.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){a.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),s=isNaN(n);return(s||n>=0)&&i(t,!s)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,n){function s(t,i,n,s){return e.each(a,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var a="Width"===n?["Left","Right"]:["Top","Bottom"],o=n.toLowerCase(),r={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(i){return i===t?r["inner"+n].call(this):this.each(function(){e(this).css(o,s(this,i)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?r["outer"+n].call(this,t):this.each(function(){e(this).css(o,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,n){var s,a=e.ui[t].prototype;for(s in n)a.plugins[s]=a.plugins[s]||[],a.plugins[s].push([i,n[s]])},call:function(e,t,i){var n,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(n=0;s.length>n;n++)e.options[s[n][0]]&&s[n][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[n]>0?!0:(t[n]=1,s=t[n]>0,t[n]=0,s)}})})(jQuery);(function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix||i:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})})(jQuery);(function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,l=Math.round,h=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:a?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var a,p,g,m,v,_,b=t(e.of),y=t.position.getWithinInfo(e.within),k=t.position.getScrollInfo(y),w=(e.collision||"flip").split(" "),D={};return _=n(b),b[0].preventDefault&&(e.at="left top"),p=_.width,g=_.height,m=_.offset,v=t.extend({},m),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=h.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=h.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),D[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=g:"center"===e.at[1]&&(v.top+=g/2),a=i(D.at,p,g),v.left+=a[0],v.top+=a[1],this.each(function(){var n,h,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),_=s(this,"marginTop"),x=u+f+s(this,"marginRight")+k.width,C=d+_+s(this,"marginBottom")+k.height,M=t.extend({},v),T=i(D.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?M.left-=u:"center"===e.my[0]&&(M.left-=u/2),"bottom"===e.my[1]?M.top-=d:"center"===e.my[1]&&(M.top-=d/2),M.left+=T[0],M.top+=T[1],t.support.offsetFractions||(M.left=l(M.left),M.top=l(M.top)),n={marginLeft:f,marginTop:_},t.each(["left","top"],function(i,s){t.ui.position[w[i]]&&t.ui.position[w[i]][s](M,{targetWidth:p,targetHeight:g,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:x,collisionHeight:C,offset:[a[0]+T[0],a[1]+T[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(h=function(t){var i=m.left-M.left,s=i+p-u,n=m.top-M.top,a=n+g-d,l={target:{element:b,left:m.left,top:m.top,width:p,height:g},element:{element:c,left:M.left,top:M.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(l.horizontal="center"),d>g&&g>r(n+a)&&(l.vertical="middle"),l.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,l)}),c.offset(t.extend(M,{using:h}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-o-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-o-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-o-a,t.top+p+f+g>c&&(0>s||r(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,t.top+p+f+g>u&&(i>0||u>r(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(t(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){t("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||t.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1):!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,t(document).width()-this.helperProportions.width-this.margins.left,(t(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(e){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=e.pageX,h=e.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(h=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,l=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("ui-draggable"),n=s.options,a=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,a))})},stop:function(e,i){var s=t(this).data("ui-draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("ui-draggable"),n=this;t.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&t.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("ui-draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("ui-draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:e.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-e.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:e.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(e.pageY-t(document).scrollTop()<s.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-s.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<s.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(e.pageX-t(document).scrollLeft()<s.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-s.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<s.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(){var e=t(this).data("ui-draggable"),i=e.options;e.snapElements=[],t(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=t(this),s=i.offset();this!==e.element[0]&&e.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(e,i){var s,n,a,o,r,l,h,c,u,d,p=t(this).data("ui-draggable"),g=p.options,f=g.snapTolerance,m=i.offset.left,_=m+p.helperProportions.width,v=i.offset.top,b=v+p.helperProportions.height;for(u=p.snapElements.length-1;u>=0;u--)r=p.snapElements[u].left,l=r+p.snapElements[u].width,h=p.snapElements[u].top,c=h+p.snapElements[u].height,r-f>_||m>l+f||h-f>b||v>c+f||!t.contains(p.snapElements[u].item.ownerDocument,p.snapElements[u].item)?(p.snapElements[u].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=!1):("inner"!==g.snapMode&&(s=f>=Math.abs(h-b),n=f>=Math.abs(c-v),a=f>=Math.abs(r-_),o=f>=Math.abs(l-m),s&&(i.position.top=p._convertPositionTo("relative",{top:h-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l}).left-p.margins.left)),d=s||n||a||o,"outer"!==g.snapMode&&(s=f>=Math.abs(h-v),n=f>=Math.abs(c-b),a=f>=Math.abs(r-m),o=f>=Math.abs(l-_),s&&(i.position.top=p._convertPositionTo("relative",{top:h,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[u].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=s||n||a||o||d)}}),t.ui.plugin.add("draggable","stack",{start:function(){var e,i=this.data("ui-draggable").options,s=t.makeArray(t(i.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(e=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(i){t(this).css("zIndex",e+i)}),this.css("zIndex",e+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}t.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],undefined):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},t.ui.ddmanager.droppables[i.scope]=t.ui.ddmanager.droppables[i.scope]||[],t.ui.ddmanager.droppables[i.scope].push(this),i.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(t,i,s){if(!i.offset)return!1;var n,a,o=(t.positionAbs||t.position.absolute).left,r=(t.positionAbs||t.position.absolute).top,l=o+t.helperProportions.width,h=r+t.helperProportions.height,c=i.offset.left,u=i.offset.top,d=c+i.proportions().width,p=u+i.proportions().height;switch(s){case"fit":return o>=c&&d>=l&&r>=u&&p>=h;case"intersect":return o+t.helperProportions.width/2>c&&d>l-t.helperProportions.width/2&&r+t.helperProportions.height/2>u&&p>h-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,a=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(a,u,i.proportions().height)&&e(n,c,i.proportions().width);case"touch":return(r>=u&&p>=r||h>=u&&p>=h||u>r&&h>p)&&(o>=c&&d>=o||l>=c&&d>=l||c>o&&l>d);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,a=t.ui.ddmanager.droppables[e.options.scope]||[],o=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||e&&!a[s].accept.call(a[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue t}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=t.ui.intersect(e,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return t.data(this,"ui-droppable").options.scope===n}),a.length&&(s=t.data(a[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}})(jQuery);(function(t){function e(t){return parseInt(t,10)||0}function i(t){return!isNaN(parseInt(t,10))}t.widget("ui.resizable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),a="ui-resizable-"+s,n=t("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,a;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=t(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,a),this._proportionallyResize()),t(this.handles[i]).length},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(t(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(t(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=e(this.helper.css("left")),n=e(this.helper.css("top")),o.containment&&(s+=t(o.containment).scrollLeft()||0,n+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(e){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,c=this.size.height,u=e.pageX-a.left||0,d=e.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[e,u,d]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==c&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||this._trigger("resize",e,this.ui()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&t.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,a=s?0:c.sizeDiff.width,o={width:c.helper.width()-a,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,h=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(o,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),i(t.left)&&(this.position.left=t.left),i(t.top)&&(this.position.top=t.top),i(t.height)&&(this.size.height=t.height),i(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,s=this.size,n=this.axis;return i(t.height)?t.width=t.height*this.aspectRatio:i(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(s.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(s.height-t.height),t.left=e.left+(s.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,s=this.axis,n=i(t.width)&&e.maxWidth&&e.maxWidth<t.width,a=i(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=i(t.width)&&e.minWidth&&e.minWidth>t.width,r=i(t.height)&&e.minHeight&&e.minHeight>t.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(s),u=/nw|ne|n/.test(s);return o&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),a&&(t.height=e.maxHeight),o&&c&&(t.left=h-e.minWidth),n&&c&&(t.left=h-e.maxWidth),r&&u&&(t.top=l-e.minHeight),a&&u&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var t,e,i,s,n,a=this.helper||this.element;for(t=0;this._proportionallyResizeElements.length>t;t++){if(n=this._proportionallyResizeElements[t],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],e=0;i.length>e;e++)this.borderDif[e]=(parseInt(i[e],10)||0)+(parseInt(s[e],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&t.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=t(this).data("ui-resizable"),c=l.options,u=l.element,d=c.containment,p=d instanceof t?d.get(0):/parent/.test(d)?u.parent().get(0):d;p&&(l.containerElement=t(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(i=t(p),s=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){s[t]=e(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=t.ui.hasScroll(p,"left")?p.scrollWidth:o,h=t.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(e){var i,s,n,a,o=t(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,c=o._aspectRatio||e.shiftKey,u={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-u.left),c&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),c&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-u.left:o.offset.left-u.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-u.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=Math.abs(o.parentData.left)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,c&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,c&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.containerOffset,n=e.containerPosition,a=e.containerElement,o=t(e.helper),r=o.offset(),h=o.outerWidth()-e.sizeDiff.width,l=o.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(a.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(a.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=function(e){t(e).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):t.each(i.alsoResize,function(t){s(t)})},resize:function(e,i){var s=t(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(a[e]=i||null)}),e.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size,n=e.originalSize,a=e.originalPosition,o=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&d>i.maxWidth,g=i.maxHeight&&p>i.maxHeight,m=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),v&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(o)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.top=a.top-u):/^(sw)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.left=a.left-c):(p-l>0?(e.size.height=p,e.position.top=a.top-u):(e.size.height=l,e.position.top=a.top+n.height-l),d-h>0?(e.size.width=d,e.position.left=a.left-c):(e.size.width=h,e.position.left=a.left+n.width-h))}})})(jQuery);(function(t){t.widget("ui.selectable",t.ui.mouse,{version:"1.10.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e=t(i.options.filter,i.element[0]),e.addClass("ui-selectee"),e.each(function(){var e=t(this),i=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:i.left,top:i.top,right:i.left+e.outerWidth(),bottom:i.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=t("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=e.pageX,l=e.pageY;return a>r&&(i=r,r=a,a=i),o>l&&(i=l,l=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:l-o}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),h=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?h=!(i.left>r||a>i.right||i.top>l||o>i.bottom):"fit"===n.tolerance&&(h=i.left>a&&r>i.right&&i.top>o&&l>i.bottom),h?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):undefined}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-t(document).scrollTop()<a.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-a.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<a.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+a.scrollSpeed)),e.pageX-t(document).scrollLeft()<a.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-a.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<a.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return n?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&s||"left"===o&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t("<td> </td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,o,a,r,h,l,c,u,d,p,f=null,g=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],g=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[g].containerCache.over||(this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1);else{for(a=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],o=this.items.length-1;o>=0;o--)t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))&&(u=this.items[o].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[o][l]-c)&&(d=!0,u+=this.items[o][l]),a>Math.abs(u-c)&&(a=Math.abs(u-c),r=this.items[o],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[g].element,!0),this._trigger("change",s,this._uiHash()),this.containers[g]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[g],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery);(function(e){var t=0,i={},a={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",a.height=a.paddingTop=a.paddingBottom=a.borderTopWidth=a.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.10.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e(),content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),undefined):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t),undefined)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,a=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:n=this.headers[(s+1)%a];break;case i.LEFT:case i.UP:n=this.headers[(s-1+a)%a];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:n=this.headers[0];break;case i.END:n=this.headers[a-1]}n&&(e(t.target).attr("tabIndex",-1),e(n).attr("tabIndex",0),n.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,a=this.options,s=a.heightStyle,n=this.element.parent(),r=this.accordionId="ui-accordion-"+(this.element.attr("id")||++t);this.active=this._findActive(a.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(t){var i=e(this),a=i.attr("id"),s=i.next(),n=s.attr("id");a||(a=r+"-header-"+t,i.attr("id",a)),n||(n=r+"-panel-"+t,s.attr("id",n)),i.attr("aria-controls",n),s.attr("aria-labelledby",a)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(a.event),"fill"===s?(i=n.height(),this.element.siblings(":visible").each(function(){var t=e(this),a=t.css("position");"absolute"!==a&&"fixed"!==a&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(i=0,this.headers.next().each(function(){i=Math.max(i,e(this).css("height","").height())}).height(i))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,a=this.active,s=e(t.currentTarget),n=s[0]===a[0],r=n&&i.collapsible,o=r?e():s.next(),h=a.next(),d={oldHeader:a,oldPanel:h,newHeader:r?e():s,newPanel:o};t.preventDefault(),n&&!i.collapsible||this._trigger("beforeActivate",t,d)===!1||(i.active=r?!1:this.headers.index(s),this.active=n?e():s,this._toggle(d),a.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&a.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),n||(s.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),s.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,a=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=a,this.options.animate?this._animate(i,a,t):(a.hide(),i.show(),this._toggleComplete(t)),a.attr({"aria-hidden":"true"}),a.prev().attr("aria-selected","false"),i.length&&a.length?a.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(e,t,s){var n,r,o,h=this,d=0,c=e.length&&(!t.length||e.index()<t.index()),l=this.options.animate||{},u=c&&l.down||l,v=function(){h._toggleComplete(s)};return"number"==typeof u&&(o=u),"string"==typeof u&&(r=u),r=r||u.easing||l.easing,o=o||u.duration||l.duration,t.length?e.length?(n=e.show().outerHeight(),t.animate(i,{duration:o,easing:r,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(a,{duration:o,easing:r,complete:v,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?d+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(n-t.outerHeight()-d),d=0)}}),undefined):t.animate(i,o,r,v):e.animate(a,o,r,v)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}})})(jQuery);(function(e){e.widget("ui.autocomplete",{version:"1.10.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,undefined;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),undefined):(this._searchTimeout(e),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(e),this._change(e),undefined)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:s})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):undefined},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<a>").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[e](t),undefined):(this.search(null,t),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.text(t))}})})(jQuery);(function(e){var t,i="ui-button ui-widget ui-state-default ui-corner-all",n="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",s=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},a=function(t){var i=t.name,n=t.form,s=e([]);return i&&(i=i.replace(/'/g,"\\'"),s=n?e(n).find("[name='"+i+"']"):e("[name='"+i+"']",t.ownerDocument).filter(function(){return!this.form})),s};e.widget("ui.button",{version:"1.10.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,s),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var n=this,o=this.options,r="checkbox"===this.type||"radio"===this.type,h=r?"":"ui-state-active";null===o.label&&(o.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(i).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){o.disabled||this===t&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){o.disabled||e(this).removeClass(h)}).bind("click"+this.eventNamespace,function(e){o.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),r&&this.element.bind("change"+this.eventNamespace,function(){n.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return o.disabled?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(o.disabled)return!1;e(this).addClass("ui-state-active"),n.buttonElement.attr("aria-pressed","true");var t=n.element[0];a(t).not(t).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return o.disabled?!1:(e(this).addClass("ui-state-active"),t=this,n.document.one("mouseup",function(){t=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return o.disabled?!1:(e(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(t){return o.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",o.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(i+" ui-state-active "+n).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.element.prop("disabled",!!t),t&&this.buttonElement.removeClass("ui-state-focus"),undefined):(this._resetButton(),undefined)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?a(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var t=this.buttonElement.removeClass(n),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,a=s.primary&&s.secondary,o=[];s.primary||s.secondary?(this.options.text&&o.push("ui-button-text-icon"+(a?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(o.push(a?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):o.push("ui-button-text-only"),t.addClass(o.join(" "))}}),e.widget("ui.buttonset",{version:"1.10.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(function(e,t){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all' style='display:none'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){e.datepicker._isDisabledDatepicker(n.inline?t.parent()[0]:n.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))})}function s(t,i){e.extend(t,i);for(var a in i)null==i[a]&&(t[a]=i[a]);return t}e.extend(e.ui,{datepicker:{version:"1.10.4"}});var n,r="datepicker";e.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return s(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var a,s,n;a=t.nodeName.toLowerCase(),s="div"===a||"span"===a,t.id||(this.uuid+=1,t.id="dp"+this.uuid),n=this._newInst(e(t),s),n.settings=e.extend({},i||{}),"input"===a?this._connectDatepicker(t,n):s&&this._inlineDatepicker(t,n)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var a=e(t);i.append=e([]),i.trigger=e([]),a.hasClass(this.markerClassName)||(this._attachments(a,i),a.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,r,i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var a,s,n,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=e("<span class='"+this._appendClass+"'>"+r+"</span>"),t[o?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),a=this._get(i,"showOn"),("focus"===a||"both"===a)&&t.focus(this._showDatepicker),("button"===a||"both"===a)&&(s=this._get(i,"buttonText"),n=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:n,alt:s,title:s}):e("<button type='button'></button>").addClass(this._triggerClass).html(n?e("<img/>").attr({src:n,alt:s,title:s}):s)),t[o?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,a,s,n=new Date(2009,11,20),r=this._get(e,"dateFormat");r.match(/[DM]/)&&(t=function(e){for(i=0,a=0,s=0;e.length>s;s++)e[s].length>i&&(i=e[s].length,a=s);return a},n.setMonth(t(this._get(e,r.match(/MM/)?"monthNames":"monthNamesShort"))),n.setDate(t(this._get(e,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-n.getDay())),e.input.attr("size",this._formatDate(e,n).length)}},_inlineDatepicker:function(t,i){var a=e(t);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(i.dpDiv),e.data(t,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,a,n,o){var u,c,h,l,d,p=this._dialogInst;return p||(this.uuid+=1,u="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+u+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},e.data(this._dialogInput[0],r,p)),s(p.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(c=document.documentElement.clientWidth,h=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[c/2-100+l,h/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(t){var i,a=e(t),s=e.data(t,r);a.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,r),"input"===i?(s.append.remove(),s.trigger.remove(),a.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&a.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().removeClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().addClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,a,n){var r,o,u,c,h=this._getInst(i);return 2===arguments.length&&"string"==typeof a?"defaults"===a?e.extend({},e.datepicker._defaults):h?"all"===a?e.extend({},h.settings):this._get(h,a):null:(r=a||{},"string"==typeof a&&(r={},r[a]=n),h&&(this._curInst===h&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),u=this._getMinMaxDate(h,"min"),c=this._getMinMaxDate(h,"max"),s(h.settings,r),null!==u&&r.dateFormat!==t&&r.minDate===t&&(h.settings.minDate=this._formatDate(h,u)),null!==c&&r.dateFormat!==t&&r.maxDate===t&&(h.settings.maxDate=this._formatDate(h,c)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(e(i),h),this._autoSize(h),this._setDate(h,o),this._updateAlternate(h),this._updateDatepicker(h)),t)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,a,s,n=e.datepicker._getInst(t.target),r=!0,o=n.dpDiv.is(".ui-datepicker-rtl");if(n._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),r=!1;break;case 13:return s=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",n.dpDiv),s[0]&&e.datepicker._selectDay(t.target,n.selectedMonth,n.selectedYear,s[0]),i=e.datepicker._get(n,"onSelect"),i?(a=e.datepicker._formatDate(n),i.apply(n.input?n.input[0]:null,[a,n])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?1:-1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?-1:1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),r=t.ctrlKey||t.metaKey;break;default:r=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(i){var a,s,n=e.datepicker._getInst(i.target);return e.datepicker._get(n,"constrainInput")?(a=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">s||!a||a.indexOf(s)>-1):t},_doKeyUp:function(t){var i,a=e.datepicker._getInst(t.target);if(a.input.val()!==a.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,e.datepicker._getFormatConfig(a)),i&&(e.datepicker._setDateFromField(a),e.datepicker._updateAlternate(a),e.datepicker._updateDatepicker(a))}catch(s){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,a,n,r,o,u,c;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),a=e.datepicker._get(i,"beforeShow"),n=a?a.apply(t,[t,i]):{},n!==!1&&(s(i.settings,n),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),r=!1,e(t).parents().each(function(){return r|="fixed"===e(this).css("position"),!r}),o={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),o=e.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(u=e.datepicker._get(i,"showAnim"),c=e.datepicker._get(i,"duration"),i.dpDiv.zIndex(e(t).zIndex()+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[u]?i.dpDiv.show(u,e.datepicker._get(i,"showOptions"),c):i.dpDiv[u||"show"](u?c:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,n=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,a=this._getNumberOfMonths(t),s=a[1],r=17;t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",r*s+"em"),t.dpDiv[(1!==a[0]||1!==a[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,a){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),r=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,u=document.documentElement.clientWidth+(a?0:e(document).scrollLeft()),c=document.documentElement.clientHeight+(a?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?s-r:0,i.left-=a&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=a&&i.top===t.input.offset().top+o?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+s>u&&u>s?Math.abs(i.left+s-u):0),i.top-=Math.min(i.top,i.top+n>c&&c>n?Math.abs(n+o):0),i},_findPos:function(t){for(var i,a=this._getInst(t),s=this._get(a,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[s?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,a,s,n,o=this._curInst;!o||t&&o!==e.data(t,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),a=this._get(o,"duration"),s=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),a,s):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?a:null,s),i||s(),this._datepickerShowing=!1,n=this._get(o,"onClose"),n&&n.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),a=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==a)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,a){var s=e(t),n=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(n,i+("M"===a?this._get(n,"showCurrentAtPos"):0),a),this._updateDatepicker(n))},_gotoToday:function(t){var i,a=e(t),s=this._getInst(a[0]);this._get(s,"gotoCurrent")&&s.currentDay?(s.selectedDay=s.currentDay,s.drawMonth=s.selectedMonth=s.currentMonth,s.drawYear=s.selectedYear=s.currentYear):(i=new Date,s.selectedDay=i.getDate(),s.drawMonth=s.selectedMonth=i.getMonth(),s.drawYear=s.selectedYear=i.getFullYear()),this._notifyChange(s),this._adjustDate(a)},_selectMonthYear:function(t,i,a){var s=e(t),n=this._getInst(s[0]);n["selected"+("M"===a?"Month":"Year")]=n["draw"+("M"===a?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(n),this._adjustDate(s)},_selectDay:function(t,i,a,s){var n,r=e(t);e(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(n=this._getInst(r[0]),n.selectedDay=n.currentDay=e("a",s).html(),n.selectedMonth=n.currentMonth=i,n.selectedYear=n.currentYear=a,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var a,s=e(t),n=this._getInst(s[0]);i=null!=i?i:this._formatDate(n),n.input&&n.input.val(i),this._updateAlternate(n),a=this._get(n,"onSelect"),a?a.apply(n.input?n.input[0]:null,[i,n]):n.input&&n.input.trigger("change"),n.inline?this._updateDatepicker(n):(this._hideDatepicker(),this._lastInput=n.input[0],"object"!=typeof n.input[0]&&n.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,a,s,n=this._get(t,"altField");n&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),a=this._getDate(t),s=this.formatDate(i,a,this._getFormatConfig(t)),e(n).each(function(){e(this).val(s)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(i,a,s){if(null==i||null==a)throw"Invalid arguments";if(a="object"==typeof a?""+a:a+"",""===a)return null;var n,r,o,u,c=0,h=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,l="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,p=(s?s.dayNames:null)||this._defaults.dayNames,g=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,m=(s?s.monthNames:null)||this._defaults.monthNames,f=-1,_=-1,v=-1,k=-1,y=!1,b=function(e){var t=i.length>n+1&&i.charAt(n+1)===e;return t&&n++,t},D=function(e){var t=b(e),i="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,s=RegExp("^\\d{1,"+i+"}"),n=a.substring(c).match(s);if(!n)throw"Missing number at position "+c;return c+=n[0].length,parseInt(n[0],10)},w=function(i,s,n){var r=-1,o=e.map(b(i)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,i){var s=i[1];return a.substr(c,s.length).toLowerCase()===s.toLowerCase()?(r=i[0],c+=s.length,!1):t}),-1!==r)return r+1;throw"Unknown name at position "+c},M=function(){if(a.charAt(c)!==i.charAt(n))throw"Unexpected literal at position "+c;c++};for(n=0;i.length>n;n++)if(y)"'"!==i.charAt(n)||b("'")?M():y=!1;else switch(i.charAt(n)){case"d":v=D("d");break;case"D":w("D",d,p);break;case"o":k=D("o");break;case"m":_=D("m");break;case"M":_=w("M",g,m);break;case"y":f=D("y");break;case"@":u=new Date(D("@")),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"!":u=new Date((D("!")-this._ticksTo1970)/1e4),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"'":b("'")?M():y=!0;break;default:M()}if(a.length>c&&(o=a.substr(c),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===f?f=(new Date).getFullYear():100>f&&(f+=(new Date).getFullYear()-(new Date).getFullYear()%100+(l>=f?0:-100)),k>-1)for(_=1,v=k;;){if(r=this._getDaysInMonth(f,_-1),r>=v)break;_++,v-=r}if(u=this._daylightSavingAdjust(new Date(f,_-1,v)),u.getFullYear()!==f||u.getMonth()+1!==_||u.getDate()!==v)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var a,s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,n=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,u=function(t){var i=e.length>a+1&&e.charAt(a+1)===t;return i&&a++,i},c=function(e,t,i){var a=""+t;if(u(e))for(;i>a.length;)a="0"+a;return a},h=function(e,t,i,a){return u(e)?a[t]:i[t]},l="",d=!1;if(t)for(a=0;e.length>a;a++)if(d)"'"!==e.charAt(a)||u("'")?l+=e.charAt(a):d=!1;else switch(e.charAt(a)){case"d":l+=c("d",t.getDate(),2);break;case"D":l+=h("D",t.getDay(),s,n);break;case"o":l+=c("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":l+=c("m",t.getMonth()+1,2);break;case"M":l+=h("M",t.getMonth(),r,o);break;case"y":l+=u("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=1e4*t.getTime()+this._ticksTo1970;break;case"'":u("'")?l+="'":d=!0;break;default:l+=e.charAt(a)}return l},_possibleChars:function(e){var t,i="",a=!1,s=function(i){var a=e.length>t+1&&e.charAt(t+1)===i;return a&&t++,a};for(t=0;e.length>t;t++)if(a)"'"!==e.charAt(t)||s("'")?i+=e.charAt(t):a=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":s("'")?i+="'":a=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,i){return e.settings[i]!==t?e.settings[i]:this._defaults[i]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),a=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),n=s,r=this._getFormatConfig(e);try{n=this.parseDate(i,a,r)||s}catch(o){a=t?"":a}e.selectedDay=n.getDate(),e.drawMonth=e.selectedMonth=n.getMonth(),e.drawYear=e.selectedYear=n.getFullYear(),e.currentDay=a?n.getDate():0,e.currentMonth=a?n.getMonth():0,e.currentYear=a?n.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,a){var s=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},n=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(a){}for(var s=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,n=s.getFullYear(),r=s.getMonth(),o=s.getDate(),u=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,c=u.exec(i);c;){switch(c[2]||"d"){case"d":case"D":o+=parseInt(c[1],10);break;case"w":case"W":o+=7*parseInt(c[1],10);break;case"m":case"M":r+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r));break;case"y":case"Y":n+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r))}c=u.exec(i)}return new Date(n,r,o)},r=null==i||""===i?a:"string"==typeof i?n(i):"number"==typeof i?isNaN(i)?a:s(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?a:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var a=!t,s=e.selectedMonth,n=e.selectedYear,r=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=r.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=r.getMonth(),e.drawYear=e.selectedYear=e.currentYear=r.getFullYear(),s===e.selectedMonth&&n===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(a?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),a="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(a,-i,"M")},next:function(){e.datepicker._adjustDate(a,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(a)},selectDay:function(){return e.datepicker._selectDay(a,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(a,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(a,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,a,s,n,r,o,u,c,h,l,d,p,g,m,f,_,v,k,y,b,D,w,M,C,x,I,N,T,A,E,S,Y,F,P,O,j,K,R,H=new Date,W=this._daylightSavingAdjust(new Date(H.getFullYear(),H.getMonth(),H.getDate())),L=this._get(e,"isRTL"),U=this._get(e,"showButtonPanel"),B=this._get(e,"hideIfNoPrevNext"),z=this._get(e,"navigationAsDateFormat"),q=this._getNumberOfMonths(e),G=this._get(e,"showCurrentAtPos"),J=this._get(e,"stepMonths"),Q=1!==q[0]||1!==q[1],V=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),$=this._getMinMaxDate(e,"min"),X=this._getMinMaxDate(e,"max"),Z=e.drawMonth-G,et=e.drawYear;if(0>Z&&(Z+=12,et--),X)for(t=this._daylightSavingAdjust(new Date(X.getFullYear(),X.getMonth()-q[0]*q[1]+1,X.getDate())),t=$&&$>t?$:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=z?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-J,1)),this._getFormatConfig(e)):i,a=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>":B?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>",s=this._get(e,"nextText"),s=z?this.formatDate(s,this._daylightSavingAdjust(new Date(et,Z+J,1)),this._getFormatConfig(e)):s,n=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>":B?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>",r=this._get(e,"currentText"),o=this._get(e,"gotoCurrent")&&e.currentDay?V:W,r=z?this.formatDate(r,o,this._getFormatConfig(e)):r,u=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",c=U?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(L?u:"")+(this._isInRange(e,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(L?"":u)+"</div>":"",h=parseInt(this._get(e,"firstDay"),10),h=isNaN(h)?0:h,l=this._get(e,"showWeek"),d=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),g=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),f=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),v=this._get(e,"selectOtherMonths"),k=this._getDefaultDate(e),y="",D=0;q[0]>D;D++){for(w="",this.maxRows=4,M=0;q[1]>M;M++){if(C=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),x=" ui-corner-all",I="",Q){if(I+="<div class='ui-datepicker-group",q[1]>1)switch(M){case 0:I+=" ui-datepicker-group-first",x=" ui-corner-"+(L?"right":"left");break;case q[1]-1:I+=" ui-datepicker-group-last",x=" ui-corner-"+(L?"left":"right");break;default:I+=" ui-datepicker-group-middle",x=""}I+="'>"}for(I+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+x+"'>"+(/all|left/.test(x)&&0===D?L?n:a:"")+(/all|right/.test(x)&&0===D?L?a:n:"")+this._generateMonthYearHeader(e,Z,et,$,X,D>0||M>0,g,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",N=l?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",b=0;7>b;b++)T=(b+h)%7,N+="<th"+((b+h+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[T]+"'>"+p[T]+"</span></th>";for(I+=N+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),E=(this._getFirstDayOfMonth(et,Z)-h+7)%7,S=Math.ceil((E+A)/7),Y=Q?this.maxRows>S?this.maxRows:S:S,this.maxRows=Y,F=this._daylightSavingAdjust(new Date(et,Z,1-E)),P=0;Y>P;P++){for(I+="<tr>",O=l?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(F)+"</td>":"",b=0;7>b;b++)j=f?f.apply(e.input?e.input[0]:null,[F]):[!0,""],K=F.getMonth()!==Z,R=K&&!v||!j[0]||$&&$>F||X&&F>X,O+="<td class='"+((b+h+6)%7>=5?" ui-datepicker-week-end":"")+(K?" ui-datepicker-other-month":"")+(F.getTime()===C.getTime()&&Z===e.selectedMonth&&e._keyEvent||k.getTime()===F.getTime()&&k.getTime()===C.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(K&&!_?"":" "+j[1]+(F.getTime()===V.getTime()?" "+this._currentClass:"")+(F.getTime()===W.getTime()?" ui-datepicker-today":""))+"'"+(K&&!_||!j[2]?"":" title='"+j[2].replace(/'/g,"'")+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+F.getMonth()+"' data-year='"+F.getFullYear()+"'")+">"+(K&&!_?" ":R?"<span class='ui-state-default'>"+F.getDate()+"</span>":"<a class='ui-state-default"+(F.getTime()===W.getTime()?" ui-state-highlight":"")+(F.getTime()===V.getTime()?" ui-state-active":"")+(K?" ui-priority-secondary":"")+"' href='#'>"+F.getDate()+"</a>")+"</td>",F.setDate(F.getDate()+1),F=this._daylightSavingAdjust(F);I+=O+"</tr>"}Z++,Z>11&&(Z=0,et++),I+="</tbody></table>"+(Q?"</div>"+(q[0]>0&&M===q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),w+=I}y+=w}return y+=c,e._keyEvent=!1,y},_generateMonthYearHeader:function(e,t,i,a,s,n,r,o){var u,c,h,l,d,p,g,m,f=this._get(e,"changeMonth"),_=this._get(e,"changeYear"),v=this._get(e,"showMonthAfterYear"),k="<div class='ui-datepicker-title'>",y="";if(n||!f)y+="<span class='ui-datepicker-month'>"+r[t]+"</span>";else{for(u=a&&a.getFullYear()===i,c=s&&s.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",h=0;12>h;h++)(!u||h>=a.getMonth())&&(!c||s.getMonth()>=h)&&(y+="<option value='"+h+"'"+(h===t?" selected='selected'":"")+">"+o[h]+"</option>");y+="</select>"}if(v||(k+=y+(!n&&f&&_?"":" ")),!e.yearshtml)if(e.yearshtml="",n||!_)k+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(l=this._get(e,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?d+parseInt(e,10):parseInt(e,10); return isNaN(t)?d:t},g=p(l[0]),m=Math.max(g,p(l[1]||"")),g=a?Math.max(g,a.getFullYear()):g,m=s?Math.min(m,s.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=g;g++)e.yearshtml+="<option value='"+g+"'"+(g===i?" selected='selected'":"")+">"+g+"</option>";e.yearshtml+="</select>",k+=e.yearshtml,e.yearshtml=null}return k+=this._get(e,"yearSuffix"),v&&(k+=(!n&&f&&_?"":" ")+y),k+="</div>"},_adjustInstDate:function(e,t,i){var a=e.drawYear+("Y"===i?t:0),s=e.drawMonth+("M"===i?t:0),n=Math.min(e.selectedDay,this._getDaysInMonth(a,s))+("D"===i?t:0),r=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(a,s,n)));e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),s=i&&i>t?i:t;return a&&s>a?a:s},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,a){var s=this._getNumberOfMonths(e),n=this._daylightSavingAdjust(new Date(i,a+(0>t?t:s[0]*s[1]),1));return 0>t&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(e,n)},_isInRange:function(e,t){var i,a,s=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),r=null,o=null,u=this._get(e,"yearRange");return u&&(i=u.split(":"),a=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=a),i[1].match(/[+\-].*/)&&(o+=a)),(!s||t.getTime()>=s.getTime())&&(!n||t.getTime()<=n.getTime())&&(!r||t.getFullYear()>=r)&&(!o||o>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,a){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var s=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(a,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),s,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new i,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.10.4"})(jQuery);(function(e){var t={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.10.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,a=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._destroyOverlay(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(s){}this._hide(this.uiDialog,this.options.hide,function(){a._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!t&&this._trigger("focus",e),i},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var e=this.element.find("[autofocus]");e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),undefined;if(t.keyCode===e.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),a=i.filter(":first"),s=i.filter(":last");t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==a[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(s.focus(1),t.preventDefault()):(a.focus(1),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html(" "),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(e.each(i,function(i,a){var s,n;a=e.isFunction(a)?{click:a,text:i}:a,a=e.extend({type:"button"},a),s=a.click,a.click=function(){s.apply(t.element[0],arguments)},n={icons:a.icons,text:a.showText},delete a.icons,delete a.showText,e("<button></button>",a).button(n).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,a=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(a,s){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",a,t(s))},drag:function(e,a){i._trigger("drag",e,t(a))},stop:function(s,n){a.position=[n.position.left-i.document.scrollLeft(),n.position.top-i.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",s,t(n))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,a=this.options,s=a.resizable,n=this.uiDialog.css("position"),r="string"==typeof s?s:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:a.maxWidth,maxHeight:a.maxHeight,minWidth:a.minWidth,minHeight:this._minHeight(),handles:r,start:function(a,s){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",a,t(s))},resize:function(e,a){i._trigger("resize",e,t(a))},stop:function(s,n){a.height=e(this).height(),a.width=e(this).width(),e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",s,t(n))}}).css("position",n)},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(a){var s=this,n=!1,r={};e.each(a,function(e,a){s._setOption(e,a),e in t&&(n=!0),e in i&&(r[e]=a)}),n&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",r)},_setOption:function(e,t){var i,a,s=this.uiDialog;"dialogClass"===e&&s.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=s.is(":data(ui-draggable)"),i&&!t&&s.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(a=s.is(":data(ui-resizable)"),a&&!t&&s.resizable("destroy"),a&&"string"==typeof t&&s.resizable("option","handles",t),a||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,a=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),a.minWidth>a.width&&(a.width=a.minWidth),e=this.uiDialog.css({height:"auto",width:a.width}).outerHeight(),t=Math.max(0,a.minHeight-e),i="number"==typeof a.maxHeight?Math.max(0,a.maxHeight-e):"none","auto"===a.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,a.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=this,i=this.widgetFullName;e.ui.dialog.overlayInstances||this._delay(function(){e.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(a){t._allowInteraction(a)||(a.preventDefault(),e(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),e.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(e.ui.dialog.overlayInstances--,e.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),e.ui.dialog.overlayInstances=0,e.uiBackCompat!==!1&&e.widget("ui.dialog",e.ui.dialog,{_position:function(){var t,i=this.options.position,a=[],s=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(a=i.split?i.split(" "):[i[0],i[1]],1===a.length&&(a[1]=a[0]),e.each(["left","top"],function(e,t){+a[e]===a[e]&&(s[e]=a[e],a[e]=t)}),i={my:a[0]+(0>s[0]?s[0]:"+"+s[0])+" "+a[1]+(0>s[1]?s[1]:"+"+s[1]),at:a.join(" ")}),i=e.extend({},e.ui.dialog.prototype.options.position,i)):i=e.ui.dialog.prototype.options.position,t=this.uiDialog.is(":visible"),t||this.uiDialog.show(),this.uiDialog.position(i),t||this.uiDialog.hide()}})})(jQuery);(function(t){t.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&t(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,l=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:l=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}l&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery);(function(t,e){t.widget("ui.progressbar",{version:"1.10.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})})(jQuery);(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,l,h,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-u.values(e));(n>i||n===i&&(e===u._lastChangedValue||u.values(e)===c.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),l=a.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-a.width()/2,top:e.pageY-l.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,l=this,h=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((l.values(s)-l._valueMin())/(l._valueMax()-l._valueMin())),u["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](u,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===s&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[h?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[h?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery);(function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>▲</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>▼</span>"+"</a>"},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})})(jQuery);(function(t,e){function i(){return++n}function s(t){return t=t.cloneNode(!1),t.hash.length>1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,c))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery);(function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.4",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=o),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function o(t){l.of=t,a.is(":hidden")||a.position(l)}var a,r,h,l=t.extend({},this.options.position);if(n){if(a=this._find(s),a.length)return a.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),a=this._tooltip(s),e(s,a.attr("id")),a.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:o}),o(i)):a.position(t.extend({of:s},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){a.is(":visible")&&(o(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:a}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(a)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),o.stop(!0),this._hide(o,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:o}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})})(jQuery);(function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),f(l,function(t,a){var o,r=a.re.exec(i),l=r&&a.parse(r),h=a.space||"rgba";return l?(o=s[h](l),s[c[h].cache]=o[c[h].cache],n=s._rgba=o._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,o,r,l){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,l],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof h?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if("alpha"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),a=c[n],o=0===this.alpha()?h("transparent"):this,r=o[a.cache]||a.to(o._rgba),l=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],h=s[a],c=u[n.type]||{};null!==h&&(null===o?l[a]=h:(c.mod&&(h-o>c.mod/2?o+=c.mod:o-h>c.mod/2&&(o-=c.mod)),l[a]=i((h-o)*e+o,n)))}),this[n](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),l=Math.min(s,n,a),h=r-l,c=r+l,u=.5*c;return e=l===r?0:s===r?60*(n-a)/h+360:n===r?60*(a-s)/h+120:60*(s-n)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[o]&&(this[o]=l(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=h(c(d)),n[o]=d,n):h(d)},f(a,function(e,i){h.fn[e]||(h.fn[e]=function(n){var a,o=t.type(n),l="alpha"===e?this._hsla?"hsla":"rgba":s,h=this[l](),c=h[i.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1))),h[i.idx]=n,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r="";if("transparent"!==n&&("string"!==t.type(n)||(a=s(n)))){if(n=h(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&o&&o.style;)try{r=t.css(o,"backgroundColor"),o=o.parentNode}catch(l){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},a=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var l=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",h=l.children?o.find("*").addBack():o;h=h.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+"Class"](e[i])})},a(),h=h.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),s=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,h.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return"boolean"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.4",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=""),t.css(s[a],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery);(function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var a,o,r,l=t(this),h=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(l,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",g=i.test(u),m={},v="show"===c;l.parent().is(".ui-effects-wrapper")?t.effects.save(l.parent(),h):t.effects.save(l,h),l.show(),a=t.effects.createWrapper(l).css({overflow:"hidden"}),o=a[p](),r=parseFloat(a.css(f))||0,m[p]=v?o:0,g||(l.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),m[f]=v?r:o+r),v&&(a.css(p,0),g||a.css(f,r+o)),a.animate(m,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&l.hide(),t.effects.restore(l,h),t.effects.removeWrapper(l),n()}})}})(jQuery);(function(t){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"effect"),h="hide"===l,c="show"===l,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||h?1:0),g=e.duration/f,m=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||h)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,g,m)),h&&(d/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m).animate(a,g,m),d=h?2*d:d/2;h&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m)),o.queue(function(){h&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}})(jQuery);(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"hide"),h="show"===l,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),h&&(n.css(d,0),n.css(p,a/2)),f[d]=h?a:0,f[p]=h?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){h||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(h,"pos"===c?-s:s),u[h]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),g||p.hide(),i()}var a,o,r,l,h,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),g="show"===f,m=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(a=0;u>a;a++)for(l=m.top+a*_,c=a-(u-1)/2,o=0;d>o;o++)r=m.left+o*v,h=o-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(g?h*v:0),top:l+(g?c*_:0),opacity:g?0:1}).animate({left:r+(g?0:h*v),top:l+(g?0:c*_),opacity:g?1:0},e.duration||500,e.easing,s)}})(jQuery);(function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}})(jQuery);(function(t){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),l="show"===r,h="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=l!==d,f=p?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[h?0:1]),l&&s.css(d?{height:0,width:c}:{height:c,width:0}),m[f[0]]=l?n[0]:c,v[f[1]]=l?n[1]:0,s.animate(m,g,e.easing).animate(v,g,e.easing,function(){h&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}})(jQuery);(function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}})(jQuery);(function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,l=o||"hide"===a,h=2*(e.times||5)+(l?1:0),c=e.duration/h,u=0,d=n.queue(),p=d.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;h>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,h+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?l:{height:l.height*r,width:l.width*r,outerHeight:l.outerHeight*r,outerWidth:l.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",l=e.origin,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=l||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:h),n.to={height:h.height*c.y,width:h.width*c.x,outerHeight:h.outerHeight*c.y,outerWidth:h.outerWidth*c.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(o,e.mode||"effect"),f=e.restore||"effect"!==p,g=e.scale||"both",m=e.origin||["middle","center"],v=o.css("position"),_=f?r:l,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===p?(o.from=e.to||b,o.to=e.from||s):(o.from=e.from||("show"===p?b:s),o.to=e.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===g||"both"===g)&&(a.from.y!==a.to.y&&(_=_.concat(u),o.from=t.effects.setTransition(o,u,a.from.y,o.from),o.to=t.effects.setTransition(o,u,a.to.y,o.to)),a.from.x!==a.to.x&&(_=_.concat(d),o.from=t.effects.setTransition(o,d,a.from.x,o.from),o.to=t.effects.setTransition(o,d,a.to.x,o.to))),("content"===g||"both"===g)&&a.from.y!==a.to.y&&(_=_.concat(c).concat(h),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),t.effects.save(o,_),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(n=t.effects.getBaseline(m,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===g||"both"===g)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),h=r.concat(u).concat(d),o.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,h),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,u,a.from.y,i.from),i.to=t.effects.setTransition(i,u,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,d,a.from.x,i.from),i.to=t.effects.setTransition(i,d,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,h)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),t.effects.restore(o,_),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",l=e.distance||20,h=e.times||3,c=2*h+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},g={},m={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+l,g[d]=(p?"+=":"-=")+2*l,m[d]=(p?"-=":"+=")+2*l,n.animate(f,u,e.easing),s=1;h>s;s++)n.animate(g,u,e.easing).animate(m,u,e.easing);n.animate(g,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(h,c?isNaN(s)?"-"+s:-s:s),u[h]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,l=a?o.scrollLeft():0,h=n.offset(),c={top:h.top-r,left:h.left-l,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-l,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}})(jQuery); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/jquery.autonumeric.js?v=20220209161352 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 500 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/jquery.autonumeric.js?v=20220209161352 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:05 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 63255 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 63,255 bytes. |
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?exports.autonumeric=t(require("jquery")):e.autonumeric=t(e.jQuery)}(this,function(e){return function(e){function t(i){if(a[i])return a[i].exports;var r=a[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var a={};return t.m=e,t.c=a,t.p="",t(0)}([function(e,t,a){var i,r,n;a(1),a(1);(function(){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var a=0;a<t.length;a++){var i=t[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,a,i){return a&&e(t.prototype,a),i&&e(t,i),t}}(),s=function(){function e(e,t){var a=[],i=!0,r=!1,n=void 0;try{for(var o,l=e[Symbol.iterator]();!(i=(o=l.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(e){r=!0,n=e}finally{try{!i&&l.return&&l.return()}finally{if(r)throw n}}return a}return function(t,a){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=void 0,d=void 0,m=void 0,h=void 0,g=void 0,v=void 0,p=["b","caption","cite","code","const","dd","del","div","dfn","dt","em","h1","h2","h3","h4","h5","h6","ins","kdb","label","li","option","output","p","q","s","sample","span","strong","td","th","u"],f={digitGroupSeparator:",",noSeparatorOnFocus:!1,digitalGroupSpacing:"3",decimalCharacter:".",decimalCharacterAlternative:null,currencySymbol:"",currencySymbolPlacement:"p",negativePositiveSignPlacement:null,showPositiveSign:!1,suffixText:"",overrideMinMaxLimits:null,maximumValue:"9999999999999.99",minimumValue:"-9999999999999.99",decimalPlacesOverride:null,decimalPlacesShownOnFocus:null,scaleDivisor:null,scaleDecimalPlaces:null,scaleSymbol:null,saveValueToSessionStorage:!1,onInvalidPaste:"error",roundingMethod:"S",allowDecimalPadding:!0,negativeBracketsTypeOnBlur:null,emptyInputBehavior:"focus",leadingZero:"deny",formatOnPageLoad:!0,selectNumberOnly:!1,defaultValueOverride:null,unformatOnSubmit:!1,outputFormat:null,showWarnings:!0,failOnUnknownOption:!1},y={Backspace:8,Tab:9,Enter:13,Shift:16,Ctrl:17,Alt:18,PauseBreak:19,CapsLock:20,Esc:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,LeftArrow:37,UpArrow:38,RightArrow:39,DownArrow:40,Insert:45,Delete:46,num0:48,num1:49,num2:50,num3:51,num4:52,num5:53,num6:54,num7:55,num8:56,num9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,Windows:91,RightClick:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,MultiplyNumpad:106,PlusNumpad:107,MinusNumpad:109,DotNumpad:110,SlashNumpad:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,MyComputer:182,MyCalculator:183,Semicolon:186,Equal:187,Comma:188,Hyphen:189,Dot:190,Slash:191,Backquote:192,LeftBracket:219,Backslash:220,RightBracket:221,Quote:222,Command:224},S={Unidentified:"Unidentified",Alt:"Alt",AltGr:"AltGraph",CapsLock:"CapsLock",Ctrl:"Control",Fn:"Fn",FnLock:"FnLock",Hyper:"Hyper",Meta:"Meta",Windows:"Meta",Command:"Meta",NumLock:"NumLock",ScrollLock:"ScrollLock",Shift:"Shift",Super:"Super",Symbol:"Symbol",SymbolLock:"SymbolLock",Enter:"Enter",Tab:"Tab",Space:" ",DownArrow:"ArrowDown",LeftArrow:"ArrowLeft",RightArrow:"ArrowRight",UpArrow:"ArrowUp",End:"End",Home:"Home",PageDown:"PageDown",PageUp:"PageUp",Backspace:"Backspace",Clear:"Clear",Copy:"Copy",CrSel:"CrSel",Cut:"Cut",Delete:"Delete",EraseEof:"EraseEof",ExSel:"ExSel",Insert:"Insert",Paste:"Paste",Redo:"Redo",Undo:"Undo",Accept:"Accept",Again:"Again",Attn:"Attn",Cancel:"Cancel",ContextMenu:"ContextMenu",Esc:"Escape",Execute:"Execute",Find:"Find",Finish:"Finish",Help:"Help",Pause:"Pause",Play:"Play",Props:"Props",Select:"Select",ZoomIn:"ZoomIn",ZoomOut:"ZoomOut",BrightnessDown:"BrightnessDown",BrightnessUp:"BrightnessUp",Eject:"Eject",LogOff:"LogOff",Power:"Power",PowerOff:"PowerOff",PrintScreen:"PrintScreen",Hibernate:"Hibernate",Standby:"Standby",WakeUp:"WakeUp",Compose:"Compose",Dead:"Dead",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",Print:"Print",num0:"0",num1:"1",num2:"2",num3:"3",num4:"4",num5:"5",num6:"6",num7:"7",num8:"8",num9:"9",numpad0:"0",numpad1:"1",numpad2:"2",numpad3:"3",numpad4:"4",numpad5:"5",numpad6:"6",numpad7:"7",numpad8:"8",numpad9:"9",a:"a",b:"b",c:"c",d:"d",e:"e",f:"f",g:"g",h:"h",i:"i",j:"j",k:"k",l:"l",m:"m",n:"n",o:"o",p:"p",q:"q",r:"r",s:"s",t:"t",u:"u",v:"v",w:"w",x:"x",y:"y",z:"z",MultiplyNumpad:"*",PlusNumpad:"+",MinusNumpad:"-",DotNumpad:".",SlashNumpad:"/",Semicolon:";",Equal:"=",Comma:",",Hyphen:"-",Minus:"-",Plus:"+",Dot:".",Slash:"/",Backquote:"`",LeftBracket:"[",RightBracket:"]",Backslash:"\\",Quote:"'"},b="-999999999999.99",P="999999999999.99",C="U",w="deny",x=!0,O={French:{digitGroupSeparator:".",decimalCharacter:",",decimalCharacterAlternative:".",currencySymbol:" €",currencySymbolPlacement:"s",selectNumberOnly:x,roundingMethod:C,leadingZero:w,minimumValue:b,maximumValue:P},NorthAmerican:{digitGroupSeparator:",",decimalCharacter:".",currencySymbol:"$",currencySymbolPlacement:"p",selectNumberOnly:x,roundingMethod:C,leadingZero:w,minimumValue:b,maximumValue:P},British:{digitGroupSeparator:",",decimalCharacter:".",currencySymbol:"£",currencySymbolPlacement:"p",selectNumberOnly:x,roundingMethod:C,leadingZero:w,minimumValue:b,maximumValue:P},Swiss:{digitGroupSeparator:"'",decimalCharacter:".",currencySymbol:" CHF",currencySymbolPlacement:"s",selectNumberOnly:x,roundingMethod:C,leadingZero:w,minimumValue:b,maximumValue:P},Japanese:{digitGroupSeparator:",",decimalCharacter:".",currencySymbol:"¥",currencySymbolPlacement:"p",selectNumberOnly:x,roundingMethod:C,leadingZero:w,minimumValue:b,maximumValue:P}};O.Spanish=O.French,O.Chinese=O.Japanese,function(o){r=[a(1)],i=o,n="function"==typeof i?i.apply(t,r):i,!(void 0!==n&&(e.exports=n))}(function(e){function t(e){return null===e}function a(e){return void 0===e}function i(e){return null===e||void 0===e||""===e}function r(e){return"string"==typeof e||e instanceof String}function n(e){return"boolean"==typeof e}function b(e){var t=String(e).toLowerCase();return"true"===t||"false"===t}function P(e){return"object"===("undefined"==typeof e?"undefined":c(e))&&null!==e&&!Array.isArray(e)}function C(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function w(e){return!F(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function x(e){return"number"==typeof e&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)}function N(e,t){return Q(e,t.settingsClone,!0).replace(t.settingsClone.decimalCharacter,".")}function k(e,t){return!(!r(e)||!r(t)||""===e||""===t)&&e.indexOf(t)!==-1}function V(e,t){return!(!F(t)||t===[]||a(e))&&t.indexOf(e)!==-1}function F(e){if("[object Array]"===Object.prototype.toString.call([]))return Array.isArray(e)||"object"===("undefined"==typeof e?"undefined":c(e))&&"[object Array]"===Object.prototype.toString.call(e);throw new Error("toString message changed for Object Array")}function A(e){var t=e.split("."),i=s(t,2),r=i[1];return a(r)?0:r.length}function T(e){return"undefined"==typeof e.which?e.keyCode:e.which}function D(e){return"undefined"==typeof e.key||"Unidentified"===e.key?String.fromCharCode(T(e)):e.key}function B(e,t,a){var i=le(e);return se(t,i)>-1&&se(a,i)<1}function L(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?k(e,"-"):M(e)}function M(e){return"-"===e.charAt(0)}function E(e){return!/[1-9]/g.test(e)}function I(e){return M(e)?e:"-"+e}function _(e,t,a){return""+e.substr(0,t)+a+e.substr(t+a.length)}function K(e,t){return Math.max(t.minimumValue,Math.min(t.maximumValue,e))}function R(e,t,a){for(var i=new RegExp("[0-9"+a+"-]"),r=0,n=0;n<t;n++)i.test(e[n])&&r++;return r}function U(e,t,a,i){var r=a.length,n=e.length,o=void 0,l=0;for(o=0;o<r&&l<n&&l<t;o++)(e[l]===a[o]||"."===e[l]&&a[o]===i)&&l++;return o}function j(e,t){for(var a=0,i=0;i<t.length;i++)t[i]===e&&a++;return a}function G(e){return Math.max(e,e-1)}function $(e){var t={};if(a(e.selectionStart)){e.focus();var i=document.selection.createRange();t.length=i.text.length,i.moveStart("character",-e.value.length),t.end=i.text.length,t.start=t.end-t.length}else t.start=e.selectionStart,t.end=e.selectionEnd,t.length=t.end-t.start;return t}function Z(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(i(r)&&(r=t),a(e.selectionStart)){e.focus();var n=e.createTextRange();n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n.select()}else e.selectionStart=t,e.selectionEnd=r}function z(e){throw new Error(e)}function H(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t&&console.warn("Warning: "+e)}function q(t,a){e.each(a,function(e,i){"function"==typeof i?a[e]=i(t,a,e):"function"==typeof t.autoNumeric[i]&&(a[e]=t.autoNumeric[i](t,a,e))})}function W(e,t){return Math.max(A(e),A(t))}function Q(e,t,i){if(""!==t.currencySymbol&&(e=e.replace(t.currencySymbol,"")),t.suffixText)for(;k(e,t.suffixText);)e=e.replace(t.suffixText,"");e=e.replace(t.skipFirstAutoStrip,"$1$2"),("s"===t.negativePositiveSignPlacement||"s"===t.currencySymbolPlacement&&"p"!==t.negativePositiveSignPlacement)&&L(e)&&""!==e&&(t.trailingNegative=!0),e=e.replace(t.skipLastAutoStrip,"$1"),e=e.replace(t.allowedAutoStrip,""),t.decimalCharacterAlternative&&(e=e.replace(t.decimalCharacterAlternative,t.decimalCharacter));var r=e.match(t.numRegAutoStrip);if(e=r?[r[1],r[2],r[3]].join(""):"","allow"===t.leadingZero||"keep"===t.leadingZero){var n="",o=e.split(t.decimalCharacter),l=s(o,2),c=l[0],u=l[1],d=c;k(d,t.negativeSignCharacter)&&(n=t.negativeSignCharacter,d=d.replace(t.negativeSignCharacter,"")),""===n&&d.length>t.mIntPos&&"0"===d.charAt(0)&&(d=d.slice(1)),""!==n&&d.length>t.mIntNeg&&"0"===d.charAt(0)&&(d=d.slice(1)),e=""+n+d+(a(u)?"":t.decimalCharacter+u)}return(i&&"deny"===t.leadingZero||!t.hasFocus&&"allow"===t.leadingZero)&&(e=e.replace(t.stripReg,"$1$2")),e}function J(e,t){if("p"===t.currencySymbolPlacement&&"l"===t.negativePositiveSignPlacement||"s"===t.currencySymbolPlacement&&"p"===t.negativePositiveSignPlacement){var a=t.negativeBracketsTypeOnBlur.split(","),i=s(a,2),r=i[0],n=i[1];t.hasFocus?t.hasFocus&&e.charAt(0)===r&&(e=e.replace(r,t.negativeSignCharacter),e=e.replace(n,"")):(e=e.replace(t.negativeSignCharacter,""),e=r+e+n)}return e}function Y(e,t){e=e.replace(t.currencySymbol,""),e=e.replace(t.digitGroupSeparator,""),"."!==t.decimalCharacter&&(e=e.replace(t.decimalCharacter,".")),L(e)&&e.lastIndexOf("-")===e.length-1&&(e=e.replace("-",""),e="-"+e);var a=_e(e,!0,!1,!1);return isNaN(a)||(e=a.toString()),e}function X(e,a){if(t(a)||"string"===a)return e;var i=void 0;switch(a){case"number":i=Number(e);break;case".-":i=L(e)?e.replace("-","")+"-":e;break;case",":case"-,":i=e.replace(".",",");break;case",-":i=e.replace(".",","),i=L(i)?i.replace("-","")+"-":i;break;case".":case"-.":i=e;break;default:z("The given outputFormat ["+a+"] option is not recognized.")}return i}function ee(e,t){return"."!==t.decimalCharacter&&(e=e.replace(t.decimalCharacter,".")),"-"!==t.negativeSignCharacter&&""!==t.negativeSignCharacter&&(e=e.replace(t.negativeSignCharacter,"-")),e.match(/\d/)||(e+="0"),e}function te(e,t){return"-"!==t.negativeSignCharacter&&""!==t.negativeSignCharacter&&(e=e.replace("-",t.negativeSignCharacter)),"."!==t.decimalCharacter&&(e=e.replace(".",t.decimalCharacter)),e}function ae(e,t,a){return""===e||e===t.negativeSignCharacter?"always"===t.emptyInputBehavior||a?"l"===t.negativePositiveSignPlacement?e+t.currencySymbol+t.suffixText:t.currencySymbol+e+t.suffixText:e:null}function ie(e,i){i.strip&&(e=Q(e,i,!1)),i.trailingNegative&&!L(e)&&(e="-"+e);var r=ae(e,i,!0),n=L(e),o=E(e);if(n&&(e=e.replace("-","")),!t(r))return r;i.digitalGroupSpacing=i.digitalGroupSpacing.toString();var l=void 0;switch(i.digitalGroupSpacing){case"2":l=/(\d)((\d)(\d{2}?)+)$/;break;case"2s":l=/(\d)((?:\d{2}){0,2}\d{3}(?:(?:\d{2}){2}\d{3})*?)$/;break;case"4":l=/(\d)((\d{4}?)+)$/;break;default:l=/(\d)((\d{3}?)+)$/}var c=e.split(i.decimalCharacter),u=s(c,2),d=u[0],m=u[1];if(i.decimalCharacterAlternative&&a(m)){var h=e.split(i.decimalCharacterAlternative),g=s(h,2);d=g[0],m=g[1]}if(""!==i.digitGroupSeparator)for(;l.test(d);)d=d.replace(l,"$1"+i.digitGroupSeparator+"$2");if(0===i.decimalPlacesOverride||a(m)?e=d:(m.length>i.decimalPlacesOverride&&(m=m.substring(0,i.decimalPlacesOverride)),e=d+i.decimalCharacter+m),i.trailingNegative=!1,"p"===i.currencySymbolPlacement)if(n)switch(i.negativePositiveSignPlacement){case"l":e=""+i.negativeSignCharacter+i.currencySymbol+e;break;case"r":e=""+i.currencySymbol+i.negativeSignCharacter+e;break;case"s":e=""+i.currencySymbol+e+i.negativeSignCharacter,i.trailingNegative=!0}else if(i.showPositiveSign&&!o)switch(i.negativePositiveSignPlacement){case"l":e=""+i.positiveSignCharacter+i.currencySymbol+e;break;case"r":e=""+i.currencySymbol+i.positiveSignCharacter+e;break;case"s":e=""+i.currencySymbol+e+i.positiveSignCharacter}else e=i.currencySymbol+e;if("s"===i.currencySymbolPlacement)if(n)switch(i.negativePositiveSignPlacement){case"r":e=""+e+i.currencySymbol+i.negativeSignCharacter,i.trailingNegative=!0;break;case"l":e=""+e+i.negativeSignCharacter+i.currencySymbol,i.trailingNegative=!0;break;case"p":e=""+i.negativeSignCharacter+e+i.currencySymbol}else if(i.showPositiveSign&&!o)switch(i.negativePositiveSignPlacement){case"r":e=""+e+i.currencySymbol+i.positiveSignCharacter;break;case"l":e=""+e+i.positiveSignCharacter+i.currencySymbol;break;case"p":e=""+i.positiveSignCharacter+e+i.currencySymbol}else e+=i.currencySymbol;return null!==i.negativeBracketsTypeOnBlur&&(i.rawValue<0||M(e))&&(e=J(e,i)),e+i.suffixText}function re(e,t){var a=void 0;switch(t){case 0:a=/(\.(?:\d*[1-9])?)0*$/;break;case 1:a=/(\.\d(?:\d*[1-9])?)0*$/;break;default:a=new RegExp("(\\.\\d{"+t+"}(?:\\d*[1-9])?)0*")}return e=e.replace(a,"$1"),0===t&&(e=e.replace(/\.$/,"")),e}function ne(e,t){if(e=""===e?"0":e.toString(),"N05"===t.roundingMethod||"CHF"===t.roundingMethod||"U05"===t.roundingMethod||"D05"===t.roundingMethod){switch(t.roundingMethod){case"N05":e=(Math.round(20*e)/20).toString();break;case"U05":e=(Math.ceil(20*e)/20).toString();break;default:e=(Math.floor(20*e)/20).toString()}var a=void 0;return a=k(e,".")?e.length-e.indexOf(".")<3?e+"0":e:e+".00"}var i="",r=0,n="",o=void 0;o=t.allowDecimalPadding?t.decimalPlacesOverride:0,M(e)&&(n="-",e=e.replace("-","")),e.match(/^\d/)||(e="0"+e),0===Number(e)&&(n=""),(Number(e)>0&&"keep"!==t.leadingZero||e.length>0&&"allow"===t.leadingZero)&&(e=e.replace(/^0*(\d)/,"$1"));var l=e.lastIndexOf("."),s=l===-1,c=s?e.length-1:l,u=e.length-1-c;if(u<=t.decimalPlacesOverride){if(i=e,u<o){s&&(i+=t.decimalCharacter);for(var d="000000";u<o;)d=d.substring(0,o-u),i+=d,u+=d.length}else u>o?i=re(i,o):0===u&&0===o&&(i=i.replace(/\.$/,""));return 0===Number(i)?i:n+i}var m=void 0;m=s?t.decimalPlacesOverride-1:t.decimalPlacesOverride+l;var h=Number(e.charAt(m+1)),g="."===e.charAt(m)?e.charAt(m-1)%2:e.charAt(m)%2,v=e.substring(0,m+1).split("");if(h>4&&"S"===t.roundingMethod||h>4&&"A"===t.roundingMethod&&""===n||h>5&&"A"===t.roundingMethod&&"-"===n||h>5&&"s"===t.roundingMethod||h>5&&"a"===t.roundingMethod&&""===n||h>4&&"a"===t.roundingMethod&&"-"===n||h>5&&"B"===t.roundingMethod||5===h&&"B"===t.roundingMethod&&1===g||h>0&&"C"===t.roundingMethod&&""===n||h>0&&"F"===t.roundingMethod&&"-"===n||h>0&&"U"===t.roundingMethod)for(r=v.length-1;r>=0;r-=1)if("."!==v[r]){if(v[r]=+v[r]+1,v[r]<10)break;r>0&&(v[r]="0")}return v=v.slice(0,m+1),i=re(v.join(""),o),0===Number(i)?i:n+i}function oe(e,t,a){if(e=a?ne(e,t):e,t.decimalCharacter&&t.decimalPlacesOverride){var i=e.split(t.decimalCharacter),r=s(i,2),n=r[0],o=r[1];if(o&&o.length>t.decimalPlacesOverride)if(t.decimalPlacesOverride>0){var l=o.substring(0,t.decimalPlacesOverride);e=""+n+t.decimalCharacter+l}else e=n}return e}function le(e){var t={},a=void 0,i=void 0,r=void 0,n=void 0;if(0===e&&1/e<0&&(e="-0"),e=e.toString(),M(e)?(e=e.slice(1),t.s=-1):t.s=1,a=e.indexOf("."),a>-1&&(e=e.replace(".","")),a<0&&(a=e.length),i=e.search(/[1-9]/i)===-1?e.length:e.search(/[1-9]/i),r=e.length,i===r)t.e=0,t.c=[0];else{for(n=r-1;"0"===e.charAt(n);n-=1)r-=1;for(r-=1,t.e=a-i-1,t.c=[],a=0;i<=r;i+=1)t.c[a]=+e.charAt(i),a+=1}return t}function se(e,t){var a=t.c,i=e.c,r=t.s,n=e.s,o=t.e,l=e.e;if(!a[0]||!i[0]){var s=void 0;return s=a[0]?r:i[0]?-n:0}if(r!==n)return r;var c=r<0;if(o!==l)return o>l^c?1:-1;for(r=-1,o=a.length,l=i.length,n=o<l?o:l,r+=1;r<n;r+=1)if(a[r]!==i[r])return a[r]>i[r]^c?1:-1;var u=void 0;return u=o===l?0:o>l^c?1:-1}function ce(e,t){e=e.toString(),e=e.replace(",",".");var a=le(t.minimumValue),i=le(t.maximumValue),r=le(e),n=void 0;switch(t.overrideMinMaxLimits){case"floor":n=[se(a,r)>-1,!0];break;case"ceiling":n=[!0,se(i,r)<1];break;case"ignore":n=[!0,!0];break;default:n=[se(a,r)>-1,se(i,r)<1]}return n}function ue(t){return r(t)&&(t="#"+t.replace(/(:|\.|\[|]|,|=)/g,"\\$1")),e(t)}function de(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.data("autoNumeric");r||(r={},e.data("autoNumeric",r));var n=r.holder;return(i||a(n)&&t)&&(n=new Re(e.get(0),t),r.holder=n),n}function me(e){e.oDec=e.decimalPlacesOverride,e.oPad=e.allowDecimalPadding,e.oBracket=e.negativeBracketsTypeOnBlur,e.oSep=e.digitGroupSeparator,e.oSign=e.currencySymbol,e.oSuffix=e.suffixText}function he(e){for(var t=e+"=",a=document.cookie.split(";"),i="",r=0;r<a.length;r+=1){for(i=a[r];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null}function ge(){var e="modernizr";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(e){return!1}}function ve(e,t){return""===e?"":0===Number(e)&&"keep"!==t.leadingZero?"0":("keep"!==t.leadingZero&&(e=e.replace(/^(-)?0+(?=\d)/g,"$1"),k(e,".")&&(e=e.replace(/(\.[0-9]*?)0+$/,"$1"))),e=e.replace(/\.$/,""))}function pe(e){var t=e.split("."),a=s(t,2),r=a[0],n=a[1];if(i(n))return r;var o=n.replace(/0+$/g,""),l=void 0;return l=""===o?r:r+"."+o}function fe(e,t,i){if(t.saveValueToSessionStorage){var r=""===e.name||a(e.name)?"AUTO_"+e.id:"AUTO_"+decodeURIComponent(e.name),n=void 0,o=void 0;if(ge()===!1)switch(i){case"set":document.cookie=r+"="+t.rawValue+"; expires= ; path=/";break;case"wipe":n=new Date,n.setTime(n.getTime()+-864e5),o="; expires="+n.toUTCString(),document.cookie=r+"='' ;"+o+"; path=/";break;case"get":return he(r)}else switch(i){case"set":sessionStorage.setItem(r,t.rawValue);break;case"wipe":sessionStorage.removeItem(r);break;case"get":return sessionStorage.getItem(r)}}}function ye(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],a=arguments[1],i=ue(a),r=e("form").index(i),n=e("form:eq("+r+")")[0],o=[],l=[],u=/^(?:submit|button|image|reset|file)$/i,d=/^(?:input|select|textarea|keygen)/i,m=/^(?:checkbox|radio)$/i,h=/^(?:button|checkbox|color|date|datetime|datetime-local|email|file|image|month|number|password|radio|range|reset|search|submit|time|url|week)/i,g=0;if(e.each(n,function(e,t){""===t.name||!d.test(t.localName)||u.test(t.type)||t.disabled||!t.checked&&m.test(t.type)?l.push(-1):(l.push(g),g++)}),g=0,e.each(n,function(e,t){"input"!==t.localName||""!==t.type&&"text"!==t.type&&"hidden"!==t.type&&"tel"!==t.type?(o.push(-1),"input"===t.localName&&h.test(t.type)&&g++):(o.push(g),g++)}),t){var v=i.serializeArray();return e.each(v,function(t,a){var i=l.indexOf(t);if(i>-1&&o[i]>-1){var n=e("form:eq("+r+") input:eq("+o[i]+")"),s=n.data("autoNumeric");"object"===("undefined"==typeof s?"undefined":c(s))&&(a.value=n.autoNumeric("getLocalized").toString())}}),v}var p=function(){var t=i.serialize(),a=t.split("&");return e.each(a,function(t){var i=a[t].split("="),n=s(i,2),u=n[0],d=n[1],m=l.indexOf(t);if(m>-1&&o[m]>-1){var h=e("form:eq("+r+") input:eq("+o[m]+")"),g=h.data("autoNumeric");if("object"===("undefined"==typeof g?"undefined":c(g))&&null!==d){var v=h.autoNumeric("getLocalized").toString();a[t]=u+"="+v}}}),{v:a.join("&")}}();if("object"===("undefined"==typeof p?"undefined":c(p)))return p.v}function Se(e,t,a){var i=t.settingsClone;if("focusin"===a.type||"mouseenter"===a.type&&!e.is(":focus")&&"focus"===i.emptyInputBehavior){i.hasFocus=!0,null!==i.negativeBracketsTypeOnBlur&&""!==i.negativeSignCharacter&&e.val(J(a.target.value,i));var r=Q(a.target.value,i,!0);r=Y(r,i),r=ve(r,i),i.trailingNegative&&(r="-"+r),i.decimalPlacesShownOnFocus?(i.decimalPlacesOverride=i.decimalPlacesShownOnFocus,e.autoNumeric("set",i.rawValue)):i.scaleDivisor?(i.decimalPlacesOverride=i.oDec,e.autoNumeric("set",i.rawValue)):i.noSeparatorOnFocus?(i.digitGroupSeparator="",i.currencySymbol="",i.suffixText="",e.autoNumeric("set",i.rawValue)):r!==i.rawValue&&e.autoNumeric("set",r),t.valueOnFocus=a.target.value,t.lastVal=t.valueOnFocus;var n=ae(t.valueOnFocus,i,!0);null!==n&&""!==n&&"focus"===i.emptyInputBehavior&&(e.val(n),n===i.currencySymbol&&"s"===i.currencySymbolPlacement&&Z(a.target,0,0))}}function be(e,t){return e._updateAutoNumericHolderEventKeycode(t),e.initialValueOnKeydown=t.target.value,e.that.readOnly?void(e.processed=!0):(e.eventKeyCode===y.Enter&&e.valueOnFocus!==t.target.value&&(Ke("change",t.target),e.valueOnFocus=t.target.value),e._updateAutoNumericHolderProperties(t),e._skipAlways(t)?void(e.processed=!0):e.eventKeyCode===y.Backspace||e.eventKeyCode===y.Delete?(e._processCharacterDeletion(),e.processed=!0,e._formatValue(t),t.target.value!==e.lastVal&&e.settingsClone.throwInput&&(Ke("input",t.target),t.preventDefault()),e.lastVal=t.target.value,void(e.settingsClone.throwInput=!0)):void(e.formatted=!1))}function Pe(e,t){var a=D(t);if(a!==S.Insert){var i=e.processed;if(e._updateAutoNumericHolderProperties(t),!e._skipAlways(t)){if(i)return void t.preventDefault();var r=e._processCharacterInsertion(t);if(r){if(e._formatValue(t),t.target.value!==e.lastVal&&e.settingsClone.throwInput)Ke("input",t.target),t.preventDefault();else{if((a===e.settings.decimalCharacter||a===e.settings.decimalCharacterAlternative)&&$(t.target).start===$(t.target).end&&$(t.target).start===t.target.value.indexOf(e.settings.decimalCharacter)){var n=$(t.target).start+1;Z(t.target,n,n)}t.preventDefault()}return e.lastVal=t.target.value,void(e.settingsClone.throwInput=!0)}t.preventDefault(),e.formatted=!1}}}function Ce(e,t,a){e._updateAutoNumericHolderProperties(a);var i=e._skipAlways(a);delete e.valuePartsBeforePaste,i||""===a.target.value||(a.target.value===e.settingsClone.currencySymbol?"s"===e.settingsClone.currencySymbolPlacement?Z(a.target,0,0):Z(a.target,e.settingsClone.currencySymbol.length,e.settingsClone.currencySymbol.length):e.eventKeyCode===y.Tab&&Z(a.target,0,a.target.value.length),(a.target.value===e.settingsClone.suffixText||""===e.settingsClone.rawValue&&""!==e.settingsClone.currencySymbol&&""!==e.settingsClone.suffixText)&&Z(a.target,0,0),null!==e.settingsClone.decimalPlacesShownOnFocus&&e.settingsClone.saveValueToSessionStorage&&fe(a.target,t,"set"),e.formatted||e._formatValue(a),a.target.value!==e.initialValueOnKeydown&&Ke("autoNumeric:formatted",a.target))}function we(e,t,a){if(!e.is(":focus")){var i=a.target.value,r=i,n=t.settingsClone;if(n.hasFocus=!1,n.saveValueToSessionStorage&&fe(a.target,n,"set"),n.noSeparatorOnFocus===!0&&(n.digitGroupSeparator=n.oSep,n.currencySymbol=n.oSign,n.suffixText=n.oSuffix),null!==n.decimalPlacesShownOnFocus&&(n.decimalPlacesOverride=n.oDec,n.allowDecimalPadding=n.oPad,n.negativeBracketsTypeOnBlur=n.oBracket),i=Q(i,n,!0),""!==i){n.trailingNegative&&!L(i)&&(i="-"+i,n.trailingNegative=!1);var o=ce(i,n),l=s(o,2),c=l[0],u=l[1];null===ae(i,n,!1)&&c&&u?(i=ee(i,n),n.rawValue=ve(i,n),n.scaleDivisor&&(i/=n.scaleDivisor,i=i.toString()),n.decimalPlacesOverride=n.scaleDivisor&&n.scaleDecimalPlaces?+n.scaleDecimalPlaces:n.decimalPlacesOverride,i=ne(i,n),i=te(i,n)):(c||e.trigger("autoNumeric:minExceeded"),u||e.trigger("autoNumeric:maxExceeded"),i=n.rawValue)}else"zero"===n.emptyInputBehavior?(n.rawValue="0",i=ne("0",n)):n.rawValue="";var d=ae(i,n,!1);null===d&&(d=ie(i,n)),d!==r&&(d=n.scaleSymbol?d+n.scaleSymbol:d,e.val(d)),d!==t.valueOnFocus&&(e.change(),delete t.valueOnFocus)}}function xe(e,t,a){a.preventDefault();var i=a.clipboardData.getData("text/plain"),r=a.target.value,n=a.target.selectionStart||0,o=a.target.selectionEnd||0,l=o-n,s=!1;l===r.length&&(s=!0);var c=M(i);c&&(i=i.slice(1,i.length));var u=N(i,t),d=void 0;if(d="."===u?".":_e(u,!1,!1,!1),"."!==d&&(!w(d)||""===d))return void("error"===t.settings.onInvalidPaste&&z("The pasted value '"+i+"' is not a valid paste content."));var m=void 0,h=void 0;h=""===a.target.value?"":e.autoNumeric("get");var g=M(h),v=void 0,p=void 0;c&&!g?(h="-"+h,g=!0,v=!0):v=!1;var f=!1;switch(t.settings.onInvalidPaste){case"truncate":case"replace":var y=r.slice(0,n),S=r.slice(o,r.length);p=n!==o?N(y+S,t):N(r,t),g&&(p=I(p)),m=G(R(r,n,t.settings.decimalCharacter)),v&&m++;var b=p.slice(0,m),P=p.slice(m,p.length);"."===d&&(k(b,".")&&(f=!0,b=b.replace(".","")),P=P.replace(".",""));for(var C=le(t.settings.minimumValue),x=le(t.settings.maximumValue),O=p,V=0,F=b;V<d.length&&(F+=d[V],p=F+P,B(p,C,x));)O=p,V++;if(m+=V,"truncate"===t.settings.onInvalidPaste){p=O,f&&m--;break}for(var A=m,T=O.length;V<d.length&&A<T;)if("."!==O[A]){if(p=_(O,A,d[V]),!B(p,C,x))break;O=p,V++,A++}else A++;m=A,f&&m--,p=O;break;case"error":case"ignore":case"clamp":default:var D=r.slice(0,n),L=r.slice(o,r.length);if(p=n!==o?N(D+L,t):N(r,t),g&&(p=I(p)),m=G(R(r,n,t.settings.decimalCharacter)),v&&m++,b=p.slice(0,m),P=p.slice(m,p.length),"."===d&&(k(b,".")&&(f=!0,b=b.replace(".","")),P=P.replace(".","")),p=""+b+d+P,n===o){var E=G(R(r,n,t.settings.decimalCharacter));m=E+d.length}else if(s)m=p.length;else if(""===P)m=G(R(r,n,t.settings.decimalCharacter))+d.length;else{var $=G(R(r,o,t.settings.decimalCharacter)),H=a.target.value.slice(n,o);m=$-l+j(t.settings.digitGroupSeparator,H)+d.length}s||(v&&m++,f&&m--)}if(!w(p)||""===p)return void("error"===t.settings.onInvalidPaste&&z("The pasted value '"+i+"' would result into an invalid content '"+p+"'."));var q=!1,W=!1;try{e.autoNumeric("set",p),q=!0}catch(a){var Q=void 0;switch(t.settings.onInvalidPaste){case"clamp":Q=K(p,t.settings);try{e.autoNumeric("set",Q)}catch(e){z("Fatal error: Unable to set the clamped value '"+Q+"'.")}W=!0,q=!0,p=Q;break;case"error":case"truncate":case"replace":z("The pasted value '"+i+"' results in a value '"+p+"' that is outside of the minimum ["+t.settings.minimumValue+"] and maximum ["+t.settings.maximumValue+"] value range.");case"ignore":default:return}}var J=void 0;if(q)switch(t.settings.onInvalidPaste){case"clamp":if(W){"s"===t.settings.currencySymbolPlacement?Z(a.target,a.target.value.length-t.settings.currencySymbol.length):Z(a.target,a.target.value.length);break}case"error":case"ignore":case"truncate":case"replace":default:J=U(p,m,a.target.value,t.settings.decimalCharacter),Z(a.target,J)}q&&r!==a.target.value&&Ke("input",a.target)}function Oe(e,t){t.target.value!==e.valueOnFocus&&Ke("change",t.target)}function Ne(e,t){e.closest("form").on("submit.autoNumeric",function(){if(t){var a=t.settingsClone;a.unformatOnSubmit&&e.val(a.rawValue)}})}function ke(e){var t=e.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])");t||"input"!==e.prop("tagName").toLowerCase()||z('The input type "'+e.prop("type")+'" is not supported by autoNumeric');var a=e.prop("tagName").toLowerCase();return"input"===a||V(a,p)||z("The <"+a+"> tag is not supported by autoNumeric"),t}function Ve(e,t,a){var r=!0;if(t){var n=a.val(),o=Ie(n,e);if(e.formatOnPageLoad&&""!==n&&i(a.attr("value")))isNaN(o)||1/0===o?z("The value ["+n+"] used in the input is not a valid value autoNumeric can work with."):(a.autoNumeric("set",o),r=!1);else if(null!==e.defaultValueOverride&&e.defaultValueOverride.toString()!==n||null===e.defaultValueOverride&&""!==n&&n!==a.attr("value")||""!==n&&"hidden"===a.attr("type")&&!w(o)){if((null!==e.decimalPlacesShownOnFocus&&e.saveValueToSessionStorage||e.scaleDivisor&&e.saveValueToSessionStorage)&&(e.rawValue=fe(a[0],e,"get")),!e.saveValueToSessionStorage){var l=void 0;null!==e.negativeBracketsTypeOnBlur&&""!==e.negativeSignCharacter?(e.hasFocus=!0,l=J(n,e)):l=n,("s"===e.negativePositiveSignPlacement||"p"!==e.negativePositiveSignPlacement&&"s"===e.currencySymbolPlacement)&&""!==e.negativeSignCharacter&&L(n)?e.rawValue=e.negativeSignCharacter+Q(l,e,!0):e.rawValue=Q(l,e,!0)}r=!1}if(""===n)switch(e.emptyInputBehavior){case"focus":r=!1;break;case"always":a.val(e.currencySymbol),r=!1;break;case"zero":a.autoNumeric("set","0"),r=!1}else r&&n===a.attr("value")&&a.autoNumeric("set",n)}V(a.prop("tagName").toLowerCase(),e.tagList)&&""!==a.text()&&(null!==e.defaultValueOverride?e.defaultValueOverride===a.text()&&a.autoNumeric("set",a.text()):a.autoNumeric("set",a.text()))}function Fe(e){if(t(e.negativePositiveSignPlacement))if(a(e)||!i(e.negativePositiveSignPlacement)||i(e.currencySymbol))e.negativePositiveSignPlacement="l";else switch(e.currencySymbolPlacement){case"s":e.negativePositiveSignPlacement="p";break;case"p":e.negativePositiveSignPlacement="l"}}function Ae(e){var t=e.maximumValue.toString().split("."),a=s(t,1),i=a[0],r=e.minimumValue||0===e.minimumValue?e.minimumValue.toString().split("."):[],n=s(r,1),o=n[0];i=i.replace("-",""),o=o.replace("-",""),e.mIntPos=Math.max(i.length,1),e.mIntNeg=Math.max(o.length,1)}function Te(e){t(e.scaleDivisor)||t(e.scaleDecimalPlaces)?t(e.decimalPlacesOverride)&&(e.decimalPlacesOverride=W(e.minimumValue,e.maximumValue)):e.decimalPlacesOverride=e.scaleDecimalPlaces,e.oDec=String(e.decimalPlacesOverride),e.decimalPlacesOverride=Number(e.decimalPlacesOverride)}function De(e){t(e.decimalCharacterAlternative)&&Number(e.decimalPlacesOverride)>0&&("."===e.decimalCharacter&&","!==e.digitGroupSeparator?e.decimalCharacterAlternative=",":","===e.decimalCharacter&&"."!==e.digitGroupSeparator&&(e.decimalCharacterAlternative="."))}function Be(e){var t="[0-9]",a="[^0-9]",i=e.negativeSignCharacter?"([-\\"+e.negativeSignCharacter+"]?)":"(-?)";e.aNegRegAutoStrip=i;var r=void 0;r=e.negativeSignCharacter?"\\"+e.negativeSignCharacter:"",e.skipFirstAutoStrip=new RegExp(i+"[^-"+r+"\\"+e.decimalCharacter+t+"].*?("+t+"|\\"+e.decimalCharacter+t+")"),e.skipLastAutoStrip=new RegExp("("+t+"\\"+e.decimalCharacter+"?)[^\\"+e.decimalCharacter+t+"]"+a+"*$");var n="-0123456789\\"+e.decimalCharacter;e.allowedAutoStrip=new RegExp("[^"+n+"]","g"),e.numRegAutoStrip=new RegExp(i+"(?:\\"+e.decimalCharacter+"?("+t+"+\\"+e.decimalCharacter+t+"+)|("+t+"*(?:\\"+e.decimalCharacter+t+"*)?))"),e.stripReg=new RegExp("^"+e.aNegRegAutoStrip+"0*("+t+")")}function Le(t){e.each(t,function(e,a){"true"!==a&&"false"!==a||(t[e]="true"===a),"number"==typeof a&&"aScale"!==e&&(t[e]=a.toString())})}function Me(e){var t={aSep:"digitGroupSeparator",nSep:"noSeparatorOnFocus",dGroup:"digitalGroupSpacing",aDec:"decimalCharacter",altDec:"decimalCharacterAlternative",aSign:"currencySymbol",pSign:"currencySymbolPlacement",pNeg:"negativePositiveSignPlacement",aSuffix:"suffixText",oLimits:"overrideMinMaxLimits",vMax:"maximumValue",vMin:"minimumValue",mDec:"decimalPlacesOverride",eDec:"decimalPlacesShownOnFocus",scaleDecimal:"scaleDecimalPlaces",aStor:"saveValueToSessionStorage",mRound:"roundingMethod",aPad:"allowDecimalPadding",nBracket:"negativeBracketsTypeOnBlur",wEmpty:"emptyInputBehavior",lZero:"leadingZero",aForm:"formatOnPageLoad",sNumber:"selectNumberOnly",anDefault:"defaultValueOverride",unSetOnSubmit:"unformatOnSubmit",outputType:"outputFormat",debug:"showWarnings",
digitGroupSeparator:!0,noSeparatorOnFocus:!0,digitalGroupSpacing:!0,decimalCharacter:!0,decimalCharacterAlternative:!0,currencySymbol:!0,currencySymbolPlacement:!0,negativePositiveSignPlacement:!0,showPositiveSign:!0,suffixText:!0,overrideMinMaxLimits:!0,maximumValue:!0,minimumValue:!0,decimalPlacesOverride:!0,decimalPlacesShownOnFocus:!0,scaleDivisor:!0,scaleDecimalPlaces:!0,scaleSymbol:!0,saveValueToSessionStorage:!0,onInvalidPaste:!0,roundingMethod:!0,allowDecimalPadding:!0,negativeBracketsTypeOnBlur:!0,emptyInputBehavior:!0,leadingZero:!0,formatOnPageLoad:!0,selectNumberOnly:!0,defaultValueOverride:!0,unformatOnSubmit:!0,outputFormat:!0,showWarnings:!0,failOnUnknownOption:!0,hasFocus:!0,runOnce:!0,rawValue:!0,trailingNegative:!0,caretFix:!0,throwInput:!0,strip:!0,tagList:!0,negativeSignCharacter:!0,positiveSignCharacter:!0,mIntPos:!0,mIntNeg:!0,oDec:!0,oPad:!0,oBracket:!0,oSep:!0,oSign:!0,oSuffix:!0,aNegRegAutoStrip:!0,skipFirstAutoStrip:!0,skipLastAutoStrip:!0,allowedAutoStrip:!0,numRegAutoStrip:!0,stripReg:!0,holder:!0};for(var a in e)if(e.hasOwnProperty(a)){if(t[a]===!0)continue;t.hasOwnProperty(a)?(H("You are using the deprecated option name '"+a+"'. Please use '"+t[a]+"' instead from now on. The old option name will be dropped soon.",!0),e[t[a]]=e[a],delete e[a]):e.failOnUnknownOption&&z("Option name '"+a+"' is unknown. Please fix the options passed to autoNumeric")}}function Ee(i,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=r.data("autoNumeric");if(!n&&t(i)||Me(i),n||a(o)){if(n)o=e.extend(o,i);else{var l=r.data();o=e.extend({},f,l,i,{hasFocus:!1,runOnce:!1,rawValue:"",trailingNegative:!1,caretFix:!1,throwInput:!0,strip:!0,tagList:p})}return Le(o),Fe(o),o.negativeSignCharacter=o.minimumValue<0?"-":"",o.positiveSignCharacter=o.maximumValue>=0?"+":"",q(r,o),Ae(o),Te(o),De(o),Be(o),g(o,!1),me(o),r.data("autoNumeric",o),o}return null}function Ie(e,t){var a=void 0;return w(Number(e))?a=e:(a=Y(e.toString(),t),w(Number(a))||(H('The value "'+e+'" being "set" is not numeric and therefore cannot be used appropriately.',t.showWarnings),a=NaN)),a}function _e(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=e.toString();if(""===r)return e;a&&(r=r.replace(/٫/,".")),i&&(r=r.replace(/٬/g,"")),r=r.replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(e){return e.charCodeAt(0)-1632}).replace(/[۰۱۲۳۴۵۶۷۸۹]/g,function(e){return e.charCodeAt(0)-1776});var n=Number(r);return isNaN(n)?n:(t&&(r=n),r)}function Ke(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=void 0;window.CustomEvent?i=new CustomEvent(e,{detail:a,bubbles:!1,cancelable:!1}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(e,!0,!0,{detail:a})),t.dispatchEvent(i)}var Re=function(){function t(a,i){o(this,t),this.settings=i,this.that=a,this.$that=e(a),this.formatted=!1,this.settingsClone=i,this.value=a.value}return l(t,[{key:"_updateAutoNumericHolderProperties",value:function(){this.value=this.that.value,this.selection=$(this.that),this.processed=!1,this.formatted=!1}},{key:"_updateAutoNumericHolderEventKeycode",value:function(e){this.eventKeyCode=T(e)}},{key:"_setSelection",value:function(e,t,i){e=Math.max(e,0),t=Math.min(t,this.that.value.length),this.selection={start:e,end:t,length:t-e},(a(i)||i)&&Z(this.that,e,t)}},{key:"_setCaretPosition",value:function(e,t){this._setSelection(e,e,t)}},{key:"_getLeftAndRightPartAroundTheSelection",value:function(){var e=this.value,t=e.substring(0,this.selection.start),a=e.substring(this.selection.end,e.length);return[t,a]}},{key:"_getUnformattedLeftAndRightPartAroundTheSelection",value:function(){var e=this.settingsClone,t=this._getLeftAndRightPartAroundTheSelection(),a=s(t,2),i=a[0],r=a[1];""===i&&""===r&&(e.trailingNegative=!1);var n=!0;return this.eventKeyCode===y.Hyphen&&0===Number(i)&&(n=!1),i=Q(i,this.settingsClone,n),r=Q(r,this.settingsClone,!1),e.trailingNegative&&!L(i)&&(i="-"+i,r="-"===r?"":r,e.trailingNegative=!1),[i,r]}},{key:"_normalizeParts",value:function(e,t){var a=this.settingsClone,i=!0;if(this.eventKeyCode===y.Hyphen&&0===Number(e)&&(i=!1),e=Q(e,a,i),t=Q(t,a,!1),"deny"!==a.leadingZero||this.eventKeyCode!==y.num0&&this.eventKeyCode!==y.numpad0||0!==Number(e)||k(e,a.decimalCharacter)||""===t||(e=e.substring(0,e.length-1)),a.trailingNegative&&!L(e)&&(e="-"+e,a.trailingNegative=!1),this.newValue=e+t,a.decimalCharacter){var r=this.newValue.match(new RegExp("^"+a.aNegRegAutoStrip+"\\"+a.decimalCharacter));r&&(e=e.replace(r[1],r[1]+"0"),this.newValue=e+t)}return[e,t]}},{key:"_setValueParts",value:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.settingsClone,r=this._normalizeParts(e,t),n=ce(this.newValue,i),o=s(n,2),l=o[0],c=o[1],u=r[0].length;if(this.newValue=r.join(""),l&&c){this.newValue=oe(this.newValue,i,a);var d=k(this.newValue,",")?this.newValue.replace(",","."):this.newValue;return""===d||d===i.negativeSignCharacter?i.rawValue="zero"===i.emptyInputBehavior?"0":"":i.rawValue=ve(d,i),u>this.newValue.length&&(u=this.newValue.length),1===u&&"0"===r[0]&&"deny"===i.leadingZero&&(u=""===r[1]||"0"===r[0]&&""!==r[1]?1:0),this.value=this.newValue,this._setCaretPosition(u,!1),!0}return l?c||this.$that.trigger("autoNumeric:maxExceeded"):this.$that.trigger("autoNumeric:minExceeded"),!1}},{key:"_getSignPosition",value:function(){var e=this.settingsClone,t=e.currencySymbol,a=this.that;if(t){var i=t.length;if("p"===e.currencySymbolPlacement){var r=e.negativeSignCharacter&&a.value&&a.value.charAt(0)===e.negativeSignCharacter;return r?[1,i+1]:[0,i]}var n=a.value.length;return[n-i,n]}return[1e3,-1]}},{key:"_expandSelectionOnSign",value:function(e){var t=this._getSignPosition(),a=this.selection;a.start<t[1]&&a.end>t[0]&&((a.start<t[0]||a.end>t[1])&&this.value.substring(Math.max(a.start,t[0]),Math.min(a.end,t[1])).match(/^\s*$/)?a.start<t[0]?this._setSelection(a.start,t[0],e):this._setSelection(t[1],a.end,e):this._setSelection(Math.min(a.start,t[0]),Math.max(a.end,t[1]),e))}},{key:"_checkPaste",value:function(){if(!a(this.valuePartsBeforePaste)){var e=this.valuePartsBeforePaste,t=this._getLeftAndRightPartAroundTheSelection(),i=s(t,2),r=i[0],n=i[1];delete this.valuePartsBeforePaste;var o=r.substr(0,e[0].length)+Q(r.substr(e[0].length),this.settingsClone,!0);this._setValueParts(o,n,!0)||(this.value=e.join(""),this._setCaretPosition(e[0].length,!1))}}},{key:"_skipAlways",value:function(e){if((e.ctrlKey||e.metaKey)&&"keyup"===e.type&&!a(this.valuePartsBeforePaste)||e.shiftKey&&this.eventKeyCode===y.Insert)return this._checkPaste(),!1;if(this.eventKeyCode>=y.F1&&this.eventKeyCode<=y.F12||this.eventKeyCode>=y.Windows&&this.eventKeyCode<=y.RightClick||this.eventKeyCode>=y.Tab&&this.eventKeyCode<y.Space||this.eventKeyCode<y.Backspace&&(0===e.which||e.which===this.eventKeyCode)||this.eventKeyCode===y.NumLock||this.eventKeyCode===y.ScrollLock||this.eventKeyCode===y.Insert||this.eventKeyCode===y.Command)return!0;if((e.ctrlKey||e.metaKey)&&this.eventKeyCode===y.a){if(this.settings.selectNumberOnly){e.preventDefault();var t=this.that.value.length,i=this.settings.currencySymbol.length,r=L(this.that.value)?1:0,n=this.settings.suffixText.length,o=this.settings.currencySymbolPlacement,l=this.settings.negativePositiveSignPlacement,s=void 0;s="s"===o?0:"l"===l&&1===r&&i>0?i+1:i;var c=void 0;if("p"===o)c=t-n;else switch(l){case"l":c=t-(n+i);break;case"r":c=i>0?t-(i+r+n):t-(i+n);break;default:c=t-(i+n)}Z(this.that,s,c)}return!0}return!e.ctrlKey&&!e.metaKey||this.eventKeyCode!==y.c&&this.eventKeyCode!==y.v&&this.eventKeyCode!==y.x?!(!e.ctrlKey&&!e.metaKey)||(this.eventKeyCode===y.LeftArrow||this.eventKeyCode===y.RightArrow?("keydown"!==e.type||e.shiftKey||(this.eventKeyCode!==y.LeftArrow||this.that.value.charAt(this.selection.start-2)!==this.settingsClone.digitGroupSeparator&&this.that.value.charAt(this.selection.start-2)!==this.settingsClone.decimalCharacter?this.eventKeyCode!==y.RightArrow||this.that.value.charAt(this.selection.start+1)!==this.settingsClone.digitGroupSeparator&&this.that.value.charAt(this.selection.start+1)!==this.settingsClone.decimalCharacter||this._setCaretPosition(this.selection.start+1):this._setCaretPosition(this.selection.start-1)),!0):this.eventKeyCode>=y.PageDown&&this.eventKeyCode<=y.DownArrow):("keydown"===e.type&&this._expandSelectionOnSign(),this.eventKeyCode!==y.v&&this.eventKeyCode!==y.Insert||("keydown"===e.type||"keypress"===e.type?a(this.valuePartsBeforePaste)&&(this.valuePartsBeforePaste=this._getLeftAndRightPartAroundTheSelection()):this._checkPaste()),"keydown"===e.type||"keypress"===e.type||this.eventKeyCode===y.c)}},{key:"_processCharacterDeletionIfTrailingNegativeSign",value:function(e){var t=s(e,2),a=t[0],i=t[1],r=this.settingsClone;return"p"===r.currencySymbolPlacement&&"s"===r.negativePositiveSignPlacement&&(this.eventKeyCode===y.Backspace?(r.caretFix=this.selection.start>=this.value.indexOf(r.suffixText)&&""!==r.suffixText,"-"===this.value.charAt(this.selection.start-1)?a=a.substring(1):this.selection.start<=this.value.length-r.suffixText.length&&(a=a.substring(0,a.length-1))):(r.caretFix=this.selection.start>=this.value.indexOf(r.suffixText)&&""!==r.suffixText,this.selection.start>=this.value.indexOf(r.currencySymbol)+r.currencySymbol.length&&(i=i.substring(1,i.length)),L(a)&&"-"===this.value.charAt(this.selection.start)&&(a=a.substring(1)))),"s"===r.currencySymbolPlacement&&"l"===r.negativePositiveSignPlacement&&(r.caretFix=this.selection.start>=this.value.indexOf(r.negativeSignCharacter)+r.negativeSignCharacter.length,this.eventKeyCode===y.Backspace?this.selection.start===this.value.indexOf(r.negativeSignCharacter)+r.negativeSignCharacter.length&&k(this.value,r.negativeSignCharacter)?a=a.substring(1):"-"!==a&&(this.selection.start<=this.value.indexOf(r.negativeSignCharacter)||!k(this.value,r.negativeSignCharacter))&&(a=a.substring(0,a.length-1)):("-"===a[0]&&(i=i.substring(1)),this.selection.start===this.value.indexOf(r.negativeSignCharacter)&&k(this.value,r.negativeSignCharacter)&&(a=a.substring(1)))),"s"===r.currencySymbolPlacement&&"r"===r.negativePositiveSignPlacement&&(r.caretFix=this.selection.start>=this.value.indexOf(r.negativeSignCharacter)+r.negativeSignCharacter.length,this.eventKeyCode===y.Backspace?this.selection.start===this.value.indexOf(r.negativeSignCharacter)+r.negativeSignCharacter.length?a=a.substring(1):"-"!==a&&this.selection.start<=this.value.indexOf(r.negativeSignCharacter)-r.currencySymbol.length?a=a.substring(0,a.length-1):""===a||k(this.value,r.negativeSignCharacter)||(a=a.substring(0,a.length-1)):(r.caretFix=this.selection.start>=this.value.indexOf(r.currencySymbol)&&""!==r.currencySymbol,this.selection.start===this.value.indexOf(r.negativeSignCharacter)&&(a=a.substring(1)),i=i.substring(1))),[a,i]}},{key:"_processCharacterDeletion",value:function(){var e=this.settingsClone,t=void 0,a=void 0;if(this.selection.length){this._expandSelectionOnSign(!1);var i=this._getUnformattedLeftAndRightPartAroundTheSelection(),r=s(i,2);t=r[0],a=r[1]}else{var n=this._getUnformattedLeftAndRightPartAroundTheSelection(),o=s(n,2);if(t=o[0],a=o[1],""===t&&""===a&&(e.throwInput=!1),("p"===e.currencySymbolPlacement&&"s"===e.negativePositiveSignPlacement||"s"===e.currencySymbolPlacement&&("l"===e.negativePositiveSignPlacement||"r"===e.negativePositiveSignPlacement))&&L(this.value)){var l=this._processCharacterDeletionIfTrailingNegativeSign([t,a]),c=s(l,2);t=c[0],a=c[1]}else this.eventKeyCode===y.Backspace?t=t.substring(0,t.length-1):a=a.substring(1,a.length)}this._setValueParts(t,a)}},{key:"_processCharacterInsertion",value:function(e){var t=this.settingsClone,a=this._getUnformattedLeftAndRightPartAroundTheSelection(),i=s(a,2),r=i[0],n=i[1];t.throwInput=!0;var o=D(e);if(o===t.decimalCharacter||t.decimalCharacterAlternative&&o===t.decimalCharacterAlternative||("."===o||","===o)&&this.eventKeyCode===y.DotNumpad)return!t.decimalPlacesOverride||!t.decimalCharacter||(!(!t.negativeSignCharacter||!k(n,t.negativeSignCharacter))||(!!k(r,t.decimalCharacter)||(n.indexOf(t.decimalCharacter)>0||(0===n.indexOf(t.decimalCharacter)&&(n=n.substr(1)),this._setValueParts(r+t.decimalCharacter,n),!0))));if(("-"===o||"+"===o)&&"-"===t.negativeSignCharacter)return!t||("p"===t.currencySymbolPlacement&&"s"===t.negativePositiveSignPlacement||"s"===t.currencySymbolPlacement&&"p"!==t.negativePositiveSignPlacement?(""===r&&k(n,t.negativeSignCharacter)&&(r=t.negativeSignCharacter,n=n.substring(1,n.length)),r=M(r)||k(r,t.negativeSignCharacter)?r.substring(1,r.length):"-"===o?t.negativeSignCharacter+r:r):(""===r&&k(n,t.negativeSignCharacter)&&(r=t.negativeSignCharacter,n=n.substring(1,n.length)),r=r.charAt(0)===t.negativeSignCharacter?r.substring(1,r.length):"-"===o?t.negativeSignCharacter+r:r),this._setValueParts(r,n),!0);var l=Number(o);return l>=0&&l<=9?(t.negativeSignCharacter&&""===r&&k(n,t.negativeSignCharacter)&&(r=t.negativeSignCharacter,n=n.substring(1,n.length)),t.maximumValue<=0&&t.minimumValue<t.maximumValue&&!k(this.value,t.negativeSignCharacter)&&"0"!==o&&(r=t.negativeSignCharacter+r),this._setValueParts(r+o,n),!0):(t.throwInput=!1,!1)}},{key:"_formatValue",value:function(t){var a=this,i=this.settingsClone,r=this.value,n=this._getUnformattedLeftAndRightPartAroundTheSelection(),o=s(n,1),l=o[0];if((""===i.digitGroupSeparator||""!==i.digitGroupSeparator&&!k(r,i.digitGroupSeparator))&&(""===i.currencySymbol||""!==i.currencySymbol&&!k(r,i.currencySymbol))){var c=r.split(i.decimalCharacter),u=s(c,1),d=u[0],m="";L(d)&&(m="-",d=d.replace("-",""),l=l.replace("-","")),""===m&&d.length>i.mIntPos&&"0"===l.charAt(0)&&(l=l.slice(1)),"-"===m&&d.length>i.mIntNeg&&"0"===l.charAt(0)&&(l=l.slice(1)),l=m+l}var h=ie(this.value,this.settingsClone),g=h.length;if(h){var v=l.split("");("s"===i.negativePositiveSignPlacement||"s"===i.currencySymbolPlacement&&"p"!==i.negativePositiveSignPlacement)&&"-"===v[0]&&""!==i.negativeSignCharacter&&(v.shift(),this.eventKeyCode!==y.Backspace&&this.eventKeyCode!==y.Delete||!i.caretFix||("s"===i.currencySymbolPlacement&&"l"===i.negativePositiveSignPlacement&&(v.push("-"),i.caretFix="keydown"===t.type),"p"===i.currencySymbolPlacement&&"s"===i.negativePositiveSignPlacement&&(v.push("-"),i.caretFix="keydown"===t.type),"s"===i.currencySymbolPlacement&&"r"===i.negativePositiveSignPlacement&&!function(){var r=i.currencySymbol.split(""),n=["\\","^","$",".","|","?","*","+","(",")","["],o=[];e.each(r,function(e,t){t=r[e],V(t,n)?o.push("\\"+t):o.push(t)}),a.eventKeyCode===y.Backspace&&o.push("-"),v.push(o.join("")),i.caretFix="keydown"===t.type}()));for(var p=0;p<v.length;p++)v[p].match("\\d")||(v[p]="\\"+v[p]);var f=new RegExp("^.*?"+v.join(".*?")),S=h.match(f);S?(g=S[0].length,i.showPositiveSign&&(0===g&&S.input.charAt(0)===i.positiveSignCharacter&&(g=1===S.input.indexOf(i.currencySymbol)?i.currencySymbol.length+1:1),0===g&&S.input.charAt(i.currencySymbol.length)===i.positiveSignCharacter&&(g=i.currencySymbol.length+1)),(0===g&&h.charAt(0)!==i.negativeSignCharacter||1===g&&h.charAt(0)===i.negativeSignCharacter)&&i.currencySymbol&&"p"===i.currencySymbolPlacement&&(g=this.settingsClone.currencySymbol.length+(M(h)?1:0))):(i.currencySymbol&&"s"===i.currencySymbolPlacement&&(g-=i.currencySymbol.length),i.suffixText&&(g-=i.suffixText.length))}h===this.that.value&&(h!==this.that.value||this.eventKeyCode!==y.num0&&this.eventKeyCode!==y.numpad0)||(this.that.value=h,this._setCaretPosition(g)),this.formatted=!0}}]),t}(),Ue={init:function(a){return this.each(function(){var i=e(this),r=ke(i),n=Ee(a,i,!1);if(t(n))return this;var o=de(i,n,!1);!n.runOnce&&n.formatOnPageLoad&&Ve(n,r,i),n.runOnce=!0,r&&(this.addEventListener("focusin",function(e){Se(i,o,e)},!1),this.addEventListener("mouseenter",function(e){Se(i,o,e)},!1),this.addEventListener("blur",function(e){we(i,o,e)},!1),this.addEventListener("mouseleave",function(e){we(i,o,e)},!1),this.addEventListener("keydown",function(e){be(o,e)},!1),this.addEventListener("keypress",function(e){Pe(o,e)},!1),this.addEventListener("keyup",function(e){Ce(o,n,e)},!1),this.addEventListener("blur",function(e){Oe(o,e)},!1),this.addEventListener("paste",function(e){xe(i,o,e)},!1),Ne(i,o))})},destroy:function(){return e(this).each(function(){var e=ue(this),t=e.data("autoNumeric");"object"===("undefined"==typeof t?"undefined":c(t))&&(e.val(""),fe(e[0],t,"wipe"),e.removeData("autoNumeric"),e.off(".autoNumeric"))})},wipe:function(){return e(this).each(function(){var e=ue(this),t=e.data("autoNumeric");"object"===("undefined"==typeof t?"undefined":c(t))&&(e.val(""),t.rawValue="",fe(e[0],t,"wipe"))})},update:function(t){return e(this).each(function(){var e=ue(this),a=e.autoNumeric("get"),i=Ee(t,e,!0);if(de(e,i,!0),""!==e.val()||""!==e.text())return e.autoNumeric("set",a)})},set:function(t){return e(this).each(function(){if(null!==t&&!a(t)){var e=ue(this),i=e.data("autoNumeric");"object"!==("undefined"==typeof i?"undefined":c(i))&&z('Initializing autoNumeric is required prior to calling the "set" method.'),i.trailingNegative=!1;var r=e.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])"),n=Ie(t,i);if(isNaN(n))return e.val("");if(""===n)return e.val("");var o=ce(n,i),l=s(o,2),u=l[0],d=l[1],m=E(n);if(m&&(n="0"),!u||!d){i.rawValue="",fe(e[0],i,"wipe");var h=n;return n="",u||e.trigger("autoNumeric:minExceeded"),d||e.trigger("autoNumeric:maxExceeded"),z("The value ["+h+"] being set falls outside of the minimumValue ["+i.minimumValue+"] and maximumValue ["+i.maximumValue+"] range set for this element"),e.val("")}if(r||V(e.prop("tagName").toLowerCase(),i.tagList)){var g=!1;if(i.decimalPlacesShownOnFocus){var v=i.decimalPlacesOverride;i.decimalPlacesOverride=i.decimalPlacesShownOnFocus,n=ne(n,i),g=!0,i.decimalPlacesOverride=v}if(i.scaleDivisor&&!i.onOff&&(n=Ie(n,i),n/=i.scaleDivisor,n=n.toString(),i.scaleDecimalPlaces)){var p=i.decimalPlacesOverride;i.decimalPlacesOverride=i.scaleDecimalPlaces,n=ne(n,i),g=!0,i.decimalPlacesOverride=p}g||(n=ne(n,i)),i.rawValue=ve(n.replace(i.decimalCharacter,"."),i),n=te(n,i),n=ie(n,i)}return i.saveValueToSessionStorage&&(i.decimalPlacesShownOnFocus||i.scaleDivisor)&&fe(e[0],i,"set"),!i.hasFocus&&i.scaleSymbol&&(n+=i.scaleSymbol),r?e.val(n):!!V(e.prop("tagName").toLowerCase(),i.tagList)&&e.text(n)}})},unSet:function(){return e(this).each(function(){var e=ue(this),t=e.data("autoNumeric");"object"===("undefined"==typeof t?"undefined":c(t))&&(t.hasFocus=!0,e.val(e.autoNumeric("getLocalized")))})},reSet:function(){return e(this).each(function(){var e=ue(this),t=e.data("autoNumeric");"object"===("undefined"==typeof t?"undefined":c(t))&&e.autoNumeric("set",e.val())})},get:function(){var e=ue(this),t=e.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])"),a=e.data("autoNumeric");"object"!==("undefined"==typeof a?"undefined":c(a))&&z('Initializing autoNumeric is required prior to calling the "get" method.');var i="";if(t?i=e.eq(0).val():V(e.prop("tagName").toLowerCase(),a.tagList)?i=e.eq(0).text():z('The "<'+e.prop("tagName").toLowerCase()+'>" tag is not supported by autoNumeric'),a.decimalPlacesShownOnFocus||a.scaleDivisor)i=a.rawValue;else{var r=L(i);if(!/\d/.test(i)&&"focus"===a.emptyInputBehavior)return"";""!==i&&null!==a.negativeBracketsTypeOnBlur&&(a.hasFocus=!0,i=J(i,a)),(a.runOnce||a.formatOnPageLoad===!1)&&(i=Q(i,a,!0),i=ve(i.replace(a.decimalCharacter,"."),a),a.trailingNegative&&r&&!L(i)&&0!==Number(i)&&(i="-"+i)),(""!==i||""===i&&"zero"===a.emptyInputBehavior)&&(i=ee(i,a))}return pe(i)},getLocalized:function(){var e=ue(this),t=e.autoNumeric("get"),a=e.data("autoNumeric");return 0===Number(t)&&"keep"!==a.leadingZero&&(t="0"),X(t,a.outputFormat)},getNumber:function(){var e=ue(this),t=e.autoNumeric("get");return X(t,"number")},getFormatted:function(){return this.hasOwnProperty("0")&&"value"in this[0]||z("Unable to get the formatted string from the element."),this[0].value},getString:function(){return ye(!1,this)},getArray:function(){return ye(!0,this)},getSettings:function(){return this.data("autoNumeric")}};e.fn.autoNumeric=function(e){if(Ue[e]){for(var t=arguments.length,a=Array(t>1?t-1:0),i=1;i<t;i++)a[i-1]=arguments[i];return Ue[e].apply(this,a)}return"object"!==("undefined"==typeof e?"undefined":c(e))&&e?void z('Method "'+e+'" is not supported by autoNumeric'):Ue.init.apply(this,[e])},m=function(){return f},e.fn.autoNumeric.defaults=f,h=function(){return O},e.fn.autoNumeric.lang=O,u=function(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(a(i)||null===i)return null;r(i)||w(i)||z('The value "'+i+'" being "set" is not numeric and therefore cannot be used appropriately.');var o=e.extend({},f,{strip:!1},n);i<0&&(o.negativeSignCharacter="-"),t(o.decimalPlacesOverride)&&(o.decimalPlacesOverride=W(o.minimumValue,o.maximumValue));var l=Ie(i,o);isNaN(l)&&z("The value ["+l+"] that you are trying to format is not a recognized number.");var c=ce(l,o),u=s(c,2),d=u[0],m=u[1];return d&&m||(Ke("autoFormat.autoNumeric",document,"Range test failed"),z("The value ["+l+"] being set falls outside of the minimumValue ["+o.minimumValue+"] and maximumValue ["+o.maximumValue+"] range set for this element")),l=ne(l,o),l=te(l,o),l=ie(l,o)},e.fn.autoFormat=u,d=function(t,i){if(a(t)||null===t)return null;if(w(t))return Number(t);(F(t)||P(t))&&z("A number or a string representing a number is needed to be able to unformat it, ["+t+"] given.");var r=e.extend({},f,{strip:!1},i),n="-0123456789\\"+r.decimalCharacter,o=new RegExp("[^"+n+"]","gi");return t=t.toString(),L(t)?r.negativeSignCharacter="-":r.negativeBracketsTypeOnBlur&&r.negativeBracketsTypeOnBlur.split(",")[0]===t.charAt(0)&&(r.negativeSignCharacter="-",r.hasFocus=!0,t=J(t,r)),t=t.replace(o,""),t=t.replace(r.decimalCharacter,"."),t=X(t,r.outputFormat)},e.fn.autoUnformat=d,g=function(a){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];(i(a)||!P(a)||C(a))&&z("The userOptions are invalid ; it should be a valid object, ["+a+"] given."),t(a)||Me(a);var l=void 0;l=o?e.extend({},f,a):a,b(l.showWarnings)||n(l.showWarnings)||z("The debug option 'showWarnings' is invalid ; it should be either 'false' or 'true', ["+l.showWarnings+"] given.");var s=/^[0-9]+$/,c=/[0-9]+/,u=/^-?[0-9]+(\.?[0-9]+)?$/,d=/^[0-9]+(\.?[0-9]+)?$/;V(l.digitGroupSeparator,[",","."," "," "," "," ","","'","٬","˙"])||z("The thousand separator character option 'digitGroupSeparator' is invalid ; it should be ',', '.', '٬', '˙', \"'\", ' ', ' ', ' ', ' ' or empty (''), ["+l.digitGroupSeparator+"] given."),b(l.noSeparatorOnFocus)||n(l.noSeparatorOnFocus)||z("The 'noSeparatorOnFocus' option is invalid ; it should be either 'false' or 'true', ["+l.noSeparatorOnFocus+"] given."),s.test(l.digitalGroupSpacing)||z("The digital grouping for thousand separator option 'digitalGroupSpacing' is invalid ; it should be a positive integer, ["+l.digitalGroupSpacing+"] given."),V(l.decimalCharacter,[",",".","·","٫","⎖"])||z("The decimal separator character option 'decimalCharacter' is invalid ; it should be '.', ',', '·', '⎖' or '٫', ["+l.decimalCharacter+"] given."),l.decimalCharacter===l.digitGroupSeparator&&z("autoNumeric will not function properly when the decimal character 'decimalCharacter' ["+l.decimalCharacter+"] and the thousand separator 'digitGroupSeparator' ["+l.digitGroupSeparator+"] are the same character."),t(l.decimalCharacterAlternative)||r(l.decimalCharacterAlternative)||z("The alternate decimal separator character option 'decimalCharacterAlternative' is invalid ; it should be a string, ["+l.decimalCharacterAlternative+"] given."),""===l.currencySymbol||r(l.currencySymbol)||z("The currency symbol option 'currencySymbol' is invalid ; it should be a string, ["+l.currencySymbol+"] given."),V(l.currencySymbolPlacement,["p","s"])||z("The placement of the currency sign option 'currencySymbolPlacement' is invalid ; it should either be 'p' (prefix) or 's' (suffix), ["+l.currencySymbolPlacement+"] given."),V(l.negativePositiveSignPlacement,["p","s","l","r",null])||z("The placement of the negative sign option 'negativePositiveSignPlacement' is invalid ; it should either be 'p' (prefix), 's' (suffix), 'l' (left), 'r' (right) or 'null', ["+l.negativePositiveSignPlacement+"] given."),b(l.showPositiveSign)||n(l.showPositiveSign)||z("The show positive sign option 'showPositiveSign' is invalid ; it should be either 'false' or 'true', ["+l.showPositiveSign+"] given."),(!r(l.suffixText)||""!==l.suffixText&&(L(l.suffixText)||c.test(l.suffixText)))&&z("The additional suffix option 'suffixText' is invalid ; it should not contains the negative sign '-' nor any numerical characters, ["+l.suffixText+"] given."),t(l.overrideMinMaxLimits)||V(l.overrideMinMaxLimits,["ceiling","floor","ignore"])||z("The override min & max limits option 'overrideMinMaxLimits' is invalid ; it should either be 'ceiling', 'floor' or 'ignore', ["+l.overrideMinMaxLimits+"] given."),r(l.maximumValue)&&u.test(l.maximumValue)||z("The maximum possible value option 'maximumValue' is invalid ; it should be a string that represents a positive or negative number, ["+l.maximumValue+"] given."),r(l.minimumValue)&&u.test(l.minimumValue)||z("The minimum possible value option 'minimumValue' is invalid ; it should be a string that represents a positive or negative number, ["+l.minimumValue+"] given."),parseFloat(l.minimumValue)>parseFloat(l.maximumValue)&&z("The minimum possible value option is greater than the maximum possible value option ; 'minimumValue' ["+l.minimumValue+"] should be smaller than 'maximumValue' ["+l.maximumValue+"]."),t(l.decimalPlacesOverride)||x(l.decimalPlacesOverride)&&l.decimalPlacesOverride>=0||r(l.decimalPlacesOverride)&&s.test(l.decimalPlacesOverride)||z("The maximum number of decimal places option 'decimalPlacesOverride' is invalid ; it should be a positive integer, ["+l.decimalPlacesOverride+"] given.");var m=W(l.minimumValue,l.maximumValue);t(l.decimalPlacesOverride)||m===Number(l.decimalPlacesOverride)||H("Setting 'decimalPlacesOverride' to ["+l.decimalPlacesOverride+"] will override the decimals declared in 'minimumValue' ["+l.minimumValue+"] and 'maximumValue' ["+l.maximumValue+"].",l.showWarnings),l.allowDecimalPadding||t(l.decimalPlacesOverride)||H("Setting 'allowDecimalPadding' to [false] will override the current 'decimalPlacesOverride' setting ["+l.decimalPlacesOverride+"].",l.showWarnings),t(l.decimalPlacesShownOnFocus)||r(l.decimalPlacesShownOnFocus)&&s.test(l.decimalPlacesShownOnFocus)||z("The number of expanded decimal places option 'decimalPlacesShownOnFocus' is invalid ; it should be a positive integer, ["+l.decimalPlacesShownOnFocus+"] given."),!t(l.decimalPlacesShownOnFocus)&&!t(l.decimalPlacesOverride)&&Number(l.decimalPlacesOverride)>Number(l.decimalPlacesShownOnFocus)&&H("The extended decimal places 'decimalPlacesShownOnFocus' ["+l.decimalPlacesShownOnFocus+"] should be greater than the 'decimalPlacesOverride' ["+l.decimalPlacesOverride+"] value. Currently, this will limit the ability of your client to manually change some of the decimal places. Do you really want to do that?",l.showWarnings),t(l.scaleDivisor)||d.test(l.scaleDivisor)||z("The scale divisor option 'scaleDivisor' is invalid ; it should be a positive number, preferably an integer, ["+l.scaleDivisor+"] given."),t(l.scaleDecimalPlaces)||s.test(l.scaleDecimalPlaces)||z("The scale number of decimals option 'scaleDecimalPlaces' is invalid ; it should be a positive integer, ["+l.scaleDecimalPlaces+"] given."),t(l.scaleSymbol)||r(l.scaleSymbol)||z("The scale symbol option 'scaleSymbol' is invalid ; it should be a string, ["+l.scaleSymbol+"] given."),b(l.saveValueToSessionStorage)||n(l.saveValueToSessionStorage)||z("The save to session storage option 'saveValueToSessionStorage' is invalid ; it should be either 'false' or 'true', ["+l.saveValueToSessionStorage+"] given."),V(l.onInvalidPaste,["error","ignore","clamp","truncate","replace"])||z("The paste behavior option 'onInvalidPaste' is invalid ; it should either be 'error', 'ignore', 'clamp', 'truncate' or 'replace' (cf. documentation), ["+l.onInvalidPaste+"] given."),V(l.roundingMethod,["S","A","s","a","B","U","D","C","F","N05","CHF","U05","D05"])||z("The rounding method option 'roundingMethod' is invalid ; it should either be 'S', 'A', 's', 'a', 'B', 'U', 'D', 'C', 'F', 'N05', 'CHF', 'U05' or 'D05' (cf. documentation), ["+l.roundingMethod+"] given."),b(l.allowDecimalPadding)||n(l.allowDecimalPadding)||z("The control decimal padding option 'allowDecimalPadding' is invalid ; it should be either 'false' or 'true', ["+l.allowDecimalPadding+"] given."),t(l.negativeBracketsTypeOnBlur)||V(l.negativeBracketsTypeOnBlur,["(,)","[,]","<,>","{,}"])||z("The brackets for negative values option 'negativeBracketsTypeOnBlur' is invalid ; it should either be '(,)', '[,]', '<,>' or '{,}', ["+l.negativeBracketsTypeOnBlur+"] given."),V(l.emptyInputBehavior,["focus","press","always","zero"])||z("The display on empty string option 'emptyInputBehavior' is invalid ; it should either be 'focus', 'press', 'always' or 'zero', ["+l.emptyInputBehavior+"] given."),V(l.leadingZero,["allow","deny","keep"])||z("The leading zero behavior option 'leadingZero' is invalid ; it should either be 'allow', 'deny' or 'keep', ["+l.leadingZero+"] given."),b(l.formatOnPageLoad)||n(l.formatOnPageLoad)||z("The format on initialization option 'formatOnPageLoad' is invalid ; it should be either 'false' or 'true', ["+l.formatOnPageLoad+"] given."),b(l.selectNumberOnly)||n(l.selectNumberOnly)||z("The select number only option 'selectNumberOnly' is invalid ; it should be either 'false' or 'true', ["+l.selectNumberOnly+"] given."),t(l.defaultValueOverride)||""===l.defaultValueOverride||u.test(l.defaultValueOverride)||z("The unformatted default value option 'defaultValueOverride' is invalid ; it should be a string that represents a positive or negative number, ["+l.defaultValueOverride+"] given."),b(l.unformatOnSubmit)||n(l.unformatOnSubmit)||z("The remove formatting on submit option 'unformatOnSubmit' is invalid ; it should be either 'false' or 'true', ["+l.unformatOnSubmit+"] given."),t(l.outputFormat)||V(l.outputFormat,["string","number",".","-.",",","-,",".-",",-"])||z("The custom locale format option 'outputFormat' is invalid ; it should either be null, 'string', 'number', '.', '-.', ',', '-,', '.-' or ',-', ["+l.outputFormat+"] given."),b(l.failOnUnknownOption)||n(l.failOnUnknownOption)||z("The debug option 'failOnUnknownOption' is invalid ; it should be either 'false' or 'true', ["+l.failOnUnknownOption+"] given.")},e.fn.autoValidate=g,v=function(e){var t=!0;try{g(e)}catch(e){t=!1}return t},function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var a=document.createEvent("CustomEvent");return a.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),a}return"function"!=typeof window.CustomEvent&&(e.prototype=window.Event.prototype,void(window.CustomEvent=e))}()}),t.default={format:u,unFormat:d,getDefaultConfig:m,getLanguages:h,validate:g,areSettingsValid:v}}).call(window)},function(t,a){t.exports=e}])}); //# sourceMappingURL=autoNumeric.min.js.map |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 234 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php HTTP/1.1
Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 19,386 bytes. |
<style type="text/css">
.div_border_front2 table:nth-child(2) input[type="button"] { color: #fff; background: #627d4d; } #forgot { color: ; } .applist_gradient { background: #627d4d; } .head_title { color: #fff; } .head_title, .apptitle { text-transform: uppercase; } .head_title1, .apptitle1 { text-transform: uppercase; } .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header { background: #627d4d; } .ui-widget-header { background: #627d4d !important; color: #fff; } .ui-dialog .ui-dialog-buttonpane button { color: #fff; } header#header,.theme_header { background: #627d4d !important; } /*header#header2 { background: #627d4d; }*/ ._program li { color: #fff; } .button1 { color: #fff; background: #627d4d; } ._figure span:first-child { color: #fff; } #hris_sub_container ul figure { background: #627d4d; } .dc_empstatico { color: ; /* colored */ } .dbg_empstatico { background: #627d4d; /* colored */ } ::-webkit-scrollbar { background: #627d4d; } ::-webkit-scrollbar-thumb { background: #627d4d; } #hris_sub_container header { color: ; /* colored */ } .gp, .ui-widget-header, .fc-day-header, { background: #627d4d; } .ui-widget-header, .fc-day-header { color : white !important;; } </style><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "/strict.dtd"> <html> <head> <title>WEBTEMPLATE</title> <link REL="SHORTCUT ICON" HREF="./images/lst_logo.ico" /> <link href='../css/applist.css' media='screen' type='text/css' /> <!-- include a theme, can be included into the core instead of 2 separate files --> <link rel="stylesheet" href="lib/alertify/css/themes/bootstrap.min.css" /> <link rel="stylesheet" href="./css/modified_layout.css" type="text/css" media="screen" /> <link rel='stylesheet' type='text/css' media='screen' href='./css/layout.css'/> </head> <body> <form name='myform' id='myform' method='post'> <link rel='stylesheet' type='text/css' href='css/login.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_view.css?v=20220209161346' /><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/layout.css?v=20220209161346' /><script type='text/javascript' src='javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='lib/pager.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/pager.css?v=20220209161346' /><script type='text/javascript' src='lib/alertify/alertify.min.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_page.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/applist.css?v=20220209161346' /> <!-- <link rel="stylesheet" type="text/css" href="css/login_page.css"> --> <input name='xpage_uri' id='xpage_uri'> <input name='xpage_dir' id='xpage_dir'> <input name='txt_action' id='txt_action'> <input name='txtappcde' id='txtappcde'> <input name='txtoutsource' id='txtoutsource'> <input id='seccode_validated' value=""> <input id="gl_comcde" name="gl_comcde" value="ATESTWEBTKM"> <!-- <input type="hidden" id="tmp_redirect_path" name="tmp_redirect_path"> --> <!-- <input type="hidden" id="tmp_appcde" name="tmp_appcde"> --> <style type="text/css"> .seccode_continue:hover { color: white; background-color: #1947D1 !important; border: 0; } .seccode_continue { background-color: #335CD6 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; /* border-radius: .3em; */ width: auto; min-width: 70px; } .seccode_cancel:hover { color: white; background-color: #990000 !important; border: 0; } .seccode_cancel { /* border-radius: .3em; */ background-color: #aa4935 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; width: 70px; /*margin-right: 3px;*/ } </style> <script type='text/javascript'> //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "WEBAPP"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function() {}; jQuery(document).ready(function() { if (jQuery('#seccode_validated').val() == 0 && jQuery('#seccode_validated').val() != '') { alertify.alert('Accesing any programs must start here.'); } jQuery('#seccode_diag').dialog({ title: "Security Code", resizable: false, autoOpen: false, height: 'auto', width: 'auto', position: { my: "center", at: "center", of: window }, modal: true, open: function() { jQuery('body').css('overflow', 'hidden'); jQuery('.ui-button-icon-primary.ui-icon.ui-icon-closethick').closest('button').remove(); jQuery(this).closest('.ui-dialog').find('.seccode_cancel').focus(); }, close: function() { jQuery('body').css('overflow', 'auto'); }, buttons: [{ text: "Continue", "class": 'seccode_continue', click: function() { val_seccode_path(jQuery('#seccode_diag').find('#seccode_path')); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { jQuery('#seccode_diag').dialog('close'); } }, ] }); jQuery('#diag_subsidiary').dialog({ title: 'Select Subsidiary', width: 500, height: 'auto', draggable: false, resizable: false, autoOpen: false, modal: true, open: function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [{ text: "Proceed", "class": 'seccode_continue', click: function() { update_pay_subdrycde_link($(this).find('#pay_subdrycde').val()); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { $(this).dialog('close'); } }, ] }); }) function val_blank_session() { alertify.alert('You must login first.', function() { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) // window.open('login_view.php', '_self'); }) } function val_seccode(xloc, xcde) { var xdata = "event_action=val_seccode"; xdata += "&xloc=" + xloc; xdata += "&xcde=" + xcde; xdata += "&" + jQuery('#myform *').serialize(); return jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata }); } function val_seccode_path(selectObj) { var xdata = "event_action=val_seccode_path"; xdata += "&apploc=" + selectObj.val(); xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { if (xret.bridge_found) { // document.forms.myform.txtappcde.value=selectObj.find("option:selected").data('appcde'); document.forms.myform.action = selectObj.val(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { alertify.alert(selectObj.find(':selected').text(), xret.bridge_found_msg); } } }); } function open_seccode_diag() { var xdata = "event_action=validate_comcde"; xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { jQuery('#seccode_diag').dialog('open'); } }); } function transaction_click(xappcde, xloc, obj) { // alert(xappcde,xloc,obj); document.forms.myform.action = xloc; document.forms.myform.txtappcde.value = xappcde; if (jQuery(obj).hasClass('show_sub_diag') || xappcde == "PAY") { var xdata = "event_action=get_user_subdry&xappcde=" + xappcde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { $.unblockUI(); console.log(response) if (response.pass == true) { if (response.show_diag == true && response.has_access == true) { var subdry_note = "Payroll"; if(xappcde == "PAY_OUTSRC") { subdry_note = "Payroll Out Sourcing"; } jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); // jQuery('#diag_subsidiary').find('#subdry_note').html(subdry_note); jQuery('#diag_subsidiary').dialog('open'); } else if (response.show_diag == false && response.has_access == true) { blockui(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); update_pay_subdrycde_link($('#pay_subdrycde').val()); } } else { alertify.alert('You must have a subsidiary access to use the payroll program.'); } } }); } else { blockui(); //20190311 donita //add check update structure // if(xappcde != "PAY_OUTSRC" || xappcde != "PAY") // { update_empstatus(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action = "admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); // } // else // { // document.forms.myform.method='POST'; // document.forms.myform.target = '_self'; // document.forms.myform.submit(); // } } } function update_empstatus(subdrycde="") { var xdata= "event_action=update_empstatus&subdrycde="+subdrycde; jQuery.ajax({ type : 'post', data : xdata, url : 'login_applist_ajax.php', success : function (xretobj) { } }); } function logout_click() { alertify.confirm('Are you sure you want to logout?', function() { blockui(); var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) } }); }); } function update_pay_subdrycde_link(xsubdrycde) { blockui(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { var xappcde = $('#txtappcde').val(); var xdata = "event_action=update_pay_subdrycde_link&xappcde=" + xappcde; xdata += "&subdrycde=" + xsubdrycde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { jQuery('#diag_subsidiary').dialog('close'); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } }); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action="admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); } function admin_click(xloc) { document.forms.myform.action = xloc; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } function getclientdir(){ var xparams = 'txt_action=getclientdir'; return jQuery.ajax({ dataType: 'json', type: 'post', data: xparams, url : 'login_validate_redirect.php' }) } </script> <style> footer { width: 580px; margin: 0 auto 50px; } footer .ftr_con { margin: 20px auto 0; } footer .ftr_con p { text-align: center; } .appgrp { margin-top: 20px; display: flex; justify-content: center; align-items: center; } </style> <!-- <form id="myform"> </form> --> <div class='applist_body' align='center'> <div class='applist_all'> <div class="logo"> <img src='img/lst.png' style="width: 100%;height: 100%;"> </div> <table border='0' align='center'> <tr> <td align='center'> <table class='applist_table'> <tr> <td align='right' colspan='10'> <span class='applist_logout' onclick='logout_click()'><b>LOGOUT</b></span> </td> </tr> <tr> <td colspan='10'> <hr> </td> </tr> <tr> <td style='white-space:nowrap;' align='center'> <div class="appgrp"> <div class='applist_button' onclick="admin_click('admin/main.php')"> <div class='applist_gradient'> <img class='applist_button_img' src='images/admin.png'> </div> <div class='admin_label'> <p>Admin</p> </div> </div> <div class="applist_button show_sub_diag" onclick='transaction_click("PAY","payroll/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/PAY.png' ></div><div class='admin_label'><p>Payroll</p></div></div><div class="applist_button " onclick='transaction_click("HR","hris/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/hr_0.png' ></div><div class='admin_label'><p>Human Resource Information System</p></div></div><div class="applist_button " onclick='transaction_click("TKM","tkm/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/clock.png' ></div><div class='admin_label'><p>Time Keeping Management</p></div></div> </div> </td> </tr> </table> </td> </tr> <tr style="height:50px;"> <td colspan="100"></td> </tr> <tr> <td colspan="10" align="center"> <input type="button" class="print" onclick="open_seccode_diag()" value="Enter Security Code"> </td> </tr> </table> </div> </div> <br> <br> <br> <div id="seccode_diag" style="display: none;"> <table><tr><td style="width:110px;">Select Program</td><td><select class="input" style="margin-right:10px;" id="seccode_path"><option value="payroll/bridge/">Payroll</option><option value="hris/bridge/">Human Resource Information System</option><option value="tkm/bridge/">Time Keeping Management</option></select></td></tr></table></div> <div id="diag_subsidiary" style="display:none;"> <table style="width:100%"> <!-- <tr> <td colspan="100"><i>Note: Only subsidiaries with <i id="subdry_note"></i> database connection setup.</i></td> </tr> --> <tr> <td><b>Subsidiary</b></td> <td><select id="pay_subdrycde" name="pay_subdrycde" class="input"></select></td> </tr> </table> </div> <!-- <footer> <div class="ftr_con" style='font-size:11px;width:60%'> <p>Copyright © 2015, LEE Systems Technology Ventures</p> <p align='right' style='padding-right : 18px;font-size : 11px;font-weight : bold;'>IP Details : 10.0.0.18</p> </div> </footer> --> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 222 bytes. |
GET http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php HTTP/1.1
Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,055 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=UTF-8 |
| Response Body - size: 34,194 bytes. |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "/strict.dtd">
<html> <head> <title>LST</title> <link REL="SHORTCUT ICON" HREF="images/lst_logo.ico"> <style type="text/css"> html{ font-family: Arial, Helvetica, sans-serif; height: 100%; } a{ text-decoration: none; } .applist_body{ background : white; height: 500px; } .applist_all{ height : 100%; display: inline-block; } .div_applist_header{ vertical-align :middle; height : 50px; } .applist_button_border{ height : 60%; /*border: 2px outset #f2f0f0;*/ padding : 20px; border-top-left-radius:7em; border-top-right-radius:0em; border-bottom-right-radius:7em; border-bottom-left-radius:0em; display: inline-block; /*background : #e5e3e3;8*/ border-top-style:solid; border-top-width:15px; border-top-color:#003300; border-left-style:solid; border-left-width:1px; border-left-color:#003300; border-right-style:solid; border-right-width:30px; border-right-color:#006633; border-bottom-style:solid; border-bottom-width:1px; border-bottom-color:#006633; } .applist_button{ /*margin-right: auto;*/ /*padding : 5px;*/ /*background: #ffffff;*/ /* for non-css3 browsers */ /*background: #627d4d;*/ /*background: #fe941b;*/ /*-webkit-border-radius: 6px;*/ /*-moz-border-radius: 6px;*/ /*border-radius: 8px;*/ /* border:1px inset;*/ display:inline-block; width : 120px; height : 170px; cursor : pointer; /*box-shadow: 0 2px 4px rgba(0,0,0,0.5);*/ transition: all 0.15s linear; overflow: hidden; } .applist_logout{ background: transparent; /* for non-css3 browsers */ cursor : pointer; font-family : Arial; } .applist_table{ width:800px; height:100px; } .applist_table td{ padding : 0px; } .applist_gradient{ /* filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#ffffff'); /* for IE */ /* background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#fff)); /* for webkit browsers */ /* background: -moz-linear-gradient(top, #ccc, #fff); /* for firefox 3.6+ */ /*height: 100%;*/ width: 100px; height: 100px; display: flex; justify-content: center; align-items: center; border-radius: 50%; } .applist_button_img{ width : 60px; height : 60px; margin: 10px auto 10px; transition: all 0.2s; /*transform: scale(0.75);*/ } .applist_button:hover{ /*box-shadow: 0 3px 20px rgba(0,0,0,0.4), 0 7px 13px rgba(0,0,0,0.2);*/ opacity: 0.8; } .applist_button:hover img { transform: rotateY(180deg); /*-webkit-filter: blur(0.05em);*/ } .applist_logout:hover{ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; cursor : pointer; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .applist_circle { position: absolute; margin-top:-30px; margin-left:-20%; width: 300px; height: 300px; -moz-border-radius: 500px; -webkit-border-radius: 500px; border-radius: 500px; border-top: #383838 20px solid; border-right: #383838 20px solid; border-bottom: #383838 20px solid; border-left: #383838 20px solid; background:#484848 ; } .applist_footer{ font-family:"Verdana", verdana, sans-serif; font-size:15px; font-weight:bold; } .admin_label { width: 100%; height: calc(100% - 120px); background: #fff; /*border-bottom: 1px solid #627d4d;*/ z-index: 10; display: flex; } .admin_label p { /*margin: 13px auto 0;*/ margin: 0 auto; /*padding: 10px;*/ white-space: normal; font-size: 13px; align-self: center; } :root { --cuscol: #87c43e; --progh: 50px; --footer: 50px; --navtop: 2vh; /*--max: 100%;*/ } * { margin: 0; padding: 0; box-sizing: border-box; font-size: 13px; font-family: 'Calibri'; } img { /* width: var(--max); height: var(--max); object-fit: contain; */ } select, input, button { outline: none; } ._textbox { border: 1px solid transparent; border-bottom: 1px solid #ccc; padding: 8px 10px; background: transparent; } .prog { width: 100vw; height: var(--progh); /*margin-top: var(--navtop);*/ margin: calc(var(--navtop) - 1vh) auto var(--navtop); /*position: fixed;*/ /*top: 1vh;*/ display: flex; justify-content: center; } .prog .progicon { width: var(--progh); height: var(--progh); margin: 0 15px; border-radius: 50%; /*border: 1px solid #ccc;*/ box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.3); /*overflow: hidden;*/ } .progicon .label { text-align: center; display: block; width: 100%; height: 30px; display: flex; justify-content: center; align-items: center; } .progicon .label span { font-size: 10px; } .loginwrapper { width: 100%; margin-top:1rem; /* height: calc(100vh - (var(--navtop) + (var(--progh)*1.5) + var(--footer))); */ position: relative; padding: 0 15vw; display: flex; flex-direction: column; justify-content: space-between; align-items: center; /* flex-wrap: wrap; */ } .loginwrapper > div { width: calc(100% / 2); display: flex; justify-content: center; align-items: center; } .left { flex-direction: column; display: none; } .right{ margin: auto; } .logo { /* width: 400px; height: 160px; */ /* margin: 20px auto; */ /*border: 1px solid #000;*/ } .companyname { color: var(--cuscol); font-size: 25px; } .logincontainer { width: 350px; background: #fff; padding: 2rem; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 2px 1px rgba(0,0,0,0.1); } .logincred { width: var(--max); margin: 40px 0 25px; } .top header { font-size: 28px; } .inputwrapper { width: var(--max); height: auto; display: flex; align-items: center; margin: 35px 0; position: relative; } .inputwrapper input, .inputwrapper select { width: var(--max); z-index: 2; padding: 8px 1px; font-weight: bold; } .inputwrapper span { display: block; width: var(--max); position: absolute; z-index: 1; color: #999; transition: all 0.3s; } .inputwrapper .underline { position: absolute; bottom: -1px; left: 0; width: var(--max); height: 1px; background: #87c43e; transition: transform 0.3s, opacity 0.1s; transform: scaleX(0); opacity: 0; } .inputwrapper .underline.full { transform: scaleX(1); opacity: 1; } .btngrp { display: flex; justify-content: space-between; align-items: center; } .loginbtn, .loginbtn * { cursor: pointer; } .loginbtn { position: relative; overflow: hidden; background: var(--cuscol); } .loginbtn input { width: 100px; padding: 6px 0; color: #fff; border: none; background: transparent; position: relative; z-index: 2; } .licagrmnt { color: #0c56f5b1; /* font-weight: bold; */ cursor: pointer; } .licagrmnt_container { position: absolute; top: 0; left: 0; /* width: 100vw; height: 100vh; */ padding: 0 25vw; background: #fff; /* background: rgb(114, 114, 114); */ z-index: 100; /* overflow-y: auto; */ /* overflow-y: scroll; */ counter-reset: x; display: flex; flex-direction: column; } .licagrmnt_container > header { /*position: absolute;*/ /*top: 0; left: 0;*/ width: 100%; height: auto; font-size: 25px; padding: 10px 0 15px; font-weight: bold; text-align: center; border-bottom: 1px solid #ccc ; /* display: flex; justify-content: center; align-items: center; */ } .licagrmnt_container article { overflow: scroll; width: 100%; scroll-behavior: smooth; padding: 15px 0 100px; } .licagrmnt_container article::-webkit-scrollbar{ overflow: hidden; } .licagrmnt_container article .xcount::before { counter-increment: x; content: counter(x) '. '; } .licagrmnt_container article section { margin-bottom: 40px; } .licagrmnt_container article section > label { font-weight: bold; font-size: 20px; margin-bottom: 15px; display: block; } .licagrmnt_container article section p { text-indent: calc(20px * 2); line-height: 1.4; margin-bottom: 15px; } .licagrmnt_container article section p, .licagrmnt_container article section li { text-align: justify; } .licagrmnt_container article section strong { text-align: center; } .licagrmnt_container article section ul.circle { list-style-type: circle; padding: 0 0 0 20px; } .licagrmnt_container > div { position: fixed; bottom: 0; left: 0; width: 100%; height: 50px; background: #fff; display: flex; justify-content: center; align-items: center; } .licagrmnt_container > div:after { /*content: '';*/ width: 100vw; height: 70px; background: linear-gradient(transparent, rgba(0,0,0,0.5)); position: absolute; z-index: -1; } .closebtn { width: 60px; height: 60px; border-radius: 50%; position: absolute; bottom: 7vh; display: flex; justify-content: center; align-items: center; cursor: pointer; background: #fff; transition: all 0.3s; } .closebtn svg { /*width: 100%; height: 100%;*/ transform: scale(0.4); stroke: #000; stroke-width: 3; transition: all 0.3s; } .closebtn:hover { background: #87c43e; } .closebtn:hover svg { stroke: #fff; } footer { /* margin-top: 120px; */ width: 100%; height: var(--footer); /*position: fixed;*/ /*bottom: 0; left: 0;*/ display: flex; justify-content: center; align-items: center; background: transparent; } .inputwrapper span.inputfocus { transform: translate(-35px, -25px) scale(0.8); font-weight: bold; /* color: var(--cuscol); */ } .explode { display: block; position: absolute; background: hsl(90, 53%, 40%); /* background: hsl(216, 53%, 40%); */ border-radius: var(--max); transform: scale(0); z-index: 1; } .explode.animate { animation: explodeAnimate 0.65s linear; } @keyframes explodeAnimate { 100% {opacity: 0; transform: scale(2.5);} } ._fadeout { opacity: 0; } ._strtoupper { text-transform: uppercase; } @media only screen and (max-width: 1024px) { .licagrmnt_container { padding: 0 15vw; } .licagrmnt_container header { padding: 5px 0 10px; } } @media only screen and (max-width: 850px) { .loginwrapper { align-items: center; flex-direction: column; height: auto; padding: 0; } .left { margin: 4vh 0; } .loginwrapper > div { width: calc((100% / 3) * 2); } .logo { width: 300px; height: 120px; } footer { margin-top: 6vh; } .licagrmnt_container { padding: 0 5vw; } .licagrmnt_container header { padding: 2px 0 5px; } } @media only screen and (max-width: 600px) { .companyname { display: none; } } @media only screen and (max-width: 480px) { .loginwrapper > div { width: calc((100% / 7) * 6); } } .table_disp{ font-family: arial; font-size: 12px; border: 1px; border-collapse: collapse; cursor: pointer; } .table_disp th{ background-color: #bdbdbd; color: black; height:30px; } .table_disp tbody tr:hover{ background-color:silver; } #login_frame{ border: 1px solid #696; padding: 60px 0; text-align: center; width: 400px; -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 10px; -webkit-box-shadow: #666 0px 2px 3px; -moz-box-shadow: #666 0px 2px 3px; box-shadow: #666 0px 2px 3px; background : white; behavior: url(./css/PIE.htc); } .gp{ width : 80%; } #login_frame table{ align-items : center; } .div_border_back{ /*border: 0px solid gainsboro;*/ /*background : #204f1e;*/ width : 350px; height : 280px; /*-webkit-border-radius: 8px;*/ /*-moz-border-radius: 8px;*/ /*border-radius: 10px;*/ -webkit-box-shadow: #666 0px 3px 10px; -moz-box-shadow: #666 0px 3px 10px; box-shadow: #666 0px 3px 10px; } .div_border_front1{ background : #3a6f8f; width : 100%; height : 4%; -webkit-border-top-left-radius: 8px; -moz-border-top-left-radius: 8px; border-top-left-radius: 10px; -webkit-border-top-right-radius: 8px; -moz-border-top-right-radius: 8px; border-top-right-radius: 10px; } .div_border_front2{ /*background : white;*/ width : 100%; height : 96%; -webkit-border-bottom-left-radius: 6px; -moz-border-bottom-left-radius: 6px; border-bottom-left-radius: 8px; -webkit-border-bottom-right-radius: 6px; -moz-border-bottom-right-radius: 6px; border-bottom-right-radius: 8px; } .gp{ width : 96%; border : solid 1px rgba(98, 125, 77, 0.5) !important; margin-bottom: 15px; } .sublabel{ color : #555555; } .headlabel{ color : #555555; } :root { --cuscol: #052b00; --progh: 50px; --footer: 50px; --navtop: 2vh; --max: 100%; } .licagrmnt { /* color: var(--cuscol); */ } /* .inputwrapper .underline { background-color: var(--cuscol); } */ * { font-family: unset; } .div_version{ display: flex; justify-content: flex-end; } .tbl_versions, .tbl_versions td, .tbl_versions th { border: 1px solid #ddd; text-align: left; } .tbl_versions { border-collapse: collapse; width: 100%; } .tbl_versions th, .tbl_versions td { padding: 5px; } </style> <script type="text/javascript" src="jquery-1.10.2.min.js"></script> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon"> <link rel="icon" href="img/favicon.ico" type="image/x-icon"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <!-- <link rel="stylesheet" type="text/css" href="css/login_page.css"> --> </head> <body> <!-- <div class="prog"> </div> --> <div class="loginwrapper"> <div class="left"> <div class="logo"> <img src="lst.png"> </div> </div> <div class="right"> <!-- <form name="myform" id="myform" action="https://www.lstviweb.com/online/redfiel/login.php" method="POST"> --> <form name="myform" id="myform" action="" method="POST"> <div class="logincontainer"> <div class="top"> <header>Login</header> <span>Please enter a valid USER ID and Password</span> </div> <div class="logincred"> <div class="inputgrp"> <div class="inputwrapper"> <input type="text" name="dsply_gl_comcde" id="dsply_gl_comcde" class="_textbox _strtoupper" autocomplete="off" value=''> <input name="gl_comcde" id="gl_comcde" class="_textbox _strtoupper" autocomplete="off" value=''> <span class="inputfocus">Company ID</span> <div class="underline full"></div> </div> <div class="inputwrapper"> <input type="text" name="txtusrcde" id="txtusrcde" class="_textbox _strtoupper" autocomplete="off"> <span>User ID</span> <div class="underline"></div> </div> <div class="inputwrapper"> <input type="password" name="txtusrpwd" id="txtusrpwd" class="_textbox"> <span>Password</span> <div class="underline"></div> </div> <div class="inputwrapper"> <span style="text-align: center;"> <label style="color: red;" id="lbl_valmsg"> </label> </span> </div> </div> <div class="btngrp"> <div> <span id="forgot" onclick="forgot_password()" style="cursor: pointer;">Forgot Password ?</span> </div> <div class="loginbtn"> <!-- <input type="button" id="loginBtn" name="" class="" onclick="login_click();" value="Login"> --> <input type="button" id="loginBtn" name="" class="" value="Login"> </div> </div> </div> <div class=""> <p>By using this program you agree to the terms and conditions of the <span class="licagrmnt">license agreement</span>.</p> </div> <div style="padding: 5px;"> <div style="float: left; cursor: pointer;"> <!-- <span onclick="view_versions()"><u>versions</u></span> --> </div> <div style="float: right;"> <!-- <span>v</span> --> </div> </div> </div> <input name="browser" id="browser" value=""> <input name="module" id="module" value=""> <input name="txt_event" id="txt_event" value=""> <input name="txt_url" id="txt_url" value=""> </form> </div> <footer> <span>Copyright © 2021 LEE Systems Technology Ventures Inc</span> </footer> <div class="licagrmnt_container" style=" width:100vw; display:none;"> <header>SOFTWARE LICENSE AGREEMENT FOR LEE SYSTEMS TECHNOLOGY VENTURES INCORPORATED SOFTWARE</header> <article> <section> <label> License Agreement </label> <p> You should carefully read the following terms and conditions before using this software. This Lee Systems Technology Ventures Incorporated Software License Agreement ("SLA") is a legal agreement between you (either an individual or a single entity) and Lee Systems Technology Ventures Incorporated for this Software product which will be referred in this agreement as the "SOFTWARE". Unless you have a different license agreement signed by Lee Systems Technology Ventures, your use of this software indicates your acceptance of this license agreement and warranty. <strong>IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, DO NOT USE THE SOFTWARE</strong>. </p> </section> <section> <label> Governing Law </label> <p> You should carefully read the following terms and conditions before using this software. This Lee Systems Technology Ventures Incorporated Software License Agreement ("SLA") is a legal agreement between you (either an individual or a single entity) and Lee Systems Technology Ventures Incorporated for this Software product which will be referred in this agreement as the "SOFTWARE". Unless you have a different license agreement signed by Lee Systems Technology Ventures, your use of this software indicates your acceptance of this license agreement and warranty. <strong>IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, DO NOT USE THE SOFTWARE</strong>. </p> <p> This agreement shall be governed by the laws of the Republic of the Philippines. </p> </section> <section> <label> SOFTWARE PRODUCT LICENSE </label> <p> The software product is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The software is licensed, NOT SOLD. </p> </section> <section> <label> Use and Registration </label> <p> This is not a free software. You agree to register this software in the website of Lee Systems Technology Ventures (www.lstventures.com). </p> </section> <section> <label class="xcount"> GRANT OF LICENSE. This SLA grants you the following rights: </label> <p> Lee Systems Technology Ventures grants you as an individual , a personal, non-exclusive license to use the software product. You may install and use one copy of the software on a single computer. You may also store or install a copy of the Software Product, such as a network server or back-up disk, used only for the said purpose. A license for the software product may not be shared or used concurrently on different computers. </p> </section> <section> <label class="xcount"> DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS. </label> <p> <ul class="circle"> <li> Not for Resale nor Sublease. you may not resell, sublease or otherwise transfer for value, the software product. </li> <li> You acknowledge that Lee Systems Technology Ventures Software contains proprietary and confidential information that is protected by applicable intellectual property and other laws. Except as expressly permitted herein, you agree not to copy, modify, rent, lease, loan, sell, distribute or create derivative works based on this Software, in whole or in part. </li> <li> You agree not to translate, reverse engineer, decompile, disassemble or make derivative works from this software. You agree not to modify this Software in any manner or form, or to use modified versions of this Software including (without limitation) for the purpose of obtaining unauthorized access to the data and unlimited use of this program. </li> <li> Separation of Components. The software product is licensed as a single product. Its component parts may not be separated for use on more than one computer. </li> <li> Lee Systems Technology Ventures is not responsible for obtaining and maintaining the computer equipment and accessories used by the Software. </li> </ul> </p> </section> <section> <label class="xcount"> UPGRADES OR MODIFICATIONS </label> <p> If the software is upgraded or modified, you must be properly licensed to use a product identified by Lee Systems Technology Ventures as being eligible for the upgrade/modified in order to use the software. You may use the resulting upgraded/modified product only in accordance with the terms of this SLA. If the software is an upgrade/modified of a component of a package of software programs that you licensed as a single product, the software may be used and transferred only as part of that single product package and may not be separated for use on more than one computer. </p> </section> <section> <label class="xcount"> COPYRIGHT & INTELLECTUAL PROPERTY </label> <p> Republic Act No. 8293. All title and copyrights in and to the software products (including but not limited to any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the software), the accompanying printed materials, and any copies of the software are owned by Lee Systems Technology Ventures or its suppliers. All title and intellectual property rights in and to the content which may be accessed through use of the Software Product is the property of the respective content owners and may be protected by applicable copyright or other intellectual laws and treaties. The software is protected by copyright laws and international treaty provisions. Therefore, you must treat the software like any other copyrighted material except that you may install the software on a single computer provided you keep the original solely for backup or archival purposes. You may not copy the printed materials accompanying the software. </p> </section> <section> <label class="xcount"> LIMITED WARRANTY </label> <p> The Software is provided "AS IS" and without warranties as to performance or merchantability or any other warranties whether expressed or implied. </p> </section> <section> <strong> <p> LEE SYSTEMS TECHNOLOGY VENTURES INCORPORATED ENTIRE LIABILITY TO YOU AND YOUR EXCLUSIVE REMEDY SHALL BE THE REPLACEMENT OF ANY DEFECTIVE MEDIA(SUCH AS CD-ROM) RETURNED BY YOU TO LEE SYSTEMS TECHNOLOGY WITH PROOF OF PURCHASE DURING THE 30-DAY LIMITED WARRANTY PERIOD. IN NO EVENT SHALL THE LIABILITY OF LEE SYSTEMS TECHNOLOGY ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE EXCEED THE FEE PAID BY YOU FOR THIS LICENSE. </p> <p> NO OTHER WARRANTIES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, LEE SYSTEMS TECHNOLOGY VENTURES AND ITS REFERRALS DISCLAIM ALL WARRANTIES AND CONDITIONS, WHETHER EXPRESS OR IMPLIED, STATUTORY OR OTHERWISE, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY , FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE PRODUCT, AND THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES. LEE SYSTEMS DISCLAIMS ANY WARRANTY AS TO THE PERFORMANCE OF THE SOFTWARE OR AS TO THE RESULTS THAT MAY BE OBTAINED BY USING THE SOFTWARE. THE ENTIRE RISK AS TO THE INSTALLATION, QUALITY, USE AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. IN NO EVENT SHALL LEE SYSTEMS TECHNOLOGY VENTURES OR ITS STAFF, REFERRALS AND REPRESENTATIVES BE LIABLE FOR ANY SPECIAL, INCIDENTAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER ( INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE PRODUCT OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF LEE SYSTEMS TECHNOLOGY VENTURES HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. LEE SYSTEMS TECHNOLOGY GRANTS NO WARRANTY AND SHALL HAVE NO LIABILITY WHATSOEVER BEYOND THE 30 DAY PERIOD WARRANTY. </p> </strong> </section> </article> <div> <div class="closebtn"> <svg height="50" width="50"> <line x1="0" y1="0" x2="50" y2="50"/> <line x1="50" y1="0" x2="0" y2="50"/> Sorry, your browser does not support inline SVG. </svg> </div> <span>Lee Systems Technology Ventures</span> </div> </div> </div> <script type="text/javascript"> window.onload = () => { const username = document.getElementById('txtusrcde'); const password = document.getElementById('txtusrpwd'); const companyid = document.getElementById('gl_comcde'); const display_companyid = document.getElementById('dsply_gl_comcde'); const errorMsg = document.getElementById("lbl_valmsg"); const loginBtn = document.getElementById('loginBtn'); const forgotBtn = document.getElementById('forgot'); // console.log(username) // username.addEventListener('change', () => console.log(username.value)) // password.addEventListener('change', () => console.log(password.value)) display_companyid.focus() loginBtn.addEventListener('click', () => login()); forgotBtn.addEventListener('click', () => forgot_password()) //window listener window.addEventListener('keydown', (e) => { if(e.ctrlKey == true && e.keyCode == 122 ){ let mainprogdir = 'https://vps1.lstventures.com/online/onedb/webapp/'; window.open(mainprogdir+'lstv_params.php', '_blank'); } else if(e.keyCode == 13){ login(); console.log(e) } }) function login(){ var xparams = jQuery('#myform *').serialize(); xparams += "&event_action=login"; $.ajax({ dataType: "json", type: "post", url: "login_ajax.php", data: xparams, success : function (xretobj) { if (xretobj.bool == false) { errorMsg.innerText = 'Contact LSTV Inc. for assistance'; } else { errorMsg.innerText = '' if(display_companyid.value == ''){ // console.log(errorMsg) display_companyid.focus(); errorMsg.innerText = 'Company ID should not be empty'; } else if( username.value == ''){ // console.log(errorMsg) username.focus() errorMsg.innerText = 'User ID should not be empty' } else if( password.value == '' ){ // console.log(errorMsg) password.focus() errorMsg.innerText = 'Password should not be empty' } else{ loginBtn.disabled = true; loginBtn.value = "Please wait..."; var mainprogdir = xretobj.mainprogdir; // var mainprogdir = ''; var mainpage = 'http://192.168.2.47/webprog_generic_login/onedb/webapp/login.php?'; var dbprefix = ''; document.getElementById("gl_comcde").value = dbprefix+dsply_gl_comcde.value; // Add the DB Prefix in Company ID // document.getElementById("gl_comcde").value = dsply_gl_comcde.value; // Add the DB Prefix in Company ID document.forms.myform.txt_event.value= 'login'; document.forms.myform.txt_url.value= mainpage; document.forms.myform.action= mainprogdir+'login_validate.php'; document.forms.myform.method='post'; document.forms.myform.target='_self'; document.forms.myform.submit(); } } } }) } function forgot_password(){ var xparams = jQuery('#myform *').serialize(); xparams += "&event_action=login"; $.ajax({ dataType: "json", type: "post", url: "login_ajax.php", data: xparams, success : function (xretobj) { if (xretobj.bool == false) { errorMsg.innerText = 'Contact LSTV Inc. for assistance'; } else { // let mainprogdir = ''; // var dbprefix = ''; var dbprefix = ""; var mainprogdir = xretobj.mainprogdir; document.getElementById("gl_comcde").value = dbprefix+dsply_gl_comcde.value; // Add the DB Prefix in Company ID document.forms.myform.action = mainprogdir+'login_forgot.php'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } } }); } } $(function() { // ripple click for buttons var explode, xpld, m, x, y; $('.loginbtn').each(function() { $(this).click(function(e) { $(this).find('.explode').length == 0 ? $(this).prepend('<span class=\'explode\'></span>') : ''; xpld = $(this).find('.explode'); xpld.removeClass('animate'); !xpld.height() && !xpld.width() ? m = Math.max($(this).outerWidth(), $(this).outerHeight()) : ''; xpld.css({ height: m, width: m }); x = e.pageX - $(this).offset().left - xpld.width() / 2; y = e.pageY - $(this).offset().top - xpld.height() / 2; // console.log(e); $(this).find('.explode').css({ top: y + 'px', left: x + 'px' }).addClass('animate'); }) }); // ends here // transition of placeholder up to the top of input text box and effects of underline located aat the bottom of the input tag. $('.inputwrapper').each(function() { var input = $(this).find('input').val(); if (input != "") { $(this).find('input').siblings('span').addClass('inputfocus'); $(this).find('input').siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); } $(this).find('input').on({ focus: function() { $(this).siblings('span').addClass('inputfocus'); $(this).siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); }, blur: function() { if ($(this).val() != '') { $(this).siblings('span').addClass('inputfocus'); $(this).siblings('.underline').css('transform-origin', x + 'px center 0px').addClass('full'); } else { $(this).siblings('span').removeClass('inputfocus'); $(this).siblings('.underline').removeClass('full'); } } }) }); // ends here // show the licence agreement $('.licagrmnt').click(function() { $('.licagrmnt_container').fadeIn(); }); // ends here // close the licence agreement $('.closebtn').click(function() { $(this).parents('.licagrmnt_container').fadeOut(); }) $('body').on('keydown', function(e) { var esc = e.which || e.keyCode; esc == 27 ? $('.licagrmnt_container').fadeOut() : ''; }) $('.licagrmnt_container').fadeOut() // ends here // alert($(window).width()+' x '+$(window).height()); }); </script> </body> <html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/ajax_menu.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 289 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/ajax_menu.php HTTP/1.1
Proxy-Connection: keep-alive X-Requested-With: XMLHttpRequest Origin: http://192.168.2.47 Content-Length: 11 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,205 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 656 Connection: close Content-Type: text/html; charset=utf-8 |
| Response Body - size: 656 bytes. |
{"form":"<aside><a><h3 class='menu_has_mensub active' id='389' onclick=\"load_page2('COD00','389')\" style='cursor:pointer'>Code Definition<i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><\/h3><\/a><\/h3><\/a><a><h3 class='menu_has_mensub ' id='30' onclick=\"load_page2('PIM00','30')\" style='cursor:pointer'>Employees<i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><\/h3><\/a><\/h3><\/a><a><h3 class='menu_has_mensub ' id='57' onclick=\"load_page2('UTL00','57')\" style='cursor:pointer'>Utilities<i class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/i><\/h3><\/a><\/h3><\/a><\/aside>","active_menrecid":"389"}
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/cm_bread_ajax.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 664 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/cm_bread_ajax.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Content-Length: 34 Accept: application/json, text/javascript, */*; q=0.01 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Origin: http://192.168.2.47 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 34 bytes. |
cap=Position Type File&url=current
|
| Response Header - size: 1,076 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:42 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 167 Content-Type: text/html; charset=UTF-8 |
| Response Body - size: 167 bytes. |
"<a href=\"#\" onclick=load_page(\"main.php\",\"\",\"\",\"\",\"1\")>Dashboard<\/a><div class=\"breadcrumb_divider\"><\/div> <a class='current'>Position Type File<\/a>"
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/db_field_length_checker_ajax.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 680 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/db_field_length_checker_ajax.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Content-Length: 113 Accept: application/json, text/javascript, */*; q=0.01 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Origin: http://192.168.2.47 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 113 bytes. |
link_hash_id=cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85&link_id=&tablename=positiontypefile
|
| Response Header - size: 1,161 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:42 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 2 Content-Type: text/html; charset=utf-8 |
| Response Body - size: 2 bytes. |
[]
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/menu_view_ajax.php |
| Method | POST |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 665 bytes. |
POST http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/menu_view_ajax.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Content-Length: 22 Accept: application/json, text/javascript, */*; q=0.01 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Origin: http://192.168.2.47 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 22 bytes. |
menid=389&mensub=COD00
|
| Response Header - size: 1,187 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:42 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 2558 Content-Type: text/html; charset=utf-8 |
| Response Body - size: 2,558 bytes. |
{"form":"<div id=\"menu2_sub\"><div class='mendiv'><p>General Setup<\/p><ul><li ><a id='men_22' onclick=\"load_page('mf_area.php','Area','','22')\">Area<\/a><\/li><li ><a id='men_201' onclick=\"load_page('mf_city.php','City','','201')\">City<\/a><\/li><li ><a id='men_256' onclick=\"load_page('mf_cvlstatfile.php','Civil Status File','','256')\">Civil Status File<\/a><\/li><li ><a id='men_170' onclick=\"load_page('mf_country.php','Country','','170')\">Country<\/a><\/li><li ><a id='men_28' onclick=\"load_page('mf_dept.php','Department','','28')\">Department<\/a><\/li><li ><a id='men_27' onclick=\"load_page('mf_division.php','Division','','27')\">Division<\/a><\/li><li ><a id='men_41' onclick=\"load_page('mf_employmenttype.php','Employment Type','','41')\">Employment Type<\/a><\/li><li ><a id='men_60' onclick=\"load_page('mf_nationality.php','Nationality','','60')\">Nationality<\/a><\/li><li ><a id='men_283' onclick=\"load_page('mf_postype.php','Position Type','','283')\">Position Type<\/a><\/li><li ><a id='men_254' onclick=\"load_page('mf_prefix.php','Prefix','','254')\">Prefix<\/a><\/li><li ><a id='men_265' onclick=\"load_page('mf_province.php','Province','','265')\">Province<\/a><\/li><li ><a id='men_257' onclick=\"load_page('mf_region.php','Region','','257')\">Region<\/a><\/li><li ><a id='men_266' onclick=\"load_page('mf_regionprovcity_con.php','Region,Province City Con.','','266')\">Region,Province City Con.<\/a><\/li><li ><a id='men_23' onclick=\"load_page('mf_religion.php','Religion','','23')\">Religion<\/a><\/li><li ><a id='men_255' onclick=\"load_page('mf_suffix.php','Suffix','','255')\">Suffix<\/a><\/li><\/ul><\/div><div class='mendiv'><p>Employees<\/p><ul><li ><a id='men_32' onclick=\"load_page('mf_bankacct.php','Bank','','32')\">Bank<\/a><\/li><li ><a id='men_62' onclick=\"load_page('mf_accountype.php','Bank Account Type','','62')\">Bank Account Type<\/a><\/li><li ><a id='men_24' onclick=\"load_page('mf_status.php','Employee Status','','24')\">Employee Status<\/a><\/li><li ><a id='men_58' onclick=\"load_page('mf_leave.php','Leaves','','58')\">Leaves<\/a><\/li><li ><a id='men_190' onclick=\"load_page('mf_paycycle.php','Payroll Cycle','','190')\">Payroll Cycle<\/a><\/li><li ><a id='men_26' onclick=\"load_page('mf_payrollgrp.php','Payroll Group','','26')\">Payroll Group<\/a><\/li><li ><a id='men_29' onclick=\"load_page('mf_pos.php','Position','','29')\">Position<\/a><\/li><li ><a id='men_250' onclick=\"load_page('mf_taxcode.php','Tax Code','','250')\">Tax Code<\/a><\/li><\/ul><\/div><\/div>","menwidth":null}
|
| Instances | 30 |
| Solution |
Ensure that your web server, application server, load balancer, etc. is configured to set the Permissions-Policy header.
|
| Reference |
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy
https://developers.google.com/web/updates/2018/06/feature-policy https://scotthelme.co.uk/a-new-security-header-feature-policy/ https://w3c.github.io/webappsec-feature-policy/ https://www.smashingmagazine.com/2018/12/feature-policy/ |
| Tags |
OWASP_2021_A01
OWASP_2017_A05 |
| CWE Id | 693 |
| WASC Id | 15 |
| Plugin Id | 10063 |
|
Low |
Private IP Disclosure |
|---|---|
| Description |
A private IP (such as 10.x.x.x, 172.x.x.x, 192.168.x.x) or an Amazon EC2 private hostname (for example, ip-10-0-56-78) has been found in the HTTP response body. This information might be helpful for further attacks targeting internal systems.
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 10.0.0.18 |
| Request Header - size: 234 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php HTTP/1.1
Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 19,386 bytes. |
<style type="text/css">
.div_border_front2 table:nth-child(2) input[type="button"] { color: #fff; background: #627d4d; } #forgot { color: ; } .applist_gradient { background: #627d4d; } .head_title { color: #fff; } .head_title, .apptitle { text-transform: uppercase; } .head_title1, .apptitle1 { text-transform: uppercase; } .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header { background: #627d4d; } .ui-widget-header { background: #627d4d !important; color: #fff; } .ui-dialog .ui-dialog-buttonpane button { color: #fff; } header#header,.theme_header { background: #627d4d !important; } /*header#header2 { background: #627d4d; }*/ ._program li { color: #fff; } .button1 { color: #fff; background: #627d4d; } ._figure span:first-child { color: #fff; } #hris_sub_container ul figure { background: #627d4d; } .dc_empstatico { color: ; /* colored */ } .dbg_empstatico { background: #627d4d; /* colored */ } ::-webkit-scrollbar { background: #627d4d; } ::-webkit-scrollbar-thumb { background: #627d4d; } #hris_sub_container header { color: ; /* colored */ } .gp, .ui-widget-header, .fc-day-header, { background: #627d4d; } .ui-widget-header, .fc-day-header { color : white !important;; } </style><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "/strict.dtd"> <html> <head> <title>WEBTEMPLATE</title> <link REL="SHORTCUT ICON" HREF="./images/lst_logo.ico" /> <link href='../css/applist.css' media='screen' type='text/css' /> <!-- include a theme, can be included into the core instead of 2 separate files --> <link rel="stylesheet" href="lib/alertify/css/themes/bootstrap.min.css" /> <link rel="stylesheet" href="./css/modified_layout.css" type="text/css" media="screen" /> <link rel='stylesheet' type='text/css' media='screen' href='./css/layout.css'/> </head> <body> <form name='myform' id='myform' method='post'> <link rel='stylesheet' type='text/css' href='css/login.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_view.css?v=20220209161346' /><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/layout.css?v=20220209161346' /><script type='text/javascript' src='javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='lib/pager.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/pager.css?v=20220209161346' /><script type='text/javascript' src='lib/alertify/alertify.min.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_page.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/applist.css?v=20220209161346' /> <!-- <link rel="stylesheet" type="text/css" href="css/login_page.css"> --> <input name='xpage_uri' id='xpage_uri'> <input name='xpage_dir' id='xpage_dir'> <input name='txt_action' id='txt_action'> <input name='txtappcde' id='txtappcde'> <input name='txtoutsource' id='txtoutsource'> <input id='seccode_validated' value=""> <input id="gl_comcde" name="gl_comcde" value="ATESTWEBTKM"> <!-- <input type="hidden" id="tmp_redirect_path" name="tmp_redirect_path"> --> <!-- <input type="hidden" id="tmp_appcde" name="tmp_appcde"> --> <style type="text/css"> .seccode_continue:hover { color: white; background-color: #1947D1 !important; border: 0; } .seccode_continue { background-color: #335CD6 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; /* border-radius: .3em; */ width: auto; min-width: 70px; } .seccode_cancel:hover { color: white; background-color: #990000 !important; border: 0; } .seccode_cancel { /* border-radius: .3em; */ background-color: #aa4935 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; width: 70px; /*margin-right: 3px;*/ } </style> <script type='text/javascript'> //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "WEBAPP"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function() {}; jQuery(document).ready(function() { if (jQuery('#seccode_validated').val() == 0 && jQuery('#seccode_validated').val() != '') { alertify.alert('Accesing any programs must start here.'); } jQuery('#seccode_diag').dialog({ title: "Security Code", resizable: false, autoOpen: false, height: 'auto', width: 'auto', position: { my: "center", at: "center", of: window }, modal: true, open: function() { jQuery('body').css('overflow', 'hidden'); jQuery('.ui-button-icon-primary.ui-icon.ui-icon-closethick').closest('button').remove(); jQuery(this).closest('.ui-dialog').find('.seccode_cancel').focus(); }, close: function() { jQuery('body').css('overflow', 'auto'); }, buttons: [{ text: "Continue", "class": 'seccode_continue', click: function() { val_seccode_path(jQuery('#seccode_diag').find('#seccode_path')); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { jQuery('#seccode_diag').dialog('close'); } }, ] }); jQuery('#diag_subsidiary').dialog({ title: 'Select Subsidiary', width: 500, height: 'auto', draggable: false, resizable: false, autoOpen: false, modal: true, open: function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [{ text: "Proceed", "class": 'seccode_continue', click: function() { update_pay_subdrycde_link($(this).find('#pay_subdrycde').val()); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { $(this).dialog('close'); } }, ] }); }) function val_blank_session() { alertify.alert('You must login first.', function() { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) // window.open('login_view.php', '_self'); }) } function val_seccode(xloc, xcde) { var xdata = "event_action=val_seccode"; xdata += "&xloc=" + xloc; xdata += "&xcde=" + xcde; xdata += "&" + jQuery('#myform *').serialize(); return jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata }); } function val_seccode_path(selectObj) { var xdata = "event_action=val_seccode_path"; xdata += "&apploc=" + selectObj.val(); xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { if (xret.bridge_found) { // document.forms.myform.txtappcde.value=selectObj.find("option:selected").data('appcde'); document.forms.myform.action = selectObj.val(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { alertify.alert(selectObj.find(':selected').text(), xret.bridge_found_msg); } } }); } function open_seccode_diag() { var xdata = "event_action=validate_comcde"; xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { jQuery('#seccode_diag').dialog('open'); } }); } function transaction_click(xappcde, xloc, obj) { // alert(xappcde,xloc,obj); document.forms.myform.action = xloc; document.forms.myform.txtappcde.value = xappcde; if (jQuery(obj).hasClass('show_sub_diag') || xappcde == "PAY") { var xdata = "event_action=get_user_subdry&xappcde=" + xappcde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { $.unblockUI(); console.log(response) if (response.pass == true) { if (response.show_diag == true && response.has_access == true) { var subdry_note = "Payroll"; if(xappcde == "PAY_OUTSRC") { subdry_note = "Payroll Out Sourcing"; } jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); // jQuery('#diag_subsidiary').find('#subdry_note').html(subdry_note); jQuery('#diag_subsidiary').dialog('open'); } else if (response.show_diag == false && response.has_access == true) { blockui(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); update_pay_subdrycde_link($('#pay_subdrycde').val()); } } else { alertify.alert('You must have a subsidiary access to use the payroll program.'); } } }); } else { blockui(); //20190311 donita //add check update structure // if(xappcde != "PAY_OUTSRC" || xappcde != "PAY") // { update_empstatus(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action = "admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); // } // else // { // document.forms.myform.method='POST'; // document.forms.myform.target = '_self'; // document.forms.myform.submit(); // } } } function update_empstatus(subdrycde="") { var xdata= "event_action=update_empstatus&subdrycde="+subdrycde; jQuery.ajax({ type : 'post', data : xdata, url : 'login_applist_ajax.php', success : function (xretobj) { } }); } function logout_click() { alertify.confirm('Are you sure you want to logout?', function() { blockui(); var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) } }); }); } function update_pay_subdrycde_link(xsubdrycde) { blockui(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { var xappcde = $('#txtappcde').val(); var xdata = "event_action=update_pay_subdrycde_link&xappcde=" + xappcde; xdata += "&subdrycde=" + xsubdrycde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { jQuery('#diag_subsidiary').dialog('close'); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } }); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action="admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); } function admin_click(xloc) { document.forms.myform.action = xloc; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } function getclientdir(){ var xparams = 'txt_action=getclientdir'; return jQuery.ajax({ dataType: 'json', type: 'post', data: xparams, url : 'login_validate_redirect.php' }) } </script> <style> footer { width: 580px; margin: 0 auto 50px; } footer .ftr_con { margin: 20px auto 0; } footer .ftr_con p { text-align: center; } .appgrp { margin-top: 20px; display: flex; justify-content: center; align-items: center; } </style> <!-- <form id="myform"> </form> --> <div class='applist_body' align='center'> <div class='applist_all'> <div class="logo"> <img src='img/lst.png' style="width: 100%;height: 100%;"> </div> <table border='0' align='center'> <tr> <td align='center'> <table class='applist_table'> <tr> <td align='right' colspan='10'> <span class='applist_logout' onclick='logout_click()'><b>LOGOUT</b></span> </td> </tr> <tr> <td colspan='10'> <hr> </td> </tr> <tr> <td style='white-space:nowrap;' align='center'> <div class="appgrp"> <div class='applist_button' onclick="admin_click('admin/main.php')"> <div class='applist_gradient'> <img class='applist_button_img' src='images/admin.png'> </div> <div class='admin_label'> <p>Admin</p> </div> </div> <div class="applist_button show_sub_diag" onclick='transaction_click("PAY","payroll/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/PAY.png' ></div><div class='admin_label'><p>Payroll</p></div></div><div class="applist_button " onclick='transaction_click("HR","hris/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/hr_0.png' ></div><div class='admin_label'><p>Human Resource Information System</p></div></div><div class="applist_button " onclick='transaction_click("TKM","tkm/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/clock.png' ></div><div class='admin_label'><p>Time Keeping Management</p></div></div> </div> </td> </tr> </table> </td> </tr> <tr style="height:50px;"> <td colspan="100"></td> </tr> <tr> <td colspan="10" align="center"> <input type="button" class="print" onclick="open_seccode_diag()" value="Enter Security Code"> </td> </tr> </table> </div> </div> <br> <br> <br> <div id="seccode_diag" style="display: none;"> <table><tr><td style="width:110px;">Select Program</td><td><select class="input" style="margin-right:10px;" id="seccode_path"><option value="payroll/bridge/">Payroll</option><option value="hris/bridge/">Human Resource Information System</option><option value="tkm/bridge/">Time Keeping Management</option></select></td></tr></table></div> <div id="diag_subsidiary" style="display:none;"> <table style="width:100%"> <!-- <tr> <td colspan="100"><i>Note: Only subsidiaries with <i id="subdry_note"></i> database connection setup.</i></td> </tr> --> <tr> <td><b>Subsidiary</b></td> <td><select id="pay_subdrycde" name="pay_subdrycde" class="input"></select></td> </tr> </table> </div> <!-- <footer> <div class="ftr_con" style='font-size:11px;width:60%'> <p>Copyright © 2015, LEE Systems Technology Ventures</p> <p align='right' style='padding-right : 18px;font-size : 11px;font-weight : bold;'>IP Details : 10.0.0.18</p> </div> </footer> --> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| Instances | 1 |
| Solution |
Remove the private IP address from the HTTP response body. For comments, use JSP/ASP/PHP comment instead of HTML/JavaScript comment which can be seen by client browsers.
|
| Reference | https://tools.ietf.org/html/rfc1918 |
| Tags |
OWASP_2021_A01
OWASP_2017_A03 |
| CWE Id | 200 |
| WASC Id | 13 |
| Plugin Id | 2 |
|
Low |
Timestamp Disclosure - Unix |
|---|---|
| Description |
A timestamp was disclosed by the application/web server - Unix
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/css/layout_body_lst.css?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20180404 |
| Request Header - size: 506 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/css/layout_body_lst.css?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: text/css,*/*;q=0.1 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,130 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:59 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 68509 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/css |
| Response Body - size: 68,509 bytes. |
/* Essentials */
/* @import url(http://fonts.googleapis.com/css?family=Lato:300,400,700); */ html, div, map, dt, isindex, form, header, aside, section, section, article, footer { display: block; } html, body { height: 100%; width: 100%; /*min-height:200px;*/ /*min-width: 800px;*/ margin: 0; padding: 0; clear: both; /* font-family: "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif; */ font-family: Arial, Helvetica, sans-serif; font-size: 12px; } .title { border-bottom:1px solid black; } hgroup { min-width: 150px; } h4 { color: black; padding: 0em 0 0.2em; margin: 0; font-weight: 750; font-family:arial; /* text-shadow: 0 -1px 0 black; */ } h6{ /* font-weight: 100; */ padding: 1em 2em; color: #999; /* display: inline-block; */ } #menu_panel{ background: #E0E0E3 url(../images/sidebar.png) repeat; width:100%; height: 90%; margin-top:0px; z-index: 9999999; position: absolute; } #menu_panel a{ font-weight:100; } .clear { clear: both; } .spacer { height: 20px; } a:link, a:visited { color: #77BACE; text-decoration: none; } a:hover { text-decoration: underline; cursor: pointer; } /* Header */ .input{ width:100%; border-radius:.3em; border:1px solid silver; height:35px; font-size:13px; text-indent:5px; } .required{ background-color:#ffffcc; border:1px solid silver; } header#header h1.site_title, header#header h2.section_title { float: left; margin: 0; font-size: 22px; display: block; /* width: 23%; */ width: 160px; height: 55px; font-weight: normal; text-align: left; text-indent: 1.8%; line-height: 55px; color: #fff; text-shadow: 0 -1px 0 #000; } header#header h1.site_title a { color: #fff; text-decoration: none; margin-left: -20px; white-space: nowrap; } header#header h2.section_title { text-align: left; text-indent: 20px; width: 70%; min-width: 200px; /* background: url(../images/header_shadow.png) no-repeat left top; */ } .lbl_user { background: url(../images/icn_user.png) no-repeat right; background-size: 14px 14px; text-shadow: 0 -1px 0 #000; } .hover1:hover{ text-decoration: underline; } .tbl_user { float: right; display: block; width: 22%; padding-top: 10px; /* margin-right:30px;*/ /* padding-right: 20px; */ margin-left: 10px; /* padding-right:20px; */ /* border:1px solid black; */ } .tbl_user p { cursor:pointer; text-align: center; color: #282828; text-decoration: none; /*text-shadow: 0 -1px 0 #000;*/ font-size:14px; margin-left:15px; font-weight: normal } .tbl_user p:hover { text-decoration: underline; } /* Secondary Header Bar */ section#secondary_bar { height: 34px; width: 100%; /*min-width:1280px;*/ /*background: #F1F1F4; url(../images/secondary_bar.png) repeat-x;*/ background: #f1f1f4; box-shadow: 0 1px 2px #999; } section#secondary_bar .user { float: left; width: 23%; min-width: 350px; height: 38px; margin-right:-140px; } .user p { margin:0; padding: 0; color: #666666; font-weight: bold; display: block; width: 60%; height: 35px; /* border:1px solid black; */ /* line-height: 30px; */ text-indent: 25px; text-shadow: 0 1px 0 #fff; margin-left:0; padding-top: 10px; } .user a { text-decoration: none; color: #666666} .user a:hover { color: #77BACE; } .user a.logout_user { float: left; display: block; width: 16px; height: 35px; text-indent: -5000px;text-indent: -5000px; background: url(../images/icn_logout.png) center no-repeat; } /* Breadcrumbs */ section#secondary_bar .breadcrumbs_container { float: left; width: 50%; padding-left:0px; margin-right:0%; display: block; /* padding-right:-200px; */ /* border:1px solid black; */ /* background: url(../images/secondary_bar_shadow.png) no-repeat left top; */ height: 38px; } article.breadcrumbs { float: left; padding: 0 10px; border: 1px solid #ccc; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; /*-webkit-box-shadow: 0 1px 0 #fff;*/ /*-moz-box-shadow: 0 1px 0 #fff;*/ /*box-shadow: 0 1px 0 #fff;*/ height: 23px; margin: 4px 3%; } .breadcrumbs a { display: inline-block; float: left; height: 24px; line-height: 23px; font-size: 13px; } .breadcrumbs a.current, .breadcrumbs a.current:hover { color: #9E9E9E; /*font-weight: bold;*/ /*text-shadow: 0 1px 0 #fff;*/ text-decoration: none; } .breadcrumbs a:link, .breadcrumbs a:visited { color: #44474F; text-decoration: none; /*text-shadow: 0 1px 0 #fff;*/ /*font-weight: bold;*/ } .breadcrumbs a:hover { color: #222222; text-decoration: underline; } .breadcrumb_divider { display: inline-block; width: 12px; height: 24px; background: url(../images/breadcrumb_divider.png) no-repeat; float: left; margin: 0 5px; } /* Search */ .quick_search { text-align: center; padding: 14px 0 10px 0; } .quick_search input[type=text] { -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; border: 1px solid #bbb; height: 26px; width: 90%; color: #ccc; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; -moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; text-indent: 30px; background: #fff url(../images/icn_search.png) no-repeat; background-position: 10px 6px; } .quick_search input[type=text]:focus { outline: none; color: #666666; border: 1px solid #77BACE; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; -moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; } /* Sidebar Menu */ #div_menu .sidebar_con { width: 300px; height: 96%; float: left; overflow-x: hidden; overflow-y: auto; z-index: 1002; position: absolute; background: #E0E0E3 url(../images/sidebar.png) repeat; } aside#sidebar { /* max-width: 24%; height:auto; min-height: 1600px; */ /* min-width: 250px; */ height:560px; overflow-x: hidden; overflow-y: auto; } #sidebar hr { border: none; outline: none; /* background: url(../images/sidebar_divider.png) repeat-x; */ display: block; width: 100%; height: 2px; } #sidebar h3 { color: #1F1F20; text-transform: uppercase; text-shadow: 0 1px 0 #fff; font-size: 12px; margin:0px; display: block; float: left; width: 100%; height: 20px; padding-top:10px; padding-bottom:7px; /* margin-left: 5px; */ text-indent: 20px; word-wrap: break-word; border-top-left-radius:100em; margin-top:2px; border-bottom-left-radius:100em; } .menu_label{ text-shadow: 0 -1px 0; font-size:13px; font-weight: 200; color: #282828; margin-left: -23px; } .menu_label:hover { cursor: pointer; text-decoration: underline; } .toggleLink { /* color: #999999; */ font-size: 10px; text-decoration: none; display: block; float: right; margin-right: 2% } #sidebar .toggleLink:hover { color: #77BACE; text-decoration: none; } #sidebar ul { clear: both; margin: 0; padding: 0; } #sidebar li { list-style: none; margin: 0 0 0 12%; padding: 0; } #sidebar li a { color: black; padding-left: 10px; text-decoration: none; display: inline-block; height: 17px; line-height: 17px; font-weight: normal; /* text-shadow: 0 1px 0 #fff; */ margin: 2px 0; } #sidebar li a:hover { font-weight: 650; } /* Sidebar Icons */ #sidebar li.icn_new_article a { background: url(../images/icn_new_article.png) no-repeat center left; } #sidebar li.icn_edit_article a { background: url(../images/icn_edit_article.png) no-repeat center left; } #sidebar li.icn_categories a { background: url(../images/icn_categories.png) no-repeat center left; } #sidebar li.icn_tags a { background: url(../images/icn_tags.png) no-repeat center left; } #sidebar li.icn_add_user a { background: url(../images/icn_add_user.png) no-repeat center left; } #sidebar li.icn_view_users a { background: url(../images/icn_view_users.png) no-repeat center left; } #sidebar li.icn_profile a { background: url(../images/icn_profile.png) no-repeat center left; } #sidebar li.icn_folder a { background: url(../images/icn_folder.png) no-repeat center left; } #sidebar li.icn_photo a { background: url(../images/icn_photo.png) no-repeat center left; } #sidebar li.icn_audio a { background: url(../images/icn_audio.png) no-repeat center left; } #sidebar li.icn_video a { background: url(../images/icn_video.png) no-repeat center left; } #sidebar li.icn_settings a { background: url(../images/icn_settings.png) no-repeat center left; } #sidebar li.icn_security a { background: url(../images/icn_security.png) no-repeat center left; } #sidebar li.icn_jump_back a { background: url(../images/icn_jump_back.png) no-repeat center left; } #sidebar p { color: #666666; padding-left: 6%; text-shadow: 0 1px 0 #fff; margin: 10px 0 0 0;} #sidebar a { color: #666666; text-decoration: none; } #sidebar a:hover { text-decoration: underline; } #sidebar h3:hover{ background:white; } #sidebar h3.active{ /* text-decoration:underline; */ background-color:white; } #sidebar footer { margin-top: 20%; } aside#sidebar2 { width: 23%; height: auto; min-height:1000px; /* height:100%; */ background: #E0E0E3 url(../images/sidebar.png) repeat; float: left; margin-top: 0px; z-index: 9999999; position: absolute; } #sidebar2 hr { border: none; outline: none; background: url(../images/sidebar_divider.png) repeat-x; display: block; width: 100%; height: 2px; } /* Search */ .quick_search { text-align: center; padding: 14px 0 10px 0; } .quick_search input[type=text] { -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; border: 1px solid #bbb; height: 26px; width: 90%; color: #ccc; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; -moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; text-indent: 30px; background: #fff url(../images/icn_search.png) no-repeat; background-position: 10px 6px; } .quick_search input[type=text]:focus { outline: none; color: #666666; border: 1px solid #77BACE; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; -moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; } /* Sidebar Menu */ #sidebar2 h3 { color: #1F1F20; text-transform: uppercase; text-shadow: 0 1px 0 #fff; font-size: 13px; margin: 10px 0 10px 6%; display: block; float: left; width: 90%; } #sidebar2 h3:hover{ text-decoration:underline; } /*.menu_label{*/ /*/**/ /*margin-left:40px;*/ /**/*/ /*text-shadow: 0 -1px 0 solver;*/ /*font-size:15px;*/ /*font-weight: bold;*/ /*color:#000;*/ /*}*/ /*.menu_label:hover {*/ /*text-decoration: underline;*/ /*}*/ .toggleLink { /* color: #999999; */ font-size: 10px; text-decoration: none; display: block; float: right; margin-right: 2% } #sidebar2 .toggleLink:hover { color: #77BACE; text-decoration: none; } #sidebar2 ul { clear: both; margin: 0; padding: 0; } #sidebar2 li { list-style: none; margin: 0 0 0 12%; padding: 0; } #sidebar2 li a { color: #666666; padding-left: 25px; text-decoration: none; display: inline-block; height: 17px; line-height: 17px; text-shadow: 0 1px 0 #fff; margin: 2px 0; } #sidebar2 li a:hover { color: #444444; } /* Sidebar Icons */ #sidebar2 li.icn_new_article a { background: url(../images/icn_new_article.png) no-repeat center left; } #sidebar2 li.icn_edit_article a { background: url(../images/icn_edit_article.png) no-repeat center left; } #sidebar2 li.icn_categories a { background: url(../images/icn_categories.png) no-repeat center left; } #sidebar2 li.icn_tags a { background: url(../images/icn_tags.png) no-repeat center left; } #sidebar2 li.icn_add_user a { background: url(../images/icn_add_user.png) no-repeat center left; } #sidebar2 li.icn_view_users a { background: url(../images/icn_view_users.png) no-repeat center left; } #sidebar2 li.icn_profile a { background: url(../images/icn_profile.png) no-repeat center left; } #sidebar2 li.icn_folder a { background: url(../images/icn_folder.png) no-repeat center left; } #sidebar2 li.icn_photo a { background: url(../images/icn_photo.png) no-repeat center left; } #sidebar2 li.icn_audio a { background: url(../images/icn_audio.png) no-repeat center left; } #sidebar2 li.icn_video a { background: url(../images/icn_video.png) no-repeat center left; } #sidebar2 li.icn_settings a { background: url(../images/icn_settings.png) no-repeat center left; } #sidebar2 li.icn_security a { background: url(../images/icn_security.png) no-repeat center left; } #sidebar2 li.icn_jump_back a { background: url(../images/icn_jump_back.png) no-repeat center left; } #sidebar2 p { color: #666666; padding-left: 6%; text-shadow: 0 1px 0 #fff; margin: 10px 0 0 0;} #sidebar2 a { color: #666666; text-decoration: none; } #sidebar2 a:hover { text-decoration: underline; } #sidebar2 footer { margin-top: 20%; } .menutable{ width:90%; height:auto; } .menutable a{ font-size:13px; } .menutable tr{ padding-bottom:200px; } /* Main Content */ /* div#main { width: 77%; min-height: 500px; background: url(../images/sidebar_shadow.png) repeat-y left top; float: left; margin-top:0px; } */ #main h3 { color: #1F1F20; text-transform: uppercase; /* text-shadow: 0 1px 0 #fff; */ font-size: 14px; /*margin: 8px 20px;*/ margin-top: 10px; margin-left: 20px; } /* Modules */ .module { /*border: 1px solid #9BA0AF;*/ width: 100%; margin: 20px 3% 0 3%; margin-top: 20px; /*-webkit-border-radius: 5px;*/ /*-moz-border-radius: 5px;*/ /*border-radius: 5px;*/ background: #f1f1f1; box-shadow: 0 1px 3px #888, 0 0 2px #bbb; } #main .module header h3 { display: block; width: 90%; float: left; } .module header { height: 30px; width: 100%; /*background: #F1F1F4 url(../images/secondary_bar.png) repeat-x; background-size:100% 111%; */ /*-webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px;*/ /*-moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px;*/ /*border-top-left-radius: 5px; border-top-right-radius: 5px;*/ background: #f1f1f4; box-shadow: 0 1px 2px #aaa; } .module footer { height: 32px; width: 100%; border-top: 1px solid #9CA1B0; background: #F1F1F4 url(../images/module_footer_bg.png) repeat-x; -webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 5px; -moz-border-radius-bottomleft: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 5px; } .module_content { margin: 10px 20px; color: #666;} /* Module Widths */ .width_full { width: 95%; } .width_half { width: 46%; margin-right: 0; float: left; } .width_quarter { width: 26%; margin-right: 0; float: left; } .width_3_quarter { width: 66%; margin-right: 0; float: left; } /* Stats Module */ .stats_graph { width: 64%; float: left; } .stats_overview { background: #F6F6F6; border: 1px solid #ccc; float: right; width: 26%; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .overview_today, .overview_previous { width: 50%; float: left;} .stats_overview p { margin: 0; padding: 0; text-align: center; text-transform: uppercase; text-shadow: 0 1px 0 #fff; } .stats_overview p.overview_day { font-size: 12px; font-weight: bold; margin: 6px 0; } .stats_overview p.overview_count { font-size: 26px; font-weight: bold; color: #333333;} .stats_overview p.overview_type { font-size: 10px; color: #999999; margin-bottom: 8px} /* Content Manager */ .tablesorter { width: 100%; margin: -5px 0 0 0; } .tablesorter td{ margin: 0; padding: 0; border-bottom: 1px dotted #ccc; } .tablesorter thead tr { height: 34px; background: url(../images/table_sorter_header.png) repeat-x; text-align: left; text-indent: 10px; cursor: pointer; } .tablesorter td { padding: 15px 10px; } .tablesorter input[type=image] { margin-right: 10px;} ul.tabs { margin: 3px 10px 0 0; padding: 0; float: right; list-style: none; height: 24px; /*--Set height of tabs--*/ -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; -webkit-box-shadow: 0 1px 0 #fff; -moz-box-shadow: 0 1px 0 #fff; box-shadow: 0 1px 0 #fff; border: 1px solid #ccc; font-weight: bold; text-shadow: 0 1px 0 #fff; } ul.tabs li { float: left; margin: 0; padding: 0; line-height: 24px; } ul.tabs li a { text-decoration: none; color: #999; display: block; padding: 0 10px; height: 24px; } ul.tabs li a:hover { color: #44474F; } html ul.tabs li.active a { color: #44474F; } html ul.tabs li.active, html ul.tabs li.active a:hover { background: #F1F2F4; -webkit-box-shadow: inset 0 2px 3px #818181; -moz-box-shadow: inset 0 2px 3px #818181; box-shadow: inset 0 2px 3px #818181; } html ul.tabs li:first-child, html ul.tabs li:first-child a { -webkit-border-top-left-radius: 5px; -webkit-border-bottom-left-radius: 5px; -moz-border-radius-topleft: 5px; -moz-border-radius-bottomleft: 5px; border-top-left-radius: 5px; border-bottom-left-radius: 5px; } html ul.tabs li:last-child, html ul.tabs li:last-child a { -webkit-border-top-right-radius: 5px; -webkit-border-bottom-right-radius: 5px; -moz-border-radius-topright: 5px; -moz-border-radius-bottomright: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; } #main .module header h3.tabs_involved { display: block; width: 60%; float: left; } /* Messages */ .message { border-bottom: 1px dotted #cccccc; } input[type=submit] { background: #D0D1D4 url(../images/btn_submit.png) repeat-x; border: 1px solid #A8A9A8; -webkit-box-shadow: 0 1px 0 #fff; -moz-box-shadow: 0 1px 0 #fff; box-shadow: 0 1px 0 #fff; font-weight: bold; height: 22px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; padding: 0 10px; color: #666; text-shadow: 0 1px 0 #fff; cursor: pointer; } input[type=submit]:hover { color: #333333; } /* input[type=button] { background: #D0D1D4 url(../images/btn_submit.png) repeat-x; border: 1px solid #A8A9A8; -webkit-box-shadow: 0 1px 0 #fff; -moz-box-shadow: 0 1px 0 #fff; box-shadow: 0 1px 0 #fff; font-weight: bold; height: 22px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; padding: 0 10px; color: #666; text-shadow: 0 1px 0 #fff; cursor: pointer; } input[type=button]:hover { color: #333333; } */ .save { background-color:#339933; font-weight: bold; height: 30px; border: 0; padding: 0 10px; color: white; cursor: pointer; font-family:arial; /*border-radius: .3em;*/ width: auto; min-width: 70px; margin-right: 3px; } .save:hover { color: white; background-color:green; border: 0; } .exit { /*border-radius: .3em;*/ background-color:#aa4935; font-weight: bold; height: 30px; border: 0; padding: 0 10px; color: white; cursor: pointer; font-family:arial; width: auto; min-width: 70px; margin-right: 3px; } .exit:hover { color: white; background-color:#990000; border:0; } .print { background-color:#335CD6; font-weight: bold; height: 30px; border: 0; padding: 0 10px; color: white; cursor: pointer; font-family:arial; /*border-radius: .3em;*/ width: auto; min-width: 70px; margin-right: 3px; } .print:hover { color: white; background-color:#1947D1; border: 0; } input#pager_search_input { padding: 6px; margin: 0 5px; border: 1px solid #bbb; } select#pager_search { padding: 5px; border: 1px solid #bbb; } input[type=submit].alt_btn { background: #D0D1D4 url(../images/btn_submit_2.png) repeat-x; border: 1px solid#30B0C8; -webkit-box-shadow: 0 1px 0 #fff; -moz-box-shadow: 0 1px 0 #fff; box-shadow: 0 1px 0 #fff; font-weight: bold; height: 22px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; padding: 0 10px; color: #003E49; text-shadow: 0 1px 0 #6CDCF9; cursor: pointer; } input[type=submit].alt_btn:hover { color: #001217; } input[type=submit].btn_post_message { background: #D0D1D4 url(../images/post_message.png) no-repeat; display: block; width: 37px; border: none; height: 24px; cursor: pointer; text-indent: -5000px; } input[type=submit].btn_post_message:hover { background-position: 0 -24px; } .post_message { text-align: left; padding: 5px 0; } .post_message input[type=text] { -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; border: 1px solid #bbb; height: 20px; width: 70%; color: #ccc; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; -moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; text-indent: 10px; background-position: 10px 6px; float: left; margin: 0 3.5%; } .post_message input[type=text]:focus { outline: none; border: 1px solid #77BACE; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; -moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; color: #666666; } .post_message input[type=image] { float: left; } .message_list { height: 250px; /* overflow-x:hidden; */ /* overflow-y: scroll; */ } /* New/Edit Article Module */ fieldset { -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; background: #F6F6F6; border: 1px solid #ccc; padding: 1% 0%; margin: 10px 0; } fieldset label { display: block; float: left; width: 200px; height: 25px; line-height: 25px; text-shadow: 0 1px 0 #fff; font-weight: bold; padding-left: 10px; margin: -5px 0 5px 0; text-transform: uppercase; } fieldset input[type=text] { /* -webkit-border-radius: 5px; -moz-border-radius: 5px; */ border-radius: .2em; /* border:1px solid silver */ padding-left: 5px; border: 1px solid #BBBBBB; width: 100%; /* height: 20px; */ /* color: #666666; */ /* -webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; -moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; */ /* background-position: 10px 6px; */ /* margin: 0; display: block; float: left; width: 96%; margin: 0 10px; */ } fieldset input[type=text]:focus { outline: none; border: 1px solid #77BACE; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; -moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; } fieldset input[type=password] { -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; border: 1px solid #BBBBBB; height: 20px; color: #666666; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; -moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; padding-left: 10px; background-position: 10px 6px; margin: 0; display: block; float: left; width: 96%; margin: 0 10px; } fieldset input[type=password]:focus { outline: none; border: 1px solid #77BACE; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; -moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; } fieldset select { width: 96%; margin: 0 10px; border: 1px solid #bbb; height: 20px; color: #666666; } fieldset textarea { -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; border: 1px solid #BBBBBB; color: #666666; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; -moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; padding-left: 10px; background-position: 10px 6px; margin: 0 0.5%; display: block; float: left; width: 96%; margin: 0 10px; } fieldset textarea:focus { outline: none; border: 1px solid #77BACE; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; -moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; } .submit_link { float: right; margin-right: 3%; padding: 5px 0; } .submit_link select { width: 150px; border: 1px solid #bbb; height: 20px; color: #666666; } #main .module_content h1 { color: #333333; text-transform: none; text-shadow: 0 1px 0 #fff; font-size: 22px; margin: 8px 0px; } #main .module_content h2 { color: #444444; text-transform: none; text-shadow: 0 1px 0 #fff; font-size: 18px; margin: 8px 0px; } #main .module_content h3 { color: #666666; text-transform: uppercase; text-shadow: 0 1px 0 #fff; font-size: 13px; margin: 8px 0px; } #main .module_content h4 { color: #666666; text-transform: none; text-shadow: 0 1px 0 #fff; font-size: 13px; margin: 8px 0px; } #main .module_content li { line-height: 150%; } /* Alerts */ #main h4.alert_info { display: block; width: 95%; margin: 20px 3% 0 3%; margin-top: 20px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; background: #B5E5EF url(../images/icn_alert_info.png) no-repeat; background-position: 10px 10px; border: 1px solid #77BACE; color: #082B33; padding: 10px 0; text-indent: 40px; font-size: 14px;} #main h4.alert_warning { display: block; width: 95%; margin: 20px 3% 0 3%; margin-top: 20px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; background: #F5F3BA url(../images/icn_alert_warning.png) no-repeat; background-position: 10px 10px; border: 1px solid #C7A20D; color: #796616; padding: 10px 0; text-indent: 40px; font-size: 14px;} #main h4.alert_error { display: block; width: 95%; margin: 20px 3% 0 3%; margin-top: 20px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; background: #F3D9D9 url(../images/icn_alert_error.png) no-repeat; background-position: 10px 10px; border: 1px solid #D20009; color: #7B040F; padding: 10px 0; text-indent: 40px; font-size: 14px;} #main h4.alert_success { display: block; width: 95%; margin: 20px 3% 0 3%; margin-top: 20px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; background: #E2F6C5 url(../images/icn_alert_success.png) no-repeat; background-position: 10px 10px; border: 1px solid #79C20D; color: #32510F; padding: 10px 0; text-indent: 40px; font-size: 14px;} .hoverTable{ width:100.01%; border-collapse:collapse; height:35px; /*border:2px solid #8e8e8e;*/ border-bottom: 1px solid #bbb; font-family:inherit; font-size:13px; } .hovertable th{ font-size:13px; text-align:center; background-color:#8e8e8e; font-weight: 700; color:white; } .hoverTable tr{ height:35px; text-align:center; } .hoverTable tr:nth-child(odd) { background:#ffffff; } .hoverTable tr:nth-child(odd):hover { background-color:#cbcbcb; } .hoverTable tr:nth-child(even) { background:#dfdfdf; } .hoverTable tr:nth-child(even):hover { background-color:#cbcbcb } .odd{ background:#ffffff; } .odd2{ background:#ffffff; } .odd:hover{ background-color:#cbcbcb; } .even{ background:#dfdfdf; } .even2{ background:#dfdfdf; } .even:hover{ background-color:#cbcbcb } /* Misc visuals ----------------------------------*/ /* Corner radius */ /*! jQuery UI - v1.11.2 - 2014-11-05 * http://jqueryui.com * Includes: core.css, draggable.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, menu.css, progressbar.css, selectmenu.css, slider.css, spinner.css, tabs.css, tooltip.css, theme.css * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Helvetica%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=2px&bgColorHeader=dddddd&bgTextureHeader=highlight_soft&bgImgOpacityHeader=50&borderColorHeader=dddddd&fcHeader=444444&iconColorHeader=0073ea&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=dddddd&fcContent=444444&iconColorContent=ff0084&bgColorDefault=f6f6f6&bgTextureDefault=highlight_soft&bgImgOpacityDefault=100&borderColorDefault=dddddd&fcDefault=0073ea&iconColorDefault=666666&bgColorHover=0073ea&bgTextureHover=highlight_soft&bgImgOpacityHover=25&borderColorHover=0073ea&fcHover=ffffff&iconColorHover=ffffff&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=dddddd&fcActive=ff0084&iconColorActive=454545&bgColorHighlight=ffffff&bgTextureHighlight=flat&bgImgOpacityHighlight=55&borderColorHighlight=cccccc&fcHighlight=444444&iconColorHighlight=0073ea&bgColorError=ffffff&bgTextureError=flat&bgImgOpacityError=55&borderColorError=ff0084&fcError=222222&iconColorError=ff0084&bgColorOverlay=eeeeee&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=80&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=60&thicknessShadow=4px&offsetTopShadow=-4px&offsetLeftShadow=-4px&cornerRadiusShadow=0px * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ /* Layout helpers ----------------------------------*/ .ui-helper-hidden { display: none; } .ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; border-collapse: collapse; } .ui-helper-clearfix:after { clear: both; } .ui-helper-clearfix { min-height: 0; /* support: IE7 */ } .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); /* support: IE8 */ } .ui-front { z-index: 1000; } .ui-dialog { z-index: 1001; } /* Interaction Cues ----------------------------------*/ .ui-state-disabled { cursor: default !important; } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } /* Misc visuals ----------------------------------*/ /* Overlays */ .ui-widget-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; /* z-index: 1001; */ } .ui-draggable-handle { -ms-touch-action: none; touch-action: none; } .ui-resizable { position: relative; } .ui-resizable-handle { position: absolute; font-size: 0.1px; display: block; -ms-touch-action: none; touch-action: none; } .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px; } .ui-selectable { -ms-touch-action: none; touch-action: none; } .ui-selectable-helper { position: absolute; z-index: 100; border: 1px dotted black; } .ui-sortable-handle { -ms-touch-action: none; touch-action: none; } .ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin: 2px 0 0 0; padding: .5em .5em .5em .7em; min-height: 0; /* support: IE7 */ font-size: 100%; } .ui-accordion .ui-accordion-icons { padding-left: 2.2em; } .ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; } .ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; } .ui-autocomplete { position: absolute; top: 0; left: 0; cursor: default; } .ui-button { display: inline-block; position: relative; padding: 0; line-height: normal; margin-right: .1em; cursor: pointer; vertical-align: middle; text-align: center; overflow: visible; /* removes extra width in IE */ } .ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; } /* to make room for the icon, a width needs to be set here */ .ui-button-icon-only { width: 2.2em; } /* button elements seem to need a little more width */ button.ui-button-icon-only { width: 2.4em; } .ui-button-icons-only { width: 3.4em; } button.ui-button-icons-only { width: 3.7em; } /* button text element */ .ui-button .ui-button-text { display: block; line-height: normal; } .ui-button-text-only .ui-button-text { padding: .4em 1em; } .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } /* no icon support for input elements, provide padding by default */ input.ui-button { padding: .4em 1em; } /* button icon element(s) */ .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } /* button sets */ .ui-buttonset { margin-right: 7px; } .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } /* workarounds */ /* reset extra padding in Firefox, see h5bp.com/l */ input.ui-button::-moz-focus-inner, button.ui-button::-moz-focus-inner { border: 0; padding: 0; } .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } .ui-datepicker .ui-datepicker-header { position: relative; padding: .2em 0; } .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position: absolute; top: 2px; width: 1.8em; height: 1.8em; } .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } .ui-datepicker .ui-datepicker-prev { left: 2px; } .ui-datepicker .ui-datepicker-next { right: 2px; } .ui-datepicker .ui-datepicker-prev-hover { left: 1px; } .ui-datepicker .ui-datepicker-next-hover { right: 1px; } .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } .ui-datepicker .ui-datepicker-title select { font-size: 1em; margin: 1px 0; } .ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { width: 45%; } .ui-datepicker table { width: 100%; table-layout: fixed; font-size: .9em; border-collapse: collapse; margin: 0 0 .4em; } .ui-datepicker th { /*padding: .7em .3em;*/ padding: .25em .3em; text-align: center; font-weight: bold; border: 0; } .ui-datepicker td { border: 0; padding: 1px; } .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; height: 100%; } .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding: 0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width: auto; overflow: visible; } .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float: left; } /* with multiple calendars */ .ui-datepicker.ui-datepicker-multi { width: auto; } .ui-datepicker-multi .ui-datepicker-group { float: left; } .ui-datepicker-multi .ui-datepicker-group table { width: 95%; margin: 0 auto .4em; } .ui-datepicker-multi-2 .ui-datepicker-group { width: 50%; } .ui-datepicker-multi-3 .ui-datepicker-group { width: 33.3%; } .ui-datepicker-multi-4 .ui-datepicker-group { width: 25%; } .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width: 0; } .ui-datepicker-multi .ui-datepicker-buttonpane { clear: left; } .ui-datepicker-row-break { clear: both; width: 100%; font-size: 0; } /* RTL support */ .ui-datepicker-rtl { direction: rtl; } .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } .ui-datepicker-rtl .ui-datepicker-buttonpane { clear: right; } .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, .ui-datepicker-rtl .ui-datepicker-group { float: right; } .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width: 0; border-left-width: 1px; } .ui-dialog { overflow: hidden; position: absolute; top: 0; left: 0; padding: .2em; outline: 0; } .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; font-size: 20px; } .ui-dialog .ui-dialog-title { float: left; margin: .1em 0; white-space: nowrap; width: 90%; overflow: hidden; text-overflow: ellipsis; } .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 20px; margin: -10px 0 0 0; padding: 1px; height: 20px; } .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; } .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin-top: .5em; padding: .3em 1em .5em .4em; } .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } .ui-dialog .ui-resizable-se { width: 12px; height: 12px; right: -5px; bottom: -5px; background-position: 16px 16px; } .ui-draggable .ui-dialog-titlebar { cursor: move; } .ui-menu { list-style: none; padding: 0; margin: 0; display: block; outline: none; } .ui-menu .ui-menu { position: absolute; } .ui-menu .ui-menu-item { position: relative; margin: 0; padding: 3px 1em 3px .4em; cursor: pointer; min-height: 0; /* support: IE7 */ /* support: IE10, see #8844 */ list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); } .ui-menu .ui-menu-divider { margin: 5px 0; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; } .ui-menu .ui-state-focus, .ui-menu .ui-state-active { margin: -1px; } /* icon support */ .ui-menu-icons { position: relative; } .ui-menu-icons .ui-menu-item { padding-left: 2em; } /* left-aligned */ .ui-menu .ui-icon { position: absolute; top: 0; bottom: 0; left: .2em; margin: auto 0; } /* right-aligned */ .ui-menu .ui-menu-icon { left: auto; right: 0; } .ui-progressbar { height: 2em; text-align: left; overflow: hidden; } .ui-progressbar .ui-progressbar-value { margin: -1px; height: 100%; } .ui-progressbar .ui-progressbar-overlay { background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); height: 100%; filter: alpha(opacity=25); /* support: IE8 */ opacity: 0.25; } .ui-progressbar-indeterminate .ui-progressbar-value { background-image: none; } .ui-selectmenu-menu { padding: 0; margin: 0; position: absolute; top: 0; left: 0; display: none; } .ui-selectmenu-menu .ui-menu { overflow: auto; /* Support: IE7 */ overflow-x: hidden; padding-bottom: 1px; } .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { font-size: 1em; font-weight: bold; line-height: 1.5; padding: 2px 0.4em; margin: 0.5em 0 0 0; height: auto; border: 0; } .ui-selectmenu-open { display: block; } .ui-selectmenu-button { display: inline-block; overflow: hidden; position: relative; text-decoration: none; cursor: pointer; } .ui-selectmenu-button span.ui-icon { right: 0.5em; left: auto; margin-top: -8px; position: absolute; top: 50%; } .ui-selectmenu-button span.ui-selectmenu-text { text-align: left; padding: 0.4em 2.1em 0.4em 1em; display: block; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ui-slider { position: relative; text-align: left; } .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; -ms-touch-action: none; touch-action: none; } .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } /* support: IE8 - See #6727 */ .ui-slider.ui-state-disabled .ui-slider-handle, .ui-slider.ui-state-disabled .ui-slider-range { filter: inherit; } .ui-slider-horizontal { height: .8em; } .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } .ui-slider-horizontal .ui-slider-range-min { left: 0; } .ui-slider-horizontal .ui-slider-range-max { right: 0; } .ui-slider-vertical { width: .8em; height: 100px; } .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } .ui-slider-vertical .ui-slider-range-min { bottom: 0; } .ui-slider-vertical .ui-slider-range-max { top: 0; } .ui-spinner { position: relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; } .ui-spinner-input { border: none; background: none; color: inherit; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; } .ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; } /* more specificity required here to override default borders */ .ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* vertically center icon */ .ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } .ui-spinner-up { top: 0; } .ui-spinner-down { bottom: 0; } /* TR overrides */ .ui-spinner .ui-icon-triangle-1-s { /* need to fix icons sprite */ background-position: -65px -16px; } .ui-tabs { position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ padding: .2em; } .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom-width: 0; padding: 0; white-space: nowrap; } .ui-tabs .ui-tabs-nav .ui-tabs-anchor { float: left; padding: .5em 1em; text-decoration: none; } .ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; } .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { cursor: text; } .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { cursor: pointer; } .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } .ui-tooltip { padding: 8px; position: absolute; z-index: 9999; max-width: 300px; -webkit-box-shadow: 0 0 5px #aaa; box-shadow: 0 0 5px #aaa; } body .ui-tooltip { border-width: 2px; padding: 5px; } /* Component containers ----------------------------------*/ .ui-widget { font-family: Helvetica,Arial,sans-serif; font-size: 1.1em; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Helvetica,Arial,sans-serif; font-size: 1em; } .ui-widget-content { /*border: 1px solid #dddddd;*/ background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x; color: #444444; overflow: visible !important; } .ui-widget-content a { color: #444444; } .ui-widget-header { /*border: 1px solid #dddddd;*/ background: #dddddd url("images/ui-bg_highlight-soft_50_dddddd_1x100.png") 50% 50% repeat-x; color: #444444; font-weight: bold; } .ui-widget-header a { color: #444444; } /* Interaction states ----------------------------------*/ .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } .ui-widget-content { border: 1px solid #ddd; background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x; color: #222222; } .ui-widget-content a { color: #222222; } .ui-widget-header { /*border: 1px solid #aaaaaa;*/ background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x; color: #222222; font-weight: bold; } .ui-widget-header a { color: #222222; } /* Interaction states ----------------------------------*/ .ui-tabs.ui-widget.ui-widget-content .ui-state-default, .ui-datepicker-calendar .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x; font-weight: normal; color: #555555; } /*.ui-state-default,*/ /*.ui-tabs.ui-widget-content .ui-state-default,*/ /*.ui-widget-header .ui-state-default {*/ /*border: 1px solid #d3d3d3;*/ /*background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;*/ /*font-weight: normal;*/ /*color: #555555;*/ /*}*/ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } .ui-datepicker-calendar .ui-state-default.ui-state-hover, .ui-tabs .ui-state-default.ui-state-hover { border: 1px solid #999999; background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x; font-weight: normal; /*color: #212121;*/ } /*.ui-state-hover,*/ /*.ui-widget-content .ui-state-hover,*/ /*.ui-widget-header .ui-state-hover,*/ /*.ui-state-focus,*/ /*.ui-widget-content .ui-state-focus,*/ /*.ui-widget-header .ui-state-focus {*/ /*border: 1px solid #999999;*/ /*background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;*/ /*font-weight: normal;*/ /*color: #212121;*/ /*}*/ /*.ui-state-hover a,*/ /*.ui-state-hover a:hover,*/ /*.ui-state-hover a:link,*/ /*.ui-state-hover a:visited,*/ /*.ui-state-focus a,*/ /*.ui-state-focus a:hover,*/ /*.ui-state-focus a:link,*/ /*.ui-state-focus a:visited {*/ /*color: #212121;*/ /*text-decoration: none;*/ /*}*/ .ui-tabs.ui-widget.ui-widget-content .ui-state-default.ui-state-active, .ui-datepicker-calendar .ui-state-default.ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x; font-weight: bold; color: #212121; } /*.ui-state-active,*/ /*.ui-widget-content .ui-state-active,*/ /*.ui-widget-header .ui-state-active {*/ /*border: 1px solid #aaaaaa;*/ /*background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;*/ /*font-weight: normal;*/ /* color: #212121; */ /*}*/ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } /* Icons ----------------------------------*/ /* states and images */ /* Icons ----------------------------------*/ /* states and images */ .ui-icon { width: 16px; height: 16px; } .ui-icon, .ui-widget-content .ui-icon { background-image: url("images/ui-icons_222222_256x240.png"); } .ui-widget-header .ui-icon { background-image: url("images/ui-icons_222222_256x240.png"); } .ui-state-default .ui-icon { background-image: url("images/ui-icons_888888_256x240.png"); } .ui-state-hover .ui-icon, .ui-state-focus .ui-icon { background-image: url("images/ui-icons_454545_256x240.png"); } .ui-state-active .ui-icon { background-image: url("images/ui-icons_454545_256x240.png"); } .ui-state-highlight .ui-icon { background-image: url("images/ui-icons_2e83ff_256x240.png"); } .ui-state-error .ui-icon, .ui-state-error-text .ui-icon { background-image: url("images/ui-icons_cd0a0a_256x240.png"); } /* positioning */ .ui-icon-blank { background-position: 16px 16px; } .ui-icon-carat-1-n { background-position: 0 0; } .ui-icon-carat-1-ne { background-position: -16px 0; } .ui-icon-carat-1-e { background-position: -32px 0; } .ui-icon-carat-1-se { background-position: -48px 0; } .ui-icon-carat-1-s { background-position: -64px 0; } .ui-icon-carat-1-sw { background-position: -80px 0; } .ui-icon-carat-1-w { background-position: -96px 0; } .ui-icon-carat-1-nw { background-position: -112px 0; } .ui-icon-carat-2-n-s { background-position: -128px 0; } .ui-icon-carat-2-e-w { background-position: -144px 0; } .ui-icon-triangle-1-n { background-position: 0 -16px; } .ui-icon-triangle-1-ne { background-position: -16px -16px; } .ui-icon-triangle-1-e { background-position: -32px -16px; } .ui-icon-triangle-1-se { background-position: -48px -16px; } .ui-icon-triangle-1-s { background-position: -64px -16px; } .ui-icon-triangle-1-sw { background-position: -80px -16px; } .ui-icon-triangle-1-w { background-position: -96px -16px; } .ui-icon-triangle-1-nw { background-position: -112px -16px; } .ui-icon-triangle-2-n-s { background-position: -128px -16px; } .ui-icon-triangle-2-e-w { background-position: -144px -16px; } .ui-icon-arrow-1-n { background-position: 0 -32px; } .ui-icon-arrow-1-ne { background-position: -16px -32px; } .ui-icon-arrow-1-e { background-position: -32px -32px; } .ui-icon-arrow-1-se { background-position: -48px -32px; } .ui-icon-arrow-1-s { background-position: -64px -32px; } .ui-icon-arrow-1-sw { background-position: -80px -32px; } .ui-icon-arrow-1-w { background-position: -96px -32px; } .ui-icon-arrow-1-nw { background-position: -112px -32px; } .ui-icon-arrow-2-n-s { background-position: -128px -32px; } .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } .ui-icon-arrow-2-e-w { background-position: -160px -32px; } .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } .ui-icon-arrowstop-1-n { background-position: -192px -32px; } .ui-icon-arrowstop-1-e { background-position: -208px -32px; } .ui-icon-arrowstop-1-s { background-position: -224px -32px; } .ui-icon-arrowstop-1-w { background-position: -240px -32px; } .ui-icon-arrowthick-1-n { background-position: 0 -48px; } .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } .ui-icon-arrowthick-1-e { background-position: -32px -48px; } .ui-icon-arrowthick-1-se { background-position: -48px -48px; } .ui-icon-arrowthick-1-s { background-position: -64px -48px; } .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } .ui-icon-arrowthick-1-w { background-position: -96px -48px; } .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } .ui-icon-arrow-4 { background-position: 0 -80px; } .ui-icon-arrow-4-diag { background-position: -16px -80px; } .ui-icon-extlink { background-position: -32px -80px; } .ui-icon-newwin { background-position: -48px -80px; } .ui-icon-refresh { background-position: -64px -80px; } .ui-icon-shuffle { background-position: -80px -80px; } .ui-icon-transfer-e-w { background-position: -96px -80px; } .ui-icon-transferthick-e-w { background-position: -112px -80px; } .ui-icon-folder-collapsed { background-position: 0 -96px; } .ui-icon-folder-open { background-position: -16px -96px; } .ui-icon-document { background-position: -32px -96px; } .ui-icon-document-b { background-position: -48px -96px; } .ui-icon-note { background-position: -64px -96px; } .ui-icon-mail-closed { background-position: -80px -96px; } .ui-icon-mail-open { background-position: -96px -96px; } .ui-icon-suitcase { background-position: -112px -96px; } .ui-icon-comment { background-position: -128px -96px; } .ui-icon-person { background-position: -144px -96px; } .ui-icon-print { background-position: -160px -96px; } .ui-icon-trash { background-position: -176px -96px; } .ui-icon-locked { background-position: -192px -96px; } .ui-icon-unlocked { background-position: -208px -96px; } .ui-icon-bookmark { background-position: -224px -96px; } .ui-icon-tag { background-position: -240px -96px; } .ui-icon-home { background-position: 0 -112px; } .ui-icon-flag { background-position: -16px -112px; } .ui-icon-calendar { background-position: -32px -112px; } .ui-icon-cart { background-position: -48px -112px; } .ui-icon-pencil { background-position: -64px -112px; } .ui-icon-clock { background-position: -80px -112px; } .ui-icon-disk { background-position: -96px -112px; } .ui-icon-calculator { background-position: -112px -112px; } .ui-icon-zoomin { background-position: -128px -112px; } .ui-icon-zoomout { background-position: -144px -112px; } .ui-icon-search { background-position: -160px -112px; } .ui-icon-wrench { background-position: -176px -112px; } .ui-icon-gear { background-position: -192px -112px; } .ui-icon-heart { background-position: -208px -112px; } .ui-icon-star { background-position: -224px -112px; } .ui-icon-link { background-position: -240px -112px; } .ui-icon-cancel { background-position: 0 -128px; } .ui-icon-plus { background-position: -16px -128px; } .ui-icon-plusthick { background-position: -32px -128px; } .ui-icon-minus { background-position: -48px -128px; } .ui-icon-minusthick { background-position: -64px -128px; } .ui-icon-close { background-position: -80px -128px; } .ui-icon-closethick { background-position: -96px -128px; } .ui-icon-key { background-position: -112px -128px; } .ui-icon-lightbulb { background-position: -128px -128px; } .ui-icon-scissors { background-position: -144px -128px; } .ui-icon-clipboard { background-position: -160px -128px; } .ui-icon-copy { background-position: -176px -128px; } .ui-icon-contact { background-position: -192px -128px; } .ui-icon-image { background-position: -208px -128px; } .ui-icon-video { background-position: -224px -128px; } .ui-icon-script { background-position: -240px -128px; } .ui-icon-alert { background-position: 0 -144px; } .ui-icon-info { background-position: -16px -144px; } .ui-icon-notice { background-position: -32px -144px; } .ui-icon-help { background-position: -48px -144px; } .ui-icon-check { background-position: -64px -144px; } .ui-icon-bullet { background-position: -80px -144px; } .ui-icon-radio-on { background-position: -96px -144px; } .ui-icon-radio-off { background-position: -112px -144px; } .ui-icon-pin-w { background-position: -128px -144px; } .ui-icon-pin-s { background-position: -144px -144px; } .ui-icon-plttery-0 { background-position: -48px -176px; } .ui-icon-battery-1 { background-position: -64px -176px; } .ui-icon-battery-2 { background-position: -80px -176px; } .ui-icon-battery-3 { background-position: -96px -176px; } .ui-icon-circle-plus { background-position: 0 -192px; } .ui-icon-circle-minus { background-position: -16px -192px; } .ui-icon-circle-close { background-position: -32px -192px; } .ui-icon-circle-triangle-e { background-position: -48px -192px; } .ui-icon-circle-triangle-s { background-position: -64px -192px; } .ui-icon-circle-triangle-w { background-position: -80px -192px; } .ui-icon-circle-triangle-n { background-position: -96px -192px; } .ui-icon-circle-arrow-e { background-position: -112px -192px; } .ui-icon-circle-arrow-s { background-position: -128px -192px; } .ui-icon-circle-arrow-w { background-position: -144px -192px; } .ui-icon-circle-arrow-n { background-position: -160px -192px; } .ui-icon-circle-zoomin { background-position: -176px -192px; } .ui-icon-circle-zoomout { background-position: -192px -192px; } .ui-icon-circle-check { background-position: -208px -192px; } .ui-icon-circlesmall-plus { background-position: 0 -208px; } .ui-icon-circlesmall-minus { background-position: -16px -208px; } .ui-icon-circlesmall-close { background-position: -32px -208px; } .ui-icon-squaresmall-plus { background-position: -48px -208px; } .ui-icon-squaresmall-minus { background-position: -64px -208px; } .ui-icon-squaresmall-close { background-position: -80px -208px; } .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } .ui-icon-grip-solid-vertical { background-position: -32px -224px; } .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } .ui-icon-grip-diagonal-se { background-position: -80px -224px; } /* Misc visuals ----------------------------------*/ /* Corner radius */ .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { /*border-top-left-radius: 2px;*/ } .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { /*border-top-right-radius: 2px;*/ } .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { /*border-bottom-left-radius: 2px;*/ } .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { /*border-bottom-right-radius: 2px;*/ } /* Overlays */ .ui-widget-overlay { /*background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;*/ background: #000000; opacity: .3; filter: Alpha(Opacity=30); /* support: IE8 */ } .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x; opacity: .3; filter: Alpha(Opacity=30); /* support: IE8 */ border-radius: 8px; } .ui-datepicker-calendar thead th{ background:#e6e6e6; } .defaultfont td:nth-child(2), #Personal_Information td:nth-child(2) { position: relative; } /*ul{ width:100%; } li.test{ display: inline-block; float:left; height:2 0px; margin:0 10% 3% 0; width:40%; } li.test:nth-child(even){ margin-right:0; } */ li { margin-bottom:10px; font-size:13px; } select, input { padding: 6px 2px; } /*.other-search { width: 33px; height: auto; background: rgba(0,0,0,0.2); border: 1px solid #aaa; z-index: 2; } .searchable_resultcontainer table { font-size: 12px; } .searchable_resultcontainer td, .searchable_resultcontainer th { border: 1px solid #ccc; } .searchable_resultcontainer td button { padding: 8px 15px; border: none; color: #fff; }*/ .inactive { background: #999; } /* Scrollbar mod works with chrome and opera -josef */ /* Green */ ::-webkit-scrollbar { width: 9px; height: 9px; /*background: rgb(98, 125, 77);*/ /*background: #fa911c;*/ position: absolute; } ::-webkit-scrollbar-track { background: #bfbfbf; -webkit-box-shadow: inset 1px 1px 6px 1px rgba(20, 20, 20, 0.5); } ::-webkit-scrollbar-thumb { /*border-radius: 2px;*/ /*background: rgb(98, 125, 77);*/ /*background: #fa911c;*/ -webkit-box-shadow: inset 1px 1px 6px 1px rgba(20, 20, 20, 0.5), inset 3px 0 6px rgba(97, 97, 97, 0.25); } ::-webkit-scrollbar-thumb:window-inactive { background: rgba(204, 10, 10, 0.2); -webkit-box-shadow: inset 0 0 20px 1px rgba(204, 12, 12, 0.95); } select { padding: 0px; } #pager_article .ui-dialog,#pager_article .ui-dialog .ui-dialog-content { overflow: visible; } .input[readonly]:not(.hasDatepicker) { /*border: 0px !important; background: transparent !important;*/ color: graytext; } .datepicker { width: 120px !important; }.bdate { width: 120px !important; } #menu_panel { display:none; }/* #sidebar { display:none; }*/ #mensub { display:none; } .ui-corner-all { /*box-shadow: 0 1px 2px #666;*/ } #fixd_con { width: 95%; margin: 0 auto; position: relative; } .ui-dialog { box-shadow: 0 0 10px rgba(0,0,0,0.8); } .ui-corner-all { padding: 0; border: none; } .ui-widget-header { /*background: #627d4d;*/ /*background: #fa911c;*/ /*color: #fff;*/ } .ui-dialog .ui-dialog-buttonpane button { /*background: #627d4d;*/ /*background: #fa911c;*/ /*color: #fff;*/ } .alertify .ajs-dimmer { z-index: 1002; } #sidebar h3 i { float: right; padding: 0 15px 0; font-weight: bold; font-size: 18px; color: #999; } #sidebar h3:hover i { float: right; padding: 0 15px 0; font-weight: bold; font-size: 18px; color: #111; animation: move 1.5s 1; -moz-animation: move 1.5s 1; -webkit-animation: move 1.5s 1; } .ui-tooltip { background: rgba(0,0,0,0.5); color: #fff; box-shadow: none; } .ui-tooltip::before { content: ''; border-bottom: 12px solid rgba(0,0,0,0.5); border-left: 10px solid transparent; border-right: 10px solid transparent; position: absolute; top: -12px; left: 0; right: 0; margin: 0 auto; width: 1px; } @keyframes move { 20% { transform: translateX(-10px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-1px); } 80% { transform: translateX(2px); } 100%{ transform: translateX(0px); } } @-moz-keyframes move { 20% { transform: translateX(-10px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-1px); } 80% { transform: translateX(2px); } 100%{ transform: translateX(0px); } } @-webkit-keyframes move { 20% { transform: translateX(-10px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-1px); } 80% { transform: translateX(2px); } 100%{ transform: translateX(0px); } } ._pointer { cursor: pointer; } .cms_content p { font-weight: normal; } #secondary_bar { transition: all 0.3s; } input.require, select.require { padding: 5px; width: 100%; min-width: 220px; border-radius: 3px; border: 1px solid #bbb; } input.class_date { padding: 5px; width: 100%; /*min-width: 220px;*/ } #pager_modal table td:first-child { padding: 10px; white-space: nowrap; } div#ui-datepicker-div { border: 1px solid #bbb; } #main_overlay { width: 100%; height: 100%; position: fixed; top: 0; left: 0; background: rgba(0,0,0,0.8); z-index: 1001; } .ui-datepicker-month { border-top-left-radius: 4px; border-bottom-left-radius: 4px; } .ui-datepicker-year { border-top-right-radius: 4px; border-bottom-right-radius: 4px; } .head_logo{ width: 50px; height: 50px; } .head_title { font-size: 2em; align-self: center; margin-left: 20px; /*color: #fff;*/ } .flex { display: flex; } .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header { /*background: #627d4d;*/ } .dwb_empstatico { color: #000; } .dwc_empstatico { color: #fff; } /*20180404 start gian karlo */ .article_btn_container { display: inline-block; text-align: right; float: right; margin-right: 15px; height: 100% } .article_btn_container .article_btn_child_container { position: relative; top: 50%; transform: translateY(-50%); } article.pager-module.pager-module-lightgray { height:auto; /*border:1px solid black;*/ /*width:75%;*/ margin-left:auto; margin-right:auto; margin-top:0px; border:1px solid #d8d8db; background:#f6f6f8; } article.pager-module.pager-module-lightgray header { /*background:#d8d8db;*/ } article.pager-module.pager-module-darkgray { height:auto; /*border:1px solid black;*/ /*width:75%;*/ margin-left:auto; margin-right:auto; margin-top:0px; border:1px solid #8e8e8e; background:#f6f6f8 } article.pager-module.pager-module-darkgray header { background:#8e8e8e; } article.pager-module.pager-module-darkgray header * { color: white !important; } article.pager-module header { } .defaultfontsize { font-size: 13px !important; } .input_hasErr { border: 1px solid red; background-color: #FFCECE; } #dash_con { width: 100%; height: auto; margin: 0 auto 50px; } .tr_spacer { height: 10px; } .td_spacer { width: 10px; } .td_left_indent { padding-left: 30px; } .hasDatepicker,input[type=time] { width: 120px; } input[type=button].save:disabled, input[type=button].exit:disabled, input[type=button].print:disabled { background-color:#a2a2a2 } input[type=text].required:disabled, select:disabled, textarea:disabled { background-color: rgb(235, 235, 228); } .CalendarClearButtonContainer { display: inline-block; } i.datepicker_clear_btn { margin-left:-20px; color: #00207b; font-size: 15px !important; display: none; cursor: pointer; } i.datepicker_clear_btn:hover { color: #0042ff; } textarea { font-family: unset; } /* ---------- demo ----------- */ .dedemo { position: sticky; /* -- behave like a relative position and fixed position at the same time when it reach a specific distance*/ top: 0; /* -- this is the "specific distance" */ width: 100%; height: 50px; background: #c33434; font-size: 25px; color: #fff; z-index: 9999; display: flex; justify-content: center; align-items: center; } .dedemo span { text-align: center; } .disabled { background-color: rgb(235, 235, 228); color: rgb(84, 84, 84); cursor: default; } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/class/lstv_pager.js?v=20220224185611 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20190314 |
| Request Header - size: 492 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/class/lstv_pager.js?v=20220224185611 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Thu, 24 Feb 2022 10:56:11 GMT Accept-Ranges: bytes Content-Length: 50267 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 50,267 bytes. |
var fields = jQuery('#pager_fields').val().split(',');
var headers = jQuery('#pager_headers').val().split(','); var table = jQuery('#pager_table').val(); var table_id = jQuery('#pager_table_id').val(); var xlink_id = jQuery('#pager_xlink').val(); var xfield = jQuery('#pager_xfield').val(); var xtitle = jQuery('#pager_title').val(); var xusedscascde = jQuery('#usedscascde').val(); var xtable_code = jQuery('#table_code').val(); var xtable_desc = jQuery('#table_desc').val(); var xmodal_width = jQuery('#modal_width').val(); var xmodal_height = jQuery('#modal_height').val(); var xhovering_type = jQuery('#hovering_type').val(); var xserver = jQuery('#server').val(); var xpager_link_id_hash = jQuery('#pager_link_id_hash').val(); var totalpages = jQuery('#pager_totalpages').val(); var page = jQuery('#pager_page').val(); var pager_keys = new Array(); jQuery(document).ready(function(){ checkpage(); jQuery('#txtchk').click(function(){ document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='post'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('.datepicker').datepicker(); jQuery('ul.ui-autocomplete').css('z-index',1100); jQuery('.dia_fld').dbFldLen({ link_hash_id: xpager_link_id_hash, tablename: table, ajaxPage:'db_field_length_checker_ajax.php' }); jQuery('#div_pager').on('click','#datatable .pager_thead .header_sort',function() { jQuery('#header_sort').val(jQuery(this).data('header_field_column')); if(jQuery(this).find('.header_sort_asc').length>0) { jQuery('#header_sort_by').val('DESC'); } else { jQuery('#header_sort_by').val('ASC'); } //20191118 justine set after sorting go to first page // document.forms.myform.action= xserver; // document.forms.myform.method='post'; // document.forms.myform.target='_self'; // document.forms.myform.submit(); jQuery('#pager_first').click(); }); jQuery('#pager_print_export').on('change','.pager_print_expt_col_sort_sel',function() { jQuery('.pager_print_expt_col_sort_sel').find('option').show(); jQuery('.pager_print_expt_col_sort_sel').each(function() { var this_val = jQuery(this).val(); if(this_val!="") { jQuery('.pager_print_expt_col_sort_sel').not(this).find('option[value="'+this_val+'"]').hide(); } }); }); jQuery('#div_pager #datatable tbody tr:eq(0) td').each(function(key,val){ pager_keys[pager_keys.length] = jQuery(val).attr('id'); }); jQuery('#pager_modal input[type=checkbox]').each(function(key,val){ jQuery(this).click(function(){ var xbool = jQuery(this).prop('checked'); var xid = jQuery(this).attr('id'); if(xbool == true){ jQuery('#checkbox_'+xid).val('1'); } else{ jQuery('#checkbox_'+xid).val('0'); } }); }); jQuery('#pager_copy_diag').dialog({ title:'Copy to Other ' + jQuery("#hr_mode").val(), width: 800, height: 600, draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function(){jQuery('.ui-dialog-titlebar-close').hide();}, buttons:[ { text:"Copy", class:"save", click:function() { pager_copy_diag_result(); } }, { text:"Cancel", class:"exit", click:function() { jQuery(this).dialog('close'); location.reload(); } } ] }); jQuery('#pager_copy_diag').on('click','.pager_freeze_tbl .tbody .td',function(e) { if(jQuery(this).find('.pager_copy_chkbox').length==0) { jQuery(this).closest('.tr').find('.pager_copy_chkbox').prop('checked',!jQuery(this).closest('.tr').find('.pager_copy_chkbox').is(':checked')).change(); } }) jQuery('#pager_copy_diag').on('change','.pager_freeze_tbl .tbody .td .pager_copy_chkbox',function(e) { if(jQuery(this).is(':checked')) { jQuery(this).closest('.tr').find('.td').addClass('td_pager_copy_candidate'); } else { jQuery(this).closest('.tr').find('.td').removeClass('td_pager_copy_candidate'); } }) jQuery('#pager_copy_diag').on('click','.pager_copy_all_chkbox',function() { jQuery('#pager_copy_diag .pager_freeze_tbl .tbody .tr').find('.pager_copy_chkbox:not(:disabled)').prop('checked',jQuery(this).is(':checked')).change(); }) jQuery('#pager_copy_diag').on('change','.pager_copy_subdryfrom',function() { jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option").show(); if(jQuery('#pager_copy_diag').find('.pager_copy_subdryto').val()==jQuery(this).val()) { jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option[value!='"+jQuery(this).val()+"']").prop('selected',true); } jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option[value='"+jQuery(this).val()+"']").hide(); reload_pager_copy_diag_result(); }) jQuery('#pager_copy_diag').on('change','.pager_copy_subdryto',function() { jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option").show(); if(jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').val()==jQuery(this).val()) { jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option[value!='"+jQuery(this).val()+"']").prop('selected',true); } jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option[value='"+jQuery(this).val()+"']").hide(); reload_pager_copy_diag_result(); }) if(xhovering_type == 'click'){ jQuery('#div_pager #datatable .pager_tbody .pager_tr').each(function(key,val){ jQuery(val).click(function(){ jQuery('#div_pager #datatable .pager_tbody .pager_tr').removeClass('pager-active'); jQuery(this).addClass('pager-active'); var active_id = jQuery(this).attr('id'); jQuery('#pager_active_id').val(active_id); for(var i=0;i<pager_keys.length;i++){ var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); jQuery('#pager_'+pager_keys[i]).val(dataval); } }); }); } else{ // console.log(jQuery('#div_pager #datatable .pager_tbody .pager_tr').length); jQuery('#div_pager').on('mouseover','#datatable .pager_tbody .pager_tr',function() { var active_id = jQuery(this).attr('id'); // console.log('hovertblasdsadasda',active_id); jQuery('#pager_active_id').val(active_id); for(var i=0;i<pager_keys.length;i++) { var dataval = jQuery(this).find('#'+pager_keys[i]).attr('value'); jQuery('#pager_'+pager_keys[i]).val(dataval); } }) // jQuery('#div_pager #datatable .pager_tbody .pager_tr').each(function(key,val){ // jQuery(val).hover(function(){ // console.log(val); // }); // }); } // init_datatable_freezetable(); }) jQuery(window).load(function() { init_datatable_freezetable(); }) function checkselval(obj) { var selval = jQuery(obj).val(); jQuery(".pager_print_expt_col_sort_sel").addClass("checkselval"); jQuery(obj).removeClass("checkselval"); jQuery('.checkselval').each(function(){ if(jQuery(this).val() == selval && jQuery(this).val() != "" ) { alertify.alert("Column No. already selected.",function(){ jQuery(obj).val(""); }); } }); jQuery(".pager_print_expt_col_sort_sel").removeClass("checkselval"); } function init_datatable_freezetable() { var header_width = []; var action_header_index=null; jQuery('#div_pager #datatable th:visible').each(function(index,value) { if(jQuery(this).hasClass('header_action')) { action_header_index=index; } header_width.push(jQuery(this).data('header_width')); }); if(action_header_index!=null) { jQuery('#div_pager ').find('table tbody tr').each(function() { jQuery(this).find('td:visible').eq(action_header_index).addClass('pager_action_btn_container'); }); // console.log(action_header_index); jQuery('#div_pager #datatable').lst_freeze_table({ column_width:header_width, // left_fixed_column_index:[1], right_fixed_column_index:[action_header_index], tbl_max_width: "auto", tbl_max_height: "auto" }); } else { jQuery('#div_pager #datatable').lst_freeze_table({ column_width:header_width, // left_fixed_column_index:[1], // right_fixed_column_index:[action_header_index], tbl_max_width: "auto", tbl_max_height: "auto" }); } } function reload_pager_copy_diag_result() { if(jQuery('#pager_copy_diag').find('.pager_copy_subdryto').val()!='') { blockui(); var xdata = ""; xdata+="&"+jQuery('#pager_copy_diag .pager_copy_subdry').serialize(); xdata+="&pager_event_action=reload_pager_copy_diag_result"; xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&headers="+headers; xdata+="&pager_xlink="+xlink_id; xdata+="&fieldname="+xfield; xdata+="&xusedscascde="+xusedscascde; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); jQuery('#pager_copy_diag #pager_freeze_tbl_container').empty() jQuery('#pager_copy_diag #pager_freeze_tbl_container').html(response.content); jQuery('#pager_copy_diag #pager_freeze_tbl_container .pager_freeze_tbl').lst_freeze_table({ column_width:response.column_width, left_fixed_column_index:[0], tbl_max_width: 770, tbl_max_height: 350 }); } }); } } function pager_copy_diag_result() { if(jQuery('#pager_copy_diag .pager_copy_chkbox:checked').length > 0) { alertify.confirm('Continue copying selected records ? ',function() { blockui(); var xdata = ""; xdata+="&"+jQuery('#pager_copy_diag *').serialize(); xdata+="&pager_event_action=pager_copy_diag_result"; xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&headers="+headers; xdata+="&pager_xlink="+xlink_id; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); alertify.alert(response.msg,function() { reload_pager_copy_diag_result(); }) } }); },function() { }) } else { alertify.alert('Please select record(s) to copy.') } } function pager_open_subdry_copy_diag() { jQuery('#pager_copy_diag').dialog('open'); jQuery('#pager_copy_diag .pager_copy_subdryfrom option:first').prop('selected',true); jQuery('#pager_copy_diag .pager_copy_subdryto option:first').prop('selected',true); jQuery('#pager_copy_diag .pager_copy_subdryfrom').change(); } function clear_searchbox() { jQuery('#pager_search_input').val(''); } function addRow() { isValid = true; jQuery('#pager_modal .required:visible').removeClass('input_hasErr'); jQuery('#pager_modal .required:visible').each(function() { if (jQuery(this).val() == '') { isValid = false; jQuery(this).addClass('input_hasErr'); } else //20191113 donita { var xval = jQuery(this).val(); xval = xval.trim(); jQuery(this).val(xval); if(xval == "") { jQuery(this).addClass('input_hasErr'); isValid = false; } } }); if(isValid) { var modalfield_tablecde = jQuery('#modalField_'+xtable_code); var modalfield_tabledsc = jQuery('#modalField_'+xtable_desc); if(xusedscascde == 1) { // console.log('passxuseddscascde',filter_syspar_code_regex(modalfield_tabledsc.val())); if(filter_syspar_code_regex(modalfield_tabledsc.val())!="") { modalfield_tablecde.val(filter_syspar_code_regex(modalfield_tabledsc.val())); } else { alertify.alert('Description must contain atleast 1 alphanumeric ( A-Z , 0-9 ) character. '); return; } } blockui(); var xdata = ""; xdata+=jQuery('#pager_modal *').serialize(); xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=add"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery('#pager_modal').find('input:checkbox:not(:checked)').each(function() { xdata+="&"+jQuery(this).attr('name')+"="+jQuery(this).data('unchecked_value'); }) console.log(xdata); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response){ $.unblockUI(); if(response.bool) { jQuery('#pager_modal').dialog('close'); } alertify.alert(response.msg,function(){ if(response.bool) { jQuery('#pager_modal').dialog('close'); //20191118 justine set after adding go to first page // pager_reload(); jQuery('#pager_first').click(); } else{ if(response.msg == "Please fill required field(s).") { var arr = response.flds; for(var x=0; x<arr.length; x++) { jQuery('#modalField_'+arr[x]).val(""); jQuery('#modalField_'+arr[x]).addClass('input_hasErr'); } } } }); } }); } else { alertify.alert('Please fill required field(s)').set({'closable':false,'modal':true}); } } function updateRow(recid) { isValid = true; jQuery('#pager_modal .required:visible').removeClass('input_hasErr'); jQuery('#pager_modal .required:visible').each(function() { if (jQuery(this).val() == '') { isValid = false; jQuery(this).addClass('input_hasErr'); } else //20191113 donita { var xval = jQuery(this).val(); xval = xval.trim(); jQuery(this).val(xval); if(xval == "") { jQuery(this).addClass('input_hasErr'); isValid = false; } } }); if(isValid) { var modalfield_tablecde = jQuery("#modalField_"+xtable_code); var modalfield_tabledsc = jQuery("#modalField_"+xtable_desc); if(xusedscascde == 1) { if(filter_syspar_code_regex(modalfield_tabledsc.val())!="") { modalfield_tablecde.val(filter_syspar_code_regex(modalfield_tabledsc.val())); } else { alertify.alert('Description must contain atleast 1 alphanumeric ( A-Z , 0-9 ) character. '); return; } } blockui(); if(xtitle == "Leaves File") { jQuery('#pager_modal').find('input[id*="modalField_"]').prop('disabled',false); } var xdata = ""; xdata+=jQuery('#pager_modal *').serialize(); xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&recid="+encodeURIComponent(recid); xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=update"; xdata+="&fieldname="+xfield; xdata+="&headers="+headers; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery('#pager_modal').find('input:checkbox:not(:checked)').each(function() { xdata+="&"+jQuery(this).attr('name')+"="+jQuery(this).data('unchecked_value'); }) jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response){ $.unblockUI(); if(response.bool) { jQuery('#pager_modal').dialog('close'); } alertify.alert(response.msg,function(){ if(response.bool) { pager_reload(); } else{ if(response.msg == "Please fill required field(s).") { var arr = response.flds; for(var x=0; x<arr.length; x++) { jQuery('#modalField_'+arr[x]).val(""); jQuery('#modalField_'+arr[x]).addClass('input_hasErr'); } } else if(response.leave_logs != "" && xtitle == "Leaves File") { document.forms.myform.action = 'mf_leave_xpt.php'; document.forms.myform.target = '_blank'; document.forms.method = 'POST'; document.forms.myform.leave_logs.value = response.leave_logs; document.forms.myform.txt_leavesdesc.value = jQuery('#modalField_leavesdesc').val(); document.forms.myform.submit(); } } }); } }); } else { alertify.alert('Please fill required field(s)').set({'closable':false,'modal':true}); } } function modPagerBtn(par) { if(par=='add') { var xfunc = 'addRow()'; var xtitle = 'Save'; } else if(par=='edit') { var xfunc = 'updateRow()'; var xtitle = 'Save'; } jQuery('.ui-dialog .ui-dialog-buttonpane .ui-button').remove(); // mica change button to input type button or button type button // var btn = "<button role='button' class='save' style='height:30px;' onclick='"+xfunc+"'>"+xtitle+"</button>"; // btn += "<button role='button' class='exit' style='height:30px;' onclick='closePagerModal()'>Close</button>"; var btn = "<input type=\"button\" class=\"save\" style=\"height:30px;\" onclick=\""+xfunc+"\" value=\""+xtitle+"\">"; btn += "<input type=\"button\" class=\"exit\" style=\"height:30px;\" onclick=\"closePagerModal()\" value=\"Close\">"; jQuery('.ui-dialog-buttonset').append(btn); } function closePagerModal() { jQuery('#div_pager #datatable tr').removeClass('action_btn_selected_row'); jQuery('#pager_modal').dialog('close'); } function add_item(){ var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&event_action=has_edo"; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { jQuery('#pager_modal').find('input,textarea,select').prop('disabled',false); jQuery('#pager_modal input:text').val(''); jQuery('#pager_modal input:checkbox').prop('checked',false); jQuery('#pager_modal .required').removeClass('input_hasErr'); if(xtitle == "Leaves File") { jQuery('#modalField_is_edo').prop('disabled',xret); } jQuery('#pager_modal').dialog({ title:'Add', width: xmodal_width, height: xmodal_height, draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function(){jQuery('.ui-dialog-titlebar-close').hide();}, buttons:[ { text:"Save", class:"save", id:"btn_diag_save", click:function() { addRow(); } }, { text:"Cancel", class:"exit", id:"btn_diag_cancel", click:function() { jQuery(this).dialog('close'); } } ] }).dialog('open'); jQuery('#modalField_subdrycde').change(); //20190314 donita } }) } function edit_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery('#pager_modal .required').removeClass('input_hasErr'); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } // console.log(recid); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&event_action=view"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); // console.log(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { $.each(xret.rs,function(key,xretDataval) { // console.log(xretDataval); // console.log(key); // var hidden_type = jQuery(xretDataval).find('#modalField_'+key).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(xretDataval).find('#'+key).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery('#modalField_'+key).prop('checked',true); // jQuery('#checkbox_modalField_'+key).val('1'); // } // else // { // jQuery('#checkbox_modalField_'+key).val('0'); // } // } // else // { // var dataval = jQuery(xretDataval).find('#'+key).attr('value'); if(jQuery('#modalField_'+key).is(':checkbox')) { jQuery('#modalField_'+key).prop('checked',false); if(jQuery('#modalField_'+key).data('checked_value')==xretDataval) { jQuery('#modalField_'+key).prop('checked',true); } } else { jQuery('#modalField_'+key).val(xretDataval); } // } }); jQuery('#pager_modal').find('input,textarea,select').prop('disabled',false); if(xtitle == "Leaves File") { $.each(xret.is_disabled,function(key,xretDataval) { jQuery('#modalField_'+key).prop('disabled',xretDataval); }); jQuery('#pager_modal').find('input#modalField_withoutpay').prop('disabled',true); } //jQuery('#pager_modal').find('#modalField_subdrycde').prop('readonly','readonly'); jQuery('#pager_modal').dialog({ title:'Edit', width: xmodal_width, height: xmodal_height, appendTo:'#div_pager', draggable:true, resizable:false, autoOpen:false, modal:true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [ { "text":"Save", "class":"save", "id": "btn_diag_save", "click":function() { updateRow(recid); } }, { "text":"Close", "class":"exit", "id": "btn_diag_close", "click":function() { jQuery(this).dialog('close'); // jQuery(this).remove(); } } ] }).dialog('open'); jQuery('#modalField_subdrycde').change(); //20190314 donita } }) // var clonedPagerModal = jQuery('#pager_modal').clone(); // var action_btn_selected_row=''; // jQuery('#div_pager #datatable tbody tr').each(function(key,val){ // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var hidden_type = jQuery(val).find('#'+pager_keys[i]).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('1'); // } // else // { // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('0'); // } // } // else // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).is(':checkbox')) // { // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).data('checked_value')==dataval) // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // } // } // else // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).val(dataval); // } // } // } // } // }); // modPagerBtn('edit'); } function pager_view_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery('#pager_modal .required').removeClass('input_hasErr'); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } // console.log(recid); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&event_action=view"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); // console.log(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { $.each(xret.rs,function(key,xretDataval) { if(jQuery('#modalField_'+key).is(':checkbox')) { jQuery('#modalField_'+key).prop('checked',!true); if(jQuery('#modalField_'+key).data('checked_value')==xretDataval) { jQuery('#modalField_'+key).prop('checked',true); } } else { jQuery('#modalField_'+key).val(xretDataval); } }); jQuery('#pager_modal').find('input,textarea,select').prop('disabled',true); jQuery('#pager_modal').dialog({ title:'View', width: xmodal_width, height: xmodal_height, appendTo:'#div_pager', draggable:true, resizable:false, autoOpen:false, modal:true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [ { "text":"Close", "class":"exit", "id":"btn_diag_close", "click":function() { jQuery(this).dialog('close'); // jQuery(this).remove(); } } ] }).dialog('open'); } }) // var clonedPagerModal = jQuery('#pager_modal').clone(); // var action_btn_selected_row=''; // jQuery('#div_pager #datatable tbody tr').each(function(key,val){ // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var hidden_type = jQuery(val).find('#'+pager_keys[i]).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('1'); // } // else // { // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('0'); // } // } // else // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).is(':checkbox')) // { // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).data('checked_value')==dataval) // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // } // } // else // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).val(dataval); // } // } // } // } // }); } function delete_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } var action_btn_selected_row=''; //tinamaan to // jQuery('#div_pager #datatable tbody tr').each(function(key,val) // { // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // jQuery('#modalField_'+pager_keys[i]).val(dataval); // } // } // }); // console.log('???',jQuery('#div_pager #datatable .tbody .tr#'+active_id)); jQuery('#div_pager #datatable .tbody .tr#'+active_id).addClass('action_btn_selected_row'); action_btn_selected_row = jQuery('#div_pager #datatable .tbody .tr#'+active_id); for(var i=0;i<pager_keys.length;i++) { var val = jQuery('#div_pager #datatable .tbody .tr[id="'+active_id+'"]').get(0); // get the DOM element var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); jQuery('#modalField_'+pager_keys[i]).val(dataval); // console.log("out",jQuery('#modalField_'+pager_keys[i]).val(dataval)); } jQuery('#pager_modal').hide(); var xparams = ""; var xretmsg = ""; xparams += "&headers="+headers; xparams += "&title="+xtitle; xparams += "&table="+table; xparams += "&recid="+encodeURIComponent(recid); xparams += "&table_id="+table_id; xparams += "&fields="+fields; xparams += "&pager_xlink="+xlink_id; xparams += "&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); jQuery.ajax({ dataType:'json', data : xparams, url : 'class/pager_item_dedector.php', type: 'post', success : function (xretobj){ xretmsg = xretobj.msg; alertify.confirm('Delete "<b>'+xtitle+'</b> (' + xretmsg + ')" Record ?',function() { blockui(); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=delete"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); alertify.alert(response.msg+' (' + xretmsg + ').',function() { if(response.bool) { // 20191118 justine set after delete go to firt page // jQuery('#pager_first').click(); pager_reload(); } }); } }); },function() { action_btn_selected_row.removeClass('action_btn_selected_row'); }); } }); } function checkpage() { if(parseInt(page) == 1) { jQuery('#pager_first').prop("disabled",true); jQuery('#pager_prev').prop("disabled",true); } else { jQuery('#pager_first').prop("disabled",false); jQuery('#pager_prev').prop("disabled",false); } if(parseInt(page) > parseInt(totalpages)) { page = parseInt(jQuery('#pager_page').val()) - 1; console.log("in"); // return false; document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); } } jQuery('#pager_selector').change(function(){ document.forms.myform.pager_page.value=this.value; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_limiter').change(function(){ document.forms.myform.pager_page.value='1'; document.forms.myform.pager_limit.value=this.value; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_next').click(function(){ if(page == totalpages){ page = totalpages; } else{ page = parseInt(jQuery('#pager_page').val()) + 1; } document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_prev').click(function(){ if(page == 1){ page = 1; } else{ page = parseInt(jQuery('#pager_page').val()) - 1; } document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_first').click(function(){ document.forms.myform.pager_page.value=1; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_last').click(function(){ document.forms.myform.pager_page.value=totalpages; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_search_btn').click(function(){ document.forms.myform.pager_page.value=1; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); //enable pressing enter on pager_search to submit jQuery('#pager_search_input').on('keypress', function (event) { if(event.which === 13){ jQuery('#pager_search_btn').click(); } }); function pager_reload() { document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); } function print_item() { jQuery('#print_layout_container').show(); jQuery('#pager_print_export').dialog({ title:"Print "+xtitle, width: '650', height: 'auto', draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); jQuery('#pager_print_export .pager_print_expt_col_sort_sel').val('').change(); jQuery('#pager_print_export .pager_print_expt_input_text').val(''); }, buttons: [ { "text":"Print Preview", "class":"print", "id": "btn_diag_print", "click":function() { document.forms.myform.action='mf_print.php'; document.forms.myform.method='POST'; document.forms.myform.target='_blank'; document.forms.myform.submit(); } }, { "text":"Cancel", "class":"exit", "id": "btn_diag_cancel", "click":function() { jQuery(this).dialog("close"); } } ] }).dialog('open'); } function export_item() { jQuery('#print_layout_container').hide(); jQuery('#pager_print_export').dialog({ title:"Export "+xtitle, width: '650', height: 'auto', draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); jQuery('#pager_print_export .pager_print_expt_col_sort_sel').val('').change(); jQuery('#pager_print_export .pager_print_expt_input_text').val(''); }, buttons: [ { "text":"Export", "class":"print", "id": "btn_diag_export", "click":function() { document.forms.myform.action='mf_export.php'; document.forms.myform.method='POST'; document.forms.myform.target='_blank'; document.forms.myform.submit(); } }, { "text":"Cancel", "id": "btn_diag_cancel", "class":"exit", "click":function() { jQuery(this).dialog("close"); } } ] }).dialog('open'); } function pager_check_all(obj) { var ischecked = jQuery(obj).prop('checked'); if(ischecked) { jQuery('.pager_checker_body').prop('checked',true); } else { jQuery('.pager_checker_body').prop('checked',false); } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function prevent_space(evt) { if(evt.which == 32) { evt.returnValue = false; } } //20191107 donita bak org // function paste_syspar_regex(evt) // { // evt.preventDefault(); // evt.returnValue = false; // var text = null; // if (window.clipboardData) // text = window.clipboardData.getData("Text"); // else if (evt && evt.clipboardData) // text = evt.clipboardData.getData("Text"); // var validate_spechar = jQuery('#pager_spechar').val(); // validate_spechar = validate_spechar.split(""); // validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; // var regex = new RegExp(validate_spechar,'mg'); // if( regex.test(text) ) // { // alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() // { // evt.target.value = text.replace(regex, ""); // // console.log(evt.target,text.replace(regex, "")); // },function() // { // }) // } // else // { // evt.target.value = text // } // } //prevent bypass of maxlength and pasting on disabled input function paste_syspar_regex(evt) { evt.preventDefault(); evt.returnValue = false; // console.log("pass") // console.log("1") // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val()+"<>"; validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery("#"+evt.target.id).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr.substring(0, xmaxlen); //20191107 donita // console.log(evt.target.id); if(jQuery("#"+evt.target.id).prop('disabled') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // disallow_tag("") // alert("1") // console.log("11") //20191106 donita newstr = evt.target.value; //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); //end trimstr = evt.target.value+newstr.substring(0, xmaxlen); evt.target.value = trimstr; // console.log(evt.target,text.replace(regex, "")); },function() { }) } else { evt.target.value = text //20191106 donita newstr = evt.target.value; trimstr = newstr.substring(0, xmaxlen); evt.target.value = trimstr; } } } function filter_syspar_code_regex(val_with_spechar) { var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); return val_with_spechar.replace(regex, ""); } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/class/lstv_pager.js?v=20220224185611 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20191106 |
| Request Header - size: 492 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/class/lstv_pager.js?v=20220224185611 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Thu, 24 Feb 2022 10:56:11 GMT Accept-Ranges: bytes Content-Length: 50267 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 50,267 bytes. |
var fields = jQuery('#pager_fields').val().split(',');
var headers = jQuery('#pager_headers').val().split(','); var table = jQuery('#pager_table').val(); var table_id = jQuery('#pager_table_id').val(); var xlink_id = jQuery('#pager_xlink').val(); var xfield = jQuery('#pager_xfield').val(); var xtitle = jQuery('#pager_title').val(); var xusedscascde = jQuery('#usedscascde').val(); var xtable_code = jQuery('#table_code').val(); var xtable_desc = jQuery('#table_desc').val(); var xmodal_width = jQuery('#modal_width').val(); var xmodal_height = jQuery('#modal_height').val(); var xhovering_type = jQuery('#hovering_type').val(); var xserver = jQuery('#server').val(); var xpager_link_id_hash = jQuery('#pager_link_id_hash').val(); var totalpages = jQuery('#pager_totalpages').val(); var page = jQuery('#pager_page').val(); var pager_keys = new Array(); jQuery(document).ready(function(){ checkpage(); jQuery('#txtchk').click(function(){ document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='post'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('.datepicker').datepicker(); jQuery('ul.ui-autocomplete').css('z-index',1100); jQuery('.dia_fld').dbFldLen({ link_hash_id: xpager_link_id_hash, tablename: table, ajaxPage:'db_field_length_checker_ajax.php' }); jQuery('#div_pager').on('click','#datatable .pager_thead .header_sort',function() { jQuery('#header_sort').val(jQuery(this).data('header_field_column')); if(jQuery(this).find('.header_sort_asc').length>0) { jQuery('#header_sort_by').val('DESC'); } else { jQuery('#header_sort_by').val('ASC'); } //20191118 justine set after sorting go to first page // document.forms.myform.action= xserver; // document.forms.myform.method='post'; // document.forms.myform.target='_self'; // document.forms.myform.submit(); jQuery('#pager_first').click(); }); jQuery('#pager_print_export').on('change','.pager_print_expt_col_sort_sel',function() { jQuery('.pager_print_expt_col_sort_sel').find('option').show(); jQuery('.pager_print_expt_col_sort_sel').each(function() { var this_val = jQuery(this).val(); if(this_val!="") { jQuery('.pager_print_expt_col_sort_sel').not(this).find('option[value="'+this_val+'"]').hide(); } }); }); jQuery('#div_pager #datatable tbody tr:eq(0) td').each(function(key,val){ pager_keys[pager_keys.length] = jQuery(val).attr('id'); }); jQuery('#pager_modal input[type=checkbox]').each(function(key,val){ jQuery(this).click(function(){ var xbool = jQuery(this).prop('checked'); var xid = jQuery(this).attr('id'); if(xbool == true){ jQuery('#checkbox_'+xid).val('1'); } else{ jQuery('#checkbox_'+xid).val('0'); } }); }); jQuery('#pager_copy_diag').dialog({ title:'Copy to Other ' + jQuery("#hr_mode").val(), width: 800, height: 600, draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function(){jQuery('.ui-dialog-titlebar-close').hide();}, buttons:[ { text:"Copy", class:"save", click:function() { pager_copy_diag_result(); } }, { text:"Cancel", class:"exit", click:function() { jQuery(this).dialog('close'); location.reload(); } } ] }); jQuery('#pager_copy_diag').on('click','.pager_freeze_tbl .tbody .td',function(e) { if(jQuery(this).find('.pager_copy_chkbox').length==0) { jQuery(this).closest('.tr').find('.pager_copy_chkbox').prop('checked',!jQuery(this).closest('.tr').find('.pager_copy_chkbox').is(':checked')).change(); } }) jQuery('#pager_copy_diag').on('change','.pager_freeze_tbl .tbody .td .pager_copy_chkbox',function(e) { if(jQuery(this).is(':checked')) { jQuery(this).closest('.tr').find('.td').addClass('td_pager_copy_candidate'); } else { jQuery(this).closest('.tr').find('.td').removeClass('td_pager_copy_candidate'); } }) jQuery('#pager_copy_diag').on('click','.pager_copy_all_chkbox',function() { jQuery('#pager_copy_diag .pager_freeze_tbl .tbody .tr').find('.pager_copy_chkbox:not(:disabled)').prop('checked',jQuery(this).is(':checked')).change(); }) jQuery('#pager_copy_diag').on('change','.pager_copy_subdryfrom',function() { jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option").show(); if(jQuery('#pager_copy_diag').find('.pager_copy_subdryto').val()==jQuery(this).val()) { jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option[value!='"+jQuery(this).val()+"']").prop('selected',true); } jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option[value='"+jQuery(this).val()+"']").hide(); reload_pager_copy_diag_result(); }) jQuery('#pager_copy_diag').on('change','.pager_copy_subdryto',function() { jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option").show(); if(jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').val()==jQuery(this).val()) { jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option[value!='"+jQuery(this).val()+"']").prop('selected',true); } jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option[value='"+jQuery(this).val()+"']").hide(); reload_pager_copy_diag_result(); }) if(xhovering_type == 'click'){ jQuery('#div_pager #datatable .pager_tbody .pager_tr').each(function(key,val){ jQuery(val).click(function(){ jQuery('#div_pager #datatable .pager_tbody .pager_tr').removeClass('pager-active'); jQuery(this).addClass('pager-active'); var active_id = jQuery(this).attr('id'); jQuery('#pager_active_id').val(active_id); for(var i=0;i<pager_keys.length;i++){ var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); jQuery('#pager_'+pager_keys[i]).val(dataval); } }); }); } else{ // console.log(jQuery('#div_pager #datatable .pager_tbody .pager_tr').length); jQuery('#div_pager').on('mouseover','#datatable .pager_tbody .pager_tr',function() { var active_id = jQuery(this).attr('id'); // console.log('hovertblasdsadasda',active_id); jQuery('#pager_active_id').val(active_id); for(var i=0;i<pager_keys.length;i++) { var dataval = jQuery(this).find('#'+pager_keys[i]).attr('value'); jQuery('#pager_'+pager_keys[i]).val(dataval); } }) // jQuery('#div_pager #datatable .pager_tbody .pager_tr').each(function(key,val){ // jQuery(val).hover(function(){ // console.log(val); // }); // }); } // init_datatable_freezetable(); }) jQuery(window).load(function() { init_datatable_freezetable(); }) function checkselval(obj) { var selval = jQuery(obj).val(); jQuery(".pager_print_expt_col_sort_sel").addClass("checkselval"); jQuery(obj).removeClass("checkselval"); jQuery('.checkselval').each(function(){ if(jQuery(this).val() == selval && jQuery(this).val() != "" ) { alertify.alert("Column No. already selected.",function(){ jQuery(obj).val(""); }); } }); jQuery(".pager_print_expt_col_sort_sel").removeClass("checkselval"); } function init_datatable_freezetable() { var header_width = []; var action_header_index=null; jQuery('#div_pager #datatable th:visible').each(function(index,value) { if(jQuery(this).hasClass('header_action')) { action_header_index=index; } header_width.push(jQuery(this).data('header_width')); }); if(action_header_index!=null) { jQuery('#div_pager ').find('table tbody tr').each(function() { jQuery(this).find('td:visible').eq(action_header_index).addClass('pager_action_btn_container'); }); // console.log(action_header_index); jQuery('#div_pager #datatable').lst_freeze_table({ column_width:header_width, // left_fixed_column_index:[1], right_fixed_column_index:[action_header_index], tbl_max_width: "auto", tbl_max_height: "auto" }); } else { jQuery('#div_pager #datatable').lst_freeze_table({ column_width:header_width, // left_fixed_column_index:[1], // right_fixed_column_index:[action_header_index], tbl_max_width: "auto", tbl_max_height: "auto" }); } } function reload_pager_copy_diag_result() { if(jQuery('#pager_copy_diag').find('.pager_copy_subdryto').val()!='') { blockui(); var xdata = ""; xdata+="&"+jQuery('#pager_copy_diag .pager_copy_subdry').serialize(); xdata+="&pager_event_action=reload_pager_copy_diag_result"; xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&headers="+headers; xdata+="&pager_xlink="+xlink_id; xdata+="&fieldname="+xfield; xdata+="&xusedscascde="+xusedscascde; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); jQuery('#pager_copy_diag #pager_freeze_tbl_container').empty() jQuery('#pager_copy_diag #pager_freeze_tbl_container').html(response.content); jQuery('#pager_copy_diag #pager_freeze_tbl_container .pager_freeze_tbl').lst_freeze_table({ column_width:response.column_width, left_fixed_column_index:[0], tbl_max_width: 770, tbl_max_height: 350 }); } }); } } function pager_copy_diag_result() { if(jQuery('#pager_copy_diag .pager_copy_chkbox:checked').length > 0) { alertify.confirm('Continue copying selected records ? ',function() { blockui(); var xdata = ""; xdata+="&"+jQuery('#pager_copy_diag *').serialize(); xdata+="&pager_event_action=pager_copy_diag_result"; xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&headers="+headers; xdata+="&pager_xlink="+xlink_id; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); alertify.alert(response.msg,function() { reload_pager_copy_diag_result(); }) } }); },function() { }) } else { alertify.alert('Please select record(s) to copy.') } } function pager_open_subdry_copy_diag() { jQuery('#pager_copy_diag').dialog('open'); jQuery('#pager_copy_diag .pager_copy_subdryfrom option:first').prop('selected',true); jQuery('#pager_copy_diag .pager_copy_subdryto option:first').prop('selected',true); jQuery('#pager_copy_diag .pager_copy_subdryfrom').change(); } function clear_searchbox() { jQuery('#pager_search_input').val(''); } function addRow() { isValid = true; jQuery('#pager_modal .required:visible').removeClass('input_hasErr'); jQuery('#pager_modal .required:visible').each(function() { if (jQuery(this).val() == '') { isValid = false; jQuery(this).addClass('input_hasErr'); } else //20191113 donita { var xval = jQuery(this).val(); xval = xval.trim(); jQuery(this).val(xval); if(xval == "") { jQuery(this).addClass('input_hasErr'); isValid = false; } } }); if(isValid) { var modalfield_tablecde = jQuery('#modalField_'+xtable_code); var modalfield_tabledsc = jQuery('#modalField_'+xtable_desc); if(xusedscascde == 1) { // console.log('passxuseddscascde',filter_syspar_code_regex(modalfield_tabledsc.val())); if(filter_syspar_code_regex(modalfield_tabledsc.val())!="") { modalfield_tablecde.val(filter_syspar_code_regex(modalfield_tabledsc.val())); } else { alertify.alert('Description must contain atleast 1 alphanumeric ( A-Z , 0-9 ) character. '); return; } } blockui(); var xdata = ""; xdata+=jQuery('#pager_modal *').serialize(); xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=add"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery('#pager_modal').find('input:checkbox:not(:checked)').each(function() { xdata+="&"+jQuery(this).attr('name')+"="+jQuery(this).data('unchecked_value'); }) console.log(xdata); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response){ $.unblockUI(); if(response.bool) { jQuery('#pager_modal').dialog('close'); } alertify.alert(response.msg,function(){ if(response.bool) { jQuery('#pager_modal').dialog('close'); //20191118 justine set after adding go to first page // pager_reload(); jQuery('#pager_first').click(); } else{ if(response.msg == "Please fill required field(s).") { var arr = response.flds; for(var x=0; x<arr.length; x++) { jQuery('#modalField_'+arr[x]).val(""); jQuery('#modalField_'+arr[x]).addClass('input_hasErr'); } } } }); } }); } else { alertify.alert('Please fill required field(s)').set({'closable':false,'modal':true}); } } function updateRow(recid) { isValid = true; jQuery('#pager_modal .required:visible').removeClass('input_hasErr'); jQuery('#pager_modal .required:visible').each(function() { if (jQuery(this).val() == '') { isValid = false; jQuery(this).addClass('input_hasErr'); } else //20191113 donita { var xval = jQuery(this).val(); xval = xval.trim(); jQuery(this).val(xval); if(xval == "") { jQuery(this).addClass('input_hasErr'); isValid = false; } } }); if(isValid) { var modalfield_tablecde = jQuery("#modalField_"+xtable_code); var modalfield_tabledsc = jQuery("#modalField_"+xtable_desc); if(xusedscascde == 1) { if(filter_syspar_code_regex(modalfield_tabledsc.val())!="") { modalfield_tablecde.val(filter_syspar_code_regex(modalfield_tabledsc.val())); } else { alertify.alert('Description must contain atleast 1 alphanumeric ( A-Z , 0-9 ) character. '); return; } } blockui(); if(xtitle == "Leaves File") { jQuery('#pager_modal').find('input[id*="modalField_"]').prop('disabled',false); } var xdata = ""; xdata+=jQuery('#pager_modal *').serialize(); xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&recid="+encodeURIComponent(recid); xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=update"; xdata+="&fieldname="+xfield; xdata+="&headers="+headers; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery('#pager_modal').find('input:checkbox:not(:checked)').each(function() { xdata+="&"+jQuery(this).attr('name')+"="+jQuery(this).data('unchecked_value'); }) jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response){ $.unblockUI(); if(response.bool) { jQuery('#pager_modal').dialog('close'); } alertify.alert(response.msg,function(){ if(response.bool) { pager_reload(); } else{ if(response.msg == "Please fill required field(s).") { var arr = response.flds; for(var x=0; x<arr.length; x++) { jQuery('#modalField_'+arr[x]).val(""); jQuery('#modalField_'+arr[x]).addClass('input_hasErr'); } } else if(response.leave_logs != "" && xtitle == "Leaves File") { document.forms.myform.action = 'mf_leave_xpt.php'; document.forms.myform.target = '_blank'; document.forms.method = 'POST'; document.forms.myform.leave_logs.value = response.leave_logs; document.forms.myform.txt_leavesdesc.value = jQuery('#modalField_leavesdesc').val(); document.forms.myform.submit(); } } }); } }); } else { alertify.alert('Please fill required field(s)').set({'closable':false,'modal':true}); } } function modPagerBtn(par) { if(par=='add') { var xfunc = 'addRow()'; var xtitle = 'Save'; } else if(par=='edit') { var xfunc = 'updateRow()'; var xtitle = 'Save'; } jQuery('.ui-dialog .ui-dialog-buttonpane .ui-button').remove(); // mica change button to input type button or button type button // var btn = "<button role='button' class='save' style='height:30px;' onclick='"+xfunc+"'>"+xtitle+"</button>"; // btn += "<button role='button' class='exit' style='height:30px;' onclick='closePagerModal()'>Close</button>"; var btn = "<input type=\"button\" class=\"save\" style=\"height:30px;\" onclick=\""+xfunc+"\" value=\""+xtitle+"\">"; btn += "<input type=\"button\" class=\"exit\" style=\"height:30px;\" onclick=\"closePagerModal()\" value=\"Close\">"; jQuery('.ui-dialog-buttonset').append(btn); } function closePagerModal() { jQuery('#div_pager #datatable tr').removeClass('action_btn_selected_row'); jQuery('#pager_modal').dialog('close'); } function add_item(){ var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&event_action=has_edo"; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { jQuery('#pager_modal').find('input,textarea,select').prop('disabled',false); jQuery('#pager_modal input:text').val(''); jQuery('#pager_modal input:checkbox').prop('checked',false); jQuery('#pager_modal .required').removeClass('input_hasErr'); if(xtitle == "Leaves File") { jQuery('#modalField_is_edo').prop('disabled',xret); } jQuery('#pager_modal').dialog({ title:'Add', width: xmodal_width, height: xmodal_height, draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function(){jQuery('.ui-dialog-titlebar-close').hide();}, buttons:[ { text:"Save", class:"save", id:"btn_diag_save", click:function() { addRow(); } }, { text:"Cancel", class:"exit", id:"btn_diag_cancel", click:function() { jQuery(this).dialog('close'); } } ] }).dialog('open'); jQuery('#modalField_subdrycde').change(); //20190314 donita } }) } function edit_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery('#pager_modal .required').removeClass('input_hasErr'); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } // console.log(recid); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&event_action=view"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); // console.log(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { $.each(xret.rs,function(key,xretDataval) { // console.log(xretDataval); // console.log(key); // var hidden_type = jQuery(xretDataval).find('#modalField_'+key).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(xretDataval).find('#'+key).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery('#modalField_'+key).prop('checked',true); // jQuery('#checkbox_modalField_'+key).val('1'); // } // else // { // jQuery('#checkbox_modalField_'+key).val('0'); // } // } // else // { // var dataval = jQuery(xretDataval).find('#'+key).attr('value'); if(jQuery('#modalField_'+key).is(':checkbox')) { jQuery('#modalField_'+key).prop('checked',false); if(jQuery('#modalField_'+key).data('checked_value')==xretDataval) { jQuery('#modalField_'+key).prop('checked',true); } } else { jQuery('#modalField_'+key).val(xretDataval); } // } }); jQuery('#pager_modal').find('input,textarea,select').prop('disabled',false); if(xtitle == "Leaves File") { $.each(xret.is_disabled,function(key,xretDataval) { jQuery('#modalField_'+key).prop('disabled',xretDataval); }); jQuery('#pager_modal').find('input#modalField_withoutpay').prop('disabled',true); } //jQuery('#pager_modal').find('#modalField_subdrycde').prop('readonly','readonly'); jQuery('#pager_modal').dialog({ title:'Edit', width: xmodal_width, height: xmodal_height, appendTo:'#div_pager', draggable:true, resizable:false, autoOpen:false, modal:true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [ { "text":"Save", "class":"save", "id": "btn_diag_save", "click":function() { updateRow(recid); } }, { "text":"Close", "class":"exit", "id": "btn_diag_close", "click":function() { jQuery(this).dialog('close'); // jQuery(this).remove(); } } ] }).dialog('open'); jQuery('#modalField_subdrycde').change(); //20190314 donita } }) // var clonedPagerModal = jQuery('#pager_modal').clone(); // var action_btn_selected_row=''; // jQuery('#div_pager #datatable tbody tr').each(function(key,val){ // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var hidden_type = jQuery(val).find('#'+pager_keys[i]).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('1'); // } // else // { // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('0'); // } // } // else // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).is(':checkbox')) // { // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).data('checked_value')==dataval) // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // } // } // else // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).val(dataval); // } // } // } // } // }); // modPagerBtn('edit'); } function pager_view_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery('#pager_modal .required').removeClass('input_hasErr'); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } // console.log(recid); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&event_action=view"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); // console.log(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { $.each(xret.rs,function(key,xretDataval) { if(jQuery('#modalField_'+key).is(':checkbox')) { jQuery('#modalField_'+key).prop('checked',!true); if(jQuery('#modalField_'+key).data('checked_value')==xretDataval) { jQuery('#modalField_'+key).prop('checked',true); } } else { jQuery('#modalField_'+key).val(xretDataval); } }); jQuery('#pager_modal').find('input,textarea,select').prop('disabled',true); jQuery('#pager_modal').dialog({ title:'View', width: xmodal_width, height: xmodal_height, appendTo:'#div_pager', draggable:true, resizable:false, autoOpen:false, modal:true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [ { "text":"Close", "class":"exit", "id":"btn_diag_close", "click":function() { jQuery(this).dialog('close'); // jQuery(this).remove(); } } ] }).dialog('open'); } }) // var clonedPagerModal = jQuery('#pager_modal').clone(); // var action_btn_selected_row=''; // jQuery('#div_pager #datatable tbody tr').each(function(key,val){ // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var hidden_type = jQuery(val).find('#'+pager_keys[i]).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('1'); // } // else // { // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('0'); // } // } // else // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).is(':checkbox')) // { // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).data('checked_value')==dataval) // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // } // } // else // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).val(dataval); // } // } // } // } // }); } function delete_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } var action_btn_selected_row=''; //tinamaan to // jQuery('#div_pager #datatable tbody tr').each(function(key,val) // { // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // jQuery('#modalField_'+pager_keys[i]).val(dataval); // } // } // }); // console.log('???',jQuery('#div_pager #datatable .tbody .tr#'+active_id)); jQuery('#div_pager #datatable .tbody .tr#'+active_id).addClass('action_btn_selected_row'); action_btn_selected_row = jQuery('#div_pager #datatable .tbody .tr#'+active_id); for(var i=0;i<pager_keys.length;i++) { var val = jQuery('#div_pager #datatable .tbody .tr[id="'+active_id+'"]').get(0); // get the DOM element var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); jQuery('#modalField_'+pager_keys[i]).val(dataval); // console.log("out",jQuery('#modalField_'+pager_keys[i]).val(dataval)); } jQuery('#pager_modal').hide(); var xparams = ""; var xretmsg = ""; xparams += "&headers="+headers; xparams += "&title="+xtitle; xparams += "&table="+table; xparams += "&recid="+encodeURIComponent(recid); xparams += "&table_id="+table_id; xparams += "&fields="+fields; xparams += "&pager_xlink="+xlink_id; xparams += "&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); jQuery.ajax({ dataType:'json', data : xparams, url : 'class/pager_item_dedector.php', type: 'post', success : function (xretobj){ xretmsg = xretobj.msg; alertify.confirm('Delete "<b>'+xtitle+'</b> (' + xretmsg + ')" Record ?',function() { blockui(); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=delete"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); alertify.alert(response.msg+' (' + xretmsg + ').',function() { if(response.bool) { // 20191118 justine set after delete go to firt page // jQuery('#pager_first').click(); pager_reload(); } }); } }); },function() { action_btn_selected_row.removeClass('action_btn_selected_row'); }); } }); } function checkpage() { if(parseInt(page) == 1) { jQuery('#pager_first').prop("disabled",true); jQuery('#pager_prev').prop("disabled",true); } else { jQuery('#pager_first').prop("disabled",false); jQuery('#pager_prev').prop("disabled",false); } if(parseInt(page) > parseInt(totalpages)) { page = parseInt(jQuery('#pager_page').val()) - 1; console.log("in"); // return false; document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); } } jQuery('#pager_selector').change(function(){ document.forms.myform.pager_page.value=this.value; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_limiter').change(function(){ document.forms.myform.pager_page.value='1'; document.forms.myform.pager_limit.value=this.value; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_next').click(function(){ if(page == totalpages){ page = totalpages; } else{ page = parseInt(jQuery('#pager_page').val()) + 1; } document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_prev').click(function(){ if(page == 1){ page = 1; } else{ page = parseInt(jQuery('#pager_page').val()) - 1; } document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_first').click(function(){ document.forms.myform.pager_page.value=1; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_last').click(function(){ document.forms.myform.pager_page.value=totalpages; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_search_btn').click(function(){ document.forms.myform.pager_page.value=1; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); //enable pressing enter on pager_search to submit jQuery('#pager_search_input').on('keypress', function (event) { if(event.which === 13){ jQuery('#pager_search_btn').click(); } }); function pager_reload() { document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); } function print_item() { jQuery('#print_layout_container').show(); jQuery('#pager_print_export').dialog({ title:"Print "+xtitle, width: '650', height: 'auto', draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); jQuery('#pager_print_export .pager_print_expt_col_sort_sel').val('').change(); jQuery('#pager_print_export .pager_print_expt_input_text').val(''); }, buttons: [ { "text":"Print Preview", "class":"print", "id": "btn_diag_print", "click":function() { document.forms.myform.action='mf_print.php'; document.forms.myform.method='POST'; document.forms.myform.target='_blank'; document.forms.myform.submit(); } }, { "text":"Cancel", "class":"exit", "id": "btn_diag_cancel", "click":function() { jQuery(this).dialog("close"); } } ] }).dialog('open'); } function export_item() { jQuery('#print_layout_container').hide(); jQuery('#pager_print_export').dialog({ title:"Export "+xtitle, width: '650', height: 'auto', draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); jQuery('#pager_print_export .pager_print_expt_col_sort_sel').val('').change(); jQuery('#pager_print_export .pager_print_expt_input_text').val(''); }, buttons: [ { "text":"Export", "class":"print", "id": "btn_diag_export", "click":function() { document.forms.myform.action='mf_export.php'; document.forms.myform.method='POST'; document.forms.myform.target='_blank'; document.forms.myform.submit(); } }, { "text":"Cancel", "id": "btn_diag_cancel", "class":"exit", "click":function() { jQuery(this).dialog("close"); } } ] }).dialog('open'); } function pager_check_all(obj) { var ischecked = jQuery(obj).prop('checked'); if(ischecked) { jQuery('.pager_checker_body').prop('checked',true); } else { jQuery('.pager_checker_body').prop('checked',false); } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function prevent_space(evt) { if(evt.which == 32) { evt.returnValue = false; } } //20191107 donita bak org // function paste_syspar_regex(evt) // { // evt.preventDefault(); // evt.returnValue = false; // var text = null; // if (window.clipboardData) // text = window.clipboardData.getData("Text"); // else if (evt && evt.clipboardData) // text = evt.clipboardData.getData("Text"); // var validate_spechar = jQuery('#pager_spechar').val(); // validate_spechar = validate_spechar.split(""); // validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; // var regex = new RegExp(validate_spechar,'mg'); // if( regex.test(text) ) // { // alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() // { // evt.target.value = text.replace(regex, ""); // // console.log(evt.target,text.replace(regex, "")); // },function() // { // }) // } // else // { // evt.target.value = text // } // } //prevent bypass of maxlength and pasting on disabled input function paste_syspar_regex(evt) { evt.preventDefault(); evt.returnValue = false; // console.log("pass") // console.log("1") // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val()+"<>"; validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery("#"+evt.target.id).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr.substring(0, xmaxlen); //20191107 donita // console.log(evt.target.id); if(jQuery("#"+evt.target.id).prop('disabled') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // disallow_tag("") // alert("1") // console.log("11") //20191106 donita newstr = evt.target.value; //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); //end trimstr = evt.target.value+newstr.substring(0, xmaxlen); evt.target.value = trimstr; // console.log(evt.target,text.replace(regex, "")); },function() { }) } else { evt.target.value = text //20191106 donita newstr = evt.target.value; trimstr = newstr.substring(0, xmaxlen); evt.target.value = trimstr; } } } function filter_syspar_code_regex(val_with_spechar) { var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); return val_with_spechar.replace(regex, ""); } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/class/lstv_pager.js?v=20220224185611 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20191107 |
| Request Header - size: 492 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/class/lstv_pager.js?v=20220224185611 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Thu, 24 Feb 2022 10:56:11 GMT Accept-Ranges: bytes Content-Length: 50267 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 50,267 bytes. |
var fields = jQuery('#pager_fields').val().split(',');
var headers = jQuery('#pager_headers').val().split(','); var table = jQuery('#pager_table').val(); var table_id = jQuery('#pager_table_id').val(); var xlink_id = jQuery('#pager_xlink').val(); var xfield = jQuery('#pager_xfield').val(); var xtitle = jQuery('#pager_title').val(); var xusedscascde = jQuery('#usedscascde').val(); var xtable_code = jQuery('#table_code').val(); var xtable_desc = jQuery('#table_desc').val(); var xmodal_width = jQuery('#modal_width').val(); var xmodal_height = jQuery('#modal_height').val(); var xhovering_type = jQuery('#hovering_type').val(); var xserver = jQuery('#server').val(); var xpager_link_id_hash = jQuery('#pager_link_id_hash').val(); var totalpages = jQuery('#pager_totalpages').val(); var page = jQuery('#pager_page').val(); var pager_keys = new Array(); jQuery(document).ready(function(){ checkpage(); jQuery('#txtchk').click(function(){ document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='post'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('.datepicker').datepicker(); jQuery('ul.ui-autocomplete').css('z-index',1100); jQuery('.dia_fld').dbFldLen({ link_hash_id: xpager_link_id_hash, tablename: table, ajaxPage:'db_field_length_checker_ajax.php' }); jQuery('#div_pager').on('click','#datatable .pager_thead .header_sort',function() { jQuery('#header_sort').val(jQuery(this).data('header_field_column')); if(jQuery(this).find('.header_sort_asc').length>0) { jQuery('#header_sort_by').val('DESC'); } else { jQuery('#header_sort_by').val('ASC'); } //20191118 justine set after sorting go to first page // document.forms.myform.action= xserver; // document.forms.myform.method='post'; // document.forms.myform.target='_self'; // document.forms.myform.submit(); jQuery('#pager_first').click(); }); jQuery('#pager_print_export').on('change','.pager_print_expt_col_sort_sel',function() { jQuery('.pager_print_expt_col_sort_sel').find('option').show(); jQuery('.pager_print_expt_col_sort_sel').each(function() { var this_val = jQuery(this).val(); if(this_val!="") { jQuery('.pager_print_expt_col_sort_sel').not(this).find('option[value="'+this_val+'"]').hide(); } }); }); jQuery('#div_pager #datatable tbody tr:eq(0) td').each(function(key,val){ pager_keys[pager_keys.length] = jQuery(val).attr('id'); }); jQuery('#pager_modal input[type=checkbox]').each(function(key,val){ jQuery(this).click(function(){ var xbool = jQuery(this).prop('checked'); var xid = jQuery(this).attr('id'); if(xbool == true){ jQuery('#checkbox_'+xid).val('1'); } else{ jQuery('#checkbox_'+xid).val('0'); } }); }); jQuery('#pager_copy_diag').dialog({ title:'Copy to Other ' + jQuery("#hr_mode").val(), width: 800, height: 600, draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function(){jQuery('.ui-dialog-titlebar-close').hide();}, buttons:[ { text:"Copy", class:"save", click:function() { pager_copy_diag_result(); } }, { text:"Cancel", class:"exit", click:function() { jQuery(this).dialog('close'); location.reload(); } } ] }); jQuery('#pager_copy_diag').on('click','.pager_freeze_tbl .tbody .td',function(e) { if(jQuery(this).find('.pager_copy_chkbox').length==0) { jQuery(this).closest('.tr').find('.pager_copy_chkbox').prop('checked',!jQuery(this).closest('.tr').find('.pager_copy_chkbox').is(':checked')).change(); } }) jQuery('#pager_copy_diag').on('change','.pager_freeze_tbl .tbody .td .pager_copy_chkbox',function(e) { if(jQuery(this).is(':checked')) { jQuery(this).closest('.tr').find('.td').addClass('td_pager_copy_candidate'); } else { jQuery(this).closest('.tr').find('.td').removeClass('td_pager_copy_candidate'); } }) jQuery('#pager_copy_diag').on('click','.pager_copy_all_chkbox',function() { jQuery('#pager_copy_diag .pager_freeze_tbl .tbody .tr').find('.pager_copy_chkbox:not(:disabled)').prop('checked',jQuery(this).is(':checked')).change(); }) jQuery('#pager_copy_diag').on('change','.pager_copy_subdryfrom',function() { jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option").show(); if(jQuery('#pager_copy_diag').find('.pager_copy_subdryto').val()==jQuery(this).val()) { jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option[value!='"+jQuery(this).val()+"']").prop('selected',true); } jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option[value='"+jQuery(this).val()+"']").hide(); reload_pager_copy_diag_result(); }) jQuery('#pager_copy_diag').on('change','.pager_copy_subdryto',function() { jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option").show(); if(jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').val()==jQuery(this).val()) { jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option[value!='"+jQuery(this).val()+"']").prop('selected',true); } jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option[value='"+jQuery(this).val()+"']").hide(); reload_pager_copy_diag_result(); }) if(xhovering_type == 'click'){ jQuery('#div_pager #datatable .pager_tbody .pager_tr').each(function(key,val){ jQuery(val).click(function(){ jQuery('#div_pager #datatable .pager_tbody .pager_tr').removeClass('pager-active'); jQuery(this).addClass('pager-active'); var active_id = jQuery(this).attr('id'); jQuery('#pager_active_id').val(active_id); for(var i=0;i<pager_keys.length;i++){ var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); jQuery('#pager_'+pager_keys[i]).val(dataval); } }); }); } else{ // console.log(jQuery('#div_pager #datatable .pager_tbody .pager_tr').length); jQuery('#div_pager').on('mouseover','#datatable .pager_tbody .pager_tr',function() { var active_id = jQuery(this).attr('id'); // console.log('hovertblasdsadasda',active_id); jQuery('#pager_active_id').val(active_id); for(var i=0;i<pager_keys.length;i++) { var dataval = jQuery(this).find('#'+pager_keys[i]).attr('value'); jQuery('#pager_'+pager_keys[i]).val(dataval); } }) // jQuery('#div_pager #datatable .pager_tbody .pager_tr').each(function(key,val){ // jQuery(val).hover(function(){ // console.log(val); // }); // }); } // init_datatable_freezetable(); }) jQuery(window).load(function() { init_datatable_freezetable(); }) function checkselval(obj) { var selval = jQuery(obj).val(); jQuery(".pager_print_expt_col_sort_sel").addClass("checkselval"); jQuery(obj).removeClass("checkselval"); jQuery('.checkselval').each(function(){ if(jQuery(this).val() == selval && jQuery(this).val() != "" ) { alertify.alert("Column No. already selected.",function(){ jQuery(obj).val(""); }); } }); jQuery(".pager_print_expt_col_sort_sel").removeClass("checkselval"); } function init_datatable_freezetable() { var header_width = []; var action_header_index=null; jQuery('#div_pager #datatable th:visible').each(function(index,value) { if(jQuery(this).hasClass('header_action')) { action_header_index=index; } header_width.push(jQuery(this).data('header_width')); }); if(action_header_index!=null) { jQuery('#div_pager ').find('table tbody tr').each(function() { jQuery(this).find('td:visible').eq(action_header_index).addClass('pager_action_btn_container'); }); // console.log(action_header_index); jQuery('#div_pager #datatable').lst_freeze_table({ column_width:header_width, // left_fixed_column_index:[1], right_fixed_column_index:[action_header_index], tbl_max_width: "auto", tbl_max_height: "auto" }); } else { jQuery('#div_pager #datatable').lst_freeze_table({ column_width:header_width, // left_fixed_column_index:[1], // right_fixed_column_index:[action_header_index], tbl_max_width: "auto", tbl_max_height: "auto" }); } } function reload_pager_copy_diag_result() { if(jQuery('#pager_copy_diag').find('.pager_copy_subdryto').val()!='') { blockui(); var xdata = ""; xdata+="&"+jQuery('#pager_copy_diag .pager_copy_subdry').serialize(); xdata+="&pager_event_action=reload_pager_copy_diag_result"; xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&headers="+headers; xdata+="&pager_xlink="+xlink_id; xdata+="&fieldname="+xfield; xdata+="&xusedscascde="+xusedscascde; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); jQuery('#pager_copy_diag #pager_freeze_tbl_container').empty() jQuery('#pager_copy_diag #pager_freeze_tbl_container').html(response.content); jQuery('#pager_copy_diag #pager_freeze_tbl_container .pager_freeze_tbl').lst_freeze_table({ column_width:response.column_width, left_fixed_column_index:[0], tbl_max_width: 770, tbl_max_height: 350 }); } }); } } function pager_copy_diag_result() { if(jQuery('#pager_copy_diag .pager_copy_chkbox:checked').length > 0) { alertify.confirm('Continue copying selected records ? ',function() { blockui(); var xdata = ""; xdata+="&"+jQuery('#pager_copy_diag *').serialize(); xdata+="&pager_event_action=pager_copy_diag_result"; xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&headers="+headers; xdata+="&pager_xlink="+xlink_id; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); alertify.alert(response.msg,function() { reload_pager_copy_diag_result(); }) } }); },function() { }) } else { alertify.alert('Please select record(s) to copy.') } } function pager_open_subdry_copy_diag() { jQuery('#pager_copy_diag').dialog('open'); jQuery('#pager_copy_diag .pager_copy_subdryfrom option:first').prop('selected',true); jQuery('#pager_copy_diag .pager_copy_subdryto option:first').prop('selected',true); jQuery('#pager_copy_diag .pager_copy_subdryfrom').change(); } function clear_searchbox() { jQuery('#pager_search_input').val(''); } function addRow() { isValid = true; jQuery('#pager_modal .required:visible').removeClass('input_hasErr'); jQuery('#pager_modal .required:visible').each(function() { if (jQuery(this).val() == '') { isValid = false; jQuery(this).addClass('input_hasErr'); } else //20191113 donita { var xval = jQuery(this).val(); xval = xval.trim(); jQuery(this).val(xval); if(xval == "") { jQuery(this).addClass('input_hasErr'); isValid = false; } } }); if(isValid) { var modalfield_tablecde = jQuery('#modalField_'+xtable_code); var modalfield_tabledsc = jQuery('#modalField_'+xtable_desc); if(xusedscascde == 1) { // console.log('passxuseddscascde',filter_syspar_code_regex(modalfield_tabledsc.val())); if(filter_syspar_code_regex(modalfield_tabledsc.val())!="") { modalfield_tablecde.val(filter_syspar_code_regex(modalfield_tabledsc.val())); } else { alertify.alert('Description must contain atleast 1 alphanumeric ( A-Z , 0-9 ) character. '); return; } } blockui(); var xdata = ""; xdata+=jQuery('#pager_modal *').serialize(); xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=add"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery('#pager_modal').find('input:checkbox:not(:checked)').each(function() { xdata+="&"+jQuery(this).attr('name')+"="+jQuery(this).data('unchecked_value'); }) console.log(xdata); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response){ $.unblockUI(); if(response.bool) { jQuery('#pager_modal').dialog('close'); } alertify.alert(response.msg,function(){ if(response.bool) { jQuery('#pager_modal').dialog('close'); //20191118 justine set after adding go to first page // pager_reload(); jQuery('#pager_first').click(); } else{ if(response.msg == "Please fill required field(s).") { var arr = response.flds; for(var x=0; x<arr.length; x++) { jQuery('#modalField_'+arr[x]).val(""); jQuery('#modalField_'+arr[x]).addClass('input_hasErr'); } } } }); } }); } else { alertify.alert('Please fill required field(s)').set({'closable':false,'modal':true}); } } function updateRow(recid) { isValid = true; jQuery('#pager_modal .required:visible').removeClass('input_hasErr'); jQuery('#pager_modal .required:visible').each(function() { if (jQuery(this).val() == '') { isValid = false; jQuery(this).addClass('input_hasErr'); } else //20191113 donita { var xval = jQuery(this).val(); xval = xval.trim(); jQuery(this).val(xval); if(xval == "") { jQuery(this).addClass('input_hasErr'); isValid = false; } } }); if(isValid) { var modalfield_tablecde = jQuery("#modalField_"+xtable_code); var modalfield_tabledsc = jQuery("#modalField_"+xtable_desc); if(xusedscascde == 1) { if(filter_syspar_code_regex(modalfield_tabledsc.val())!="") { modalfield_tablecde.val(filter_syspar_code_regex(modalfield_tabledsc.val())); } else { alertify.alert('Description must contain atleast 1 alphanumeric ( A-Z , 0-9 ) character. '); return; } } blockui(); if(xtitle == "Leaves File") { jQuery('#pager_modal').find('input[id*="modalField_"]').prop('disabled',false); } var xdata = ""; xdata+=jQuery('#pager_modal *').serialize(); xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&recid="+encodeURIComponent(recid); xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=update"; xdata+="&fieldname="+xfield; xdata+="&headers="+headers; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery('#pager_modal').find('input:checkbox:not(:checked)').each(function() { xdata+="&"+jQuery(this).attr('name')+"="+jQuery(this).data('unchecked_value'); }) jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response){ $.unblockUI(); if(response.bool) { jQuery('#pager_modal').dialog('close'); } alertify.alert(response.msg,function(){ if(response.bool) { pager_reload(); } else{ if(response.msg == "Please fill required field(s).") { var arr = response.flds; for(var x=0; x<arr.length; x++) { jQuery('#modalField_'+arr[x]).val(""); jQuery('#modalField_'+arr[x]).addClass('input_hasErr'); } } else if(response.leave_logs != "" && xtitle == "Leaves File") { document.forms.myform.action = 'mf_leave_xpt.php'; document.forms.myform.target = '_blank'; document.forms.method = 'POST'; document.forms.myform.leave_logs.value = response.leave_logs; document.forms.myform.txt_leavesdesc.value = jQuery('#modalField_leavesdesc').val(); document.forms.myform.submit(); } } }); } }); } else { alertify.alert('Please fill required field(s)').set({'closable':false,'modal':true}); } } function modPagerBtn(par) { if(par=='add') { var xfunc = 'addRow()'; var xtitle = 'Save'; } else if(par=='edit') { var xfunc = 'updateRow()'; var xtitle = 'Save'; } jQuery('.ui-dialog .ui-dialog-buttonpane .ui-button').remove(); // mica change button to input type button or button type button // var btn = "<button role='button' class='save' style='height:30px;' onclick='"+xfunc+"'>"+xtitle+"</button>"; // btn += "<button role='button' class='exit' style='height:30px;' onclick='closePagerModal()'>Close</button>"; var btn = "<input type=\"button\" class=\"save\" style=\"height:30px;\" onclick=\""+xfunc+"\" value=\""+xtitle+"\">"; btn += "<input type=\"button\" class=\"exit\" style=\"height:30px;\" onclick=\"closePagerModal()\" value=\"Close\">"; jQuery('.ui-dialog-buttonset').append(btn); } function closePagerModal() { jQuery('#div_pager #datatable tr').removeClass('action_btn_selected_row'); jQuery('#pager_modal').dialog('close'); } function add_item(){ var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&event_action=has_edo"; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { jQuery('#pager_modal').find('input,textarea,select').prop('disabled',false); jQuery('#pager_modal input:text').val(''); jQuery('#pager_modal input:checkbox').prop('checked',false); jQuery('#pager_modal .required').removeClass('input_hasErr'); if(xtitle == "Leaves File") { jQuery('#modalField_is_edo').prop('disabled',xret); } jQuery('#pager_modal').dialog({ title:'Add', width: xmodal_width, height: xmodal_height, draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function(){jQuery('.ui-dialog-titlebar-close').hide();}, buttons:[ { text:"Save", class:"save", id:"btn_diag_save", click:function() { addRow(); } }, { text:"Cancel", class:"exit", id:"btn_diag_cancel", click:function() { jQuery(this).dialog('close'); } } ] }).dialog('open'); jQuery('#modalField_subdrycde').change(); //20190314 donita } }) } function edit_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery('#pager_modal .required').removeClass('input_hasErr'); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } // console.log(recid); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&event_action=view"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); // console.log(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { $.each(xret.rs,function(key,xretDataval) { // console.log(xretDataval); // console.log(key); // var hidden_type = jQuery(xretDataval).find('#modalField_'+key).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(xretDataval).find('#'+key).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery('#modalField_'+key).prop('checked',true); // jQuery('#checkbox_modalField_'+key).val('1'); // } // else // { // jQuery('#checkbox_modalField_'+key).val('0'); // } // } // else // { // var dataval = jQuery(xretDataval).find('#'+key).attr('value'); if(jQuery('#modalField_'+key).is(':checkbox')) { jQuery('#modalField_'+key).prop('checked',false); if(jQuery('#modalField_'+key).data('checked_value')==xretDataval) { jQuery('#modalField_'+key).prop('checked',true); } } else { jQuery('#modalField_'+key).val(xretDataval); } // } }); jQuery('#pager_modal').find('input,textarea,select').prop('disabled',false); if(xtitle == "Leaves File") { $.each(xret.is_disabled,function(key,xretDataval) { jQuery('#modalField_'+key).prop('disabled',xretDataval); }); jQuery('#pager_modal').find('input#modalField_withoutpay').prop('disabled',true); } //jQuery('#pager_modal').find('#modalField_subdrycde').prop('readonly','readonly'); jQuery('#pager_modal').dialog({ title:'Edit', width: xmodal_width, height: xmodal_height, appendTo:'#div_pager', draggable:true, resizable:false, autoOpen:false, modal:true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [ { "text":"Save", "class":"save", "id": "btn_diag_save", "click":function() { updateRow(recid); } }, { "text":"Close", "class":"exit", "id": "btn_diag_close", "click":function() { jQuery(this).dialog('close'); // jQuery(this).remove(); } } ] }).dialog('open'); jQuery('#modalField_subdrycde').change(); //20190314 donita } }) // var clonedPagerModal = jQuery('#pager_modal').clone(); // var action_btn_selected_row=''; // jQuery('#div_pager #datatable tbody tr').each(function(key,val){ // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var hidden_type = jQuery(val).find('#'+pager_keys[i]).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('1'); // } // else // { // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('0'); // } // } // else // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).is(':checkbox')) // { // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).data('checked_value')==dataval) // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // } // } // else // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).val(dataval); // } // } // } // } // }); // modPagerBtn('edit'); } function pager_view_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery('#pager_modal .required').removeClass('input_hasErr'); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } // console.log(recid); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&event_action=view"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); // console.log(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { $.each(xret.rs,function(key,xretDataval) { if(jQuery('#modalField_'+key).is(':checkbox')) { jQuery('#modalField_'+key).prop('checked',!true); if(jQuery('#modalField_'+key).data('checked_value')==xretDataval) { jQuery('#modalField_'+key).prop('checked',true); } } else { jQuery('#modalField_'+key).val(xretDataval); } }); jQuery('#pager_modal').find('input,textarea,select').prop('disabled',true); jQuery('#pager_modal').dialog({ title:'View', width: xmodal_width, height: xmodal_height, appendTo:'#div_pager', draggable:true, resizable:false, autoOpen:false, modal:true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [ { "text":"Close", "class":"exit", "id":"btn_diag_close", "click":function() { jQuery(this).dialog('close'); // jQuery(this).remove(); } } ] }).dialog('open'); } }) // var clonedPagerModal = jQuery('#pager_modal').clone(); // var action_btn_selected_row=''; // jQuery('#div_pager #datatable tbody tr').each(function(key,val){ // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var hidden_type = jQuery(val).find('#'+pager_keys[i]).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('1'); // } // else // { // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('0'); // } // } // else // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).is(':checkbox')) // { // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).data('checked_value')==dataval) // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // } // } // else // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).val(dataval); // } // } // } // } // }); } function delete_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } var action_btn_selected_row=''; //tinamaan to // jQuery('#div_pager #datatable tbody tr').each(function(key,val) // { // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // jQuery('#modalField_'+pager_keys[i]).val(dataval); // } // } // }); // console.log('???',jQuery('#div_pager #datatable .tbody .tr#'+active_id)); jQuery('#div_pager #datatable .tbody .tr#'+active_id).addClass('action_btn_selected_row'); action_btn_selected_row = jQuery('#div_pager #datatable .tbody .tr#'+active_id); for(var i=0;i<pager_keys.length;i++) { var val = jQuery('#div_pager #datatable .tbody .tr[id="'+active_id+'"]').get(0); // get the DOM element var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); jQuery('#modalField_'+pager_keys[i]).val(dataval); // console.log("out",jQuery('#modalField_'+pager_keys[i]).val(dataval)); } jQuery('#pager_modal').hide(); var xparams = ""; var xretmsg = ""; xparams += "&headers="+headers; xparams += "&title="+xtitle; xparams += "&table="+table; xparams += "&recid="+encodeURIComponent(recid); xparams += "&table_id="+table_id; xparams += "&fields="+fields; xparams += "&pager_xlink="+xlink_id; xparams += "&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); jQuery.ajax({ dataType:'json', data : xparams, url : 'class/pager_item_dedector.php', type: 'post', success : function (xretobj){ xretmsg = xretobj.msg; alertify.confirm('Delete "<b>'+xtitle+'</b> (' + xretmsg + ')" Record ?',function() { blockui(); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=delete"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); alertify.alert(response.msg+' (' + xretmsg + ').',function() { if(response.bool) { // 20191118 justine set after delete go to firt page // jQuery('#pager_first').click(); pager_reload(); } }); } }); },function() { action_btn_selected_row.removeClass('action_btn_selected_row'); }); } }); } function checkpage() { if(parseInt(page) == 1) { jQuery('#pager_first').prop("disabled",true); jQuery('#pager_prev').prop("disabled",true); } else { jQuery('#pager_first').prop("disabled",false); jQuery('#pager_prev').prop("disabled",false); } if(parseInt(page) > parseInt(totalpages)) { page = parseInt(jQuery('#pager_page').val()) - 1; console.log("in"); // return false; document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); } } jQuery('#pager_selector').change(function(){ document.forms.myform.pager_page.value=this.value; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_limiter').change(function(){ document.forms.myform.pager_page.value='1'; document.forms.myform.pager_limit.value=this.value; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_next').click(function(){ if(page == totalpages){ page = totalpages; } else{ page = parseInt(jQuery('#pager_page').val()) + 1; } document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_prev').click(function(){ if(page == 1){ page = 1; } else{ page = parseInt(jQuery('#pager_page').val()) - 1; } document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_first').click(function(){ document.forms.myform.pager_page.value=1; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_last').click(function(){ document.forms.myform.pager_page.value=totalpages; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_search_btn').click(function(){ document.forms.myform.pager_page.value=1; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); //enable pressing enter on pager_search to submit jQuery('#pager_search_input').on('keypress', function (event) { if(event.which === 13){ jQuery('#pager_search_btn').click(); } }); function pager_reload() { document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); } function print_item() { jQuery('#print_layout_container').show(); jQuery('#pager_print_export').dialog({ title:"Print "+xtitle, width: '650', height: 'auto', draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); jQuery('#pager_print_export .pager_print_expt_col_sort_sel').val('').change(); jQuery('#pager_print_export .pager_print_expt_input_text').val(''); }, buttons: [ { "text":"Print Preview", "class":"print", "id": "btn_diag_print", "click":function() { document.forms.myform.action='mf_print.php'; document.forms.myform.method='POST'; document.forms.myform.target='_blank'; document.forms.myform.submit(); } }, { "text":"Cancel", "class":"exit", "id": "btn_diag_cancel", "click":function() { jQuery(this).dialog("close"); } } ] }).dialog('open'); } function export_item() { jQuery('#print_layout_container').hide(); jQuery('#pager_print_export').dialog({ title:"Export "+xtitle, width: '650', height: 'auto', draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); jQuery('#pager_print_export .pager_print_expt_col_sort_sel').val('').change(); jQuery('#pager_print_export .pager_print_expt_input_text').val(''); }, buttons: [ { "text":"Export", "class":"print", "id": "btn_diag_export", "click":function() { document.forms.myform.action='mf_export.php'; document.forms.myform.method='POST'; document.forms.myform.target='_blank'; document.forms.myform.submit(); } }, { "text":"Cancel", "id": "btn_diag_cancel", "class":"exit", "click":function() { jQuery(this).dialog("close"); } } ] }).dialog('open'); } function pager_check_all(obj) { var ischecked = jQuery(obj).prop('checked'); if(ischecked) { jQuery('.pager_checker_body').prop('checked',true); } else { jQuery('.pager_checker_body').prop('checked',false); } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function prevent_space(evt) { if(evt.which == 32) { evt.returnValue = false; } } //20191107 donita bak org // function paste_syspar_regex(evt) // { // evt.preventDefault(); // evt.returnValue = false; // var text = null; // if (window.clipboardData) // text = window.clipboardData.getData("Text"); // else if (evt && evt.clipboardData) // text = evt.clipboardData.getData("Text"); // var validate_spechar = jQuery('#pager_spechar').val(); // validate_spechar = validate_spechar.split(""); // validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; // var regex = new RegExp(validate_spechar,'mg'); // if( regex.test(text) ) // { // alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() // { // evt.target.value = text.replace(regex, ""); // // console.log(evt.target,text.replace(regex, "")); // },function() // { // }) // } // else // { // evt.target.value = text // } // } //prevent bypass of maxlength and pasting on disabled input function paste_syspar_regex(evt) { evt.preventDefault(); evt.returnValue = false; // console.log("pass") // console.log("1") // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val()+"<>"; validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery("#"+evt.target.id).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr.substring(0, xmaxlen); //20191107 donita // console.log(evt.target.id); if(jQuery("#"+evt.target.id).prop('disabled') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // disallow_tag("") // alert("1") // console.log("11") //20191106 donita newstr = evt.target.value; //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); //end trimstr = evt.target.value+newstr.substring(0, xmaxlen); evt.target.value = trimstr; // console.log(evt.target,text.replace(regex, "")); },function() { }) } else { evt.target.value = text //20191106 donita newstr = evt.target.value; trimstr = newstr.substring(0, xmaxlen); evt.target.value = trimstr; } } } function filter_syspar_code_regex(val_with_spechar) { var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); return val_with_spechar.replace(regex, ""); } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/class/lstv_pager.js?v=20220224185611 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20191113 |
| Request Header - size: 492 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/class/lstv_pager.js?v=20220224185611 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Thu, 24 Feb 2022 10:56:11 GMT Accept-Ranges: bytes Content-Length: 50267 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 50,267 bytes. |
var fields = jQuery('#pager_fields').val().split(',');
var headers = jQuery('#pager_headers').val().split(','); var table = jQuery('#pager_table').val(); var table_id = jQuery('#pager_table_id').val(); var xlink_id = jQuery('#pager_xlink').val(); var xfield = jQuery('#pager_xfield').val(); var xtitle = jQuery('#pager_title').val(); var xusedscascde = jQuery('#usedscascde').val(); var xtable_code = jQuery('#table_code').val(); var xtable_desc = jQuery('#table_desc').val(); var xmodal_width = jQuery('#modal_width').val(); var xmodal_height = jQuery('#modal_height').val(); var xhovering_type = jQuery('#hovering_type').val(); var xserver = jQuery('#server').val(); var xpager_link_id_hash = jQuery('#pager_link_id_hash').val(); var totalpages = jQuery('#pager_totalpages').val(); var page = jQuery('#pager_page').val(); var pager_keys = new Array(); jQuery(document).ready(function(){ checkpage(); jQuery('#txtchk').click(function(){ document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='post'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('.datepicker').datepicker(); jQuery('ul.ui-autocomplete').css('z-index',1100); jQuery('.dia_fld').dbFldLen({ link_hash_id: xpager_link_id_hash, tablename: table, ajaxPage:'db_field_length_checker_ajax.php' }); jQuery('#div_pager').on('click','#datatable .pager_thead .header_sort',function() { jQuery('#header_sort').val(jQuery(this).data('header_field_column')); if(jQuery(this).find('.header_sort_asc').length>0) { jQuery('#header_sort_by').val('DESC'); } else { jQuery('#header_sort_by').val('ASC'); } //20191118 justine set after sorting go to first page // document.forms.myform.action= xserver; // document.forms.myform.method='post'; // document.forms.myform.target='_self'; // document.forms.myform.submit(); jQuery('#pager_first').click(); }); jQuery('#pager_print_export').on('change','.pager_print_expt_col_sort_sel',function() { jQuery('.pager_print_expt_col_sort_sel').find('option').show(); jQuery('.pager_print_expt_col_sort_sel').each(function() { var this_val = jQuery(this).val(); if(this_val!="") { jQuery('.pager_print_expt_col_sort_sel').not(this).find('option[value="'+this_val+'"]').hide(); } }); }); jQuery('#div_pager #datatable tbody tr:eq(0) td').each(function(key,val){ pager_keys[pager_keys.length] = jQuery(val).attr('id'); }); jQuery('#pager_modal input[type=checkbox]').each(function(key,val){ jQuery(this).click(function(){ var xbool = jQuery(this).prop('checked'); var xid = jQuery(this).attr('id'); if(xbool == true){ jQuery('#checkbox_'+xid).val('1'); } else{ jQuery('#checkbox_'+xid).val('0'); } }); }); jQuery('#pager_copy_diag').dialog({ title:'Copy to Other ' + jQuery("#hr_mode").val(), width: 800, height: 600, draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function(){jQuery('.ui-dialog-titlebar-close').hide();}, buttons:[ { text:"Copy", class:"save", click:function() { pager_copy_diag_result(); } }, { text:"Cancel", class:"exit", click:function() { jQuery(this).dialog('close'); location.reload(); } } ] }); jQuery('#pager_copy_diag').on('click','.pager_freeze_tbl .tbody .td',function(e) { if(jQuery(this).find('.pager_copy_chkbox').length==0) { jQuery(this).closest('.tr').find('.pager_copy_chkbox').prop('checked',!jQuery(this).closest('.tr').find('.pager_copy_chkbox').is(':checked')).change(); } }) jQuery('#pager_copy_diag').on('change','.pager_freeze_tbl .tbody .td .pager_copy_chkbox',function(e) { if(jQuery(this).is(':checked')) { jQuery(this).closest('.tr').find('.td').addClass('td_pager_copy_candidate'); } else { jQuery(this).closest('.tr').find('.td').removeClass('td_pager_copy_candidate'); } }) jQuery('#pager_copy_diag').on('click','.pager_copy_all_chkbox',function() { jQuery('#pager_copy_diag .pager_freeze_tbl .tbody .tr').find('.pager_copy_chkbox:not(:disabled)').prop('checked',jQuery(this).is(':checked')).change(); }) jQuery('#pager_copy_diag').on('change','.pager_copy_subdryfrom',function() { jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option").show(); if(jQuery('#pager_copy_diag').find('.pager_copy_subdryto').val()==jQuery(this).val()) { jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option[value!='"+jQuery(this).val()+"']").prop('selected',true); } jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option[value='"+jQuery(this).val()+"']").hide(); reload_pager_copy_diag_result(); }) jQuery('#pager_copy_diag').on('change','.pager_copy_subdryto',function() { jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option").show(); if(jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').val()==jQuery(this).val()) { jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option[value!='"+jQuery(this).val()+"']").prop('selected',true); } jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option[value='"+jQuery(this).val()+"']").hide(); reload_pager_copy_diag_result(); }) if(xhovering_type == 'click'){ jQuery('#div_pager #datatable .pager_tbody .pager_tr').each(function(key,val){ jQuery(val).click(function(){ jQuery('#div_pager #datatable .pager_tbody .pager_tr').removeClass('pager-active'); jQuery(this).addClass('pager-active'); var active_id = jQuery(this).attr('id'); jQuery('#pager_active_id').val(active_id); for(var i=0;i<pager_keys.length;i++){ var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); jQuery('#pager_'+pager_keys[i]).val(dataval); } }); }); } else{ // console.log(jQuery('#div_pager #datatable .pager_tbody .pager_tr').length); jQuery('#div_pager').on('mouseover','#datatable .pager_tbody .pager_tr',function() { var active_id = jQuery(this).attr('id'); // console.log('hovertblasdsadasda',active_id); jQuery('#pager_active_id').val(active_id); for(var i=0;i<pager_keys.length;i++) { var dataval = jQuery(this).find('#'+pager_keys[i]).attr('value'); jQuery('#pager_'+pager_keys[i]).val(dataval); } }) // jQuery('#div_pager #datatable .pager_tbody .pager_tr').each(function(key,val){ // jQuery(val).hover(function(){ // console.log(val); // }); // }); } // init_datatable_freezetable(); }) jQuery(window).load(function() { init_datatable_freezetable(); }) function checkselval(obj) { var selval = jQuery(obj).val(); jQuery(".pager_print_expt_col_sort_sel").addClass("checkselval"); jQuery(obj).removeClass("checkselval"); jQuery('.checkselval').each(function(){ if(jQuery(this).val() == selval && jQuery(this).val() != "" ) { alertify.alert("Column No. already selected.",function(){ jQuery(obj).val(""); }); } }); jQuery(".pager_print_expt_col_sort_sel").removeClass("checkselval"); } function init_datatable_freezetable() { var header_width = []; var action_header_index=null; jQuery('#div_pager #datatable th:visible').each(function(index,value) { if(jQuery(this).hasClass('header_action')) { action_header_index=index; } header_width.push(jQuery(this).data('header_width')); }); if(action_header_index!=null) { jQuery('#div_pager ').find('table tbody tr').each(function() { jQuery(this).find('td:visible').eq(action_header_index).addClass('pager_action_btn_container'); }); // console.log(action_header_index); jQuery('#div_pager #datatable').lst_freeze_table({ column_width:header_width, // left_fixed_column_index:[1], right_fixed_column_index:[action_header_index], tbl_max_width: "auto", tbl_max_height: "auto" }); } else { jQuery('#div_pager #datatable').lst_freeze_table({ column_width:header_width, // left_fixed_column_index:[1], // right_fixed_column_index:[action_header_index], tbl_max_width: "auto", tbl_max_height: "auto" }); } } function reload_pager_copy_diag_result() { if(jQuery('#pager_copy_diag').find('.pager_copy_subdryto').val()!='') { blockui(); var xdata = ""; xdata+="&"+jQuery('#pager_copy_diag .pager_copy_subdry').serialize(); xdata+="&pager_event_action=reload_pager_copy_diag_result"; xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&headers="+headers; xdata+="&pager_xlink="+xlink_id; xdata+="&fieldname="+xfield; xdata+="&xusedscascde="+xusedscascde; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); jQuery('#pager_copy_diag #pager_freeze_tbl_container').empty() jQuery('#pager_copy_diag #pager_freeze_tbl_container').html(response.content); jQuery('#pager_copy_diag #pager_freeze_tbl_container .pager_freeze_tbl').lst_freeze_table({ column_width:response.column_width, left_fixed_column_index:[0], tbl_max_width: 770, tbl_max_height: 350 }); } }); } } function pager_copy_diag_result() { if(jQuery('#pager_copy_diag .pager_copy_chkbox:checked').length > 0) { alertify.confirm('Continue copying selected records ? ',function() { blockui(); var xdata = ""; xdata+="&"+jQuery('#pager_copy_diag *').serialize(); xdata+="&pager_event_action=pager_copy_diag_result"; xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&headers="+headers; xdata+="&pager_xlink="+xlink_id; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); alertify.alert(response.msg,function() { reload_pager_copy_diag_result(); }) } }); },function() { }) } else { alertify.alert('Please select record(s) to copy.') } } function pager_open_subdry_copy_diag() { jQuery('#pager_copy_diag').dialog('open'); jQuery('#pager_copy_diag .pager_copy_subdryfrom option:first').prop('selected',true); jQuery('#pager_copy_diag .pager_copy_subdryto option:first').prop('selected',true); jQuery('#pager_copy_diag .pager_copy_subdryfrom').change(); } function clear_searchbox() { jQuery('#pager_search_input').val(''); } function addRow() { isValid = true; jQuery('#pager_modal .required:visible').removeClass('input_hasErr'); jQuery('#pager_modal .required:visible').each(function() { if (jQuery(this).val() == '') { isValid = false; jQuery(this).addClass('input_hasErr'); } else //20191113 donita { var xval = jQuery(this).val(); xval = xval.trim(); jQuery(this).val(xval); if(xval == "") { jQuery(this).addClass('input_hasErr'); isValid = false; } } }); if(isValid) { var modalfield_tablecde = jQuery('#modalField_'+xtable_code); var modalfield_tabledsc = jQuery('#modalField_'+xtable_desc); if(xusedscascde == 1) { // console.log('passxuseddscascde',filter_syspar_code_regex(modalfield_tabledsc.val())); if(filter_syspar_code_regex(modalfield_tabledsc.val())!="") { modalfield_tablecde.val(filter_syspar_code_regex(modalfield_tabledsc.val())); } else { alertify.alert('Description must contain atleast 1 alphanumeric ( A-Z , 0-9 ) character. '); return; } } blockui(); var xdata = ""; xdata+=jQuery('#pager_modal *').serialize(); xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=add"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery('#pager_modal').find('input:checkbox:not(:checked)').each(function() { xdata+="&"+jQuery(this).attr('name')+"="+jQuery(this).data('unchecked_value'); }) console.log(xdata); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response){ $.unblockUI(); if(response.bool) { jQuery('#pager_modal').dialog('close'); } alertify.alert(response.msg,function(){ if(response.bool) { jQuery('#pager_modal').dialog('close'); //20191118 justine set after adding go to first page // pager_reload(); jQuery('#pager_first').click(); } else{ if(response.msg == "Please fill required field(s).") { var arr = response.flds; for(var x=0; x<arr.length; x++) { jQuery('#modalField_'+arr[x]).val(""); jQuery('#modalField_'+arr[x]).addClass('input_hasErr'); } } } }); } }); } else { alertify.alert('Please fill required field(s)').set({'closable':false,'modal':true}); } } function updateRow(recid) { isValid = true; jQuery('#pager_modal .required:visible').removeClass('input_hasErr'); jQuery('#pager_modal .required:visible').each(function() { if (jQuery(this).val() == '') { isValid = false; jQuery(this).addClass('input_hasErr'); } else //20191113 donita { var xval = jQuery(this).val(); xval = xval.trim(); jQuery(this).val(xval); if(xval == "") { jQuery(this).addClass('input_hasErr'); isValid = false; } } }); if(isValid) { var modalfield_tablecde = jQuery("#modalField_"+xtable_code); var modalfield_tabledsc = jQuery("#modalField_"+xtable_desc); if(xusedscascde == 1) { if(filter_syspar_code_regex(modalfield_tabledsc.val())!="") { modalfield_tablecde.val(filter_syspar_code_regex(modalfield_tabledsc.val())); } else { alertify.alert('Description must contain atleast 1 alphanumeric ( A-Z , 0-9 ) character. '); return; } } blockui(); if(xtitle == "Leaves File") { jQuery('#pager_modal').find('input[id*="modalField_"]').prop('disabled',false); } var xdata = ""; xdata+=jQuery('#pager_modal *').serialize(); xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&recid="+encodeURIComponent(recid); xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=update"; xdata+="&fieldname="+xfield; xdata+="&headers="+headers; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery('#pager_modal').find('input:checkbox:not(:checked)').each(function() { xdata+="&"+jQuery(this).attr('name')+"="+jQuery(this).data('unchecked_value'); }) jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response){ $.unblockUI(); if(response.bool) { jQuery('#pager_modal').dialog('close'); } alertify.alert(response.msg,function(){ if(response.bool) { pager_reload(); } else{ if(response.msg == "Please fill required field(s).") { var arr = response.flds; for(var x=0; x<arr.length; x++) { jQuery('#modalField_'+arr[x]).val(""); jQuery('#modalField_'+arr[x]).addClass('input_hasErr'); } } else if(response.leave_logs != "" && xtitle == "Leaves File") { document.forms.myform.action = 'mf_leave_xpt.php'; document.forms.myform.target = '_blank'; document.forms.method = 'POST'; document.forms.myform.leave_logs.value = response.leave_logs; document.forms.myform.txt_leavesdesc.value = jQuery('#modalField_leavesdesc').val(); document.forms.myform.submit(); } } }); } }); } else { alertify.alert('Please fill required field(s)').set({'closable':false,'modal':true}); } } function modPagerBtn(par) { if(par=='add') { var xfunc = 'addRow()'; var xtitle = 'Save'; } else if(par=='edit') { var xfunc = 'updateRow()'; var xtitle = 'Save'; } jQuery('.ui-dialog .ui-dialog-buttonpane .ui-button').remove(); // mica change button to input type button or button type button // var btn = "<button role='button' class='save' style='height:30px;' onclick='"+xfunc+"'>"+xtitle+"</button>"; // btn += "<button role='button' class='exit' style='height:30px;' onclick='closePagerModal()'>Close</button>"; var btn = "<input type=\"button\" class=\"save\" style=\"height:30px;\" onclick=\""+xfunc+"\" value=\""+xtitle+"\">"; btn += "<input type=\"button\" class=\"exit\" style=\"height:30px;\" onclick=\"closePagerModal()\" value=\"Close\">"; jQuery('.ui-dialog-buttonset').append(btn); } function closePagerModal() { jQuery('#div_pager #datatable tr').removeClass('action_btn_selected_row'); jQuery('#pager_modal').dialog('close'); } function add_item(){ var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&event_action=has_edo"; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { jQuery('#pager_modal').find('input,textarea,select').prop('disabled',false); jQuery('#pager_modal input:text').val(''); jQuery('#pager_modal input:checkbox').prop('checked',false); jQuery('#pager_modal .required').removeClass('input_hasErr'); if(xtitle == "Leaves File") { jQuery('#modalField_is_edo').prop('disabled',xret); } jQuery('#pager_modal').dialog({ title:'Add', width: xmodal_width, height: xmodal_height, draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function(){jQuery('.ui-dialog-titlebar-close').hide();}, buttons:[ { text:"Save", class:"save", id:"btn_diag_save", click:function() { addRow(); } }, { text:"Cancel", class:"exit", id:"btn_diag_cancel", click:function() { jQuery(this).dialog('close'); } } ] }).dialog('open'); jQuery('#modalField_subdrycde').change(); //20190314 donita } }) } function edit_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery('#pager_modal .required').removeClass('input_hasErr'); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } // console.log(recid); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&event_action=view"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); // console.log(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { $.each(xret.rs,function(key,xretDataval) { // console.log(xretDataval); // console.log(key); // var hidden_type = jQuery(xretDataval).find('#modalField_'+key).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(xretDataval).find('#'+key).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery('#modalField_'+key).prop('checked',true); // jQuery('#checkbox_modalField_'+key).val('1'); // } // else // { // jQuery('#checkbox_modalField_'+key).val('0'); // } // } // else // { // var dataval = jQuery(xretDataval).find('#'+key).attr('value'); if(jQuery('#modalField_'+key).is(':checkbox')) { jQuery('#modalField_'+key).prop('checked',false); if(jQuery('#modalField_'+key).data('checked_value')==xretDataval) { jQuery('#modalField_'+key).prop('checked',true); } } else { jQuery('#modalField_'+key).val(xretDataval); } // } }); jQuery('#pager_modal').find('input,textarea,select').prop('disabled',false); if(xtitle == "Leaves File") { $.each(xret.is_disabled,function(key,xretDataval) { jQuery('#modalField_'+key).prop('disabled',xretDataval); }); jQuery('#pager_modal').find('input#modalField_withoutpay').prop('disabled',true); } //jQuery('#pager_modal').find('#modalField_subdrycde').prop('readonly','readonly'); jQuery('#pager_modal').dialog({ title:'Edit', width: xmodal_width, height: xmodal_height, appendTo:'#div_pager', draggable:true, resizable:false, autoOpen:false, modal:true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [ { "text":"Save", "class":"save", "id": "btn_diag_save", "click":function() { updateRow(recid); } }, { "text":"Close", "class":"exit", "id": "btn_diag_close", "click":function() { jQuery(this).dialog('close'); // jQuery(this).remove(); } } ] }).dialog('open'); jQuery('#modalField_subdrycde').change(); //20190314 donita } }) // var clonedPagerModal = jQuery('#pager_modal').clone(); // var action_btn_selected_row=''; // jQuery('#div_pager #datatable tbody tr').each(function(key,val){ // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var hidden_type = jQuery(val).find('#'+pager_keys[i]).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('1'); // } // else // { // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('0'); // } // } // else // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).is(':checkbox')) // { // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).data('checked_value')==dataval) // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // } // } // else // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).val(dataval); // } // } // } // } // }); // modPagerBtn('edit'); } function pager_view_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery('#pager_modal .required').removeClass('input_hasErr'); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } // console.log(recid); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&event_action=view"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); // console.log(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { $.each(xret.rs,function(key,xretDataval) { if(jQuery('#modalField_'+key).is(':checkbox')) { jQuery('#modalField_'+key).prop('checked',!true); if(jQuery('#modalField_'+key).data('checked_value')==xretDataval) { jQuery('#modalField_'+key).prop('checked',true); } } else { jQuery('#modalField_'+key).val(xretDataval); } }); jQuery('#pager_modal').find('input,textarea,select').prop('disabled',true); jQuery('#pager_modal').dialog({ title:'View', width: xmodal_width, height: xmodal_height, appendTo:'#div_pager', draggable:true, resizable:false, autoOpen:false, modal:true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [ { "text":"Close", "class":"exit", "id":"btn_diag_close", "click":function() { jQuery(this).dialog('close'); // jQuery(this).remove(); } } ] }).dialog('open'); } }) // var clonedPagerModal = jQuery('#pager_modal').clone(); // var action_btn_selected_row=''; // jQuery('#div_pager #datatable tbody tr').each(function(key,val){ // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var hidden_type = jQuery(val).find('#'+pager_keys[i]).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('1'); // } // else // { // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('0'); // } // } // else // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).is(':checkbox')) // { // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).data('checked_value')==dataval) // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // } // } // else // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).val(dataval); // } // } // } // } // }); } function delete_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } var action_btn_selected_row=''; //tinamaan to // jQuery('#div_pager #datatable tbody tr').each(function(key,val) // { // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // jQuery('#modalField_'+pager_keys[i]).val(dataval); // } // } // }); // console.log('???',jQuery('#div_pager #datatable .tbody .tr#'+active_id)); jQuery('#div_pager #datatable .tbody .tr#'+active_id).addClass('action_btn_selected_row'); action_btn_selected_row = jQuery('#div_pager #datatable .tbody .tr#'+active_id); for(var i=0;i<pager_keys.length;i++) { var val = jQuery('#div_pager #datatable .tbody .tr[id="'+active_id+'"]').get(0); // get the DOM element var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); jQuery('#modalField_'+pager_keys[i]).val(dataval); // console.log("out",jQuery('#modalField_'+pager_keys[i]).val(dataval)); } jQuery('#pager_modal').hide(); var xparams = ""; var xretmsg = ""; xparams += "&headers="+headers; xparams += "&title="+xtitle; xparams += "&table="+table; xparams += "&recid="+encodeURIComponent(recid); xparams += "&table_id="+table_id; xparams += "&fields="+fields; xparams += "&pager_xlink="+xlink_id; xparams += "&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); jQuery.ajax({ dataType:'json', data : xparams, url : 'class/pager_item_dedector.php', type: 'post', success : function (xretobj){ xretmsg = xretobj.msg; alertify.confirm('Delete "<b>'+xtitle+'</b> (' + xretmsg + ')" Record ?',function() { blockui(); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=delete"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); alertify.alert(response.msg+' (' + xretmsg + ').',function() { if(response.bool) { // 20191118 justine set after delete go to firt page // jQuery('#pager_first').click(); pager_reload(); } }); } }); },function() { action_btn_selected_row.removeClass('action_btn_selected_row'); }); } }); } function checkpage() { if(parseInt(page) == 1) { jQuery('#pager_first').prop("disabled",true); jQuery('#pager_prev').prop("disabled",true); } else { jQuery('#pager_first').prop("disabled",false); jQuery('#pager_prev').prop("disabled",false); } if(parseInt(page) > parseInt(totalpages)) { page = parseInt(jQuery('#pager_page').val()) - 1; console.log("in"); // return false; document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); } } jQuery('#pager_selector').change(function(){ document.forms.myform.pager_page.value=this.value; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_limiter').change(function(){ document.forms.myform.pager_page.value='1'; document.forms.myform.pager_limit.value=this.value; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_next').click(function(){ if(page == totalpages){ page = totalpages; } else{ page = parseInt(jQuery('#pager_page').val()) + 1; } document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_prev').click(function(){ if(page == 1){ page = 1; } else{ page = parseInt(jQuery('#pager_page').val()) - 1; } document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_first').click(function(){ document.forms.myform.pager_page.value=1; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_last').click(function(){ document.forms.myform.pager_page.value=totalpages; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_search_btn').click(function(){ document.forms.myform.pager_page.value=1; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); //enable pressing enter on pager_search to submit jQuery('#pager_search_input').on('keypress', function (event) { if(event.which === 13){ jQuery('#pager_search_btn').click(); } }); function pager_reload() { document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); } function print_item() { jQuery('#print_layout_container').show(); jQuery('#pager_print_export').dialog({ title:"Print "+xtitle, width: '650', height: 'auto', draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); jQuery('#pager_print_export .pager_print_expt_col_sort_sel').val('').change(); jQuery('#pager_print_export .pager_print_expt_input_text').val(''); }, buttons: [ { "text":"Print Preview", "class":"print", "id": "btn_diag_print", "click":function() { document.forms.myform.action='mf_print.php'; document.forms.myform.method='POST'; document.forms.myform.target='_blank'; document.forms.myform.submit(); } }, { "text":"Cancel", "class":"exit", "id": "btn_diag_cancel", "click":function() { jQuery(this).dialog("close"); } } ] }).dialog('open'); } function export_item() { jQuery('#print_layout_container').hide(); jQuery('#pager_print_export').dialog({ title:"Export "+xtitle, width: '650', height: 'auto', draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); jQuery('#pager_print_export .pager_print_expt_col_sort_sel').val('').change(); jQuery('#pager_print_export .pager_print_expt_input_text').val(''); }, buttons: [ { "text":"Export", "class":"print", "id": "btn_diag_export", "click":function() { document.forms.myform.action='mf_export.php'; document.forms.myform.method='POST'; document.forms.myform.target='_blank'; document.forms.myform.submit(); } }, { "text":"Cancel", "id": "btn_diag_cancel", "class":"exit", "click":function() { jQuery(this).dialog("close"); } } ] }).dialog('open'); } function pager_check_all(obj) { var ischecked = jQuery(obj).prop('checked'); if(ischecked) { jQuery('.pager_checker_body').prop('checked',true); } else { jQuery('.pager_checker_body').prop('checked',false); } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function prevent_space(evt) { if(evt.which == 32) { evt.returnValue = false; } } //20191107 donita bak org // function paste_syspar_regex(evt) // { // evt.preventDefault(); // evt.returnValue = false; // var text = null; // if (window.clipboardData) // text = window.clipboardData.getData("Text"); // else if (evt && evt.clipboardData) // text = evt.clipboardData.getData("Text"); // var validate_spechar = jQuery('#pager_spechar').val(); // validate_spechar = validate_spechar.split(""); // validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; // var regex = new RegExp(validate_spechar,'mg'); // if( regex.test(text) ) // { // alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() // { // evt.target.value = text.replace(regex, ""); // // console.log(evt.target,text.replace(regex, "")); // },function() // { // }) // } // else // { // evt.target.value = text // } // } //prevent bypass of maxlength and pasting on disabled input function paste_syspar_regex(evt) { evt.preventDefault(); evt.returnValue = false; // console.log("pass") // console.log("1") // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val()+"<>"; validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery("#"+evt.target.id).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr.substring(0, xmaxlen); //20191107 donita // console.log(evt.target.id); if(jQuery("#"+evt.target.id).prop('disabled') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // disallow_tag("") // alert("1") // console.log("11") //20191106 donita newstr = evt.target.value; //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); //end trimstr = evt.target.value+newstr.substring(0, xmaxlen); evt.target.value = trimstr; // console.log(evt.target,text.replace(regex, "")); },function() { }) } else { evt.target.value = text //20191106 donita newstr = evt.target.value; trimstr = newstr.substring(0, xmaxlen); evt.target.value = trimstr; } } } function filter_syspar_code_regex(val_with_spechar) { var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); return val_with_spechar.replace(regex, ""); } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/class/lstv_pager.js?v=20220224185611 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20191118 |
| Request Header - size: 492 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/class/lstv_pager.js?v=20220224185611 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Thu, 24 Feb 2022 10:56:11 GMT Accept-Ranges: bytes Content-Length: 50267 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 50,267 bytes. |
var fields = jQuery('#pager_fields').val().split(',');
var headers = jQuery('#pager_headers').val().split(','); var table = jQuery('#pager_table').val(); var table_id = jQuery('#pager_table_id').val(); var xlink_id = jQuery('#pager_xlink').val(); var xfield = jQuery('#pager_xfield').val(); var xtitle = jQuery('#pager_title').val(); var xusedscascde = jQuery('#usedscascde').val(); var xtable_code = jQuery('#table_code').val(); var xtable_desc = jQuery('#table_desc').val(); var xmodal_width = jQuery('#modal_width').val(); var xmodal_height = jQuery('#modal_height').val(); var xhovering_type = jQuery('#hovering_type').val(); var xserver = jQuery('#server').val(); var xpager_link_id_hash = jQuery('#pager_link_id_hash').val(); var totalpages = jQuery('#pager_totalpages').val(); var page = jQuery('#pager_page').val(); var pager_keys = new Array(); jQuery(document).ready(function(){ checkpage(); jQuery('#txtchk').click(function(){ document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='post'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('.datepicker').datepicker(); jQuery('ul.ui-autocomplete').css('z-index',1100); jQuery('.dia_fld').dbFldLen({ link_hash_id: xpager_link_id_hash, tablename: table, ajaxPage:'db_field_length_checker_ajax.php' }); jQuery('#div_pager').on('click','#datatable .pager_thead .header_sort',function() { jQuery('#header_sort').val(jQuery(this).data('header_field_column')); if(jQuery(this).find('.header_sort_asc').length>0) { jQuery('#header_sort_by').val('DESC'); } else { jQuery('#header_sort_by').val('ASC'); } //20191118 justine set after sorting go to first page // document.forms.myform.action= xserver; // document.forms.myform.method='post'; // document.forms.myform.target='_self'; // document.forms.myform.submit(); jQuery('#pager_first').click(); }); jQuery('#pager_print_export').on('change','.pager_print_expt_col_sort_sel',function() { jQuery('.pager_print_expt_col_sort_sel').find('option').show(); jQuery('.pager_print_expt_col_sort_sel').each(function() { var this_val = jQuery(this).val(); if(this_val!="") { jQuery('.pager_print_expt_col_sort_sel').not(this).find('option[value="'+this_val+'"]').hide(); } }); }); jQuery('#div_pager #datatable tbody tr:eq(0) td').each(function(key,val){ pager_keys[pager_keys.length] = jQuery(val).attr('id'); }); jQuery('#pager_modal input[type=checkbox]').each(function(key,val){ jQuery(this).click(function(){ var xbool = jQuery(this).prop('checked'); var xid = jQuery(this).attr('id'); if(xbool == true){ jQuery('#checkbox_'+xid).val('1'); } else{ jQuery('#checkbox_'+xid).val('0'); } }); }); jQuery('#pager_copy_diag').dialog({ title:'Copy to Other ' + jQuery("#hr_mode").val(), width: 800, height: 600, draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function(){jQuery('.ui-dialog-titlebar-close').hide();}, buttons:[ { text:"Copy", class:"save", click:function() { pager_copy_diag_result(); } }, { text:"Cancel", class:"exit", click:function() { jQuery(this).dialog('close'); location.reload(); } } ] }); jQuery('#pager_copy_diag').on('click','.pager_freeze_tbl .tbody .td',function(e) { if(jQuery(this).find('.pager_copy_chkbox').length==0) { jQuery(this).closest('.tr').find('.pager_copy_chkbox').prop('checked',!jQuery(this).closest('.tr').find('.pager_copy_chkbox').is(':checked')).change(); } }) jQuery('#pager_copy_diag').on('change','.pager_freeze_tbl .tbody .td .pager_copy_chkbox',function(e) { if(jQuery(this).is(':checked')) { jQuery(this).closest('.tr').find('.td').addClass('td_pager_copy_candidate'); } else { jQuery(this).closest('.tr').find('.td').removeClass('td_pager_copy_candidate'); } }) jQuery('#pager_copy_diag').on('click','.pager_copy_all_chkbox',function() { jQuery('#pager_copy_diag .pager_freeze_tbl .tbody .tr').find('.pager_copy_chkbox:not(:disabled)').prop('checked',jQuery(this).is(':checked')).change(); }) jQuery('#pager_copy_diag').on('change','.pager_copy_subdryfrom',function() { jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option").show(); if(jQuery('#pager_copy_diag').find('.pager_copy_subdryto').val()==jQuery(this).val()) { jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option[value!='"+jQuery(this).val()+"']").prop('selected',true); } jQuery('#pager_copy_diag').find('.pager_copy_subdryto').find("option[value='"+jQuery(this).val()+"']").hide(); reload_pager_copy_diag_result(); }) jQuery('#pager_copy_diag').on('change','.pager_copy_subdryto',function() { jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option").show(); if(jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').val()==jQuery(this).val()) { jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option[value!='"+jQuery(this).val()+"']").prop('selected',true); } jQuery('#pager_copy_diag').find('.pager_copy_subdryfrom').find("option[value='"+jQuery(this).val()+"']").hide(); reload_pager_copy_diag_result(); }) if(xhovering_type == 'click'){ jQuery('#div_pager #datatable .pager_tbody .pager_tr').each(function(key,val){ jQuery(val).click(function(){ jQuery('#div_pager #datatable .pager_tbody .pager_tr').removeClass('pager-active'); jQuery(this).addClass('pager-active'); var active_id = jQuery(this).attr('id'); jQuery('#pager_active_id').val(active_id); for(var i=0;i<pager_keys.length;i++){ var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); jQuery('#pager_'+pager_keys[i]).val(dataval); } }); }); } else{ // console.log(jQuery('#div_pager #datatable .pager_tbody .pager_tr').length); jQuery('#div_pager').on('mouseover','#datatable .pager_tbody .pager_tr',function() { var active_id = jQuery(this).attr('id'); // console.log('hovertblasdsadasda',active_id); jQuery('#pager_active_id').val(active_id); for(var i=0;i<pager_keys.length;i++) { var dataval = jQuery(this).find('#'+pager_keys[i]).attr('value'); jQuery('#pager_'+pager_keys[i]).val(dataval); } }) // jQuery('#div_pager #datatable .pager_tbody .pager_tr').each(function(key,val){ // jQuery(val).hover(function(){ // console.log(val); // }); // }); } // init_datatable_freezetable(); }) jQuery(window).load(function() { init_datatable_freezetable(); }) function checkselval(obj) { var selval = jQuery(obj).val(); jQuery(".pager_print_expt_col_sort_sel").addClass("checkselval"); jQuery(obj).removeClass("checkselval"); jQuery('.checkselval').each(function(){ if(jQuery(this).val() == selval && jQuery(this).val() != "" ) { alertify.alert("Column No. already selected.",function(){ jQuery(obj).val(""); }); } }); jQuery(".pager_print_expt_col_sort_sel").removeClass("checkselval"); } function init_datatable_freezetable() { var header_width = []; var action_header_index=null; jQuery('#div_pager #datatable th:visible').each(function(index,value) { if(jQuery(this).hasClass('header_action')) { action_header_index=index; } header_width.push(jQuery(this).data('header_width')); }); if(action_header_index!=null) { jQuery('#div_pager ').find('table tbody tr').each(function() { jQuery(this).find('td:visible').eq(action_header_index).addClass('pager_action_btn_container'); }); // console.log(action_header_index); jQuery('#div_pager #datatable').lst_freeze_table({ column_width:header_width, // left_fixed_column_index:[1], right_fixed_column_index:[action_header_index], tbl_max_width: "auto", tbl_max_height: "auto" }); } else { jQuery('#div_pager #datatable').lst_freeze_table({ column_width:header_width, // left_fixed_column_index:[1], // right_fixed_column_index:[action_header_index], tbl_max_width: "auto", tbl_max_height: "auto" }); } } function reload_pager_copy_diag_result() { if(jQuery('#pager_copy_diag').find('.pager_copy_subdryto').val()!='') { blockui(); var xdata = ""; xdata+="&"+jQuery('#pager_copy_diag .pager_copy_subdry').serialize(); xdata+="&pager_event_action=reload_pager_copy_diag_result"; xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&headers="+headers; xdata+="&pager_xlink="+xlink_id; xdata+="&fieldname="+xfield; xdata+="&xusedscascde="+xusedscascde; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); jQuery('#pager_copy_diag #pager_freeze_tbl_container').empty() jQuery('#pager_copy_diag #pager_freeze_tbl_container').html(response.content); jQuery('#pager_copy_diag #pager_freeze_tbl_container .pager_freeze_tbl').lst_freeze_table({ column_width:response.column_width, left_fixed_column_index:[0], tbl_max_width: 770, tbl_max_height: 350 }); } }); } } function pager_copy_diag_result() { if(jQuery('#pager_copy_diag .pager_copy_chkbox:checked').length > 0) { alertify.confirm('Continue copying selected records ? ',function() { blockui(); var xdata = ""; xdata+="&"+jQuery('#pager_copy_diag *').serialize(); xdata+="&pager_event_action=pager_copy_diag_result"; xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&headers="+headers; xdata+="&pager_xlink="+xlink_id; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); alertify.alert(response.msg,function() { reload_pager_copy_diag_result(); }) } }); },function() { }) } else { alertify.alert('Please select record(s) to copy.') } } function pager_open_subdry_copy_diag() { jQuery('#pager_copy_diag').dialog('open'); jQuery('#pager_copy_diag .pager_copy_subdryfrom option:first').prop('selected',true); jQuery('#pager_copy_diag .pager_copy_subdryto option:first').prop('selected',true); jQuery('#pager_copy_diag .pager_copy_subdryfrom').change(); } function clear_searchbox() { jQuery('#pager_search_input').val(''); } function addRow() { isValid = true; jQuery('#pager_modal .required:visible').removeClass('input_hasErr'); jQuery('#pager_modal .required:visible').each(function() { if (jQuery(this).val() == '') { isValid = false; jQuery(this).addClass('input_hasErr'); } else //20191113 donita { var xval = jQuery(this).val(); xval = xval.trim(); jQuery(this).val(xval); if(xval == "") { jQuery(this).addClass('input_hasErr'); isValid = false; } } }); if(isValid) { var modalfield_tablecde = jQuery('#modalField_'+xtable_code); var modalfield_tabledsc = jQuery('#modalField_'+xtable_desc); if(xusedscascde == 1) { // console.log('passxuseddscascde',filter_syspar_code_regex(modalfield_tabledsc.val())); if(filter_syspar_code_regex(modalfield_tabledsc.val())!="") { modalfield_tablecde.val(filter_syspar_code_regex(modalfield_tabledsc.val())); } else { alertify.alert('Description must contain atleast 1 alphanumeric ( A-Z , 0-9 ) character. '); return; } } blockui(); var xdata = ""; xdata+=jQuery('#pager_modal *').serialize(); xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=add"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery('#pager_modal').find('input:checkbox:not(:checked)').each(function() { xdata+="&"+jQuery(this).attr('name')+"="+jQuery(this).data('unchecked_value'); }) console.log(xdata); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response){ $.unblockUI(); if(response.bool) { jQuery('#pager_modal').dialog('close'); } alertify.alert(response.msg,function(){ if(response.bool) { jQuery('#pager_modal').dialog('close'); //20191118 justine set after adding go to first page // pager_reload(); jQuery('#pager_first').click(); } else{ if(response.msg == "Please fill required field(s).") { var arr = response.flds; for(var x=0; x<arr.length; x++) { jQuery('#modalField_'+arr[x]).val(""); jQuery('#modalField_'+arr[x]).addClass('input_hasErr'); } } } }); } }); } else { alertify.alert('Please fill required field(s)').set({'closable':false,'modal':true}); } } function updateRow(recid) { isValid = true; jQuery('#pager_modal .required:visible').removeClass('input_hasErr'); jQuery('#pager_modal .required:visible').each(function() { if (jQuery(this).val() == '') { isValid = false; jQuery(this).addClass('input_hasErr'); } else //20191113 donita { var xval = jQuery(this).val(); xval = xval.trim(); jQuery(this).val(xval); if(xval == "") { jQuery(this).addClass('input_hasErr'); isValid = false; } } }); if(isValid) { var modalfield_tablecde = jQuery("#modalField_"+xtable_code); var modalfield_tabledsc = jQuery("#modalField_"+xtable_desc); if(xusedscascde == 1) { if(filter_syspar_code_regex(modalfield_tabledsc.val())!="") { modalfield_tablecde.val(filter_syspar_code_regex(modalfield_tabledsc.val())); } else { alertify.alert('Description must contain atleast 1 alphanumeric ( A-Z , 0-9 ) character. '); return; } } blockui(); if(xtitle == "Leaves File") { jQuery('#pager_modal').find('input[id*="modalField_"]').prop('disabled',false); } var xdata = ""; xdata+=jQuery('#pager_modal *').serialize(); xdata+="&table="+table; xdata+="&title="+xtitle; xdata+="&table_id="+table_id; xdata+="&recid="+encodeURIComponent(recid); xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=update"; xdata+="&fieldname="+xfield; xdata+="&headers="+headers; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery('#pager_modal').find('input:checkbox:not(:checked)').each(function() { xdata+="&"+jQuery(this).attr('name')+"="+jQuery(this).data('unchecked_value'); }) jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response){ $.unblockUI(); if(response.bool) { jQuery('#pager_modal').dialog('close'); } alertify.alert(response.msg,function(){ if(response.bool) { pager_reload(); } else{ if(response.msg == "Please fill required field(s).") { var arr = response.flds; for(var x=0; x<arr.length; x++) { jQuery('#modalField_'+arr[x]).val(""); jQuery('#modalField_'+arr[x]).addClass('input_hasErr'); } } else if(response.leave_logs != "" && xtitle == "Leaves File") { document.forms.myform.action = 'mf_leave_xpt.php'; document.forms.myform.target = '_blank'; document.forms.method = 'POST'; document.forms.myform.leave_logs.value = response.leave_logs; document.forms.myform.txt_leavesdesc.value = jQuery('#modalField_leavesdesc').val(); document.forms.myform.submit(); } } }); } }); } else { alertify.alert('Please fill required field(s)').set({'closable':false,'modal':true}); } } function modPagerBtn(par) { if(par=='add') { var xfunc = 'addRow()'; var xtitle = 'Save'; } else if(par=='edit') { var xfunc = 'updateRow()'; var xtitle = 'Save'; } jQuery('.ui-dialog .ui-dialog-buttonpane .ui-button').remove(); // mica change button to input type button or button type button // var btn = "<button role='button' class='save' style='height:30px;' onclick='"+xfunc+"'>"+xtitle+"</button>"; // btn += "<button role='button' class='exit' style='height:30px;' onclick='closePagerModal()'>Close</button>"; var btn = "<input type=\"button\" class=\"save\" style=\"height:30px;\" onclick=\""+xfunc+"\" value=\""+xtitle+"\">"; btn += "<input type=\"button\" class=\"exit\" style=\"height:30px;\" onclick=\"closePagerModal()\" value=\"Close\">"; jQuery('.ui-dialog-buttonset').append(btn); } function closePagerModal() { jQuery('#div_pager #datatable tr').removeClass('action_btn_selected_row'); jQuery('#pager_modal').dialog('close'); } function add_item(){ var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&event_action=has_edo"; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { jQuery('#pager_modal').find('input,textarea,select').prop('disabled',false); jQuery('#pager_modal input:text').val(''); jQuery('#pager_modal input:checkbox').prop('checked',false); jQuery('#pager_modal .required').removeClass('input_hasErr'); if(xtitle == "Leaves File") { jQuery('#modalField_is_edo').prop('disabled',xret); } jQuery('#pager_modal').dialog({ title:'Add', width: xmodal_width, height: xmodal_height, draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function(){jQuery('.ui-dialog-titlebar-close').hide();}, buttons:[ { text:"Save", class:"save", id:"btn_diag_save", click:function() { addRow(); } }, { text:"Cancel", class:"exit", id:"btn_diag_cancel", click:function() { jQuery(this).dialog('close'); } } ] }).dialog('open'); jQuery('#modalField_subdrycde').change(); //20190314 donita } }) } function edit_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery('#pager_modal .required').removeClass('input_hasErr'); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } // console.log(recid); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&event_action=view"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); // console.log(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { $.each(xret.rs,function(key,xretDataval) { // console.log(xretDataval); // console.log(key); // var hidden_type = jQuery(xretDataval).find('#modalField_'+key).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(xretDataval).find('#'+key).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery('#modalField_'+key).prop('checked',true); // jQuery('#checkbox_modalField_'+key).val('1'); // } // else // { // jQuery('#checkbox_modalField_'+key).val('0'); // } // } // else // { // var dataval = jQuery(xretDataval).find('#'+key).attr('value'); if(jQuery('#modalField_'+key).is(':checkbox')) { jQuery('#modalField_'+key).prop('checked',false); if(jQuery('#modalField_'+key).data('checked_value')==xretDataval) { jQuery('#modalField_'+key).prop('checked',true); } } else { jQuery('#modalField_'+key).val(xretDataval); } // } }); jQuery('#pager_modal').find('input,textarea,select').prop('disabled',false); if(xtitle == "Leaves File") { $.each(xret.is_disabled,function(key,xretDataval) { jQuery('#modalField_'+key).prop('disabled',xretDataval); }); jQuery('#pager_modal').find('input#modalField_withoutpay').prop('disabled',true); } //jQuery('#pager_modal').find('#modalField_subdrycde').prop('readonly','readonly'); jQuery('#pager_modal').dialog({ title:'Edit', width: xmodal_width, height: xmodal_height, appendTo:'#div_pager', draggable:true, resizable:false, autoOpen:false, modal:true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [ { "text":"Save", "class":"save", "id": "btn_diag_save", "click":function() { updateRow(recid); } }, { "text":"Close", "class":"exit", "id": "btn_diag_close", "click":function() { jQuery(this).dialog('close'); // jQuery(this).remove(); } } ] }).dialog('open'); jQuery('#modalField_subdrycde').change(); //20190314 donita } }) // var clonedPagerModal = jQuery('#pager_modal').clone(); // var action_btn_selected_row=''; // jQuery('#div_pager #datatable tbody tr').each(function(key,val){ // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var hidden_type = jQuery(val).find('#'+pager_keys[i]).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('1'); // } // else // { // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('0'); // } // } // else // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).is(':checkbox')) // { // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).data('checked_value')==dataval) // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // } // } // else // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).val(dataval); // } // } // } // } // }); // modPagerBtn('edit'); } function pager_view_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery('#pager_modal .required').removeClass('input_hasErr'); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } // console.log(recid); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&event_action=view"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); // console.log(); jQuery.ajax({ url: "class/pager_handler.php", type: "post", dataType: "json", data: xdata, success: function (xret) { $.each(xret.rs,function(key,xretDataval) { if(jQuery('#modalField_'+key).is(':checkbox')) { jQuery('#modalField_'+key).prop('checked',!true); if(jQuery('#modalField_'+key).data('checked_value')==xretDataval) { jQuery('#modalField_'+key).prop('checked',true); } } else { jQuery('#modalField_'+key).val(xretDataval); } }); jQuery('#pager_modal').find('input,textarea,select').prop('disabled',true); jQuery('#pager_modal').dialog({ title:'View', width: xmodal_width, height: xmodal_height, appendTo:'#div_pager', draggable:true, resizable:false, autoOpen:false, modal:true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [ { "text":"Close", "class":"exit", "id":"btn_diag_close", "click":function() { jQuery(this).dialog('close'); // jQuery(this).remove(); } } ] }).dialog('open'); } }) // var clonedPagerModal = jQuery('#pager_modal').clone(); // var action_btn_selected_row=''; // jQuery('#div_pager #datatable tbody tr').each(function(key,val){ // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var hidden_type = jQuery(val).find('#'+pager_keys[i]).attr('hidden_type'); // if(hidden_type == 'checkbox') // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(dataval == 'Y' || dataval == '1') // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('1'); // } // else // { // jQuery(clonedPagerModal).find('#checkbox_modalField_'+pager_keys[i]).val('0'); // } // } // else // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).is(':checkbox')) // { // if(jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).data('checked_value')==dataval) // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).prop('checked',true); // } // } // else // { // jQuery(clonedPagerModal).find('#modalField_'+pager_keys[i]).val(dataval); // } // } // } // } // }); } function delete_item(recid) { var active_id = jQuery('#pager_active_id').val(); jQuery("#modalField_"+table_id).val(active_id); if(active_id == '') { alertify.alert('No row selected!'); return false; } var action_btn_selected_row=''; //tinamaan to // jQuery('#div_pager #datatable tbody tr').each(function(key,val) // { // var xactive = jQuery(val).attr('id'); // jQuery(this).removeClass('action_btn_selected_row'); // if(active_id == xactive) // { // action_btn_selected_row = jQuery(this); // action_btn_selected_row.addClass('action_btn_selected_row'); // for(var i=0;i<pager_keys.length;i++) // { // var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); // jQuery('#modalField_'+pager_keys[i]).val(dataval); // } // } // }); // console.log('???',jQuery('#div_pager #datatable .tbody .tr#'+active_id)); jQuery('#div_pager #datatable .tbody .tr#'+active_id).addClass('action_btn_selected_row'); action_btn_selected_row = jQuery('#div_pager #datatable .tbody .tr#'+active_id); for(var i=0;i<pager_keys.length;i++) { var val = jQuery('#div_pager #datatable .tbody .tr[id="'+active_id+'"]').get(0); // get the DOM element var dataval = jQuery(val).find('#'+pager_keys[i]).attr('value'); jQuery('#modalField_'+pager_keys[i]).val(dataval); // console.log("out",jQuery('#modalField_'+pager_keys[i]).val(dataval)); } jQuery('#pager_modal').hide(); var xparams = ""; var xretmsg = ""; xparams += "&headers="+headers; xparams += "&title="+xtitle; xparams += "&table="+table; xparams += "&recid="+encodeURIComponent(recid); xparams += "&table_id="+table_id; xparams += "&fields="+fields; xparams += "&pager_xlink="+xlink_id; xparams += "&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); jQuery.ajax({ dataType:'json', data : xparams, url : 'class/pager_item_dedector.php', type: 'post', success : function (xretobj){ xretmsg = xretobj.msg; alertify.confirm('Delete "<b>'+xtitle+'</b> (' + xretmsg + ')" Record ?',function() { blockui(); var xdata = jQuery('#pager_modal *').serialize(); xdata+="&title="+xtitle; xdata+="&table="+table; xdata+="&recid="+encodeURIComponent(recid); xdata+="&table_id="+table_id; xdata+="&fields="+fields; xdata+="&pager_xlink="+xlink_id; xdata+="&pager_event_action=delete"; xdata+="&fieldname="+xfield; xdata+="&pager_link_id_hash="+jQuery('#pager_link_id_hash').val(); xdata+="&pager_modsubdry="+jQuery('#pager_modsubdry').val(); jQuery.ajax({ url:'class/pager_handler.php', type:'post', dataType:'json', data: xdata, success:function(response) { $.unblockUI(); alertify.alert(response.msg+' (' + xretmsg + ').',function() { if(response.bool) { // 20191118 justine set after delete go to firt page // jQuery('#pager_first').click(); pager_reload(); } }); } }); },function() { action_btn_selected_row.removeClass('action_btn_selected_row'); }); } }); } function checkpage() { if(parseInt(page) == 1) { jQuery('#pager_first').prop("disabled",true); jQuery('#pager_prev').prop("disabled",true); } else { jQuery('#pager_first').prop("disabled",false); jQuery('#pager_prev').prop("disabled",false); } if(parseInt(page) > parseInt(totalpages)) { page = parseInt(jQuery('#pager_page').val()) - 1; console.log("in"); // return false; document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); } } jQuery('#pager_selector').change(function(){ document.forms.myform.pager_page.value=this.value; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_limiter').change(function(){ document.forms.myform.pager_page.value='1'; document.forms.myform.pager_limit.value=this.value; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_next').click(function(){ if(page == totalpages){ page = totalpages; } else{ page = parseInt(jQuery('#pager_page').val()) + 1; } document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_prev').click(function(){ if(page == 1){ page = 1; } else{ page = parseInt(jQuery('#pager_page').val()) - 1; } document.forms.myform.pager_page.value=page; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_first').click(function(){ document.forms.myform.pager_page.value=1; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_last').click(function(){ document.forms.myform.pager_page.value=totalpages; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); jQuery('#pager_search_btn').click(function(){ document.forms.myform.pager_page.value=1; document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); }); //enable pressing enter on pager_search to submit jQuery('#pager_search_input').on('keypress', function (event) { if(event.which === 13){ jQuery('#pager_search_btn').click(); } }); function pager_reload() { document.forms.myform.action= xserver; document.forms.myform.method='POST'; document.forms.myform.target='_self'; document.forms.myform.submit(); } function print_item() { jQuery('#print_layout_container').show(); jQuery('#pager_print_export').dialog({ title:"Print "+xtitle, width: '650', height: 'auto', draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); jQuery('#pager_print_export .pager_print_expt_col_sort_sel').val('').change(); jQuery('#pager_print_export .pager_print_expt_input_text').val(''); }, buttons: [ { "text":"Print Preview", "class":"print", "id": "btn_diag_print", "click":function() { document.forms.myform.action='mf_print.php'; document.forms.myform.method='POST'; document.forms.myform.target='_blank'; document.forms.myform.submit(); } }, { "text":"Cancel", "class":"exit", "id": "btn_diag_cancel", "click":function() { jQuery(this).dialog("close"); } } ] }).dialog('open'); } function export_item() { jQuery('#print_layout_container').hide(); jQuery('#pager_print_export').dialog({ title:"Export "+xtitle, width: '650', height: 'auto', draggable:true, appendTo:'#div_pager', resizable:false, autoOpen:false, modal : true, closeOnEscape:false, open:function() { jQuery('.ui-dialog-titlebar-close').hide(); jQuery('#pager_print_export .pager_print_expt_col_sort_sel').val('').change(); jQuery('#pager_print_export .pager_print_expt_input_text').val(''); }, buttons: [ { "text":"Export", "class":"print", "id": "btn_diag_export", "click":function() { document.forms.myform.action='mf_export.php'; document.forms.myform.method='POST'; document.forms.myform.target='_blank'; document.forms.myform.submit(); } }, { "text":"Cancel", "id": "btn_diag_cancel", "class":"exit", "click":function() { jQuery(this).dialog("close"); } } ] }).dialog('open'); } function pager_check_all(obj) { var ischecked = jQuery(obj).prop('checked'); if(ischecked) { jQuery('.pager_checker_body').prop('checked',true); } else { jQuery('.pager_checker_body').prop('checked',false); } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function prevent_space(evt) { if(evt.which == 32) { evt.returnValue = false; } } //20191107 donita bak org // function paste_syspar_regex(evt) // { // evt.preventDefault(); // evt.returnValue = false; // var text = null; // if (window.clipboardData) // text = window.clipboardData.getData("Text"); // else if (evt && evt.clipboardData) // text = evt.clipboardData.getData("Text"); // var validate_spechar = jQuery('#pager_spechar').val(); // validate_spechar = validate_spechar.split(""); // validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; // var regex = new RegExp(validate_spechar,'mg'); // if( regex.test(text) ) // { // alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() // { // evt.target.value = text.replace(regex, ""); // // console.log(evt.target,text.replace(regex, "")); // },function() // { // }) // } // else // { // evt.target.value = text // } // } //prevent bypass of maxlength and pasting on disabled input function paste_syspar_regex(evt) { evt.preventDefault(); evt.returnValue = false; // console.log("pass") // console.log("1") // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val()+"<>"; validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery("#"+evt.target.id).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr.substring(0, xmaxlen); //20191107 donita // console.log(evt.target.id); if(jQuery("#"+evt.target.id).prop('disabled') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // disallow_tag("") // alert("1") // console.log("11") //20191106 donita newstr = evt.target.value; //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); //end trimstr = evt.target.value+newstr.substring(0, xmaxlen); evt.target.value = trimstr; // console.log(evt.target,text.replace(regex, "")); },function() { }) } else { evt.target.value = text //20191106 donita newstr = evt.target.value; trimstr = newstr.substring(0, xmaxlen); evt.target.value = trimstr; } } } function filter_syspar_code_regex(val_with_spechar) { var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); return val_with_spechar.replace(regex, ""); } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20160801 |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20160805 |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20180214 |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20180412 |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20180420 |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20180430 |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20180820 |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20190226 |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20190606 |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20191112 |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 06262015 |
| Request Header - size: 487 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 15425 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 15,425 bytes. |
/**
*** used of names *** alphabet + dash(-) + period(.) **/ function isNameKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; // var regex = /[- . +a-zA-Z ]/; //20160809 - karlo - included Ñ,ñ to regex (\u00d1 \u00f1) var regex = /[- . +a-zA-Z \u00d1 \u00f1]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) **/ function isAlphaNum(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } //20191115 donita function disallow_tag(regex="") { // console.log('disallow tag'); //20191123 donita jQuery('body').find('input ,textarea').each(function(){ if(!jQuery(this).hasClass('hasDialogTag')) { jQuery(this).addClass('hasDialogTag'); jQuery(this).keypress(function(e){ // console.log(e.keyCode); if(e.keyCode == 60 || e.keyCode == 62){ return false; } }); } }); jQuery('body').find('input:not([onpaste][ondrop][onkeypress]),textarea:not([onpaste][ondrop][onkeypress])').not('#categcde').not('#categcde').not('#modalField_apporder').not('#modalField_scrto').not('#modalField_scrfrom').each(function(){ if(!jQuery(this).hasClass('hasDialogTag2')) { jQuery(this).addClass('hasDialogTag2'); // jQuery(this).keypress(function(e){ // // console.log(e.keyCode); // if(e.keyCode == 60 || e.keyCode == 62){ // return false; // } // }); jQuery(this).on("paste",function(e){ console.log("2") var x = e.originalEvent.clipboardData.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); newval = newval.substring(0,maxlen); } if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); // Kiel 11-27-2019 - Added maxlength validation if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); x = x.substring(0,maxlen); } jQuery(e.target).val(x); e.preventDefault(); } }); //mica 11-18-19 jQuery(this).on("drop",function(e){ var x = e.originalEvent.dataTransfer.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); jQuery(e.target).val(x); e.preventDefault(); } }); } }); } //20191030 donita function prevent_Event(evt) { evt.preventDefault(); } function isCheck_paste(evt, thisobj,regex) { xval = evt.clipboardData.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { // console.log(xval[i]); if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; //20191112 donita // if(jQuery("#"+evt.target.id).prop('disabled') == true) //20191121 donita - use the target tag/element if(jQuery(evt.target).prop('disabled') == true) { } else { xmaxlength = jQuery(thisobj).attr('maxlength'); xnewval = jQuery(thisobj).val() + newval; jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval.slice(0,xmaxlength)); jQuery(thisobj).focus(); } } function isCheck_drop(evt, thisobj,regex) { xval = evt.dataTransfer.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; if(jQuery(thisobj).attr('maxlength')!=undefined) { var maxlen = jQuery(thisobj).attr('maxlength'); xnewval = xnewval.substring(0,maxlen); } jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval); } /** *** used of alphanumeric *** alphabet + numbers + dash(-) **/ function isAlphaNumDash(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isAlphaNumPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isTextContent(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[/';(),.a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number only **/ function isNumberKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + period(.) **/ function isNumberKeyWithPeriod(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); var regex = /[0-9]|\./; inputval=$(evt.srcElement).val() inputval=inputval+key; var period_count = (inputval.split(".").length - 1); if( !regex.test(key) || (evt.keyCode==46 && period_count >1)) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[, . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey_2(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + minus sign **/ function isContactKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]|\+|\(|\)|\-/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** validation if the inputed value is a valid email **/ function isEmailKey(id) { var x = $('#'+id).val(); var atpos = x.indexOf("@"); var dotpos = x.lastIndexOf("."); if(x.trim()=='') { } else { if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { // alert("Not a valid e-mail address"); alertify.alert('Not a valid e-mail address.'); $('#'+id).val(''); } } } /** *** added 06262015 -jep *** auto compute age by date inputted in DOB **/ function ageCount(xid_dob,xid_age) { var date1 = new Date(); var dob = document.getElementById(xid_dob).value; var new_dob_str = dob.replace(/-/g,"/"); var date2 = new Date(new_dob_str); var pattern = /^\d{1,2}\/\d{1,2}\/\d{4}$/; //Regex to validate date format (dd/mm/yyyy) if(dob!='') { if (pattern.test(new_dob_str)) { var today = new Date(); var birthDate = date2; var age = today.getFullYear() - birthDate.getFullYear(); var m = today.getMonth() - birthDate.getMonth(); if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { age--; } //calculating age document.getElementById(xid_age).value = age; document.getElementById(xid_age).focus(); return true; } else { if(dob!='') { alertify.alert("Invalid date format. format!"); return false; } } } else { document.getElementById(xid_age).value = 0; } } function paste_syspar_regex(evt) { var textVal = jQuery(evt.target).val(); evt.preventDefault(); evt.returnValue = false; // console.log("pass2") var caretPos =event.target.selectionStart; var caretEnd = event.target.selectionEnd; var textAreaTxt = jQuery(evt.target).val(); // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery(evt.target).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr; //20191107 donita // console.log(evt.target.id); console.log(jQuery(evt.target).prop('disabled')) if(jQuery(evt.target).prop('disabled') == true || jQuery(evt.target).prop('readonly') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // //20191106 donita newstr = evt.target.value; // //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); // //end trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); jQuery(evt.target).focus(); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length },function() { }) } else { evt.target.value = text; //20191106 donita newstr = evt.target.value; newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length } } } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function isAlphaNumColumnPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. , +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) + colon(:) + new line (/r /n) **/ function isAlphaNumDashWithColumnNewLine(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20160809 |
| Request Header - size: 487 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 15425 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 15,425 bytes. |
/**
*** used of names *** alphabet + dash(-) + period(.) **/ function isNameKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; // var regex = /[- . +a-zA-Z ]/; //20160809 - karlo - included Ñ,ñ to regex (\u00d1 \u00f1) var regex = /[- . +a-zA-Z \u00d1 \u00f1]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) **/ function isAlphaNum(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } //20191115 donita function disallow_tag(regex="") { // console.log('disallow tag'); //20191123 donita jQuery('body').find('input ,textarea').each(function(){ if(!jQuery(this).hasClass('hasDialogTag')) { jQuery(this).addClass('hasDialogTag'); jQuery(this).keypress(function(e){ // console.log(e.keyCode); if(e.keyCode == 60 || e.keyCode == 62){ return false; } }); } }); jQuery('body').find('input:not([onpaste][ondrop][onkeypress]),textarea:not([onpaste][ondrop][onkeypress])').not('#categcde').not('#categcde').not('#modalField_apporder').not('#modalField_scrto').not('#modalField_scrfrom').each(function(){ if(!jQuery(this).hasClass('hasDialogTag2')) { jQuery(this).addClass('hasDialogTag2'); // jQuery(this).keypress(function(e){ // // console.log(e.keyCode); // if(e.keyCode == 60 || e.keyCode == 62){ // return false; // } // }); jQuery(this).on("paste",function(e){ console.log("2") var x = e.originalEvent.clipboardData.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); newval = newval.substring(0,maxlen); } if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); // Kiel 11-27-2019 - Added maxlength validation if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); x = x.substring(0,maxlen); } jQuery(e.target).val(x); e.preventDefault(); } }); //mica 11-18-19 jQuery(this).on("drop",function(e){ var x = e.originalEvent.dataTransfer.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); jQuery(e.target).val(x); e.preventDefault(); } }); } }); } //20191030 donita function prevent_Event(evt) { evt.preventDefault(); } function isCheck_paste(evt, thisobj,regex) { xval = evt.clipboardData.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { // console.log(xval[i]); if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; //20191112 donita // if(jQuery("#"+evt.target.id).prop('disabled') == true) //20191121 donita - use the target tag/element if(jQuery(evt.target).prop('disabled') == true) { } else { xmaxlength = jQuery(thisobj).attr('maxlength'); xnewval = jQuery(thisobj).val() + newval; jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval.slice(0,xmaxlength)); jQuery(thisobj).focus(); } } function isCheck_drop(evt, thisobj,regex) { xval = evt.dataTransfer.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; if(jQuery(thisobj).attr('maxlength')!=undefined) { var maxlen = jQuery(thisobj).attr('maxlength'); xnewval = xnewval.substring(0,maxlen); } jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval); } /** *** used of alphanumeric *** alphabet + numbers + dash(-) **/ function isAlphaNumDash(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isAlphaNumPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isTextContent(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[/';(),.a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number only **/ function isNumberKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + period(.) **/ function isNumberKeyWithPeriod(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); var regex = /[0-9]|\./; inputval=$(evt.srcElement).val() inputval=inputval+key; var period_count = (inputval.split(".").length - 1); if( !regex.test(key) || (evt.keyCode==46 && period_count >1)) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[, . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey_2(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + minus sign **/ function isContactKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]|\+|\(|\)|\-/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** validation if the inputed value is a valid email **/ function isEmailKey(id) { var x = $('#'+id).val(); var atpos = x.indexOf("@"); var dotpos = x.lastIndexOf("."); if(x.trim()=='') { } else { if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { // alert("Not a valid e-mail address"); alertify.alert('Not a valid e-mail address.'); $('#'+id).val(''); } } } /** *** added 06262015 -jep *** auto compute age by date inputted in DOB **/ function ageCount(xid_dob,xid_age) { var date1 = new Date(); var dob = document.getElementById(xid_dob).value; var new_dob_str = dob.replace(/-/g,"/"); var date2 = new Date(new_dob_str); var pattern = /^\d{1,2}\/\d{1,2}\/\d{4}$/; //Regex to validate date format (dd/mm/yyyy) if(dob!='') { if (pattern.test(new_dob_str)) { var today = new Date(); var birthDate = date2; var age = today.getFullYear() - birthDate.getFullYear(); var m = today.getMonth() - birthDate.getMonth(); if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { age--; } //calculating age document.getElementById(xid_age).value = age; document.getElementById(xid_age).focus(); return true; } else { if(dob!='') { alertify.alert("Invalid date format. format!"); return false; } } } else { document.getElementById(xid_age).value = 0; } } function paste_syspar_regex(evt) { var textVal = jQuery(evt.target).val(); evt.preventDefault(); evt.returnValue = false; // console.log("pass2") var caretPos =event.target.selectionStart; var caretEnd = event.target.selectionEnd; var textAreaTxt = jQuery(evt.target).val(); // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery(evt.target).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr; //20191107 donita // console.log(evt.target.id); console.log(jQuery(evt.target).prop('disabled')) if(jQuery(evt.target).prop('disabled') == true || jQuery(evt.target).prop('readonly') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // //20191106 donita newstr = evt.target.value; // //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); // //end trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); jQuery(evt.target).focus(); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length },function() { }) } else { evt.target.value = text; //20191106 donita newstr = evt.target.value; newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length } } } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function isAlphaNumColumnPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. , +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) + colon(:) + new line (/r /n) **/ function isAlphaNumDashWithColumnNewLine(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20191030 |
| Request Header - size: 487 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 15425 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 15,425 bytes. |
/**
*** used of names *** alphabet + dash(-) + period(.) **/ function isNameKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; // var regex = /[- . +a-zA-Z ]/; //20160809 - karlo - included Ñ,ñ to regex (\u00d1 \u00f1) var regex = /[- . +a-zA-Z \u00d1 \u00f1]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) **/ function isAlphaNum(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } //20191115 donita function disallow_tag(regex="") { // console.log('disallow tag'); //20191123 donita jQuery('body').find('input ,textarea').each(function(){ if(!jQuery(this).hasClass('hasDialogTag')) { jQuery(this).addClass('hasDialogTag'); jQuery(this).keypress(function(e){ // console.log(e.keyCode); if(e.keyCode == 60 || e.keyCode == 62){ return false; } }); } }); jQuery('body').find('input:not([onpaste][ondrop][onkeypress]),textarea:not([onpaste][ondrop][onkeypress])').not('#categcde').not('#categcde').not('#modalField_apporder').not('#modalField_scrto').not('#modalField_scrfrom').each(function(){ if(!jQuery(this).hasClass('hasDialogTag2')) { jQuery(this).addClass('hasDialogTag2'); // jQuery(this).keypress(function(e){ // // console.log(e.keyCode); // if(e.keyCode == 60 || e.keyCode == 62){ // return false; // } // }); jQuery(this).on("paste",function(e){ console.log("2") var x = e.originalEvent.clipboardData.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); newval = newval.substring(0,maxlen); } if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); // Kiel 11-27-2019 - Added maxlength validation if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); x = x.substring(0,maxlen); } jQuery(e.target).val(x); e.preventDefault(); } }); //mica 11-18-19 jQuery(this).on("drop",function(e){ var x = e.originalEvent.dataTransfer.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); jQuery(e.target).val(x); e.preventDefault(); } }); } }); } //20191030 donita function prevent_Event(evt) { evt.preventDefault(); } function isCheck_paste(evt, thisobj,regex) { xval = evt.clipboardData.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { // console.log(xval[i]); if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; //20191112 donita // if(jQuery("#"+evt.target.id).prop('disabled') == true) //20191121 donita - use the target tag/element if(jQuery(evt.target).prop('disabled') == true) { } else { xmaxlength = jQuery(thisobj).attr('maxlength'); xnewval = jQuery(thisobj).val() + newval; jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval.slice(0,xmaxlength)); jQuery(thisobj).focus(); } } function isCheck_drop(evt, thisobj,regex) { xval = evt.dataTransfer.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; if(jQuery(thisobj).attr('maxlength')!=undefined) { var maxlen = jQuery(thisobj).attr('maxlength'); xnewval = xnewval.substring(0,maxlen); } jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval); } /** *** used of alphanumeric *** alphabet + numbers + dash(-) **/ function isAlphaNumDash(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isAlphaNumPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isTextContent(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[/';(),.a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number only **/ function isNumberKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + period(.) **/ function isNumberKeyWithPeriod(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); var regex = /[0-9]|\./; inputval=$(evt.srcElement).val() inputval=inputval+key; var period_count = (inputval.split(".").length - 1); if( !regex.test(key) || (evt.keyCode==46 && period_count >1)) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[, . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey_2(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + minus sign **/ function isContactKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]|\+|\(|\)|\-/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** validation if the inputed value is a valid email **/ function isEmailKey(id) { var x = $('#'+id).val(); var atpos = x.indexOf("@"); var dotpos = x.lastIndexOf("."); if(x.trim()=='') { } else { if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { // alert("Not a valid e-mail address"); alertify.alert('Not a valid e-mail address.'); $('#'+id).val(''); } } } /** *** added 06262015 -jep *** auto compute age by date inputted in DOB **/ function ageCount(xid_dob,xid_age) { var date1 = new Date(); var dob = document.getElementById(xid_dob).value; var new_dob_str = dob.replace(/-/g,"/"); var date2 = new Date(new_dob_str); var pattern = /^\d{1,2}\/\d{1,2}\/\d{4}$/; //Regex to validate date format (dd/mm/yyyy) if(dob!='') { if (pattern.test(new_dob_str)) { var today = new Date(); var birthDate = date2; var age = today.getFullYear() - birthDate.getFullYear(); var m = today.getMonth() - birthDate.getMonth(); if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { age--; } //calculating age document.getElementById(xid_age).value = age; document.getElementById(xid_age).focus(); return true; } else { if(dob!='') { alertify.alert("Invalid date format. format!"); return false; } } } else { document.getElementById(xid_age).value = 0; } } function paste_syspar_regex(evt) { var textVal = jQuery(evt.target).val(); evt.preventDefault(); evt.returnValue = false; // console.log("pass2") var caretPos =event.target.selectionStart; var caretEnd = event.target.selectionEnd; var textAreaTxt = jQuery(evt.target).val(); // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery(evt.target).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr; //20191107 donita // console.log(evt.target.id); console.log(jQuery(evt.target).prop('disabled')) if(jQuery(evt.target).prop('disabled') == true || jQuery(evt.target).prop('readonly') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // //20191106 donita newstr = evt.target.value; // //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); // //end trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); jQuery(evt.target).focus(); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length },function() { }) } else { evt.target.value = text; //20191106 donita newstr = evt.target.value; newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length } } } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function isAlphaNumColumnPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. , +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) + colon(:) + new line (/r /n) **/ function isAlphaNumDashWithColumnNewLine(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20191106 |
| Request Header - size: 487 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 15425 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 15,425 bytes. |
/**
*** used of names *** alphabet + dash(-) + period(.) **/ function isNameKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; // var regex = /[- . +a-zA-Z ]/; //20160809 - karlo - included Ñ,ñ to regex (\u00d1 \u00f1) var regex = /[- . +a-zA-Z \u00d1 \u00f1]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) **/ function isAlphaNum(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } //20191115 donita function disallow_tag(regex="") { // console.log('disallow tag'); //20191123 donita jQuery('body').find('input ,textarea').each(function(){ if(!jQuery(this).hasClass('hasDialogTag')) { jQuery(this).addClass('hasDialogTag'); jQuery(this).keypress(function(e){ // console.log(e.keyCode); if(e.keyCode == 60 || e.keyCode == 62){ return false; } }); } }); jQuery('body').find('input:not([onpaste][ondrop][onkeypress]),textarea:not([onpaste][ondrop][onkeypress])').not('#categcde').not('#categcde').not('#modalField_apporder').not('#modalField_scrto').not('#modalField_scrfrom').each(function(){ if(!jQuery(this).hasClass('hasDialogTag2')) { jQuery(this).addClass('hasDialogTag2'); // jQuery(this).keypress(function(e){ // // console.log(e.keyCode); // if(e.keyCode == 60 || e.keyCode == 62){ // return false; // } // }); jQuery(this).on("paste",function(e){ console.log("2") var x = e.originalEvent.clipboardData.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); newval = newval.substring(0,maxlen); } if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); // Kiel 11-27-2019 - Added maxlength validation if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); x = x.substring(0,maxlen); } jQuery(e.target).val(x); e.preventDefault(); } }); //mica 11-18-19 jQuery(this).on("drop",function(e){ var x = e.originalEvent.dataTransfer.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); jQuery(e.target).val(x); e.preventDefault(); } }); } }); } //20191030 donita function prevent_Event(evt) { evt.preventDefault(); } function isCheck_paste(evt, thisobj,regex) { xval = evt.clipboardData.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { // console.log(xval[i]); if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; //20191112 donita // if(jQuery("#"+evt.target.id).prop('disabled') == true) //20191121 donita - use the target tag/element if(jQuery(evt.target).prop('disabled') == true) { } else { xmaxlength = jQuery(thisobj).attr('maxlength'); xnewval = jQuery(thisobj).val() + newval; jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval.slice(0,xmaxlength)); jQuery(thisobj).focus(); } } function isCheck_drop(evt, thisobj,regex) { xval = evt.dataTransfer.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; if(jQuery(thisobj).attr('maxlength')!=undefined) { var maxlen = jQuery(thisobj).attr('maxlength'); xnewval = xnewval.substring(0,maxlen); } jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval); } /** *** used of alphanumeric *** alphabet + numbers + dash(-) **/ function isAlphaNumDash(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isAlphaNumPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isTextContent(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[/';(),.a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number only **/ function isNumberKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + period(.) **/ function isNumberKeyWithPeriod(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); var regex = /[0-9]|\./; inputval=$(evt.srcElement).val() inputval=inputval+key; var period_count = (inputval.split(".").length - 1); if( !regex.test(key) || (evt.keyCode==46 && period_count >1)) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[, . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey_2(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + minus sign **/ function isContactKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]|\+|\(|\)|\-/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** validation if the inputed value is a valid email **/ function isEmailKey(id) { var x = $('#'+id).val(); var atpos = x.indexOf("@"); var dotpos = x.lastIndexOf("."); if(x.trim()=='') { } else { if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { // alert("Not a valid e-mail address"); alertify.alert('Not a valid e-mail address.'); $('#'+id).val(''); } } } /** *** added 06262015 -jep *** auto compute age by date inputted in DOB **/ function ageCount(xid_dob,xid_age) { var date1 = new Date(); var dob = document.getElementById(xid_dob).value; var new_dob_str = dob.replace(/-/g,"/"); var date2 = new Date(new_dob_str); var pattern = /^\d{1,2}\/\d{1,2}\/\d{4}$/; //Regex to validate date format (dd/mm/yyyy) if(dob!='') { if (pattern.test(new_dob_str)) { var today = new Date(); var birthDate = date2; var age = today.getFullYear() - birthDate.getFullYear(); var m = today.getMonth() - birthDate.getMonth(); if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { age--; } //calculating age document.getElementById(xid_age).value = age; document.getElementById(xid_age).focus(); return true; } else { if(dob!='') { alertify.alert("Invalid date format. format!"); return false; } } } else { document.getElementById(xid_age).value = 0; } } function paste_syspar_regex(evt) { var textVal = jQuery(evt.target).val(); evt.preventDefault(); evt.returnValue = false; // console.log("pass2") var caretPos =event.target.selectionStart; var caretEnd = event.target.selectionEnd; var textAreaTxt = jQuery(evt.target).val(); // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery(evt.target).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr; //20191107 donita // console.log(evt.target.id); console.log(jQuery(evt.target).prop('disabled')) if(jQuery(evt.target).prop('disabled') == true || jQuery(evt.target).prop('readonly') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // //20191106 donita newstr = evt.target.value; // //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); // //end trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); jQuery(evt.target).focus(); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length },function() { }) } else { evt.target.value = text; //20191106 donita newstr = evt.target.value; newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length } } } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function isAlphaNumColumnPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. , +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) + colon(:) + new line (/r /n) **/ function isAlphaNumDashWithColumnNewLine(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20191107 |
| Request Header - size: 487 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 15425 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 15,425 bytes. |
/**
*** used of names *** alphabet + dash(-) + period(.) **/ function isNameKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; // var regex = /[- . +a-zA-Z ]/; //20160809 - karlo - included Ñ,ñ to regex (\u00d1 \u00f1) var regex = /[- . +a-zA-Z \u00d1 \u00f1]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) **/ function isAlphaNum(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } //20191115 donita function disallow_tag(regex="") { // console.log('disallow tag'); //20191123 donita jQuery('body').find('input ,textarea').each(function(){ if(!jQuery(this).hasClass('hasDialogTag')) { jQuery(this).addClass('hasDialogTag'); jQuery(this).keypress(function(e){ // console.log(e.keyCode); if(e.keyCode == 60 || e.keyCode == 62){ return false; } }); } }); jQuery('body').find('input:not([onpaste][ondrop][onkeypress]),textarea:not([onpaste][ondrop][onkeypress])').not('#categcde').not('#categcde').not('#modalField_apporder').not('#modalField_scrto').not('#modalField_scrfrom').each(function(){ if(!jQuery(this).hasClass('hasDialogTag2')) { jQuery(this).addClass('hasDialogTag2'); // jQuery(this).keypress(function(e){ // // console.log(e.keyCode); // if(e.keyCode == 60 || e.keyCode == 62){ // return false; // } // }); jQuery(this).on("paste",function(e){ console.log("2") var x = e.originalEvent.clipboardData.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); newval = newval.substring(0,maxlen); } if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); // Kiel 11-27-2019 - Added maxlength validation if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); x = x.substring(0,maxlen); } jQuery(e.target).val(x); e.preventDefault(); } }); //mica 11-18-19 jQuery(this).on("drop",function(e){ var x = e.originalEvent.dataTransfer.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); jQuery(e.target).val(x); e.preventDefault(); } }); } }); } //20191030 donita function prevent_Event(evt) { evt.preventDefault(); } function isCheck_paste(evt, thisobj,regex) { xval = evt.clipboardData.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { // console.log(xval[i]); if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; //20191112 donita // if(jQuery("#"+evt.target.id).prop('disabled') == true) //20191121 donita - use the target tag/element if(jQuery(evt.target).prop('disabled') == true) { } else { xmaxlength = jQuery(thisobj).attr('maxlength'); xnewval = jQuery(thisobj).val() + newval; jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval.slice(0,xmaxlength)); jQuery(thisobj).focus(); } } function isCheck_drop(evt, thisobj,regex) { xval = evt.dataTransfer.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; if(jQuery(thisobj).attr('maxlength')!=undefined) { var maxlen = jQuery(thisobj).attr('maxlength'); xnewval = xnewval.substring(0,maxlen); } jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval); } /** *** used of alphanumeric *** alphabet + numbers + dash(-) **/ function isAlphaNumDash(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isAlphaNumPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isTextContent(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[/';(),.a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number only **/ function isNumberKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + period(.) **/ function isNumberKeyWithPeriod(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); var regex = /[0-9]|\./; inputval=$(evt.srcElement).val() inputval=inputval+key; var period_count = (inputval.split(".").length - 1); if( !regex.test(key) || (evt.keyCode==46 && period_count >1)) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[, . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey_2(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + minus sign **/ function isContactKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]|\+|\(|\)|\-/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** validation if the inputed value is a valid email **/ function isEmailKey(id) { var x = $('#'+id).val(); var atpos = x.indexOf("@"); var dotpos = x.lastIndexOf("."); if(x.trim()=='') { } else { if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { // alert("Not a valid e-mail address"); alertify.alert('Not a valid e-mail address.'); $('#'+id).val(''); } } } /** *** added 06262015 -jep *** auto compute age by date inputted in DOB **/ function ageCount(xid_dob,xid_age) { var date1 = new Date(); var dob = document.getElementById(xid_dob).value; var new_dob_str = dob.replace(/-/g,"/"); var date2 = new Date(new_dob_str); var pattern = /^\d{1,2}\/\d{1,2}\/\d{4}$/; //Regex to validate date format (dd/mm/yyyy) if(dob!='') { if (pattern.test(new_dob_str)) { var today = new Date(); var birthDate = date2; var age = today.getFullYear() - birthDate.getFullYear(); var m = today.getMonth() - birthDate.getMonth(); if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { age--; } //calculating age document.getElementById(xid_age).value = age; document.getElementById(xid_age).focus(); return true; } else { if(dob!='') { alertify.alert("Invalid date format. format!"); return false; } } } else { document.getElementById(xid_age).value = 0; } } function paste_syspar_regex(evt) { var textVal = jQuery(evt.target).val(); evt.preventDefault(); evt.returnValue = false; // console.log("pass2") var caretPos =event.target.selectionStart; var caretEnd = event.target.selectionEnd; var textAreaTxt = jQuery(evt.target).val(); // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery(evt.target).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr; //20191107 donita // console.log(evt.target.id); console.log(jQuery(evt.target).prop('disabled')) if(jQuery(evt.target).prop('disabled') == true || jQuery(evt.target).prop('readonly') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // //20191106 donita newstr = evt.target.value; // //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); // //end trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); jQuery(evt.target).focus(); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length },function() { }) } else { evt.target.value = text; //20191106 donita newstr = evt.target.value; newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length } } } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function isAlphaNumColumnPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. , +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) + colon(:) + new line (/r /n) **/ function isAlphaNumDashWithColumnNewLine(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20191112 |
| Request Header - size: 487 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 15425 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 15,425 bytes. |
/**
*** used of names *** alphabet + dash(-) + period(.) **/ function isNameKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; // var regex = /[- . +a-zA-Z ]/; //20160809 - karlo - included Ñ,ñ to regex (\u00d1 \u00f1) var regex = /[- . +a-zA-Z \u00d1 \u00f1]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) **/ function isAlphaNum(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } //20191115 donita function disallow_tag(regex="") { // console.log('disallow tag'); //20191123 donita jQuery('body').find('input ,textarea').each(function(){ if(!jQuery(this).hasClass('hasDialogTag')) { jQuery(this).addClass('hasDialogTag'); jQuery(this).keypress(function(e){ // console.log(e.keyCode); if(e.keyCode == 60 || e.keyCode == 62){ return false; } }); } }); jQuery('body').find('input:not([onpaste][ondrop][onkeypress]),textarea:not([onpaste][ondrop][onkeypress])').not('#categcde').not('#categcde').not('#modalField_apporder').not('#modalField_scrto').not('#modalField_scrfrom').each(function(){ if(!jQuery(this).hasClass('hasDialogTag2')) { jQuery(this).addClass('hasDialogTag2'); // jQuery(this).keypress(function(e){ // // console.log(e.keyCode); // if(e.keyCode == 60 || e.keyCode == 62){ // return false; // } // }); jQuery(this).on("paste",function(e){ console.log("2") var x = e.originalEvent.clipboardData.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); newval = newval.substring(0,maxlen); } if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); // Kiel 11-27-2019 - Added maxlength validation if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); x = x.substring(0,maxlen); } jQuery(e.target).val(x); e.preventDefault(); } }); //mica 11-18-19 jQuery(this).on("drop",function(e){ var x = e.originalEvent.dataTransfer.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); jQuery(e.target).val(x); e.preventDefault(); } }); } }); } //20191030 donita function prevent_Event(evt) { evt.preventDefault(); } function isCheck_paste(evt, thisobj,regex) { xval = evt.clipboardData.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { // console.log(xval[i]); if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; //20191112 donita // if(jQuery("#"+evt.target.id).prop('disabled') == true) //20191121 donita - use the target tag/element if(jQuery(evt.target).prop('disabled') == true) { } else { xmaxlength = jQuery(thisobj).attr('maxlength'); xnewval = jQuery(thisobj).val() + newval; jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval.slice(0,xmaxlength)); jQuery(thisobj).focus(); } } function isCheck_drop(evt, thisobj,regex) { xval = evt.dataTransfer.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; if(jQuery(thisobj).attr('maxlength')!=undefined) { var maxlen = jQuery(thisobj).attr('maxlength'); xnewval = xnewval.substring(0,maxlen); } jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval); } /** *** used of alphanumeric *** alphabet + numbers + dash(-) **/ function isAlphaNumDash(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isAlphaNumPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isTextContent(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[/';(),.a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number only **/ function isNumberKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + period(.) **/ function isNumberKeyWithPeriod(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); var regex = /[0-9]|\./; inputval=$(evt.srcElement).val() inputval=inputval+key; var period_count = (inputval.split(".").length - 1); if( !regex.test(key) || (evt.keyCode==46 && period_count >1)) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[, . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey_2(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + minus sign **/ function isContactKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]|\+|\(|\)|\-/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** validation if the inputed value is a valid email **/ function isEmailKey(id) { var x = $('#'+id).val(); var atpos = x.indexOf("@"); var dotpos = x.lastIndexOf("."); if(x.trim()=='') { } else { if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { // alert("Not a valid e-mail address"); alertify.alert('Not a valid e-mail address.'); $('#'+id).val(''); } } } /** *** added 06262015 -jep *** auto compute age by date inputted in DOB **/ function ageCount(xid_dob,xid_age) { var date1 = new Date(); var dob = document.getElementById(xid_dob).value; var new_dob_str = dob.replace(/-/g,"/"); var date2 = new Date(new_dob_str); var pattern = /^\d{1,2}\/\d{1,2}\/\d{4}$/; //Regex to validate date format (dd/mm/yyyy) if(dob!='') { if (pattern.test(new_dob_str)) { var today = new Date(); var birthDate = date2; var age = today.getFullYear() - birthDate.getFullYear(); var m = today.getMonth() - birthDate.getMonth(); if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { age--; } //calculating age document.getElementById(xid_age).value = age; document.getElementById(xid_age).focus(); return true; } else { if(dob!='') { alertify.alert("Invalid date format. format!"); return false; } } } else { document.getElementById(xid_age).value = 0; } } function paste_syspar_regex(evt) { var textVal = jQuery(evt.target).val(); evt.preventDefault(); evt.returnValue = false; // console.log("pass2") var caretPos =event.target.selectionStart; var caretEnd = event.target.selectionEnd; var textAreaTxt = jQuery(evt.target).val(); // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery(evt.target).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr; //20191107 donita // console.log(evt.target.id); console.log(jQuery(evt.target).prop('disabled')) if(jQuery(evt.target).prop('disabled') == true || jQuery(evt.target).prop('readonly') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // //20191106 donita newstr = evt.target.value; // //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); // //end trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); jQuery(evt.target).focus(); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length },function() { }) } else { evt.target.value = text; //20191106 donita newstr = evt.target.value; newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length } } } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function isAlphaNumColumnPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. , +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) + colon(:) + new line (/r /n) **/ function isAlphaNumDashWithColumnNewLine(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20191115 |
| Request Header - size: 487 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 15425 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 15,425 bytes. |
/**
*** used of names *** alphabet + dash(-) + period(.) **/ function isNameKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; // var regex = /[- . +a-zA-Z ]/; //20160809 - karlo - included Ñ,ñ to regex (\u00d1 \u00f1) var regex = /[- . +a-zA-Z \u00d1 \u00f1]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) **/ function isAlphaNum(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } //20191115 donita function disallow_tag(regex="") { // console.log('disallow tag'); //20191123 donita jQuery('body').find('input ,textarea').each(function(){ if(!jQuery(this).hasClass('hasDialogTag')) { jQuery(this).addClass('hasDialogTag'); jQuery(this).keypress(function(e){ // console.log(e.keyCode); if(e.keyCode == 60 || e.keyCode == 62){ return false; } }); } }); jQuery('body').find('input:not([onpaste][ondrop][onkeypress]),textarea:not([onpaste][ondrop][onkeypress])').not('#categcde').not('#categcde').not('#modalField_apporder').not('#modalField_scrto').not('#modalField_scrfrom').each(function(){ if(!jQuery(this).hasClass('hasDialogTag2')) { jQuery(this).addClass('hasDialogTag2'); // jQuery(this).keypress(function(e){ // // console.log(e.keyCode); // if(e.keyCode == 60 || e.keyCode == 62){ // return false; // } // }); jQuery(this).on("paste",function(e){ console.log("2") var x = e.originalEvent.clipboardData.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); newval = newval.substring(0,maxlen); } if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); // Kiel 11-27-2019 - Added maxlength validation if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); x = x.substring(0,maxlen); } jQuery(e.target).val(x); e.preventDefault(); } }); //mica 11-18-19 jQuery(this).on("drop",function(e){ var x = e.originalEvent.dataTransfer.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); jQuery(e.target).val(x); e.preventDefault(); } }); } }); } //20191030 donita function prevent_Event(evt) { evt.preventDefault(); } function isCheck_paste(evt, thisobj,regex) { xval = evt.clipboardData.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { // console.log(xval[i]); if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; //20191112 donita // if(jQuery("#"+evt.target.id).prop('disabled') == true) //20191121 donita - use the target tag/element if(jQuery(evt.target).prop('disabled') == true) { } else { xmaxlength = jQuery(thisobj).attr('maxlength'); xnewval = jQuery(thisobj).val() + newval; jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval.slice(0,xmaxlength)); jQuery(thisobj).focus(); } } function isCheck_drop(evt, thisobj,regex) { xval = evt.dataTransfer.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; if(jQuery(thisobj).attr('maxlength')!=undefined) { var maxlen = jQuery(thisobj).attr('maxlength'); xnewval = xnewval.substring(0,maxlen); } jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval); } /** *** used of alphanumeric *** alphabet + numbers + dash(-) **/ function isAlphaNumDash(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isAlphaNumPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isTextContent(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[/';(),.a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number only **/ function isNumberKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + period(.) **/ function isNumberKeyWithPeriod(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); var regex = /[0-9]|\./; inputval=$(evt.srcElement).val() inputval=inputval+key; var period_count = (inputval.split(".").length - 1); if( !regex.test(key) || (evt.keyCode==46 && period_count >1)) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[, . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey_2(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + minus sign **/ function isContactKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]|\+|\(|\)|\-/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** validation if the inputed value is a valid email **/ function isEmailKey(id) { var x = $('#'+id).val(); var atpos = x.indexOf("@"); var dotpos = x.lastIndexOf("."); if(x.trim()=='') { } else { if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { // alert("Not a valid e-mail address"); alertify.alert('Not a valid e-mail address.'); $('#'+id).val(''); } } } /** *** added 06262015 -jep *** auto compute age by date inputted in DOB **/ function ageCount(xid_dob,xid_age) { var date1 = new Date(); var dob = document.getElementById(xid_dob).value; var new_dob_str = dob.replace(/-/g,"/"); var date2 = new Date(new_dob_str); var pattern = /^\d{1,2}\/\d{1,2}\/\d{4}$/; //Regex to validate date format (dd/mm/yyyy) if(dob!='') { if (pattern.test(new_dob_str)) { var today = new Date(); var birthDate = date2; var age = today.getFullYear() - birthDate.getFullYear(); var m = today.getMonth() - birthDate.getMonth(); if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { age--; } //calculating age document.getElementById(xid_age).value = age; document.getElementById(xid_age).focus(); return true; } else { if(dob!='') { alertify.alert("Invalid date format. format!"); return false; } } } else { document.getElementById(xid_age).value = 0; } } function paste_syspar_regex(evt) { var textVal = jQuery(evt.target).val(); evt.preventDefault(); evt.returnValue = false; // console.log("pass2") var caretPos =event.target.selectionStart; var caretEnd = event.target.selectionEnd; var textAreaTxt = jQuery(evt.target).val(); // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery(evt.target).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr; //20191107 donita // console.log(evt.target.id); console.log(jQuery(evt.target).prop('disabled')) if(jQuery(evt.target).prop('disabled') == true || jQuery(evt.target).prop('readonly') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // //20191106 donita newstr = evt.target.value; // //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); // //end trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); jQuery(evt.target).focus(); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length },function() { }) } else { evt.target.value = text; //20191106 donita newstr = evt.target.value; newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length } } } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function isAlphaNumColumnPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. , +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) + colon(:) + new line (/r /n) **/ function isAlphaNumDashWithColumnNewLine(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20191121 |
| Request Header - size: 487 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 15425 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 15,425 bytes. |
/**
*** used of names *** alphabet + dash(-) + period(.) **/ function isNameKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; // var regex = /[- . +a-zA-Z ]/; //20160809 - karlo - included Ñ,ñ to regex (\u00d1 \u00f1) var regex = /[- . +a-zA-Z \u00d1 \u00f1]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) **/ function isAlphaNum(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } //20191115 donita function disallow_tag(regex="") { // console.log('disallow tag'); //20191123 donita jQuery('body').find('input ,textarea').each(function(){ if(!jQuery(this).hasClass('hasDialogTag')) { jQuery(this).addClass('hasDialogTag'); jQuery(this).keypress(function(e){ // console.log(e.keyCode); if(e.keyCode == 60 || e.keyCode == 62){ return false; } }); } }); jQuery('body').find('input:not([onpaste][ondrop][onkeypress]),textarea:not([onpaste][ondrop][onkeypress])').not('#categcde').not('#categcde').not('#modalField_apporder').not('#modalField_scrto').not('#modalField_scrfrom').each(function(){ if(!jQuery(this).hasClass('hasDialogTag2')) { jQuery(this).addClass('hasDialogTag2'); // jQuery(this).keypress(function(e){ // // console.log(e.keyCode); // if(e.keyCode == 60 || e.keyCode == 62){ // return false; // } // }); jQuery(this).on("paste",function(e){ console.log("2") var x = e.originalEvent.clipboardData.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); newval = newval.substring(0,maxlen); } if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); // Kiel 11-27-2019 - Added maxlength validation if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); x = x.substring(0,maxlen); } jQuery(e.target).val(x); e.preventDefault(); } }); //mica 11-18-19 jQuery(this).on("drop",function(e){ var x = e.originalEvent.dataTransfer.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); jQuery(e.target).val(x); e.preventDefault(); } }); } }); } //20191030 donita function prevent_Event(evt) { evt.preventDefault(); } function isCheck_paste(evt, thisobj,regex) { xval = evt.clipboardData.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { // console.log(xval[i]); if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; //20191112 donita // if(jQuery("#"+evt.target.id).prop('disabled') == true) //20191121 donita - use the target tag/element if(jQuery(evt.target).prop('disabled') == true) { } else { xmaxlength = jQuery(thisobj).attr('maxlength'); xnewval = jQuery(thisobj).val() + newval; jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval.slice(0,xmaxlength)); jQuery(thisobj).focus(); } } function isCheck_drop(evt, thisobj,regex) { xval = evt.dataTransfer.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; if(jQuery(thisobj).attr('maxlength')!=undefined) { var maxlen = jQuery(thisobj).attr('maxlength'); xnewval = xnewval.substring(0,maxlen); } jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval); } /** *** used of alphanumeric *** alphabet + numbers + dash(-) **/ function isAlphaNumDash(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isAlphaNumPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isTextContent(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[/';(),.a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number only **/ function isNumberKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + period(.) **/ function isNumberKeyWithPeriod(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); var regex = /[0-9]|\./; inputval=$(evt.srcElement).val() inputval=inputval+key; var period_count = (inputval.split(".").length - 1); if( !regex.test(key) || (evt.keyCode==46 && period_count >1)) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[, . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey_2(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + minus sign **/ function isContactKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]|\+|\(|\)|\-/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** validation if the inputed value is a valid email **/ function isEmailKey(id) { var x = $('#'+id).val(); var atpos = x.indexOf("@"); var dotpos = x.lastIndexOf("."); if(x.trim()=='') { } else { if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { // alert("Not a valid e-mail address"); alertify.alert('Not a valid e-mail address.'); $('#'+id).val(''); } } } /** *** added 06262015 -jep *** auto compute age by date inputted in DOB **/ function ageCount(xid_dob,xid_age) { var date1 = new Date(); var dob = document.getElementById(xid_dob).value; var new_dob_str = dob.replace(/-/g,"/"); var date2 = new Date(new_dob_str); var pattern = /^\d{1,2}\/\d{1,2}\/\d{4}$/; //Regex to validate date format (dd/mm/yyyy) if(dob!='') { if (pattern.test(new_dob_str)) { var today = new Date(); var birthDate = date2; var age = today.getFullYear() - birthDate.getFullYear(); var m = today.getMonth() - birthDate.getMonth(); if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { age--; } //calculating age document.getElementById(xid_age).value = age; document.getElementById(xid_age).focus(); return true; } else { if(dob!='') { alertify.alert("Invalid date format. format!"); return false; } } } else { document.getElementById(xid_age).value = 0; } } function paste_syspar_regex(evt) { var textVal = jQuery(evt.target).val(); evt.preventDefault(); evt.returnValue = false; // console.log("pass2") var caretPos =event.target.selectionStart; var caretEnd = event.target.selectionEnd; var textAreaTxt = jQuery(evt.target).val(); // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery(evt.target).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr; //20191107 donita // console.log(evt.target.id); console.log(jQuery(evt.target).prop('disabled')) if(jQuery(evt.target).prop('disabled') == true || jQuery(evt.target).prop('readonly') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // //20191106 donita newstr = evt.target.value; // //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); // //end trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); jQuery(evt.target).focus(); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length },function() { }) } else { evt.target.value = text; //20191106 donita newstr = evt.target.value; newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length } } } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function isAlphaNumColumnPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. , +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) + colon(:) + new line (/r /n) **/ function isAlphaNumDashWithColumnNewLine(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20191123 |
| Request Header - size: 487 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/regex.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 15425 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 15,425 bytes. |
/**
*** used of names *** alphabet + dash(-) + period(.) **/ function isNameKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; // var regex = /[- . +a-zA-Z ]/; //20160809 - karlo - included Ñ,ñ to regex (\u00d1 \u00f1) var regex = /[- . +a-zA-Z \u00d1 \u00f1]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) **/ function isAlphaNum(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } //20191115 donita function disallow_tag(regex="") { // console.log('disallow tag'); //20191123 donita jQuery('body').find('input ,textarea').each(function(){ if(!jQuery(this).hasClass('hasDialogTag')) { jQuery(this).addClass('hasDialogTag'); jQuery(this).keypress(function(e){ // console.log(e.keyCode); if(e.keyCode == 60 || e.keyCode == 62){ return false; } }); } }); jQuery('body').find('input:not([onpaste][ondrop][onkeypress]),textarea:not([onpaste][ondrop][onkeypress])').not('#categcde').not('#categcde').not('#modalField_apporder').not('#modalField_scrto').not('#modalField_scrfrom').each(function(){ if(!jQuery(this).hasClass('hasDialogTag2')) { jQuery(this).addClass('hasDialogTag2'); // jQuery(this).keypress(function(e){ // // console.log(e.keyCode); // if(e.keyCode == 60 || e.keyCode == 62){ // return false; // } // }); jQuery(this).on("paste",function(e){ console.log("2") var x = e.originalEvent.clipboardData.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); newval = newval.substring(0,maxlen); } if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); // Kiel 11-27-2019 - Added maxlength validation if(jQuery(e.target).attr('maxlength')!=undefined) { var maxlen = jQuery(e.target).attr('maxlength'); x = x.substring(0,maxlen); } jQuery(e.target).val(x); e.preventDefault(); } }); //mica 11-18-19 jQuery(this).on("drop",function(e){ var x = e.originalEvent.dataTransfer.getData('text/plain'); //mica 11-18-19 x = x.replace(/</g, ""); x = x.replace(/>/g, ""); var newval = jQuery(e.target).val() + x; if(jQuery(e.target).prop('disabled') == true || jQuery(e.target).prop('readonly') == true) { } else { // e.originalEvent.dataTransfer.setData('text/plain',x); jQuery(e.target).val(x); e.preventDefault(); } }); } }); } //20191030 donita function prevent_Event(evt) { evt.preventDefault(); } function isCheck_paste(evt, thisobj,regex) { xval = evt.clipboardData.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { // console.log(xval[i]); if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; //20191112 donita // if(jQuery("#"+evt.target.id).prop('disabled') == true) //20191121 donita - use the target tag/element if(jQuery(evt.target).prop('disabled') == true) { } else { xmaxlength = jQuery(thisobj).attr('maxlength'); xnewval = jQuery(thisobj).val() + newval; jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval.slice(0,xmaxlength)); jQuery(thisobj).focus(); } } function isCheck_drop(evt, thisobj,regex) { xval = evt.dataTransfer.getData('text'); switch (regex) { case "namekey": regex = /[- . +a-zA-Z \u00d1 \u00f1]/; break; case "alphanum": regex = /[a-zA-Z0-9]/; break; case "alphanumdash": regex = /[- +a-zA-Z0-9]/; break; case "alphanumperiod": regex = /[. +a-zA-Z0-9]/; break; case "alphanumdashwithcolumnnewline": regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; break; case "textcontent": regex = /[/';(),.a-zA-Z0-9]/; break; case "alphanumcolumnperiod": regex = /[, . +a-zA-Z0-9]/; break; case "numberkey": regex = /[0-9]/; break; case "numberkeywithperiod": regex = /[0-9]|\./; break; case "characterkey": regex = /[, . a-zA-Z]/; break; case "contactkey": regex = /[0-9]|\+|\(|\)|\-/; break; case "emailkey": // return "onblur='return isEmailKey(\"$elem_id\")' onpaste='return false'"; break; default: regex = /[a-zA-Z \u00d1 \u00f1]/; break; } var newval = ""; for (var i = 0; i < xval.length; i++) { if( !regex.test(xval[i]) ) { } else { newval += xval[i]; } } xnewval = jQuery(thisobj).val() + newval; if(jQuery(thisobj).attr('maxlength')!=undefined) { var maxlen = jQuery(thisobj).attr('maxlength'); xnewval = xnewval.substring(0,maxlen); } jQuery(thisobj).val(""); jQuery(thisobj).val(xnewval); } /** *** used of alphanumeric *** alphabet + numbers + dash(-) **/ function isAlphaNumDash(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isAlphaNumPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isTextContent(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[/';(),.a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number only **/ function isNumberKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + period(.) **/ function isNumberKeyWithPeriod(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); var regex = /[0-9]|\./; inputval=$(evt.srcElement).val() inputval=inputval+key; var period_count = (inputval.split(".").length - 1); if( !regex.test(key) || (evt.keyCode==46 && period_count >1)) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[, . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function isCharacterKey_2(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** number + minus sign **/ function isContactKey(evt) { if(evt.keyCode!=8) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[0-9]|\+|\(|\)|\-/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** validation if the inputed value is a valid email **/ function isEmailKey(id) { var x = $('#'+id).val(); var atpos = x.indexOf("@"); var dotpos = x.lastIndexOf("."); if(x.trim()=='') { } else { if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) { // alert("Not a valid e-mail address"); alertify.alert('Not a valid e-mail address.'); $('#'+id).val(''); } } } /** *** added 06262015 -jep *** auto compute age by date inputted in DOB **/ function ageCount(xid_dob,xid_age) { var date1 = new Date(); var dob = document.getElementById(xid_dob).value; var new_dob_str = dob.replace(/-/g,"/"); var date2 = new Date(new_dob_str); var pattern = /^\d{1,2}\/\d{1,2}\/\d{4}$/; //Regex to validate date format (dd/mm/yyyy) if(dob!='') { if (pattern.test(new_dob_str)) { var today = new Date(); var birthDate = date2; var age = today.getFullYear() - birthDate.getFullYear(); var m = today.getMonth() - birthDate.getMonth(); if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { age--; } //calculating age document.getElementById(xid_age).value = age; document.getElementById(xid_age).focus(); return true; } else { if(dob!='') { alertify.alert("Invalid date format. format!"); return false; } } } else { document.getElementById(xid_age).value = 0; } } function paste_syspar_regex(evt) { var textVal = jQuery(evt.target).val(); evt.preventDefault(); evt.returnValue = false; // console.log("pass2") var caretPos =event.target.selectionStart; var caretEnd = event.target.selectionEnd; var textAreaTxt = jQuery(evt.target).val(); // console.log(jQuery("#"+evt.target.id).attr('maxlength')); var text = null; if (window.clipboardData) text = window.clipboardData.getData("Text"); else if (evt && evt.clipboardData) text = evt.clipboardData.getData("Text"); var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar,'mg'); //20191106 donita var xmaxlen = jQuery(evt.target).attr('maxlength'); var newstr = evt.target.value; var trimstr = newstr; //20191107 donita // console.log(evt.target.id); console.log(jQuery(evt.target).prop('disabled')) if(jQuery(evt.target).prop('disabled') == true || jQuery(evt.target).prop('readonly') == true) { } else { if( regex.test(text) ) { alertify.confirm('The text you are trying to paste contains invalid character(s). Remove special character(s) and continue pasting ?',function() { evt.target.value = text.replace(regex, ""); // //20191106 donita newstr = evt.target.value; // //mica 11-18-19 newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); // //end trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); jQuery(evt.target).focus(); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length },function() { }) } else { evt.target.value = text; //20191106 donita newstr = evt.target.value; newstr = newstr.replace(/</g, ""); newstr = newstr.replace(/>/g, ""); trimstr = textVal.substring(0, caretPos) + newstr + textVal.substring( caretEnd ); evt.target.value = trimstr; // // console.log(evt.target,text.replace(regex, "")); evt.target.selectionStart = caretPos + trimstr.length evt.target.selectionEnd = caretPos + trimstr.length } } } function keydown_syspar_regex(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = theEvent.key var validate_spechar = jQuery('#pager_spechar').val(); validate_spechar = validate_spechar.split(""); validate_spechar = "[\\"+validate_spechar.join('\\')+"]"; var regex = new RegExp(validate_spechar); if( regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } function isAlphaNumColumnPeriod(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[. , +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } /** *** used of alphanumeric *** alphabet + numbers + dash(-) + period(.) + colon(:) + new line (/r /n) **/ function isAlphaNumDashWithColumnNewLine(evt) { if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; var regex = /[- : (\r\n|\r|\n) +a-zA-Z0-9]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/searchmodal/searchable.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20190801 |
| Request Header - size: 504 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/searchmodal/searchable.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:07:49 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 10850 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 10,850 bytes. |
(function( $ )
{ $.fn.searchable=function(options) { var that = this; var jquery_this = $(this); $.fn.searchable.destroy = function(searchable_input_selector) { jQuery(searchable_input_selector).each(function() { var searchable_input_backup = jQuery(this).closest('.searchable_container').find('.searchable_input_backup'); var input_orig_parent = jQuery(this).closest('.searchable_outer_container').parent(); var nodename=searchable_input_backup.data('nodename'); var input_orig=jQuery("<"+nodename+"/>"); $.each(searchable_input_backup.data(),function(name,value) { if(name!="nodename") { input_orig.attr(name,value); } }) input_orig_parent.html(input_orig); }) return; } $.fn.searchable.searchButton = function() { var btn = $('<button />').attr( { type: 'button', class: 'searchable_calldialog other-search', tabIndex:"-1" }); return btn; }; $.fn.searchable.modalClearButton = function() { var btn = $('<i />').attr( { class: 'fa fa-times searchable_clear_btn', title: 'Clear Field' }); return btn; }; $.fn.searchable.modalSearchButton = function() { var btn = $('<button />').attr( { value:'', class:'searchable_modalbtnfilterer save' }).text('Search'); return btn; }; $.fn.searchable.hiddenTblCols = function() { var txt = $('<input />').attr( { type:'hidden', name:'filter_txthidden' }); return txt; } $.fn.searchable.searchTxt = function() { var txt = $('<input />').attr( { type:'text', value:'', placeholder:'Search through here...', name:'filter_txt', class:'searchable_modaltxtfilterer' }); return txt; }; $.fn.searchable.searchBy = function(val,desc) { var sel = $('<select />', { name:'filter_col_name', class:'searchable_modalselfilterer' }); for (var key in val) { var option=$("<option />", { value:val[key] }).text(desc[key]); sel.append(option); } return sel; }; $.fn.searchable.createRequestorDestroyableBackup = function(requestor) { var data_nodename = requestor[0].nodeName; var elem_backup = $('<div />'); elem_backup.attr('data-nodeName',data_nodename.toLowerCase()); $.each(requestor[0].attributes, function() { if(this.specified) { elem_backup.attr('data-'+this.name,this.value); } }); elem_backup.addClass('searchable_input_backup'); return elem_backup; }; $.fn.searchable.div = function() { return $('<div />'); } $.fn.searchable.divDialog=function(title,height,width,resultContainer,filtererContainer,closeOnEscape,resizable) { title = title || ''; height = height || 500; width = width || 500; resultContainer = resultContainer || $('<div/ >'); filtererContainer = filtererContainer || $('<div/ >'); closeOnEscape = closeOnEscape || true; resizable = resizable || false; var divDialog = jQuery('<div />'); divDialog.addClass('searchable_dialog'); return divDialog.dialog({ autoOpen : false, modal : true, height: height, width:width, resizable : resizable, title : title, closeOnEscape : closeOnEscape, open:function() { jQuery(this).find('.ui-dialog-titlebar-close').hide(); resultContainer.empty(); jQuery('body').css('overflow-y','hidden'); filtererContainer.find('input').val(''); // filtererContainer.find('select').val(filtererContainer.find('select option:first').val()); jQuery(this).closest('.ui-dialog').css({ 'z-index': '2000'}); // jQuery('.ui-dialog').css({ 'z-index': '2000'}); }, close:function() { jQuery('body').css('overflow-y','scroll'); }, buttons:[ { text: "Cancel", "class": 'searchable_dialog_cancel_btn exit', click: function() { jQuery(this).dialog('close'); } } ] }); } $.fn.searchable.defaults = { // searchButtonCusClass:'', // searchButtonshrtct_keys_f: [114,115], modalselfilterer_codeshortcut:114, modalselfilterer_descshortcut:115, modalTitle:'', modalWidth:"auto", modalHeight:'auto', modalCloseOnEscape:true, modalResizable:false, ajaxPage:'../javascript/searchmodal/searchable_ajax.php', order:'asc', orderBy:'', groupBy:'', table:"", link_id:"", searchCol:'', searchByDesc:[], searchByValue:[], tableCol:'', tableColHeader:'', sqlfilter:'', data:'', passValueTo:[], passValue:[], autoOpen:true }; //public functions var opts = $.extend( {}, $.fn.searchable.defaults, options ); return this.each(function(index) { var id=index; var requestor=$(this); if(!requestor.hasClass('searchable_text')) { var createRequestorDestroyableBackup = $.fn.searchable.createRequestorDestroyableBackup(requestor); requestor.attr('placeholder','Click button to search...'); requestor.wrap('<div class=\"searchable_outer_container\"></div>'); requestor.wrap('<div class=\"searchable_container\"></div>'); requestor.addClass('searchable_text'); var searchButton = $.fn.searchable.searchButton(); var modalSearchButton = $.fn.searchable.modalSearchButton(); var selBy=$.fn.searchable.searchBy(opts.searchByValue,opts.searchByDesc); var searchTxt=$.fn.searchable.searchTxt(); var modalClearButton = $.fn.searchable.modalClearButton(); modalClearButton.insertAfter(requestor); var filtererContainer=$.fn.searchable.div(); filtererContainer.addClass('searchable_filterercontainer'); var resultContainer=$.fn.searchable.div(); resultContainer.addClass('searchable_resultcontainer'); var dialog = $.fn.searchable.divDialog(opts.modalTitle,opts.modalHeight,opts.modalWidth,resultContainer,filtererContainer,opts.modalCloseOnEscape,opts.modalResizable); filtererContainer.append(searchTxt); filtererContainer.append(selBy); filtererContainer.append(modalSearchButton); dialog.append(filtererContainer); dialog.append(resultContainer); requestor.data('target-dialog',dialog.attr('id')); createRequestorDestroyableBackup.appendTo(requestor.parents('.searchable_container')); searchButton.appendTo(requestor.parents('.searchable_container')); searchButton.html('<i class="fa fa-search" aria-hidden="true"></i>'); searchTxt.on('keypress', function (event) { if(event.which === 13) { modalSearchButton.click(); } }); searchButton.on('click',function(e) { //20190801 - randle to immediate load datas before dialog opens dialog.find(".searchable_modaltxtfilterer").val(""); dialog.find(".searchable_modalbtnfilterer").click(); dialog.dialog('open'); }); modalClearButton.on('click',function(e) { requestor.val('').change(); if(opts.passValue.length > 0) { //- remove value in passVlue fields for(var i =0;i<opts.passValue.length;i++) { var input_passValue=$(this).parents('td').find('.passValue_'+opts.passValueTo[i]).val(); $('#'+opts.passValueTo[i]).val(''); } } }); requestor.closest('.searchable_container').hover(function() { // if(requestor.val() != '' && (requestor.hasClass('disabled') == false || requestor.prop('disabled') == false) ) if(requestor.val() != '' && requestor.hasClass('disabled') == false) { $(this).find('.searchable_clear_btn').css('visibility','visible'); } },function() { if(requestor.hasClass('disabled') == false) { $(this).find('.searchable_clear_btn').css('visibility','hidden'); } }) // (this).closest('td').find('.searchable_clear_btn').show(); // }) requestor.on('keydown',function(e) { // if(opts.searchButtonshrtct_keys_f.indexOf(e.keyCode)!==-1) if(opts.modalselfilterer_codeshortcut==e.keyCode) { filtererContainer.find('.searchable_modalselfilterer').find('option[value$=cde],option[value$=code]').prop('selected',true); $(this).closest('.searchable_container').find('.searchable_calldialog').click(); } if(opts.modalselfilterer_descshortcut==e.keyCode) { filtererContainer.find('.searchable_modalselfilterer').find('option[value$=dsc],option[value$=desc]').prop('selected',true); $(this).closest('.searchable_container').find('.searchable_calldialog').click(); } }) requestor.closest('.searchable_outer_container').show(); if(opts.autoOpen==false) { requestor.closest('.searchable_outer_container').hide(); } } var target_dialog=jQuery('#'+requestor.data('target-dialog')); jQuery(target_dialog).find('.searchable_modalbtnfilterer').off('click'); jQuery(target_dialog).find('.searchable_modalbtnfilterer').click(function() { var data=target_dialog.find("*").serialize()+"&table="+opts.table+"&link_id="+opts.link_id+"&searchCol="+opts.searchCol+"&tblcol="+opts.tableCol+'&tblcolheaders='+opts.tableColHeader; data+="&sqlfilter="+opts.sqlfilter; data+="&sqlorderby="+opts.orderBy; data+="&sqlorder="+opts.order; data+="&sqlgroupBy="+opts.groupBy; data+="&"+opts.data; data+="&passValue="; var passValueData=""; for(var i =0;i<opts.passValue.length;i++) { data+=opts.passValue[i]; passValueData+="&passValueTo["+opts.passValueTo[i]+"]="+opts.passValue[i]; if((i+1)<opts.passValue.length) { data+=","; } } data+=passValueData; blockui(); $.ajax({ type: "POST", url: opts.ajaxPage, data: data, dataType: "json", success: function(xret) { jQuery.unblockUI(); target_dialog.find('.searchable_resultcontainer').html(xret.content); target_dialog.find('.searchable_resultcontainer').find('.filter_select').on('click',function() { for(var i =0;i<opts.passValue.length;i++) { var input_passValue=jQuery(this).closest('td').find('.passValue.searchable_'+opts.passValue[i]).val(); if(opts.passValueTo[i] instanceof jQuery) //if value is a jQuery Object { opts.passValueTo[i].val(input_passValue).change(); } else { jQuery('#'+opts.passValueTo[i]).val(input_passValue).change(); } } requestor.val(jQuery(this).val()).change(); target_dialog.dialog('close'); }); } }); }); }); }; }( jQuery )); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/tinymce/tinymce.min.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 16777215 |
| Request Header - size: 501 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/tinymce/tinymce.min.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 385081 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 385,081 bytes. |
// 4.4.3 (2016-09-01)
!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){var r,i,o,a,l;for(r=0;r<n.length;r++){i=e,o=n[r],a=o.split(/[.\/]/);for(var c=0;c<a.length-1;++c)i[a[c]]===t&&(i[a[c]]={}),i=i[a[c]];i[a[a.length-1]]=s[o]}if(e.AMDLC_TESTS){l=e.privateModules||{};for(o in s)l[o]=s[o];for(r=0;r<n.length;r++)delete l[n[r]];e.privateModules=l}}var s={},l="tinymce/geom/Rect",c="tinymce/util/Promise",u="tinymce/util/Delay",d="tinymce/Env",f="tinymce/dom/EventUtils",h="tinymce/dom/Sizzle",p="tinymce/util/Arr",m="tinymce/util/Tools",g="tinymce/dom/DomQuery",v="tinymce/html/Styles",y="tinymce/dom/TreeWalker",b="tinymce/dom/Range",C="tinymce/html/Entities",x="tinymce/dom/StyleSheetLoader",w="tinymce/dom/DOMUtils",N="tinymce/dom/ScriptLoader",E="tinymce/AddOnManager",_="tinymce/dom/NodeType",S="tinymce/text/Zwsp",k="tinymce/caret/CaretContainer",T="tinymce/dom/RangeUtils",R="tinymce/NodeChange",A="tinymce/html/Node",B="tinymce/html/Schema",D="tinymce/html/SaxParser",L="tinymce/html/DomParser",M="tinymce/html/Writer",P="tinymce/html/Serializer",O="tinymce/dom/Serializer",H="tinymce/dom/TridentSelection",I="tinymce/util/VK",F="tinymce/dom/ControlSelection",z="tinymce/util/Fun",U="tinymce/caret/CaretCandidate",W="tinymce/geom/ClientRect",V="tinymce/text/ExtendingChar",$="tinymce/caret/CaretPosition",q="tinymce/caret/CaretBookmark",j="tinymce/dom/BookmarkManager",Y="tinymce/dom/Selection",X="tinymce/dom/ElementUtils",K="tinymce/fmt/Preview",G="tinymce/fmt/Hooks",J="tinymce/Formatter",Q="tinymce/UndoManager",Z="tinymce/EnterKey",ee="tinymce/ForceBlocks",te="tinymce/caret/CaretUtils",ne="tinymce/caret/CaretWalker",re="tinymce/InsertList",ie="tinymce/InsertContent",oe="tinymce/EditorCommands",ae="tinymce/util/URI",se="tinymce/util/Class",le="tinymce/util/EventDispatcher",ce="tinymce/data/Binding",ue="tinymce/util/Observable",de="tinymce/data/ObservableObject",fe="tinymce/ui/Selector",he="tinymce/ui/Collection",pe="tinymce/ui/DomUtils",me="tinymce/ui/BoxUtils",ge="tinymce/ui/ClassList",ve="tinymce/ui/ReflowQueue",ye="tinymce/ui/Control",be="tinymce/ui/Factory",Ce="tinymce/ui/KeyboardNavigation",xe="tinymce/ui/Container",we="tinymce/ui/DragHelper",Ne="tinymce/ui/Scrollable",Ee="tinymce/ui/Panel",_e="tinymce/ui/Movable",Se="tinymce/ui/Resizable",ke="tinymce/ui/FloatPanel",Te="tinymce/ui/Window",Re="tinymce/ui/MessageBox",Ae="tinymce/WindowManager",Be="tinymce/ui/Tooltip",De="tinymce/ui/Widget",Le="tinymce/ui/Progress",Me="tinymce/ui/Notification",Pe="tinymce/NotificationManager",Oe="tinymce/dom/NodePath",He="tinymce/util/Quirks",Ie="tinymce/EditorObservable",Fe="tinymce/Mode",ze="tinymce/Shortcuts",Ue="tinymce/file/Uploader",We="tinymce/file/Conversions",Ve="tinymce/file/ImageScanner",$e="tinymce/file/BlobCache",qe="tinymce/file/UploadStatus",je="tinymce/EditorUpload",Ye="tinymce/caret/FakeCaret",Xe="tinymce/dom/Dimensions",Ke="tinymce/caret/LineWalker",Ge="tinymce/caret/LineUtils",Je="tinymce/dom/MousePosition",Qe="tinymce/DragDropOverrides",Ze="tinymce/SelectionOverrides",et="tinymce/util/Uuid",tt="tinymce/Editor",nt="tinymce/util/I18n",rt="tinymce/FocusManager",it="tinymce/EditorManager",ot="tinymce/LegacyInput",at="tinymce/util/XHR",st="tinymce/util/JSON",lt="tinymce/util/JSONRequest",ct="tinymce/util/JSONP",ut="tinymce/util/LocalStorage",dt="tinymce/Compat",ft="tinymce/ui/Layout",ht="tinymce/ui/AbsoluteLayout",pt="tinymce/ui/Button",mt="tinymce/ui/ButtonGroup",gt="tinymce/ui/Checkbox",vt="tinymce/ui/ComboBox",yt="tinymce/ui/ColorBox",bt="tinymce/ui/PanelButton",Ct="tinymce/ui/ColorButton",xt="tinymce/util/Color",wt="tinymce/ui/ColorPicker",Nt="tinymce/ui/Path",Et="tinymce/ui/ElementPath",_t="tinymce/ui/FormItem",St="tinymce/ui/Form",kt="tinymce/ui/FieldSet",Tt="tinymce/ui/FilePicker",Rt="tinymce/ui/FitLayout",At="tinymce/ui/FlexLayout",Bt="tinymce/ui/FlowLayout",Dt="tinymce/ui/FormatControls",Lt="tinymce/ui/GridLayout",Mt="tinymce/ui/Iframe",Pt="tinymce/ui/InfoBox",Ot="tinymce/ui/Label",Ht="tinymce/ui/Toolbar",It="tinymce/ui/MenuBar",Ft="tinymce/ui/MenuButton",zt="tinymce/ui/MenuItem",Ut="tinymce/ui/Throbber",Wt="tinymce/ui/Menu",Vt="tinymce/ui/ListBox",$t="tinymce/ui/Radio",qt="tinymce/ui/ResizeHandle",jt="tinymce/ui/SelectBox",Yt="tinymce/ui/Slider",Xt="tinymce/ui/Spacer",Kt="tinymce/ui/SplitButton",Gt="tinymce/ui/StackLayout",Jt="tinymce/ui/TabPanel",Qt="tinymce/ui/TextBox",Zt="tinymce/Register";r(l,[],function(){function e(e,t,n){var r,i,a,s,l,u;return r=t.x,i=t.y,a=e.w,s=e.h,l=t.w,u=t.h,n=(n||"").split(""),"b"===n[0]&&(i+=u),"r"===n[1]&&(r+=l),"c"===n[0]&&(i+=c(u/2)),"c"===n[1]&&(r+=c(l/2)),"b"===n[3]&&(i-=s),"r"===n[4]&&(r-=a),"c"===n[3]&&(i-=c(s/2)),"c"===n[4]&&(r-=c(a/2)),o(r,i,a,s)}function t(t,n,r,i){var o,a;for(a=0;a<i.length;a++)if(o=e(t,n,i[a]),o.x>=r.x&&o.x+o.w<=r.w+r.x&&o.y>=r.y&&o.y+o.h<=r.h+r.y)return i[a];return null}function n(e,t,n){return o(e.x-t,e.y-n,e.w+2*t,e.h+2*n)}function r(e,t){var n,r,i,a;return n=l(e.x,t.x),r=l(e.y,t.y),i=s(e.x+e.w,t.x+t.w),a=s(e.y+e.h,t.y+t.h),0>i-n||0>a-r?null:o(n,r,i-n,a-r)}function i(e,t,n){var r,i,a,s,c,u,d,f,h,p;return c=e.x,u=e.y,d=e.x+e.w,f=e.y+e.h,h=t.x+t.w,p=t.y+t.h,r=l(0,t.x-c),i=l(0,t.y-u),a=l(0,d-h),s=l(0,f-p),c+=r,u+=i,n&&(d+=r,f+=i,c-=a,u-=s),d-=a,f-=s,o(c,u,d-c,f-u)}function o(e,t,n,r){return{x:e,y:t,w:n,h:r}}function a(e){return o(e.left,e.top,e.width,e.height)}var s=Math.min,l=Math.max,c=Math.round;return{inflate:n,relativePosition:e,findBestRelativePosition:t,intersect:r,clamp:i,create:o,fromClientRect:a}}),r(c,[],function(){function e(e,t){return function(){e.apply(t,arguments)}}function t(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(t,e(r,this),e(i,this))}function n(e){var t=this;return null===this._state?void this._deferreds.push(e):void l(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=n(t._value)}catch(i){return void e.reject(i)}e.resolve(r)})}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void s(e(n,t),e(r,this),e(i,this))}this._state=!0,this._value=t,o.call(this)}catch(a){i.call(this,a)}}function i(e){this._state=!1,this._value=e,o.call(this)}function o(){for(var e=0,t=this._deferreds.length;t>e;e++)n.call(this,this._deferreds[e]);this._deferreds=null}function a(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function s(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(i){if(r)return;r=!0,n(i)}}if(window.Promise)return window.Promise;var l=t.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)},c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return t.prototype["catch"]=function(e){return this.then(null,e)},t.prototype.then=function(e,r){var i=this;return new t(function(t,o){n.call(i,new a(e,r,t,o))})},t.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&c(arguments[0])?arguments[0]:arguments);return new t(function(t,n){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},n)}e[o]=a,0===--i&&t(e)}catch(l){n(l)}}if(0===e.length)return t([]);for(var i=e.length,o=0;o<e.length;o++)r(o,e[o])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(t){t(e)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.race=function(e){return new t(function(t,n){for(var r=0,i=e.length;i>r;r++)e[r].then(t,n)})},t}),r(u,[c],function(e){function t(e,t){function n(e){window.setTimeout(e,0)}var r,i=window.requestAnimationFrame,o=["ms","moz","webkit"];for(r=0;r<o.length&&!i;r++)i=window[o[r]+"RequestAnimationFrame"];i||(i=n),i(e,t)}function n(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)}function r(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)}function i(e){return clearTimeout(e)}function o(e){return clearInterval(e)}var a;return{requestAnimationFrame:function(n,r){return a?void a.then(n):void(a=new e(function(e){r||(r=document.body),t(e,r)}).then(n))},setTimeout:n,setInterval:r,setEditorTimeout:function(e,t,r){return n(function(){e.removed||t()},r)},setEditorInterval:function(e,t,n){var i;return i=r(function(){e.removed?clearInterval(i):t()},n)},throttle:function(e,t){var r,i;return i=function(){var i=arguments;clearTimeout(r),r=n(function(){e.apply(this,i)},t)},i.stop=function(){clearTimeout(r)},i},clearInterval:o,clearTimeout:i}}),r(d,[],function(){function e(e){return"matchMedia"in window?matchMedia(e).matches:!1}var t=navigator,n=t.userAgent,r,i,o,a,s,l,c,u,d,f,h,p,m;r=window.opera&&window.opera.buildNumber,d=/Android/.test(n),i=/WebKit/.test(n),o=!i&&!r&&/MSIE/gi.test(n)&&/Explorer/gi.test(t.appName),o=o&&/MSIE (\w+)\./.exec(n)[1],a=-1==n.indexOf("Trident/")||-1==n.indexOf("rv:")&&-1==t.appName.indexOf("Netscape")?!1:11,s=-1==n.indexOf("Edge/")||o||a?!1:12,o=o||a||s,l=!i&&!a&&/Gecko/.test(n),c=-1!=n.indexOf("Mac"),u=/(iPad|iPhone)/.test(n),f="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,h=e("only screen and (max-device-width: 480px)")&&(d||u),p=e("only screen and (min-width: 800px)")&&(d||u),m=-1!=n.indexOf("Windows Phone"),s&&(i=!1);var g=!u||f||n.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:r,webkit:i,ie:o,gecko:l,mac:c,iOS:u,android:d,contentEditable:g,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=o,range:window.getSelection&&"Range"in window,documentMode:o&&!s?document.documentMode||7:10,fileApi:f,ceFalse:o===!1||o>8,canHaveCSP:o===!1||o>11,desktop:!h&&!p,windowsPhone:m}}),r(f,[u,d],function(e,t){function n(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function r(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function i(e,t){var n,r=t;return n=e.path,n&&n.length>0&&(r=n[0]),e.deepPath&&(n=e.deepPath(),n&&n.length>0&&(r=n[0])),r}function o(e,n){function r(){return!1}function o(){return!0}var a,s=n||{},l;for(a in e)u[a]||(s[a]=e[a]);if(s.target||(s.target=s.srcElement||document),t.experimentalShadowDom&&(s.target=i(e,s.target)),e&&c.test(e.type)&&e.pageX===l&&e.clientX!==l){var d=s.target.ownerDocument||document,f=d.documentElement,h=d.body;s.pageX=e.clientX+(f&&f.scrollLeft||h&&h.scrollLeft||0)-(f&&f.clientLeft||h&&h.clientLeft||0),s.pageY=e.clientY+(f&&f.scrollTop||h&&h.scrollTop||0)-(f&&f.clientTop||h&&h.clientTop||0)}return s.preventDefault=function(){s.isDefaultPrevented=o,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},s.stopPropagation=function(){s.isPropagationStopped=o,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},s.stopImmediatePropagation=function(){s.isImmediatePropagationStopped=o,s.stopPropagation()},s.isDefaultPrevented||(s.isDefaultPrevented=r,s.isPropagationStopped=r,s.isImmediatePropagationStopped=r),"undefined"==typeof s.metaKey&&(s.metaKey=!1),s}function a(t,i,o){function a(){o.domLoaded||(o.domLoaded=!0,i(u))}function s(){("complete"===c.readyState||"interactive"===c.readyState&&c.body)&&(r(c,"readystatechange",s),a())}function l(){try{c.documentElement.doScroll("left")}catch(t){return void e.setTimeout(l)}a()}var c=t.document,u={type:"ready"};return o.domLoaded?void i(u):(c.addEventListener?"complete"===c.readyState?a():n(t,"DOMContentLoaded",a):(n(c,"readystatechange",s),c.documentElement.doScroll&&t.self===t.top&&l()),void n(t,"load",a))}function s(){function e(e,t){var n,r,o,a,s=i[t];if(n=s&&s[e.type])for(r=0,o=n.length;o>r;r++)if(a=n[r],a&&a.func.call(a.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var t=this,i={},s,c,u,d,f;c=l+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},s=1,t.domLoaded=!1,t.events=i,t.bind=function(r,l,h,p){function m(t){e(o(t||N.event),g)}var g,v,y,b,C,x,w,N=window;if(r&&3!==r.nodeType&&8!==r.nodeType){for(r[c]?g=r[c]:(g=s++,r[c]=g,i[g]={}),p=p||r,l=l.split(" "),y=l.length;y--;)b=l[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),t.domLoaded&&"ready"===b&&"complete"==r.readyState?h.call(p,o({type:b})):(d||(C=f[b],C&&(x=function(t){var n,r;if(n=t.currentTarget,r=t.relatedTarget,r&&n.contains)r=n.contains(r);else for(;r&&r!==n;)r=r.parentNode;r||(t=o(t||N.event),t.type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=n,e(t,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(t){t=o(t||N.event),t.type="focus"===t.type?"focusin":"focusout",e(t,g)}),v=i[g][b],v?"ready"===b&&t.domLoaded?h({type:b}):v.push({func:h,scope:p}):(i[g][b]=v=[{func:h,scope:p}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?a(r,x,t):n(r,C||b,x,w)));return r=v=0,h}},t.unbind=function(e,n,o){var a,s,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return t;if(a=e[c]){if(f=i[a],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],s=f[d]){if(o)for(u=s.length;u--;)if(s[u].func===o){var h=s.nativeHandler,p=s.fakeName,m=s.capture;s=s.slice(0,u).concat(s.slice(u+1)),s.nativeHandler=h,s.fakeName=p,s.capture=m,f[d]=s}o&&0!==s.length||(delete f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture))}}else{for(d in f)s=f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture);f={}}for(d in f)return t;delete i[a];try{delete e[c]}catch(g){e[c]=null}}return t},t.fire=function(n,r,i){var a;if(!n||3===n.nodeType||8===n.nodeType)return t;i=o(null,i),i.type=r,i.target=n;do a=n[c],a&&e(i,a),n=n.parentNode||n.ownerDocument||n.defaultView||n.parentWindow;while(n&&!i.isPropagationStopped());return t},t.clean=function(e){var n,r,i=t.unbind;if(!e||3===e.nodeType||8===e.nodeType)return t;if(e[c]&&i(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(i(e),r=e.getElementsByTagName("*"),n=r.length;n--;)e=r[n],e[c]&&i(e);return t},t.destroy=function(){i={}},t.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var l="mce-data-",c=/^(?:mouse|contextmenu)|click/,u={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1};return s.Event=new s,s.Event.bind(window,"ready",function(){}),s}),r(h,[],function(){function e(e,t,n,r){var i,o,a,s,l,c,d,h,p,m;if((t?t.ownerDocument||t:z)!==D&&B(t),t=t||D,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(M&&!r){if(i=ve.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&I(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&x.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(x.qsa&&(!P||!P.test(e))){if(h=d=F,p=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=_(e),(d=t.getAttribute("id"))?h=d.replace(be,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=c.length;l--;)c[l]=h+f(c[l]);p=ye.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return Z.apply(n,p.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return k(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>w.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[F]=!0,e}function i(e){var t=D.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||X)-(~e.sourceIndex||X);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&typeof e.getElementsByTagName!==Y&&e}function d(){}function f(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[U,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[F]||(t[F]={}),(s=l[r])&&s[0]===U&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),c&&t.push(s)));return a}function v(e,t,n,i,o,a){return i&&!i[F]&&(i=v(i)),o&&!o[F]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,f=[],h=[],p=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,f,e,s,l),b=n?o||(r?e:p||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[h[u]]=!(y[h[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?te.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(p,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return te.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==T)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=w.relative[e[s].type])u=[h(p(u),n)];else{if(n=w.filter[e[s].type].apply(null,e[s].matches),n[F]){for(r=++s;i>r&&!w.relative[e[r].type];r++);return v(s>1&&p(u),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&f(e))}u.push(n)}return p(u)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,s,l,c){var u,d,f,h=0,p="0",m=r&&[],v=[],y=T,b=r||o&&w.find.TAG("*",c),C=U+=null==y?1:Math.random()||.1,x=b.length;for(c&&(T=a!==D&&a);p!==x&&null!=(u=b[p]);p++){if(o&&u){for(d=0;f=t[d++];)if(f(u,a,s)){l.push(u);break}c&&(U=C)}i&&((u=!f&&u)&&h--,r&&m.push(u))}if(h+=p,i&&p!==h){for(d=0;f=n[d++];)f(m,v,a,s);if(r){if(h>0)for(;p--;)m[p]||v[p]||(v[p]=J.call(l));v=g(v)}Z.apply(l,v),c&&!r&&v.length>0&&h+n.length>1&&e.uniqueSort(l)}return c&&(U=C,T=y),m};return i?r(a):a}var C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F="sizzle"+-new Date,z=window.document,U=0,W=0,V=n(),$=n(),q=n(),j=function(e,t){return e===t&&(A=!0),0},Y=typeof t,X=1<<31,K={}.hasOwnProperty,G=[],J=G.pop,Q=G.push,Z=G.push,ee=G.slice,te=G.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},ne="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",re="[\\x20\\t\\r\\n\\f]",ie="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",oe="\\["+re+"*("+ie+")(?:"+re+"*([*^$|!~]?=)"+re+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+re+"*\\]",ae=":("+ie+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp("^"+re+"+|((?:^|[^\\\\])(?:\\\\.)*)"+re+"+$","g"),le=new RegExp("^"+re+"*,"+re+"*"),ce=new RegExp("^"+re+"*([>+~]|"+re+")"+re+"*"),ue=new RegExp("="+re+"*([^\\]'\"]*?)"+re+"*\\]","g"),de=new RegExp(ae),fe=new RegExp("^"+ie+"$"),he={ID:new RegExp("^#("+ie+")"),CLASS:new RegExp("^\\.("+ie+")"),TAG:new RegExp("^("+ie+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+re+"*(even|odd|(([+-]|)(\\d*)n|)"+re+"*(?:([+-]|)"+re+"*(\\d+)|))"+re+"*\\)|)","i"),bool:new RegExp("^(?:"+ne+")$","i"),needsContext:new RegExp("^"+re+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+re+"*((?:-\\d)?\\d*)"+re+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ge=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,be=/'|\\/g,Ce=new RegExp("\\\\([\\da-f]{1,6}"+re+"?|("+re+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Z.apply(G=ee.call(z.childNodes),z.childNodes),G[z.childNodes.length].nodeType}catch(we){Z={apply:G.length?function(e,t){Q.apply(e,ee.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}x=e.support={},E=e.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},B=e.setDocument=function(e){function t(e){try{return e.top}catch(t){}return null}var n,r=e?e.ownerDocument||e:z,o=r.defaultView;return r!==D&&9===r.nodeType&&r.documentElement?(D=r,L=r.documentElement,M=!E(r),o&&o!==t(o)&&(o.addEventListener?o.addEventListener("unload",function(){B()},!1):o.attachEvent&&o.attachEvent("onunload",function(){B()})),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=ge.test(r.getElementsByClassName),x.getById=i(function(e){return L.appendChild(e).id=F,!r.getElementsByName||!r.getElementsByName(F).length}),x.getById?(w.find.ID=function(e,t){if(typeof t.getElementById!==Y&&M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){return e.getAttribute("id")===t}}):(delete w.find.ID,w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),w.find.TAG=x.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Y?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=x.getElementsByClassName&&function(e,t){return M?t.getElementsByClassName(e):void 0},O=[],P=[],(x.qsa=ge.test(r.querySelectorAll))&&(i(function(e){e.innerHTML="<select msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+re+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||P.push("\\["+re+"*(?:value|"+ne+")"),e.querySelectorAll(":checked").length||P.push(":checked")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&P.push("name"+re+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||P.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),P.push(",.*:")})),(x.matchesSelector=ge.test(H=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){x.disconnectedMatch=H.call(e,"div"),H.call(e,"[s!='']:x"),O.push("!=",ae)}),P=P.length&&new RegExp(P.join("|")),O=O.length&&new RegExp(O.join("|")),n=ge.test(L.compareDocumentPosition),I=n||ge.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},j=n?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===z&&I(z,e)?-1:t===r||t.ownerDocument===z&&I(z,t)?1:R?te.call(R,e)-te.call(R,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:R?te.call(R,e)-te.call(R,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===z?-1:c[i]===z?1:0},r):D},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==D&&B(t),n=n.replace(ue,"='$1']"),x.matchesSelector&&M&&(!O||!O.test(n))&&(!P||!P.test(n)))try{var r=H.call(t,n);if(r||x.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,D,null,[t]).length>0},e.contains=function(e,t){return(e.ownerDocument||e)!==D&&B(e),I(e,t)},e.attr=function(e,n){(e.ownerDocument||e)!==D&&B(e);var r=w.attrHandle[n.toLowerCase()],i=r&&K.call(w.attrHandle,n.toLowerCase())?r(e,n,!M):t;return i!==t?i:x.attributes||!M?e.getAttribute(n):(i=e.getAttributeNode(n))&&i.specified?i.value:null},e.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},e.uniqueSort=function(e){var t,n=[],r=0,i=0;if(A=!x.detectDuplicates,R=!x.sortStable&&e.slice(0),e.sort(j),A){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return R=null,e},N=e.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=N(t);return n},w=e.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ce,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(Ce,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=_(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ce,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+re+")"+e+"("+re+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,h,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(u=g[F]||(g[F]={}),c=u[e]||[],h=c[0]===U&&c[1],f=c[0]===U&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(f=h=0)||p.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[U,h,f];break}}else if(y&&(c=(t[F]||(t[F]={}))[e])&&c[0]===U)f=c[1];else for(;(d=++h&&d&&d[m]||(f=h=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[F]||(d[F]={}))[e]=[U,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(t,n){var i,o=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[F]?o(n):o.length>1?(i=[t,t,"",n],w.setFilters.hasOwnProperty(t.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=te.call(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=S(e.replace(se,"$1"));return i[F]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(e){return e=e.replace(Ce,xe),function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(t){return fe.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(Ce,xe).toLowerCase(),function(e){var n;do if(n=M?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}},w.pseudos.nth=w.pseudos.eq;for(C in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})w.pseudos[C]=s(C);for(C in{submit:!0,reset:!0})w.pseudos[C]=l(C);return d.prototype=w.filters=w.pseudos,w.setFilters=new d,_=e.tokenize=function(t,n){var r,i,o,a,s,l,c,u=$[t+" "];if(u)return n?0:u.slice(0);for(s=t,l=[],c=w.preFilter;s;){r&&!(i=le.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=ce.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(se," ")}),s=s.slice(r.length));for(a in w.filter)!(i=he[a].exec(s))||c[a]&&!(i=c[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?e.error(t):$(t,l).slice(0)},S=e.compile=function(e,t){var n,r=[],i=[],o=q[e+" "];if(!o){for(t||(t=_(e)),n=t.length;n--;)o=y(t[n]),o[F]?r.push(o):i.push(o);o=q(e,b(i,r)),o.selector=e}return o},k=e.select=function(e,t,n,r){var i,o,a,s,l,c="function"==typeof e&&e,d=!r&&_(e=c.selector||e);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&x.getById&&9===t.nodeType&&M&&w.relative[o[1].type]){if(t=(w.find.ID(a.matches[0].replace(Ce,xe),t)||[])[0], !t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=he.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((l=w.find[s])&&(r=l(a.matches[0].replace(Ce,xe),ye.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&f(o),!e)return Z.apply(n,r),n;break}}return(c||S(e,d))(r,t,!M,n,ye.test(e)&&u(t.parentNode)||t),n},x.sortStable=F.split("").sort(j).join("")===F,x.detectDuplicates=!!A,B(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(ne,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),e}),r(p,[],function(){function e(e){var t=e,n,r;if(!u(e))for(t=[],n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function n(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function r(e,t){var r=[];return n(e,function(n,i){r.push(t(n,i,e))}),r}function i(e,t){var r=[];return n(e,function(n,i){t&&!t(n,i,e)||r.push(n)}),r}function o(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function a(e,t,n,r){var i=0;for(arguments.length<3&&(n=e[0]);i<e.length;i++)n=t.call(r,n,e[i],i);return n}function s(e,t,n){var r,i;for(r=0,i=e.length;i>r;r++)if(t.call(n,e[r],r,e))return r;return-1}function l(e,n,r){var i=s(e,n,r);return-1!==i?e[i]:t}function c(e){return e[e.length-1]}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{isArray:u,toArray:e,each:n,map:r,filter:i,indexOf:o,reduce:a,findIndex:s,find:l,last:c}}),r(m,[d,p],function(e,n){function r(e){return null===e||e===t?"":(""+e).replace(h,"")}function i(e,r){return r?"array"==r&&n.isArray(e)?!0:typeof e==r:e!==t}function o(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function a(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],c?o[a]=function(){return i[s].apply(this,arguments)}:o[a]=function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function s(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function l(e,t,r,i){i=i||this,e&&(r&&(e=e[r]),n.each(e,function(e,n){return t.call(i,e,n,r)===!1?!1:void l(e,t,r,i)}))}function c(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)r=e[n],t[r]||(t[r]={}),t=t[r];return t}function u(e,t){var n,r;for(t=t||window,e=e.split("."),n=0,r=e.length;r>n&&(t=t[e[n]],t);n++);return t}function d(e,t){return!e||i(e,"array")?e:n.map(e.split(t||","),r)}function f(t){var n=e.cacheSuffix;return n&&(t+=(-1===t.indexOf("?")?"?":"&")+n),t}var h=/^\s*|\s*$/g;return{trim:r,isArray:n.isArray,is:i,toArray:n.toArray,makeMap:o,each:n.each,map:n.map,grep:n.filter,inArray:n.indexOf,extend:s,create:a,walk:l,createNS:c,resolve:u,explode:d,_addCacheSuffix:f}}),r(g,[f,h,m,d],function(e,n,r,i){function o(e){return"undefined"!=typeof e}function a(e){return"string"==typeof e}function s(e){return e&&e==e.window}function l(e,t){var n,r,i;for(t=t||w,i=t.createElement("div"),n=t.createDocumentFragment(),i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return n}function c(e,t,n,r){var i;if(a(t))t=l(t,v(e[0]));else if(t.length&&!t.nodeType){if(t=f.makeArray(t),r)for(i=t.length-1;i>=0;i--)c(e,t[i],n,r);else for(i=0;i<t.length;i++)c(e,t[i],n,r);return e}if(t.nodeType)for(i=e.length;i--;)n.call(e[i],t);return e}function u(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")}function d(e,t,n){var r,i;return t=f(t)[0],e.each(function(){var e=this;n&&r==e.parentNode?i.appendChild(e):(r=e.parentNode,i=t.cloneNode(!1),e.parentNode.insertBefore(i,e),i.appendChild(e))}),e}function f(e,t){return new f.fn.init(e,t)}function h(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1}function p(e){return null===e||e===k?"":(""+e).replace(P,"")}function m(e,t){var n,r,i,o,a;if(e)if(n=e.length,n===o){for(r in e)if(e.hasOwnProperty(r)&&(a=e[r],t.call(a,r,a)===!1))break}else for(i=0;n>i&&(a=e[i],t.call(a,i,a)!==!1);i++);return e}function g(e,t){var n=[];return m(e,function(e,r){t(r,e)&&n.push(r)}),n}function v(e){return e?9==e.nodeType?e:e.ownerDocument:w}function y(e,n,r){var i=[],o=e[n];for("string"!=typeof r&&r instanceof f&&(r=r[0]);o&&9!==o.nodeType;){if(r!==t){if(o===r)break;if("string"==typeof r&&f(o).is(r))break}1===o.nodeType&&i.push(o),o=o[n]}return i}function b(e,n,r,i){var o=[];for(i instanceof f&&(i=i[0]);e;e=e[n])if(!r||e.nodeType===r){if(i!==t){if(e===i)break;if("string"==typeof i&&f(e).is(i))break}o.push(e)}return o}function C(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType==n)return e;return null}function x(e,t,n){m(n,function(n,r){e[n]=e[n]||{},e[n][t]=r})}var w=document,N=Array.prototype.push,E=Array.prototype.slice,_=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,S=e.Event,k,T=r.makeMap("children,contents,next,prev"),R=r.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),A=r.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),B={"for":"htmlFor","class":"className",readonly:"readOnly"},D={"float":"cssFloat"},L={},M={},P=/^\s*|\s*$/g;return f.fn=f.prototype={constructor:f,selector:"",context:null,length:0,init:function(e,t){var n=this,r,i;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(t&&t.nodeType)n.context=t;else{if(t)return f(e).attr(t);n.context=t=document}if(a(e)){if(n.selector=e,r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:_.exec(e),!r)return f(t).find(e);if(r[1])for(i=l(e,v(t)).firstChild;i;)N.call(n,i),i=i.nextSibling;else{if(i=v(t).getElementById(r[2]),!i)return n;if(i.id!==r[2])return n.find(e);n.length=1,n[0]=i}}else this.add(e,!1);return n},toArray:function(){return r.toArray(this)},add:function(e,t){var n=this,r,i;if(a(e))return n.add(f(e));if(t!==!1)for(r=f.unique(n.toArray().concat(f.makeArray(e))),n.length=r.length,i=0;i<r.length;i++)n[i]=r[i];else N.apply(n,f.makeArray(e));return n},attr:function(e,t){var n=this,r;if("object"==typeof e)m(e,function(e,t){n.attr(e,t)});else{if(!o(t)){if(n[0]&&1===n[0].nodeType){if(r=L[e],r&&r.get)return r.get(n[0],e);if(A[e])return n.prop(e)?e:k;t=n[0].getAttribute(e,2),null===t&&(t=k)}return t}this.each(function(){var n;if(1===this.nodeType){if(n=L[e],n&&n.set)return void n.set(this,t);null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2)}})}return n},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if(e=B[e]||e,"object"==typeof e)m(e,function(e,t){n.prop(e,t)});else{if(!o(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1==this.nodeType&&(this[e]=t)})}return n},css:function(e,t){function n(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})}function r(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})}var i=this,a,s;if("object"==typeof e)m(e,function(e,t){i.css(e,t)});else if(o(t))e=n(e),"number"!=typeof t||R[e]||(t+="px"),i.each(function(){var n=this.style;if(s=M[e],s&&s.set)return void s.set(this,t);try{this.style[D[e]||e]=t}catch(i){}null!==t&&""!==t||(n.removeProperty?n.removeProperty(r(e)):n.removeAttribute(e))});else{if(a=i[0],s=M[e],s&&s.get)return s.get(a);if(a.ownerDocument.defaultView)try{return a.ownerDocument.defaultView.getComputedStyle(a,null).getPropertyValue(r(e))}catch(l){return k}else if(a.currentStyle)return a.currentStyle[n(e)]}return i},remove:function(){for(var e=this,t,n=this.length;n--;)t=e[n],S.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var e=this,t,n=this.length;n--;)for(t=e[n];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(e){var t=this,n;if(o(e)){n=t.length;try{for(;n--;)t[n].innerHTML=e}catch(r){f(t[n]).empty().append(e)}return t}return t[0]?t[0].innerHTML:""},text:function(e){var t=this,n;if(o(e)){for(n=t.length;n--;)"innerText"in t[n]?t[n].innerText=e:t[0].textContent=e;return t}return t[0]?t[0].innerText||t[0].textContent:""},append:function(){return c(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return c(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){var e=this;return e[0]&&e[0].parentNode?c(e,arguments,function(e){this.parentNode.insertBefore(e,this)}):e},after:function(){var e=this;return e[0]&&e[0].parentNode?c(e,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):e},appendTo:function(e){return f(e).append(this),this},prependTo:function(e){return f(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return d(this,e)},wrapAll:function(e){return d(this,e,!0)},wrapInner:function(e){return this.each(function(){f(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){f(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),f(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return"string"!=typeof e?n:(-1!==e.indexOf(" ")?m(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(n,r){var i,o;o=u(r,e),o!==t&&(i=r.className,o?r.className=p((" "+i+" ").replace(" "+e+" "," ")):r.className+=i?" "+e:e)}),n)},hasClass:function(e){return u(this[0],e)},each:function(e){return m(this,e)},on:function(e,t){return this.each(function(){S.bind(this,e,t)})},off:function(e,t){return this.each(function(){S.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?S.fire(this,e.type,e):S.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new f(E.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;n>t;t++)f.find(e,this[t],r);return f(r)},filter:function(e){return f("function"==typeof e?g(this.toArray(),function(t,n){return e(n,t)}):f.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof f&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&f(r).is(e)){t.push(r);break}if(r==e){t.push(r);break}r=r.parentNode}}),f(t)},offset:function(e){var t,n,r,i=0,o=0,a;return e?this.css(e):(t=this[0],t&&(n=t.ownerDocument,r=n.documentElement,t.getBoundingClientRect&&(a=t.getBoundingClientRect(),i=a.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,o=a.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:o})},push:N,sort:[].sort,splice:[].splice},r.extend(f,{extend:r.extend,makeArray:function(e){return s(e)||e.nodeType?[e]:r.toArray(e)},inArray:h,isArray:r.isArray,each:m,trim:p,grep:g,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,contains:n.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!=t[r].nodeType&&t.splice(r,1);return t=1===t.length?f.find.matchesSelector(t[0],e)?[t[0]]:[]:f.find.matches(e,t)}}),m({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return y(e,"parentNode")},next:function(e){return C(e,"nextSibling",1)},prev:function(e){return C(e,"previousSibling",1)},children:function(e){return b(e.firstChild,"nextSibling",1)},contents:function(e){return r.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){f.fn[e]=function(n){var r=this,i=[];return r.each(function(){var e=t.call(i,this,n,i);e&&(f.isArray(e)?i.push.apply(i,e):i.push(e))}),this.length>1&&(T[e]||(i=f.unique(i)),0===e.indexOf("parents")&&(i=i.reverse())),i=f(i),n?i.filter(n):i}}),m({parentsUntil:function(e,t){return y(e,"parentNode",t)},nextUntil:function(e,t){return b(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return b(e,"previousSibling",1,t).slice(1)}},function(e,t){f.fn[e]=function(n,r){var i=this,o=[];return i.each(function(){var e=t.call(o,this,n,o);e&&(f.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=f.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse())),o=f(o),r?o.filter(r):o}}),f.fn.is=function(e){return!!e&&this.filter(e).length>0},f.fn.init.prototype=f.fn,f.overrideDefaults=function(e){function t(r,i){return n=n||e(),0===arguments.length&&(r=n.element),i||(i=n.context),new t.fn.init(r,i)}var n;return f.extend(t,this),t},i.ie&&i.ie<8&&(x(L,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?k:t},size:function(e){var t=e.size;return 20===t?k:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?k:t}}),x(L,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),i.ie&&i.ie<9&&(D["float"]="styleFloat",x(M,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),f.attrHooks=L,f.cssHooks=M,f}),r(v,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d,f,h="\ufeff";for(e=e||{},t&&(d=t.getValidStyles(),f=t.getInvalidStyles()),u=("\\\" \\' \\; \\: ; : "+h).split(" "),l=0;l<u.length;l++)c[u[l]]=h+l,c[h+l]=u[l];return{toHex:function(e){return e.replace(r,n)},parse:function(t){function s(e,t,n){var r,i,o,a;if(r=m[e+"-top"+t],r&&(i=m[e+"-right"+t],i&&(o=m[e+"-bottom"+t],o&&(a=m[e+"-left"+t])))){var s=[r,i,o,a];for(l=s.length-1;l--&&s[l]===s[l+1];);l>-1&&n||(m[e+t]=-1==l?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}}function u(e){var t=m[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return m[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}function f(e){return b=!0,c[e]}function h(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function p(t,n,r,i,o,a){if(o=o||a)return o=h(o),"'"+o.replace(/\'/g,"\\'")+"'";if(n=h(n||r||i),!e.allow_script_urls){var s=n.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(s))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"}var m={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),y=y.replace(/\\[0-9a-f]+/g,function(e){return String.fromCharCode(parseInt(e.substr(1),16))}),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(|\/\*|\*\//.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":"color"!==v&&"background-color"!==v||(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,p),m[v]=b?h(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(e,t){function n(t){var n,r,o,a;if(n=d[t])for(r=0,o=n.length;o>r;r++)t=n[r],a=e[t],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+t+": "+a+";")}function r(e,t){var n;return n=f["*"],n&&n[e]?!1:(n=f[t],!n||!n[e])}var i="",o,a;if(t&&d)n("*"),n(t);else for(o in e)a=e[o],a!==s&&a.length>0&&(f&&!r(o,t)||(i+=(i.length>0?" ":"")+o+": "+a+";"));return i}}}}),r(y,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}function r(e,n,r,i){var o,a,s;if(e){if(o=e[r],t&&o===t)return;if(o){if(!i)for(s=o[n];s;s=s[n])if(!s[n])return s;return o}if(a=e.parentNode,a&&a!==t)return a}}var i=e;this.current=function(){return i},this.next=function(e){return i=n(i,"firstChild","nextSibling",e)},this.prev=function(e){return i=n(i,"lastChild","previousSibling",e)},this.prev2=function(e){return i=r(i,"lastChild","previousSibling",e)}}}),r(b,[m],function(e){function t(n){function r(){return P.createDocumentFragment()}function i(e,t){N(F,e,t)}function o(e,t){N(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(M[V]=M[W],M[$]=M[U]):(M[W]=M[V],M[U]=M[$]),M.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function h(e,t){var n=M[W],r=M[U],i=M[V],o=M[$],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function p(){E(I)}function m(){return E(O)}function g(){return E(H)}function v(e){var t=this[W],r=this[U],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=M.extractContents();M.insertNode(e),e.appendChild(t),M.selectNode(e)}function b(){return q(new t(n),{startContainer:M[W],startOffset:M[U],endContainer:M[V],endOffset:M[$],collapsed:M.collapsed,commonAncestorContainer:M.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return M[W]==M[V]&&M[U]==M[$]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function N(e,t,r){var i,o;for(e?(M[W]=t,M[U]=r):(M[V]=t,M[$]=r),i=M[V];i.parentNode;)i=i.parentNode;for(o=M[W];o.parentNode;)o=o.parentNode;o==i?w(M[W],M[U],M[V],M[$])>0&&M.collapse(e):M.collapse(e),M.collapsed=x(),M.commonAncestorContainer=n.findCommonAncestor(M[W],M[V])}function E(e){var t,n=0,r=0,i,o,a,s,l,c;if(M[W]==M[V])return _(e);for(t=M[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[W])return S(t,e);++n}for(t=M[W],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[V])return k(t,e);++r}for(o=r-n,a=M[W];o>0;)a=a.parentNode,o--;for(s=M[V];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function _(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),M[U]==M[$])return t;if(3==M[W].nodeType){if(n=M[W].nodeValue,i=n.substring(M[U],M[$]),e!=H&&(o=M[W],c=M[U],u=M[$]-M[U],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),M.collapse(F)),e==I)return;return i.length>0&&t.appendChild(P.createTextNode(i)),t}for(o=C(M[W],M[U]),a=M[$]-M[U];o&&a>0;)s=o.nextSibling,l=D(o,e),t&&t.appendChild(l),--a,o=s;return e!=H&&M.collapse(F),t}function S(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-M[U],0>=a)return t!=H&&(M.setEndBefore(e),M.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=D(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=H&&(M.setEndBefore(e),M.collapse(z)),n}function k(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=M[$]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=D(o,t),n&&n.appendChild(l),--a,o=s;return t!=H&&(M.setStartAfter(e),M.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=D(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=H&&(M.setStartAfter(e),M.collapse(F)),o}function R(e,t){var n=C(M[V],M[$]-1),r,i,o,a,s,l=n!=M[V];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(M[W],M[U]),r=n!=M[W],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return D(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=M[U],a=o.substring(l),s=o.substring(0,l)):(l=M[$],a=o.substring(0,l),s=o.substring(l)),i!=H&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function D(e,t){return t!=I?t==H?n.clone(e,F):e:void e.parentNode.removeChild(e)}function L(){return n.create("body",null,g()).outerText}var M=this,P=n.doc,O=0,H=1,I=2,F=!0,z=!1,U="startOffset",W="startContainer",V="endContainer",$="endOffset",q=e.extend,j=n.nodeIndex;return q(M,{startContainer:P,startOffset:0,endContainer:P,endOffset:0,collapsed:F,commonAncestorContainer:P,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:h,deleteContents:p,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:L}),M}return t.prototype.toString=function(){return this.toStringIE()},t}),r(C,[m],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),o[r]||(i="&"+e[n+1]+";",a[r]=i,a[i]=r);return a}}var r=e.makeMap,i,o,a,s=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n){return n?(n="x"===n.charAt(0).toLowerCase()?parseInt(n.substr(1),16):parseInt(n,10),n>65535?(n-=65536,String.fromCharCode(55296+(n>>10),56320+(1023&n))):d[n]||String.fromCharCode(n)):a[e]||i[e]||t(e)})}};return f}),r(x,[m,u],function(e,t){return function(n,r){function i(e){n.getElementsByTagName("head")[0].appendChild(e)}function o(r,o,c){function u(){for(var e=b.passed,t=e.length;t--;)e[t]();b.status=2,b.passed=[],b.failed=[]}function d(){for(var e=b.failed,t=e.length;t--;)e[t]();b.status=3,b.passed=[],b.failed=[]}function f(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function h(e,n){e()||((new Date).getTime()-y<l?t.setTimeout(n):d())}function p(){h(function(){for(var e=n.styleSheets,t,r=e.length,i;r--;)if(t=e[r],i=t.ownerNode?t.ownerNode:t.owningElement,i&&i.id===g.id)return u(),!0},p)}function m(){h(function(){try{var e=v.sheet.cssRules;return u(),!!e}catch(t){}},m)}var g,v,y,b;if(r=e._addCacheSuffix(r),s[r]?b=s[r]:(b={passed:[],failed:[]},s[r]=b),o&&b.passed.push(o),c&&b.failed.push(c),1!=b.status){if(2==b.status)return void u();if(3==b.status)return void d();if(b.status=1,g=n.createElement("link"),g.rel="stylesheet",g.type="text/css",g.id="u"+a++,g.async=!1,g.defer=!1,y=(new Date).getTime(),"onload"in g&&!f())g.onload=p,g.onerror=d;else{if(navigator.userAgent.indexOf("Firefox")>0)return v=n.createElement("style"),v.textContent='@import "'+r+'"',m(),void i(v);p()}i(g),g.href=r}}var a=0,s={},l;r=r||{},l=r.maxLoadTime||5e3,this.load=o}}),r(w,[h,g,v,f,y,b,C,d,m,x],function(e,n,r,i,o,a,s,l,c,u){function d(e,t){var n={},r=t.keep_values,i;return i={set:function(n,r,i){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||e,r,i,n[0])),n.attr("data-mce-"+i,r).attr(i,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},n={style:{set:function(e,t){return null!==t&&"object"==typeof t?void e.css(t):(r&&e.attr("data-mce-style",t),void e.attr("style",t))},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serializeStyle(e.parseStyle(n),t[0].nodeName)}}},r&&(n.href=n.src=i),n}function f(e,t){var n=t.attr("style");n=e.serializeStyle(e.parseStyle(n),t[0].nodeName),n||(n=null),t.attr("data-mce-style",n)}function h(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n}function p(e,t){var o=this,a;o.doc=e,o.win=window,o.files={},o.counter=0,o.stdMode=!b||e.documentMode>=8,o.boxModel=!b||"CSS1Compat"==e.compatMode||o.stdMode,o.styleSheetLoader=new u(e),o.boundEvents=[],o.settings=t=t||{},o.schema=t.schema,o.styles=new r({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),o.fixDoc(e),o.events=t.ownEvents?new i(t.proxy):i.Event,o.attrHooks=d(o,t),a=t.schema?t.schema.getBlockElements():{},o.$=n.overrideDefaults(function(){return{context:e,element:o.getRoot()}}),o.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!a[e.nodeName]):!!a[e]}}var m=c.each,g=c.is,v=c.grep,y=c.trim,b=l.ie,C=/^([a-z0-9],?)+$/i,x=/^[ \t\r\n]*$/;return p.prototype={$$:function(e){return"string"==typeof e&&(e=this.get(e)),this.$(e)},root:null,fixDoc:function(e){var t=this.settings,n;if(b&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!b||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.settings.root_element||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),g(n,"string")&&(a=n, n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.settings.root_element||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(C.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=g(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&"undefined"!=typeof t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"</"+e+">":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return e=this.$$(e),t?e.each(function(){for(var e;e=this.firstChild;)3==e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():e.remove(),e.length>1?e.toArray():e[0]},setStyle:function(e,t,n){e=this.$$(e).css(t,n),this.settings.update_styles&&f(this,e)},getStyle:function(e,n,r){return e=this.$$(e),r?e.css(n):(n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=l.ie&&l.ie<12?"styleFloat":"cssFloat"),e[0]&&e[0].style?e[0].style[n]:t)},setStyles:function(e,t){e=this.$$(e).css(t),this.settings.update_styles&&f(this,e)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this,i,o,a=r.settings;""===n&&(n=null),e=r.$$(e),i=e.attr(t),e.length&&(o=r.attrHooks[t],o&&o.set?o.set(e,n,t):e.attr(t,n),i!=n&&a.onSetAttrib&&a.onSetAttrib({attrElm:e,attrName:t,attrValue:n}))},setAttribs:function(e,t){var n=this;n.$$(e).each(function(e,r){m(t,function(e,t){n.setAttrib(r,t,e)})})},getAttrib:function(e,t,n){var r=this,i,o;return e=r.$$(e),e.length&&(i=r.attrHooks[t],o=i&&i.get?i.get(e,t):e.attr(t)),"undefined"==typeof o&&(o=n||""),o},getPos:function(e,t){var r=this,i=0,o=0,a,s=r.doc,l=s.body,c;if(e=r.get(e),t=t||l,e){if(t===l&&e.getBoundingClientRect&&"static"===n(l).css("position"))return c=e.getBoundingClientRect(),t=r.boxModel?s.documentElement:l,i=c.left+(s.documentElement.scrollLeft||l.scrollLeft)-t.clientLeft,o=c.top+(s.documentElement.scrollTop||l.scrollTop)-t.clientTop,{x:i,y:o};for(a=e;a&&a!=t&&a.nodeType;)i+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=e.parentNode;a&&a!=t&&a.nodeType;)i-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode}return{x:i,y:o}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==p.DOM&&n===document){var o=p.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,p.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==p.DOM&&n===document?void p.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void m(e.split(","),function(e){var i;e=c._addCacheSuffix(e),t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),b&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){this.$$(e).addClass(t)},removeClass:function(e,t){this.toggleClass(e,t,!1)},hasClass:function(e,t){return this.$$(e).hasClass(t)},toggleClass:function(e,t,r){this.$$(e).toggleClass(t,r).each(function(){""===this.className&&n(this).attr("class",null)})},show:function(e){this.$$(e).show()},hide:function(e){this.$$(e).hide()},isHidden:function(e){return"none"==this.$$(e).css("display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){e=this.$$(e),b?e.each(function(e,r){if(r.canHaveHTML!==!1){for(;r.firstChild;)r.removeChild(r.firstChild);try{r.innerHTML="<br>"+t,r.removeChild(r.firstChild)}catch(i){n("<div>").html("<br>"+t).contents().slice(1).appendTo(r)}return t}}):e.html(t)},getOuterHTML:function(e){return e=this.get(e),1==e.nodeType&&"outerHTML"in e?e.outerHTML:n("<div>").append(n(e).clone()).html()},setOuterHTML:function(e,t){var r=this;r.$$(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}r.remove(n(this).html(t),!0)})},decode:s.decode,encode:s.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return g(t,"array")&&(e=e.cloneNode(!0)),n&&m(v(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(c.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],m(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(b){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,i,a,s,l,c=0;if(e=e.firstChild){s=new o(e,e.parentNode),t=t||(n.schema?n.schema.getNonEmptyElements():null);do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(i=n.getAttribs(e),r=i.length;r--;)if(l=i[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!x.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new a(this)},nodeIndex:h,split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=y(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.insertBefore(n,e):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(c.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(c.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return e&&1==e.nodeType?(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null):null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&(n=this.getContentEditable(e),null===n);e=e.parentNode);return n},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},p.DOM=new p(document),p.nodeIndex=h,p}),r(N,[w,m],function(e,t){function n(){function e(e,n){function i(){a.remove(l),s&&(s.onreadystatechange=s.onload=s=null),n()}function o(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var a=r,s,l;l=a.uniqueId(),s=document.createElement("script"),s.id=l,s.type="text/javascript",s.src=t._addCacheSuffix(e),"onreadystatechange"in s?s.onreadystatechange=function(){/loaded|complete/.test(s.readyState)&&i()}:s.onload=i,s.onerror=o,(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}var n=0,a=1,s=2,l={},c=[],u={},d=[],f=0,h;this.isDone=function(e){return l[e]==s},this.markDone=function(e){l[e]=s},this.add=this.load=function(e,t,r){var i=l[e];i==h&&(c.push(e),l[e]=n),t&&(u[e]||(u[e]=[]),u[e].push({func:t,scope:r||this}))},this.remove=function(e){delete l[e],delete u[e]},this.loadQueue=function(e,t){this.loadScripts(c,e,t)},this.loadScripts=function(t,n,r){function c(e){i(u[e],function(e){e.func.call(e.scope)}),u[e]=h}var p;d.push({func:n,scope:r||this}),(p=function(){var n=o(t);t.length=0,i(n,function(t){return l[t]==s?void c(t):void(l[t]!=a&&(l[t]=a,f++,e(t,function(){l[t]=s,f--,c(t),p()})))}),f||(i(d,function(e){e.func.call(e.scope)}),d.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(E,[N,m],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){var i=r.language;if(i&&r.languageLoad!==!1){if(n)if(n=","+n+",",-1!=n.indexOf(","+i.substr(0,2)+","))i=i.substr(0,2);else if(-1==n.indexOf(","+i+","))return;e.ScriptLoader.add(this.urls[t]+"/langs/"+i+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},remove:function(e){delete this.urls[e],delete this.lookup[e]},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&(s?a.call(s):a.call(e))}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(_,[],function(){function e(e){return function(t){return!!t&&t.nodeType==e}}function t(e){return e=e.toLowerCase().split(" "),function(t){var n,r;if(t&&t.nodeType)for(r=t.nodeName.toLowerCase(),n=0;n<e.length;n++)if(r===e[n])return!0;return!1}}function n(e,t){return t=t.toLowerCase().split(" "),function(n){var r,i;if(s(n))for(r=0;r<t.length;r++)if(i=getComputedStyle(n,null).getPropertyValue(e),i===t[r])return!0;return!1}}function r(e,t){return function(n){return s(n)&&n[e]===t}}function i(e,t){return function(n){return s(n)&&n.getAttribute(e)===t}}function o(e){return s(e)&&e.hasAttribute("data-mce-bogus")}function a(e){return function(t){if(s(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}}var s=e(1);return{isText:e(3),isElement:s,isComment:e(8),isBr:t("br"),isContentEditableTrue:a("true"),isContentEditableFalse:a("false"),matchNodeNames:t,hasPropValue:r,hasAttributeValue:i,matchStyleValues:n,isBogus:o}}),r(S,[],function(){function e(e){return e==n}function t(e){return e.replace(new RegExp(n,"g"),"")}var n="\ufeff";return{isZwsp:e,ZWSP:n,trim:t}}),r(k,[_,S],function(e,t){function n(e){return p(e)&&(e=e.parentNode),h(e)&&e.hasAttribute("data-mce-caret")}function r(e){return p(e)&&t.isZwsp(e.data)}function i(e){return n(e)||r(e)}function o(e){var t=e.parentNode;t&&t.removeChild(e)}function a(e){try{return e.nodeValue}catch(t){return""}}function s(e,t){0===t.length?o(e):e.nodeValue=t}function l(e,n){var r,o,a,s;if(r=e.ownerDocument,a=r.createTextNode(t.ZWSP),s=e.parentNode,n){if(o=e.previousSibling,p(o)){if(i(o))return o;if(f(o))return o.splitText(o.data.length-1)}s.insertBefore(a,e)}else{if(o=e.nextSibling,p(o)){if(i(o))return o;if(d(o))return o.splitText(1),o}e.nextSibling?s.insertBefore(a,e.nextSibling):s.appendChild(a)}return a}function c(e,t,n){var r,i,o;return r=t.ownerDocument,i=r.createElement(e),i.setAttribute("data-mce-caret",n?"before":"after"),i.setAttribute("data-mce-bogus","all"),i.appendChild(r.createTextNode("\xa0")),o=t.parentNode,n?o.insertBefore(i,t):t.nextSibling?o.insertBefore(i,t.nextSibling):o.appendChild(i),i}function u(e){if(h(e)&&i(e)&&(" "!=e.innerHTML?e.removeAttribute("data-mce-caret"):o(e)),p(e)){var n=t.trim(a(e));s(e,n)}}function d(e){return p(e)&&e.data[0]==t.ZWSP}function f(e){return p(e)&&e.data[e.data.length-1]==t.ZWSP}var h=e.isElement,p=e.isText;return{isCaretContainer:i,isCaretContainerBlock:n,isCaretContainerInline:r,insertInline:l,insertBlock:c,remove:u,startsWithCaretContainer:d,endsWithCaretContainer:f}}),r(T,[m,y,_,b,k],function(e,t,n,r,i){function o(e,t){var n=e.childNodes;return t--,t>n.length-1?t=n.length-1:0>t&&(t=0),n[t]||e}function a(e){this.walk=function(t,n){function r(e){var t;return t=e[0],3===t.nodeType&&t===c&&u>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===f&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function i(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,o){var a=o?"nextSibling":"previousSibling";for(g=e,v=g.parentNode;g&&g!=t;g=v)v=g.parentNode,y=i(g==e?g:g[a],a),y.length&&(o||y.reverse(),n(r(y)))}var c=t.startContainer,u=t.startOffset,d=t.endContainer,f=t.endOffset,h,p,m,g,v,y,b;if(b=e.select("td[data-mce-selected],th[data-mce-selected]"),b.length>0)return void l(b,function(e){n([e])});if(1==c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[u]),1==d.nodeType&&d.hasChildNodes()&&(d=o(d,f)),c==d)return n(r([c]));for(h=e.findCommonAncestor(c,d),g=c;g;g=g.parentNode){if(g===d)return s(c,h,!0);if(g===h)break}for(g=d;g;g=g.parentNode){if(g===c)return s(d,h);if(g===h)break}p=a(c,h)||c,m=a(d,h)||d,s(c,p,!0),y=i(p==c?p:p.nextSibling,"nextSibling",m==d?m.nextSibling:m),y.length&&n(r(y)),s(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&r<n.nodeValue.length&&(i=t(n,r),n=i.previousSibling,o>r?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r<n.nodeValue.length&&(n=t(n,r),r=0),3==i.nodeType&&o>0&&o<i.nodeValue.length&&(i=t(i,o).previousSibling,o=i.nodeValue.length)),{startContainer:n,startOffset:r,endContainer:i,endOffset:o}},this.normalize=function(n){function r(r){function a(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}function s(n,r){for(var i=new t(n,e.getParent(n.parentNode,e.isBlock)||g);n=i[r?"prev":"next"]();)if("BR"===n.nodeName)return!0}function l(e){for(;e&&e!=g;){if(c(e))return!0;e=e.parentNode}return!1}function d(e,t){return e.previousSibling&&e.previousSibling.nodeName==t}function f(n,r){var a,s,l;if(r=r||h,l=e.getParent(r.parentNode,e.isBlock)||g,n&&"BR"==r.nodeName&&C&&e.isEmpty(l))return h=r.parentNode,p=e.nodeIndex(r),void(i=!0);for(a=new t(r,l);v=a[n?"prev":"next"]();){if("false"===e.getContentEditableParent(v)||u(v))return;if(3===v.nodeType&&v.nodeValue.length>0)return h=v,p=n?v.nodeValue.length:0,void(i=!0);if(e.isBlock(v)||y[v.nodeName.toLowerCase()])return;s=v}o&&s&&(h=s,i=!0,p=0)}var h,p,m,g=e.getRoot(),v,y,b,C;if(h=n[(r?"start":"end")+"Container"],p=n[(r?"start":"end")+"Offset"],C=1==h.nodeType&&p===h.childNodes.length,y=e.schema.getNonEmptyElements(),b=r,!u(h)){if(1==h.nodeType&&p>h.childNodes.length-1&&(b=!1),9===h.nodeType&&(h=e.getRoot(),p=0),h===g){if(b&&(v=h.childNodes[p>0?p-1:0])){if(u(v))return;if(y[v.nodeName]||"TABLE"==v.nodeName)return}if(h.hasChildNodes()){if(p=Math.min(!b&&p>0?p-1:p,h.childNodes.length-1),h=h.childNodes[p],p=0,!o&&h===g.lastChild&&"TABLE"===h.nodeName)return;if(l(h)||u(h))return;if(h.hasChildNodes()&&!/TABLE/.test(h.nodeName)){v=h,m=new t(h,g);do{if(c(v)||u(v)){i=!1;break}if(3===v.nodeType&&v.nodeValue.length>0){p=b?0:v.nodeValue.length,h=v,i=!0;break}if(y[v.nodeName.toLowerCase()]&&!a(v)){p=e.nodeIndex(v),h=v.parentNode,"IMG"!=v.nodeName||b||p++,i=!0;break}}while(v=b?m.next():m.prev())}}}o&&(3===h.nodeType&&0===p&&f(!0),1===h.nodeType&&(v=h.childNodes[p],v||(v=h.childNodes[p-1]),!v||"BR"!==v.nodeName||d(v,"A")||s(v)||s(v,!0)||f(!0,v))),b&&!o&&3===h.nodeType&&p===h.nodeValue.length&&f(!1),i&&n["set"+(r?"Start":"End")](h,p)}}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}function s(t,n,r){var i,o,a;if(i=r.elementFromPoint(t,n),o=r.body.createTextRange(),i&&"HTML"!=i.tagName||(i=r.body),o.moveToElementText(i),a=e.toArray(o.getClientRects()),a=a.sort(function(e,t){return e=Math.abs(Math.max(e.top-n,e.bottom-n)),t=Math.abs(Math.max(t.top-n,t.bottom-n)),e-t}),a.length>0){n=(a[0].bottom+a[0].top)/2;try{return o.moveToPoint(t,n),o.collapse(!0),o}catch(s){}}return null}var l=e.each,c=n.isContentEditableFalse,u=i.isCaretContainer;return a.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},a.getCaretRangeFromPoint=function(e,t,n){var r,i;if(n.caretPositionFromPoint)i=n.caretPositionFromPoint(e,t),r=n.createRange(),r.setStart(i.offsetNode,i.offset),r.collapse(!0);else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r=s(e,t,n)}}return r},a.getSelectedNode=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset==n+1?t.childNodes[n]:null},a.getNode=function(e,t){return 1==e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},a}),r(R,[T,d,u],function(e,t,n){return function(r){function i(e){var t,n;if(n=r.$(e).parentsUntil(r.getBody()).add(e),n.length===a.length){for(t=n.length;t>=0&&n[t]===a[t];t--);if(-1===t)return a=n,!0}return a=n,!1}var o,a=[];"onselectionchange"in r.getDoc()||r.on("NodeChange Click MouseUp KeyUp Focus",function(t){var n,i;n=r.selection.getRng(),i={startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset},"nodechange"!=t.type&&e.compareRanges(i,o)||r.fire("SelectionChange"),o=i}),r.on("contextmenu",function(){r.fire("SelectionChange")}),r.on("SelectionChange",function(){var e=r.selection.getStart(!0);!t.range&&r.selection.isCollapsed()||!i(e)&&r.dom.isChildOf(e,r.getBody())&&r.nodeChanged({selectionChange:!0})}),r.on("MouseUp",function(e){e.isDefaultPrevented()||("IMG"==r.selection.getNode().nodeName?n.setEditorTimeout(r,function(){r.nodeChanged()}):r.nodeChanged())}),this.nodeChanged=function(e){var t=r.selection,n,i,o;r.initialized&&t&&!r.settings.disable_nodechange&&!r.readonly&&(o=r.getBody(),n=t.getStart()||o,n.ownerDocument==r.getDoc()&&r.dom.isChildOf(n,o)||(n=o),"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),i=[],r.dom.getParent(n,function(e){return e===o?!0:void i.push(e)}),e=e||{},e.element=n,e.parents=i,r.fire("NodeChange",e))}}}),r(A,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(B,[m],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e,t){var n={},r,i;for(r=0,i=e.length;i>r;r++)n[e[r]]=t||{};return n}var s,c,u,d=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),c=3;c<d.length;c++)"string"==typeof d[c]&&(d[c]=t(d[c])),r.push.apply(r,d[c]);for(e=t(e),s=e.length;s--;)u=[].concat(l,t(n)),a[e[s]]={attributes:i(u),attributesOrder:u,children:i(r,o)}}function r(e,n){var r,i,o,s;for(e=t(e),r=e.length,n=t(n);r--;)for(i=a[e[r]],o=0,s=n.length;s>o;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},l,c,u,d,f,h;return i[e]?i[e]:(l=t("id accesskey class dir lang style tabindex title"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),u=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(l.push.apply(l,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),u.push.apply(u,t("audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(l.push("xml:lang"),h=t("acronym applet basefont big font strike tt"),u.push.apply(u,h),s(h,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),s(f,function(e){n(e,"",d)})),d=d||[].concat(c,u),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),n("address dt dd div caption","",d),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",u),n("blockquote","cite",d),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",d),n("dl","","dt dd"),n("a","href target rel media hreflang type",u),n("q","cite",u),n("ins del","cite datetime",d),n("img","src sizes srcset alt usemap ismap width height"),n("iframe","src name width height",d),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",d,"param"),n("param","name value"),n("map","name",d,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",d),n("th","colspan rowspan headers scope abbr",d),n("form","accept-charset action autocomplete enctype method name novalidate target",d),n("fieldset","disabled form name",d,"legend"),n("label","form for",u),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?d:u),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",d,"li"),n("noscript","",d),"html4"!=e&&(n("wbr"),n("ruby","",u,"rt rp"),n("figcaption","",d),n("mark rt rp summary bdi","",u),n("canvas","width height",d),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",d,"track source"),n("picture","","img source"),n("source","src srcset type media sizes"),n("track","kind src srclang label default"),n("datalist","",u,"option"),n("article section nav aside header footer","",d),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",d,"figcaption"),n("time","datetime",u),n("dialog","open",d),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",u),n("progress","value max",u),n("meter","value min max low high optimum",u),n("details","open",d,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(r("script","language xml:space"),r("style","xml:space"),r("object","declare classid code codebase codetype archive standby align border hspace vspace"),r("embed","align name hspace vspace"),r("param","valuetype type"),r("a","charset name rev shape coords"),r("br","clear"),r("applet","codebase archive code object alt name width height align hspace vspace"),r("img","name longdesc align border hspace vspace"),r("iframe","longdesc frameborder marginwidth marginheight scrolling align"),r("font basefont","size color face"),r("input","usemap align"),r("select","onchange"),r("textarea"),r("h1 h2 h3 h4 h5 h6 div p legend caption","align"),r("ul","type compact"),r("li","type"),r("ol dl menu dir","compact"),r("pre","width xml:space"),r("hr","align noshade size width"),r("isindex","prompt"),r("table","summary width frame rules cellspacing cellpadding align bgcolor"),r("col","width align char charoff valign"),r("colgroup","width align char charoff valign"),r("thead","align char charoff valign"),r("tr","align char charoff valign bgcolor"),r("th","axis align char charoff valign nowrap bgcolor width height"),r("form","accept"),r("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),r("tfoot","align char charoff valign"),r("tbody","align char charoff valign"),r("area","nohref"),r("body","background bgcolor text link vlink alink")),"html4"!=e&&(r("input button select textarea","autofocus"),r("input textarea","placeholder"),r("a","download"),r("link script img","crossorigin"),r("iframe","sandbox seamless allowfullscreen")),s(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,delete a.script,i[e]=a,a)}function r(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),s(e,function(e,r){n[r]=n[r.toUpperCase()]="map"==t?a(e,/[, ]/):c(e,/[, ]/)})),n}var i={},o={},a=e.makeMap,s=e.each,l=e.extend,c=e.explode,u=e.inArray;return function(e){function o(t,n,r){var o=e[t];return o?o=a(o,/[, ]/,a(o.toUpperCase(),/[, ]/)):(o=i[t],o||(o=a(n," ",a(n.toUpperCase()," ")),o=l(o,r),i[t]=o)),o}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function f(e){var n,r,i,o,s,l,c,f,h,p,m,g,v,b,x,w,N,E,_,S=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,k=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),y["@"]&&(w=y["@"].attributes,N=y["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=S.exec(e[n])){if(b=s[1],h=s[2],x=s[3],f=s[5],g={},v=[],l={attributes:g,attributesOrder:v},"#"===b&&(l.paddEmpty=!0),"-"===b&&(l.removeEmpty=!0),"!"===s[4]&&(l.removeEmptyAttrs=!0),w){for(E in w)g[E]=w[E];v.push.apply(v,N)}if(f)for(f=t(f,"|"),i=0,o=f.length;o>i;i++)if(s=k.exec(f[i])){if(c={},m=s[1],p=s[2].replace(/::/g,":"),b=s[3],_=s[4],"!"===m&&(l.attributesRequired=l.attributesRequired||[],l.attributesRequired.push(p),c.required=!0),"-"===m){delete g[p],v.splice(u(v,p),1);continue}b&&("="===b&&(l.attributesDefault=l.attributesDefault||[],l.attributesDefault.push({name:p,value:_}),c.defaultValue=_),":"===b&&(l.attributesForced=l.attributesForced||[],l.attributesForced.push({name:p,value:_}),c.forcedValue=_),"<"===b&&(c.validValues=a(_,"?"))), T.test(p)?(l.attributePatterns=l.attributePatterns||[],c.pattern=d(p),l.attributePatterns.push(c)):(g[p]||v.push(p),g[p]=c)}w||"@"!=h||(w=g,N=v),x&&(l.outputName=h,y[x]=l),T.test(h)?(l.pattern=d(h),C.push(l)):y[h]=l}}function h(e){y={},C=[],f(e),s(N,function(e,t){b[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&(i.text_block_elements=i.block_elements=null,s(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",o=t[2];if(b[o]=b[i],M[o]=i,r||(R[o.toUpperCase()]={},R[o]={}),!y[o]){var a=y[i];a=l({},a),delete a.removeEmptyAttrs,delete a.removeEmpty,y[o]=a}s(b,function(e,t){e[i]&&(b[t]=e=l({},b[t]),e[o]=e[i])})}))}function m(n){var r=/^([+\-]?)(\w+)\[([^\]]+)\]$/;i[e.schema]=null,n&&s(t(n,","),function(e){var n=r.exec(e),i,o;n&&(o=n[1],i=o?b[n[2]]:b[n[2]]={"#comment":{}},i=b[n[2]],s(t(n[3],"|"),function(e){"-"===o?delete i[e]:i[e]={}}))})}function g(e){var t=y[e],n;if(t)return t;for(n=C.length;n--;)if(t=C[n],t.pattern.test(e))return t}var v=this,y={},b={},C=[],x,w,N,E,_,S,k,T,R,A,B,D,L,M={},P={};e=e||{},N=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),x=r(e.valid_styles),w=r(e.invalid_styles,"map"),T=r(e.valid_classes,"map"),E=o("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=o("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),S=o("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),k=o("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),A=o("non_empty_elements","td th iframe video audio object script",S),B=o("move_caret_before_on_enter_elements","table",A),D=o("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),R=o("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption",D),L=o("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),s((e.special||"script noscript style textarea").split(" "),function(e){P[e]=new RegExp("</"+e+"[^>]*>","gi")}),e.valid_elements?h(e.valid_elements):(s(N,function(e,t){y[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},b[t]=e.children}),"html5"!=e.schema&&s(t("strong/b em/i"),function(e){e=t(e,"/"),y[e[1]].outputName=e[0]}),s(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){y[e]&&(y[e].removeEmpty=!0)}),s(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){y[e].paddEmpty=!0}),s(t("span"),function(e){y[e].removeEmptyAttrs=!0})),p(e.custom_elements),m(e.valid_children),f(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&s(c(e.invalid_elements),function(e){y[e]&&delete y[e]}),g("span")||f("span[!data-mce-type|*]"),v.children=b,v.getValidStyles=function(){return x},v.getInvalidStyles=function(){return w},v.getValidClasses=function(){return T},v.getBoolAttrs=function(){return k},v.getBlockElements=function(){return R},v.getTextBlockElements=function(){return D},v.getTextInlineElements=function(){return L},v.getShortEndedElements=function(){return S},v.getSelfClosingElements=function(){return _},v.getNonEmptyElements=function(){return A},v.getMoveCaretBeforeOnEnterElements=function(){return B},v.getWhiteSpaceElements=function(){return E},v.getSpecialElements=function(){return P},v.isValidChild=function(e,t){var n=b[e];return!(!n||!n[t])},v.isValid=function(e,t){var n,r,i=g(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},v.getElementRule=g,v.getCustomElements=function(){return M},v.addValidElements=f,v.setValidElements=h,v.addCustomElements=p,v.addValidChildren=m,v.elements=y}}),r(D,[B,C,m],function(e,t,n){function r(e,t,n){var r=1,i,o,a,s;for(s=e.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g,a.lastIndex=i=n;o=a.exec(t);){if(i=a.lastIndex,"/"===o[1])r--;else if(!o[1]){if(o[2]in s)continue;r++}if(0===r)break}return i}function i(i,a){function s(){}var l=this;i=i||{},l.schema=a=a||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),o("comment cdata text start end pi doctype".split(" "),function(e){e&&(l[e]=i[e]||s)}),l.parse=function(e){function o(e){var t,n;for(t=h.length;t--&&h[t].name!==e;);if(t>=0){for(n=h.length-1;n>=t;n--)e=h[n],e.valid&&l.end(e.name);h.length=t}}function s(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in x?t:z(n||r||o||""),N&&!y&&0!==t.indexOf("data-")){if(a=T[t],!a&&R){for(s=R.length;s--&&(a=R[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(W[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{c=decodeURIComponent(c)}catch(u){c=unescape(c)}if(V.test(c))return;if(!i.allow_html_data_urls&&$.test(c)&&!/^data:image\//i.test(c))return}p.map[t]=n,p.push({name:t,value:n})}var l=this,c,u=0,d,f,h=[],p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F=0,z=t.decode,U,W=n.makeMap("src,href,data,background,formaction,poster"),V=/((java|vb)script|mhtml):/i,$=/^data:/i;for(P=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),O=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,C=a.getShortEndedElements(),M=i.self_closing_elements||a.getSelfClosingElements(),x=a.getBoolAttrs(),N=i.validate,b=i.remove_internals,U=i.fix_self_closing,H=a.getSpecialElements();c=P.exec(e);){if(u<c.index&&l.text(z(e.substr(u,c.index-u))),d=c[6])d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),o(d);else if(d=c[7]){if(d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),w=d in C,U&&M[d]&&h.length>0&&h[h.length-1].name===d&&o(d),!N||(E=a.getElementRule(d))){if(_=!0,N&&(T=E.attributes,R=E.attributePatterns),(k=c[8])?(y=-1!==k.indexOf("data-mce-type"),y&&b&&(_=!1),p=[],p.map={},k.replace(O,s)):(p=[],p.map={}),N&&!y){if(A=E.attributesRequired,B=E.attributesDefault,D=E.attributesForced,L=E.removeEmptyAttrs,L&&!p.length&&(_=!1),D)for(m=D.length;m--;)S=D[m],v=S.name,I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I});if(B)for(m=B.length;m--;)S=B[m],v=S.name,v in p.map||(I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I}));if(A){for(m=A.length;m--&&!(A[m]in p.map););-1===m&&(_=!1)}if(S=p.map["data-mce-bogus"]){if("all"===S){u=r(a,e,P.lastIndex),P.lastIndex=u;continue}_=!1}}_&&l.start(d,p,w)}else _=!1;if(f=H[d]){f.lastIndex=u=c.index+c[0].length,(c=f.exec(e))?(_&&(g=e.substr(u,c.index-u)),u=c.index+c[0].length):(g=e.substr(u),u=e.length),_&&(g.length>0&&l.text(g,!0),l.end(d)),P.lastIndex=u;continue}w||(k&&k.indexOf("/")==k.length-1?_&&l.end(d):h.push({name:d,valid:_}))}else(d=c[1])?(">"===d.charAt(0)&&(d=" "+d),i.allow_conditional_comments||"[if"!==d.substr(0,3)||(d=" "+d),l.comment(d)):(d=c[2])?l.cdata(d):(d=c[3])?l.doctype(d):(d=c[4])&&l.pi(d,c[5]);u=c.index+c[0].length}for(u<e.length&&l.text(z(e.substr(u))),m=h.length-1;m>=0;m--)d=h[m],d.valid&&l.end(d.name)}}var o=n.each;return i.findEndTag=r,i}),r(L,[A,B,D,m],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,h,p,m,g,v,y,b;for(m=i("tr,td,th,tbody,thead,tfoot,table"),p=l.getNonEmptyElements(),g=l.getTextBlockElements(),v=l.getSpecialElements(),n=0;n<t.length;n++)if(r=t[n],r.parent&&!r.fixed)if(g[r.name]&&"li"==r.parent.name){for(y=r.next;y&&g[y.name];)y.name="li",y.fixed=!0,r.parent.insert(y,r.parent),y=y.next;r.unwrap(r)}else{for(a=[r],o=r.parent;o&&!l.isValidChild(o.name,r.name)&&!m[o.name];o=o.parent)a.push(o);if(o&&a.length>1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),h=0;h<a.length-1;h++){for(l.isValidChild(c.name,a[h].name)?(d=u.filterNode(a[h].clone()),c.append(d)):d=c,f=a[h].firstChild;f&&f!=a[h+1];)b=f.next,d.append(f),f=b;c=d}s.isEmpty(p)?o.insert(r,a[0],!0):(o.insert(s,a[0],!0),o.insert(r,s)),o=a[0],(o.isEmpty(p)||o.firstChild===o.lastChild&&"br"===o.firstChild.name)&&o.empty().remove()}else if(r.parent){if("li"===r.name){if(y=r.prev,y&&("ul"===y.name||"ul"===y.name)){y.append(r);continue}if(y=r.next,y&&("ul"===y.name||"ul"===y.name)){y.insert(r,y.firstChild,!0);continue}r.wrap(u.filterNode(new e("ul",1)));continue}l.isValidChild(r.parent.name,"div")&&l.isValidChild("div",r.name)?r.wrap(u.filterNode(new e("div",1))):v[r.name]?r.empty().remove():r.unwrap()}}}var u=this,d={},f=[],h={},p={};r=r||{},r.validate="validate"in r?r.validate:!0,r.root_name=r.root_name||"body",u.schema=l=l||new t,u.filterNode=function(e){var t,n,r;n in d&&(r=h[n],r?r.push(e):h[n]=[e]),t=f.length;for(;t--;)n=f[t].name,n in e.attributes.map&&(r=p[n],r?r.push(e):p[n]=[e]);return e},u.addNodeFilter=function(e,t){o(a(e),function(e){var n=d[e];n||(d[e]=n=[]),n.push(t)})},u.addAttributeFilter=function(e,t){o(a(e),function(e){var n;for(n=0;n<f.length;n++)if(f[n].name===e)return void f[n].callbacks.push(t);f.push({name:e,callbacks:[t]})})},u.parse=function(t,o){function a(){function e(e){e&&(t=e.firstChild,t&&3==t.type&&(t.value=t.value.replace(R,"")),t=e.lastChild,t&&3==t.type&&(t.value=t.value.replace(D,"")))}var t=y.firstChild,n,i;if(l.isValidChild(y.name,I.toLowerCase())){for(;t;)n=t.next,3==t.type||1==t.type&&"p"!==t.name&&!T[t.name]&&!t.attr("data-mce-type")?i?i.append(t):(i=u(I,1),i.attr(r.forced_root_block_attrs),y.insert(i,t),i.append(t)):(e(i),i=null),t=n;e(i)}}function u(t,n){var r=new e(t,n),i;return t in d&&(i=h[t],i?i.push(r):h[t]=[r]),r}function m(e){var t,n,r,i,o=l.getBlockElements();for(t=e.prev;t&&3===t.type;){if(r=t.value.replace(D,""),r.length>0)return void(t.value=r);if(n=t.next){if(3==n.type&&n.value.length){t=t.prev;continue}if(!o[n.name]&&"script"!=n.name&&"style"!=n.name){t=t.prev;continue}}i=t.prev,t.remove(),t=i}}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,N,E,_,S,k,T,R,A=[],B,D,L,M,P,O,H,I;if(o=o||{},h={},p={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),H=l.getNonEmptyElements(),O=l.children,k=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,P=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,L=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,v=new n({validate:k,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(L," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=k?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=O[b.name],s&&O[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(_=p[a],_?_.push(r):p[a]=[r]);T[e]&&m(r),n||(b=r),!B&&P[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=k?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(D,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o}if(B&&P[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(H))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,T[b.name]?b.empty().remove():b.unwrap(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),k&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(S in h){for(_=d[S],C=h[S],N=C.length;N--;)C[N].parent||C.splice(N,1);for(x=0,w=_.length;w>x;x++)_[x](C,S,o)}for(x=0,w=f.length;w>x;x++)if(_=f[x],_.name in p){for(C=p[_.name],N=C.length;N--;)C[N].parent||C.splice(N,1);for(N=0,E=_.callbacks.length;E>N;N++)_.callbacks[N](C,_.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,h,p;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(h=l.getElementRule(c.name),h&&(h.removeEmpty?c.remove():h.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(p=new e("#text",3),p.value="\xa0",i.replace(p))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}}),r.validate&&l.getValidClasses()&&u.addAttributeFilter("class",function(e){for(var t=e.length,n,r,i,o,a,s=l.getValidClasses(),c,u;t--;){for(n=e[t],r=n.attr("class").split(" "),a="",i=0;i<r.length;i++)o=r[i],u=!1,c=s["*"],c&&c[o]&&(u=!0),c=s[n.name],!u&&c&&c[o]&&(u=!0),u&&(a&&(a+=" "),a+=o);a.length||(a=null),n.attr("class",a)}})}}),r(M,[C,m],function(e,t){var n=t.makeMap;return function(t){var r=[],i,o,a,s,l;return t=t||{},i=t.indent,o=n(t.indent_before||""),a=n(t.indent_after||""),s=e.getEncodeFunc(t.entity_encoding||"raw",t.entities),l="html"==t.element_format,{start:function(e,t,n){var c,u,d,f;if(i&&o[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');!n||l?r[r.length]=">":r[r.length]=" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push("</",e,">"),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("<![CDATA[",e,"]]>")},comment:function(e){r.push("<!--",e,"-->")},pi:function(e,t){t?r.push("<?",e," ",s(t),"?>"):r.push("<?",e,"?>"),i&&r.push("\n")},doctype:function(e){r.push("<!DOCTYPE",e,">",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(P,[M,B],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,h,p,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1&&(f=[],f.map={},m=r.getElementRule(e.name))){for(h=0,p=m.attributesOrder.length;p>h;h++)u=m.attributesOrder[h],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(h=0,p=c.length;p>h;h++)u=c[h].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(O,[w,L,D,C,P,A,B,d,m,S],function(e,t,n,r,i,o,a,s,l,c){function u(e){function t(e){return e&&"br"===e.name}var n,r;n=e.lastChild,t(n)&&(r=n.prev,t(r)&&(n.remove(),r.remove()))}var d=l.each,f=l.trim,h=e.DOM,p=["data-mce-selected"];return function(e,o){function m(e){var t=new RegExp(["<span[^>]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","\\s?("+p.join("|")+')="[^"]+"'].join("|"),"gi");return e=c.trim(e.replace(t,""))}function g(){var e=o.getBody().innerHTML,t=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,r,i,a,s,l,c=o.schema;for(e=m(e),l=c.getShortEndedElements();s=t.exec(e);)i=t.lastIndex,a=s[0].length,r=l[s[1]]?i:n.findEndTag(c,e,i),e=e.substring(0,i-a)+e.substring(r),t.lastIndex=i-a;return f(e)}function v(e){-1===l.inArray(p,e)&&(C.addAttributeFilter(e,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),p.push(e))}var y,b,C;return o&&(y=o.dom,b=o.schema),y=y||h,b=b||new a(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,C=new t(e,b),C.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n=e.length,r;n--;)r=e[n],r.attr("tabindex",r.attributes.map["data-mce-tabindex"]),r.attr(t,null)}),C.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,s=e.url_converter,l=e.url_converter_scope,c;r--;)i=t[r],o=i.attributes.map[a],o!==c?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=y.serializeStyle(y.parseStyle(o),i.name):s&&(o=s.call(l,o,n,i.name)),i.attr(n,o.length>0?o:null))}),C.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class"),r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}),C.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),C.addNodeFilter("noscript",function(e){for(var t=e.length,n;t--;)n=e[t].firstChild,n&&(n.value=r.decode(n.value))}),C.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o,a;r--;)i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t?(a=i.attr("type"),a&&i.attr("type","mce-no/type"==a?null:a.replace(/^mce\-/,"")),o.length>0&&(i.firstChild.value="// <![CDATA[\n"+n(o)+"\n// ]]>")):o.length>0&&(i.firstChild.value="<!--\n"+n(o)+"\n-->")}),C.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),C.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&C.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,"ul"!==r.name&&"ol"!==r.name||n.prev&&"li"===n.prev.name&&n.prev.append(n)}),C.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:b,addNodeFilter:C.addNodeFilter,addAttributeFilter:C.addAttributeFilter,serialize:function(t,n){var r=this,o,a,l,h,p,m;return s.ie&&y.select("script,style,select,map").length>0?(p=t.innerHTML,t=t.cloneNode(!1),y.setHTML(t,p)):t=t.cloneNode(!0),o=document.implementation,o.createHTMLDocument&&(a=o.createHTMLDocument(""),d("BODY"==t.nodeName?t.childNodes:[t],function(e){a.body.appendChild(a.importNode(e,!0))}),t="BODY"!=t.nodeName?a.body.firstChild:a.body,l=y.doc,y.doc=a),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,r.onPreProcess(n)),m=C.parse(f(n.getInner?t.innerHTML:y.getOuterHTML(t)),n),u(m),h=new i(e,b),n.content=h.serialize(m),n.cleanup||(n.content=c.trim(n.content),n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||r.onPostProcess(n),l&&(y.doc=l),n.node=null,n.content},addRules:function(e){b.addValidElements(e)},setRules:function(e){b.setValidElements(e)},onPreProcess:function(e){o&&o.fire("PreProcess",e)},onPostProcess:function(e){o&&o.fire("PostProcess",e)},addTempAttr:v,trimHtml:m,getTrimmedContent:g}}}),r(H,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(3==l.nodeType&&(u=l.nodeValue,s+=u.length,s>=i)){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(3==l.nodeType&&(s+=l.nodeValue.length,s>=i)){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,p;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),t!=f&&t!=f.documentElement||(t=h,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(p=t.childNodes,p.length?(n>=p.length?i.insertAfter(a,p[p.length-1]):t.insertBefore(a,p[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="<span></span>",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,h=f.body,p,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=h.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="<span></span><span></span>",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=h.createControlRange(),a.addElement(m),a.select(),p=e.getRng(),p.item&&m===p.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(I,[d],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(t){return e.mac?t.metaKey:t.ctrlKey&&!t.altKey}}}),r(F,[I,m,u,d,_],function(e,t,n,r,i){function o(e,t){for(;t&&t!=e;){if(s(t)||a(t))return t;t=t.parentNode}return null}var a=i.isContentEditableFalse,s=i.isContentEditableTrue;return function(i,s){function l(e){var t=s.settings.object_resizing;return t===!1||r.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:e==s.getBody()?!1:s.dom.is(e,t))}function c(t){var n,r,i,o,a;n=t.screenX-L,r=t.screenY-M,U=n*B[2]+H,W=r*B[3]+I,U=5>U?5:U,W=5>W?5:W,i="IMG"==k.nodeName&&s.settings.resize_img_proportional!==!1?!e.modifierPressed(t):e.modifierPressed(t)||"IMG"==k.nodeName&&B[2]*B[3]!==0,i&&(j(n)>j(r)?(W=Y(U*F),U=Y(W/F)):(U=Y(W/F),W=Y(U*F))),_.setStyles(T,{width:U,height:W}),o=B.startPos.x+n,a=B.startPos.y+r,o=o>0?o:0,a=a>0?a:0,_.setStyles(R,{left:o,top:a,display:"block"}),R.innerHTML=U+" × "+W,B[2]<0&&T.clientWidth<=U&&_.setStyle(T,"left",P+(H-U)),B[3]<0&&T.clientHeight<=W&&_.setStyle(T,"top",O+(I-W)),n=X.scrollWidth-K,r=X.scrollHeight-G,n+r!==0&&_.setStyles(R,{left:o-n,top:a-r}),z||(s.fire("ObjectResizeStart",{target:k,width:H,height:I}),z=!0)}function u(){function e(e,t){t&&(k.style[e]||!s.schema.isValid(k.nodeName.toLowerCase(),e)?_.setStyle(k,e,t):_.setAttrib(k,e,t))}z=!1,e("width",U),e("height",W),_.unbind(V,"mousemove",c),_.unbind(V,"mouseup",u),$!=V&&(_.unbind($,"mousemove",c),_.unbind($,"mouseup",u)),_.remove(T),_.remove(R),q&&"TABLE"!=k.nodeName||d(k),s.fire("ObjectResized",{target:k,width:U,height:W}),_.setAttrib(k,"style",_.getAttrib(k,"style")),s.nodeChanged()}function d(e,t,n){var i,o,a,d,h;f(),x(),i=_.getPos(e,X),P=i.x,O=i.y,h=e.getBoundingClientRect(),o=h.width||h.right-h.left,a=h.height||h.bottom-h.top,k!=e&&(C(),k=e,U=W=0),d=s.fire("ObjectSelected",{target:e}),l(e)&&!d.isDefaultPrevented()?S(A,function(e,i){function s(t){L=t.screenX,M=t.screenY,H=k.clientWidth,I=k.clientHeight,F=I/H,B=e,e.startPos={x:o*e[0]+P,y:a*e[1]+O},K=X.scrollWidth,G=X.scrollHeight,T=k.cloneNode(!0),_.addClass(T,"mce-clonedresizable"),_.setAttrib(T,"data-mce-bogus","all"),T.contentEditable=!1,T.unSelectabe=!0,_.setStyles(T,{left:P,top:O,margin:0}),T.removeAttribute("data-mce-selected"),X.appendChild(T),_.bind(V,"mousemove",c),_.bind(V,"mouseup",u),$!=V&&(_.bind($,"mousemove",c),_.bind($,"mouseup",u)),R=_.add(X,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},H+" × "+I)}var l;return t?void(i==t&&s(n)):(l=_.get("mceResizeHandle"+i),l&&_.remove(l),l=_.add(X,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),r.ie&&(l.contentEditable=!1),_.bind(l,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),s(e)}),e.elm=l,void _.setStyles(l,{left:o*e[0]+P-l.offsetWidth/2,top:a*e[1]+O-l.offsetHeight/2}))}):f(),k.setAttribute("data-mce-selected","1")}function f(){var e,t;x(),k&&k.removeAttribute("data-mce-selected");for(e in A)t=_.get("mceResizeHandle"+e),t&&(_.unbind(t),_.remove(t))}function h(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n,r;if(!z&&!s.removed)return S(_.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),r="mousedown"==e.type?e.target:i.getNode(),r=_.$(r).closest(q?"table":"table,img,hr")[0],t(r,X)&&(w(),n=i.getStart(!0),t(n,r)&&t(i.getEnd(!0),r)&&(!q||r!=n&&"IMG"!==n.nodeName))?void d(r):void f()}function p(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function m(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function g(e){var t=e.srcElement,n,r,i,o,a,l,c;n=t.getBoundingClientRect(),l=D.clientX-n.left,c=D.clientY-n.top;for(r in A)if(i=A[r],o=t.offsetWidth*i[0],a=t.offsetHeight*i[1],j(o-l)<8&&j(a-c)<8){B=i;break}z=!0,s.fire("ObjectResizeStart",{target:k,width:k.clientWidth,height:k.clientHeight}),s.getDoc().selection.empty(),d(t,r,D)}function v(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function y(e){return a(o(s.getBody(),e))}function b(e){var t=e.srcElement;if(y(t))return void v(e);if(t!=k){if(s.fire("ObjectSelected",{target:t}),C(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);"IMG"!=t.nodeName&&"TABLE"!=t.nodeName||(f(),k=t,p(t,"resizestart",g))}}function C(){m(k,"resizestart",g)}function x(){for(var e in A){var t=A[e];t.elm&&(_.unbind(t.elm),delete t.elm)}}function w(){try{s.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function N(e){var t;if(q){t=V.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function E(){k=T=null,q&&(C(),m(X,"controlselect",b))}var _=s.dom,S=t.each,k,T,R,A,B,D,L,M,P,O,H,I,F,z,U,W,V=s.getDoc(),$=document,q=r.ie&&r.ie<11,j=Math.abs,Y=Math.round,X=s.getBody(),K,G;A={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var J=".mce-content-body";return s.contentStyles.push(J+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: box-sizing;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+J+" .mce-resizehandle:hover {background: #000}"+J+" img[data-mce-selected],"+J+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+J+" .mce-clonedresizable {position: absolute;"+(r.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+J+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}"),s.on("init",function(){q?(s.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(f(),N(e.target))}),p(X,"controlselect",b),s.on("mousedown",function(e){D=e})):(w(),r.ie>=11&&(s.on("mousedown click",function(e){var t=e.target,n=t.nodeName;z||!/^(TABLE|IMG|HR)$/.test(n)||y(t)||(s.selection.select(t,"TABLE"==n),"mousedown"==e.type&&s.nodeChanged())}),s.dom.bind(X,"mscontrolselect",function(e){function t(e){n.setEditorTimeout(s,function(){s.selection.select(e)})}return y(e.target)?(e.preventDefault(),void t(e.target)):void(/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&t(e.target)))})));var e=n.throttle(function(e){s.composing||h(e)});s.on("nodechange ResizeEditor ResizeWindow drop",e),s.on("keyup compositionend",function(t){k&&"TABLE"==k.nodeName&&e(t)}),s.on("hide blur",f)}),s.on("remove",x),{isResizable:l,showResizeRect:d,hideResizeRect:f,updateResizeRect:h,controlSelect:N,destroy:E}}}),r(z,[],function(){function e(e){return function(){return e}}function t(e){return function(t){return!e(t)}}function n(e,t){return function(n){return e(t(n))}}function r(){var e=a.call(arguments);return function(t){for(var n=0;n<e.length;n++)if(e[n](t))return!0;return!1}}function i(){var e=a.call(arguments); return function(t){for(var n=0;n<e.length;n++)if(!e[n](t))return!1;return!0}}function o(e){var t=a.call(arguments);return t.length-1>=e.length?e.apply(this,t.slice(1)):function(){var e=t.concat([].slice.call(arguments));return o.apply(this,e)}}var a=[].slice;return{constant:e,negate:t,and:i,or:r,curry:o,compose:n}}),r(U,[_,p,k],function(e,t,n){function r(e){return m(e)?!1:d(e)?!f(e.parentNode):h(e)||u(e)||p(e)||c(e)}function i(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode){if(c(e))return!1;if(l(e))return!0}return!0}function o(e){return c(e)?t.reduce(e.getElementsByTagName("*"),function(e,t){return e||l(t)},!1)!==!0:!1}function a(e){return h(e)||o(e)}function s(e,t){return r(e)&&i(e,t)}var l=e.isContentEditableTrue,c=e.isContentEditableFalse,u=e.isBr,d=e.isText,f=e.matchNodeNames("script style textarea"),h=e.matchNodeNames("img input textarea hr iframe video audio object"),p=e.matchNodeNames("table"),m=n.isCaretContainer;return{isCaretCandidate:r,isInEditable:i,isAtomic:a,isEditableCaretCandidate:s}}),r(W,[],function(){function e(e){return e?{left:u(e.left),top:u(e.top),bottom:u(e.bottom),right:u(e.right),width:u(e.width),height:u(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}}function t(t,n){return t=e(t),n?t.right=t.left:(t.left=t.left+t.width,t.right=t.left),t.width=0,t}function n(e,t){return e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right}function r(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2}function i(e,t){return e.bottom<t.top?!0:e.top>t.bottom?!1:r(t.top-e.bottom,e,t)}function o(e,t){return e.top>t.bottom?!0:e.bottom<t.top?!1:r(t.bottom-e.top,e,t)}function a(e,t){return e.left<t.left}function s(e,t){return e.right>t.right}function l(e,t){return i(e,t)?-1:o(e,t)?1:a(e,t)?-1:s(e,t)?1:0}function c(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom}var u=Math.round;return{clone:e,collapse:t,isEqual:n,isAbove:i,isBelow:o,isLeft:a,isRight:s,compare:l,containsXY:c}}),r(V,[],function(){function e(e){return"string"==typeof e&&e.charCodeAt(0)>=768&&t.test(e)}var t=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]");return{isExtendingChar:e}}),r($,[z,_,w,T,U,W,V],function(e,t,n,r,i,o,a){function s(e){return"createRange"in e?e.createRange():n.DOM.createRng()}function l(e){return e&&/[\r\n\t ]/.test(e)}function c(e){var t=e.startContainer,n=e.startOffset,r;return!!(l(e.toString())&&v(t.parentNode)&&(r=t.data,l(r[n-1])||l(r[n+1])))}function u(e){function t(e){var t=e.ownerDocument,n=s(t),r=t.createTextNode("\xa0"),i=e.parentNode,a;return i.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1),a=o.clone(n.getBoundingClientRect()),i.removeChild(r),a}function n(e){var n,r;return r=e.getClientRects(),n=r.length>0?o.clone(r[0]):o.clone(e.getBoundingClientRect()),b(e)&&0===n.left?t(e):n}function r(e,t){return e=o.collapse(e,t),e.width=1,e.right=e.left+1,e}function i(e){0!==e.height&&(u.length>0&&o.isEqual(e,u[u.length-1])||u.push(e))}function l(e,t){var o=s(e.ownerDocument);if(t<e.data.length){if(a.isExtendingChar(e.data[t]))return u;if(a.isExtendingChar(e.data[t-1])&&(o.setStart(e,t),o.setEnd(e,t+1),!c(o)))return i(r(n(o),!1)),u}t>0&&(o.setStart(e,t-1),o.setEnd(e,t),c(o)||i(r(n(o),!1))),t<e.data.length&&(o.setStart(e,t),o.setEnd(e,t+1),c(o)||i(r(n(o),!0)))}var u=[],d,h;if(y(e.container()))return l(e.container(),e.offset()),u;if(f(e.container()))if(e.isAtEnd())h=x(e.container(),e.offset()),y(h)&&l(h,h.data.length),g(h)&&!b(h)&&i(r(n(h),!1));else{if(h=x(e.container(),e.offset()),y(h)&&l(h,0),g(h)&&e.isAtEnd())return i(r(n(h),!1)),u;d=x(e.container(),e.offset()-1),g(d)&&!b(d)&&(p(d)||p(h)||!g(h))&&i(r(n(d),!1)),g(h)&&i(r(n(h),!0))}return u}function d(t,n,r){function i(){return y(t)?0===n:0===n}function o(){return y(t)?n>=t.data.length:n>=t.childNodes.length}function a(){var e;return e=s(t.ownerDocument),e.setStart(t,n),e.setEnd(t,n),e}function l(){return r||(r=u(new d(t,n))),r}function c(){return l().length>0}function f(e){return e&&t===e.container()&&n===e.offset()}function h(e){return x(t,e?n-1:n)}return{container:e.constant(t),offset:e.constant(n),toRange:a,getClientRects:l,isVisible:c,isAtStart:i,isAtEnd:o,isEqual:f,getNode:h}}var f=t.isElement,h=i.isCaretCandidate,p=t.matchStyleValues("display","block table"),m=t.matchStyleValues("float","left right"),g=e.and(f,h,e.negate(m)),v=e.negate(t.matchStyleValues("white-space","pre pre-line pre-wrap")),y=t.isText,b=t.isBr,C=n.nodeIndex,x=r.getNode;return d.fromRangeStart=function(e){return new d(e.startContainer,e.startOffset)},d.fromRangeEnd=function(e){return new d(e.endContainer,e.endOffset)},d.after=function(e){return new d(e.parentNode,C(e)+1)},d.before=function(e){return new d(e.parentNode,C(e))},d}),r(q,[_,w,z,p,$],function(e,t,n,r,i){function o(e){var t=e.parentNode;return v(t)?o(t):t}function a(e){return e?r.reduce(e.childNodes,function(e,t){return v(t)&&"BR"!=t.nodeName?e=e.concat(a(t)):e.push(t),e},[]):[]}function s(e,t){for(;(e=e.previousSibling)&&g(e);)t+=e.data.length;return t}function l(e){return function(t){return e===t}}function c(t){var n,i,s;return n=a(o(t)),i=r.findIndex(n,l(t),t),n=n.slice(0,i+1),s=r.reduce(n,function(e,t,r){return g(t)&&g(n[r-1])&&e++,e},0),n=r.filter(n,e.matchNodeNames(t.nodeName)),i=r.findIndex(n,l(t),t),i-s}function u(e){var t;return t=g(e)?"text()":e.nodeName.toLowerCase(),t+"["+c(e)+"]"}function d(e,t,n){var r=[];for(t=t.parentNode;t!=e&&(!n||!n(t));t=t.parentNode)r.push(t);return r}function f(t,i){var o,a,l=[],c,f,h;return o=i.container(),a=i.offset(),g(o)?c=s(o,a):(f=o.childNodes,a>=f.length?(c="after",a=f.length-1):c="before",o=f[a]),l.push(u(o)),h=d(t,o),h=r.filter(h,n.negate(e.isBogus)),l=l.concat(r.map(h,function(e){return u(e)})),l.reverse().join("/")+","+c}function h(t,n,i){var o=a(t);return o=r.filter(o,function(e,t){return!g(e)||!g(o[t-1])}),o=r.filter(o,e.matchNodeNames(n)),o[i]}function p(e,t){for(var n=e,r=0,o;g(n);){if(o=n.data.length,t>=r&&r+o>=t){e=n,t-=r;break}if(!g(n.nextSibling)){e=n,t=o;break}r+=o,n=n.nextSibling}return t>e.data.length&&(t=e.data.length),new i(e,t)}function m(e,t){var n,o,a;return t?(n=t.split(","),t=n[0].split("/"),a=n.length>1?n[1]:"before",o=r.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),h(e,t[1],parseInt(t[2],10))):null},e),o?g(o)?p(o,parseInt(a,10)):(a="after"===a?y(o)+1:y(o),new i(o.parentNode,a)):null):null}var g=e.isText,v=e.isBogus,y=t.nodeIndex;return{create:f,resolve:m}}),r(j,[d,m,k,q,$,_],function(e,t,n,r,i,o){function a(a){var l=a.dom;this.getBookmark=function(e,c){function u(e,n){var r=0;return t.each(l.select(e),function(e){return"all"!==e.getAttribute("data-mce-bogus")?e==n?!1:void r++:void 0}),r}function d(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function f(e){function t(e,t){var r=e[t?"startContainer":"endContainer"],i=e[t?"startOffset":"endOffset"],o=[],a,s,u=0;if(3==r.nodeType){if(c)for(a=r.previousSibling;a&&3==a.nodeType;a=a.previousSibling)i+=a.nodeValue.length;o.push(i)}else s=r.childNodes,i>=s.length&&s.length&&(u=1,i=Math.max(0,s.length-1)),o.push(l.nodeIndex(s[i],c)+u);for(;r&&r!=n;r=r.parentNode)o.push(l.nodeIndex(r,c));return o}var n=l.getRoot(),r={};return r.start=t(e,!0),a.isCollapsed()||(r.end=t(e)),r}function h(e){function t(e){var t;if(n.isCaretContainer(e)){if(o.isText(e)&&n.isCaretContainerBlock(e)&&(e=e.parentNode),t=e.previousSibling,s(t))return t;if(t=e.nextSibling,s(t))return t}}return t(e.startContainer)||t(e.endContainer)}var p,m,g,v,y,b,C="",x;if(2==e)return b=a.getNode(),y=b?b.nodeName:null,p=a.getRng(),s(b)||"IMG"==y?{name:y,index:u(y,b)}:a.tridentSel?a.tridentSel.getBookmark(e):(b=h(p),b?(y=b.tagName,{name:y,index:u(y,b)}):f(p));if(3==e)return p=a.getRng(),{start:r.create(l.getRoot(),i.fromRangeStart(p)),end:r.create(l.getRoot(),i.fromRangeEnd(p))};if(e)return{rng:a.getRng()};if(p=a.getRng(),g=l.uniqueId(),v=a.isCollapsed(),x="overflow:hidden;line-height:0px",p.duplicate||p.item){if(p.item)return b=p.item(0),y=b.nodeName,{name:y,index:u(y,b)};m=p.duplicate();try{p.collapse(),p.pasteHTML('<span data-mce-type="bookmark" id="'+g+'_start" style="'+x+'">'+C+"</span>"),v||(m.collapse(!1),p.moveToElementText(m.parentElement()),0===p.compareEndPoints("StartToEnd",m)&&m.move("character",-1),m.pasteHTML('<span data-mce-type="bookmark" id="'+g+'_end" style="'+x+'">'+C+"</span>"))}catch(w){return null}}else{if(b=a.getNode(),y=b.nodeName,"IMG"==y)return{name:y,index:u(y,b)};m=d(p.cloneRange()),v||(m.collapse(!1),m.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_end",style:x},C))),p=d(p),p.collapse(!0),p.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_start",style:x},C))}return a.moveToBookmark({id:g,keep:1}),{id:g}},this.moveToBookmark=function(n){function i(e){var t=n[e?"start":"end"],r,i,o,a;if(t){for(o=t[0],i=d,r=t.length-1;r>=1;r--){if(a=i.childNodes,t[r]>a.length-1)return;i=a[t[r]]}3===i.nodeType&&(o=Math.min(t[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(t[0],i.childNodes.length)),e?u.setStart(i,o):u.setEnd(i,o)}return!0}function o(r){var i=l.get(n.id+"_"+r),o,a,s,c,u=n.keep;if(i&&(o=i.parentNode,"start"==r?(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),f=h=o,p=m=a):(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),h=o,m=a),!u)){for(c=i.previousSibling,s=i.nextSibling,t.each(t.grep(i.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});i=l.get(n.id+"_"+r);)l.remove(i,1);c&&s&&c.nodeType==s.nodeType&&3==c.nodeType&&!e.opera&&(a=c.nodeValue.length,c.appendData(s.nodeValue),l.remove(s),"start"==r?(f=h=c,p=m=a):(h=c,m=a))}}function s(t){return!l.isBlock(t)||t.innerHTML||e.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t}function c(){var e,t;return e=l.createRng(),t=r.resolve(l.getRoot(),n.start),e.setStart(t.container(),t.offset()),t=r.resolve(l.getRoot(),n.end),e.setEnd(t.container(),t.offset()),e}var u,d,f,h,p,m;if(n)if(t.isArray(n.start)){if(u=l.createRng(),d=l.getRoot(),a.tridentSel)return a.tridentSel.moveToBookmark(n);i(!0)&&i()&&a.setRng(u)}else"string"==typeof n.start?a.setRng(c(n)):n.id?(o("start"),o("end"),f&&(u=l.createRng(),u.setStart(s(f),p),u.setEnd(s(h),m),a.setRng(u))):n.name?a.select(l.select(n.name)[n.index]):n.rng&&a.setRng(n.rng)}}var s=o.isContentEditableFalse;return a.isBookmarkNode=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},a}),r(Y,[y,H,F,T,j,_,d,m,$],function(e,n,r,i,o,a,s,l,c){function u(e,t,i,a){var s=this;s.dom=e,s.win=t,s.serializer=i,s.editor=a,s.bookmarkManager=new o(s),s.controlSelection=new r(s,a),s.win.getSelection||(s.tridentSel=new n(s))}var d=l.each,f=l.trim,h=s.ie;return u.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='<span id="__caret">_</span>',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('<span id="__mce_tmp">_</span>'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(e){var t=this,n=t.getRng(),r,i,o,a;if(n.duplicate||n.item){if(n.item)return n.item(0);for(o=n.duplicate(),o.collapse(1),r=o.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),i=a=n.parentElement();a=a.parentNode;)if(a==r){r=i;break}return r}return r=n.startContainer,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[Math.min(r.childNodes.length-1,n.startOffset)])),r&&3==r.nodeType?r.parentNode:r},getEnd:function(e){var t=this,n=t.getRng(),r,i;return n.duplicate||n.item?n.item?n.item(0):(n=n.duplicate(),n.collapse(0),r=n.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),r&&"BODY"==r.nodeName?r.lastChild||r:r):(r=n.endContainer,i=n.endOffset,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[i>0?i-1:i])),r&&3==r.nodeType?r.parentNode:r)},getBookmark:function(e,t){return this.bookmarkManager.getBookmark(e,t)},moveToBookmark:function(e){return this.bookmarkManager.moveToBookmark(e)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a,s,l;if(!n.win)return null;if(a=n.win.document,!e&&n.lastFocusBookmark){var c=n.lastFocusBookmark;return c.startContainer?(i=a.createRange(),i.setStart(c.startContainer,c.startOffset),i.setEnd(c.endContainer,c.endOffset)):i=c,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(u){}if(l=n.editor.fire("GetSelectionRange",{range:i}),l.range!==i)return l.range;if(h&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(u){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r,i,o;if(e)if(e.select){n.explicitRange=null;try{e.select()}catch(a){}}else if(n.tridentSel){if(e.cloneRange)try{n.tridentSel.addRange(e)}catch(a){}}else{if(r=n.getSel(),o=n.editor.fire("SetSelectionRange",{range:e}),e=o.range,r){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(a){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}e.collapsed||e.startContainer!=e.endContainer||!r.setBaseAndExtent||s.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(i=e.startContainer.childNodes[e.startOffset],i&&"IMG"==i.tagName&&n.getSel().setBaseAndExtent(i,0,i,1))}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i,o,a,s,l=t.dom.getRoot();return n?(i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r)):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return s.range&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};d(n.selectorChangedData,function(e,t){d(o,function(n){return i.is(n,t)?(r[t]||(d(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),d(r,function(e,n){a[n]||(delete r[n],d(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){function n(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var r,i,o=this,s=o.dom,l=s.getRoot(),c,u,d=0;if(a.isElement(e)){if(t===!1&&(d=e.offsetHeight),"BODY"!=l.nodeName){var f=o.getScrollContainer();if(f)return r=n(e).y-n(f).y+d,u=f.clientHeight,c=f.scrollTop,void((c>r||r+25>c+u)&&(f.scrollTop=c>r?r:r-u+25))}i=s.getViewPort(o.editor.getWin()),r=s.getPos(e).y+d,c=i.y,u=i.h,(r<i.y||r+25>c+u)&&o.editor.getWin().scrollTo(0,c>r?r:r-u+25)}},placeCaretAt:function(e,t){this.setRng(i.getCaretRangeFromPoint(e,t,this.editor.getDoc()))},_moveEndPoint:function(t,n,r){var i=n,o=new e(n,i),a=this.dom.schema.getNonEmptyElements();do{if(3==n.nodeType&&0!==f(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"==n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(s.ie&&s.ie<11&&this.dom.isBlock(n)&&this.dom.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?o.next():o.prev());"BODY"==i.nodeName&&(r?t.setStart(i,0):t.setEnd(i,i.childNodes.length))},getBoundingClientRect:function(){var e=this.getRng();return e.collapsed?c.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){this.win=null,this.controlSelection.destroy()}},u}),r(X,[j,m],function(e,t){function n(t){this.compare=function(n,i){function o(e){var n={};return r(t.getAttribs(e),function(r){var i=r.nodeName.toLowerCase();0!==i.indexOf("_")&&"style"!==i&&0!==i.indexOf("data-")&&(n[i]=t.getAttrib(e,i))}),n}function a(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(n=t[r],"undefined"==typeof n)return!1;if(e[r]!=n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0}return n.nodeName!=i.nodeName?!1:a(o(n),o(i))&&a(t.parseStyle(t.getAttrib(n,"style")),t.parseStyle(t.getAttrib(i,"style")))?!e.isBookmarkNode(n)&&!e.isBookmarkNode(i):!1}}var r=t.each;return n}),r(K,[m],function(e){function t(e,t){function r(e){return e.replace(/%(\w+)/g,"")}var i,o,a=e.dom,s="",l,c;if(c=e.settings.preview_styles,c===!1)return"";if(c||(c="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),"string"==typeof t){if(t=e.formatter.get(t),!t)return;t=t[0]}return i=t.block||t.inline||"span",o=a.create(i),n(t.styles,function(e,t){e=r(e),e&&a.setStyle(o,t,e)}),n(t.attributes,function(e,t){e=r(e),e&&a.setAttrib(o,t,e)}),n(t.classes,function(e){e=r(e),a.hasClass(o,e)||a.addClass(o,e)}),e.fire("PreviewFormats"),a.setStyles(o,{position:"absolute",left:-65535}),e.getBody().appendChild(o),l=a.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,n(c.split(" "),function(t){var n=a.getStyle(o,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=a.getStyle(e.getBody(),t,!0),"#ffffff"==a.toHex(n).toLowerCase())||"color"==t&&"#000000"==a.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(s+="padding:0 2px;"),s+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),a.remove(o),s}var n=e.each;return{getCssText:t}}),r(G,[p,_,g],function(e,t,n){function r(e,t){var n=o[e];n||(o[e]=n=[]),o[e].push(t)}function i(e,t){s(o[e],function(e){e(t)})}var o=[],a=e.filter,s=e.each;return r("pre",function(r){function i(t){return c(t.previousSibling)&&-1!=e.indexOf(u,t.previousSibling)}function o(e,t){n(t).remove(),n(e).append("<br><br>").append(t.childNodes)}var l=r.selection.getRng(),c,u;c=t.matchNodeNames("pre"),l.collapsed||(u=r.selection.getSelectedBlocks(),s(a(a(u,c),i),function(e){o(e.previousSibling,e)}))}),{postProcess:i}}),r(J,[y,T,j,X,m,K,G],function(e,t,n,r,i,o,a){return function(s){function l(e){return e.nodeType&&(e=e.nodeName),!!s.schema.getTextBlockElements()[e.toLowerCase()]}function c(e){return/^(TH|TD)$/.test(e.nodeName)}function u(e){return e&&/^(IMG)$/.test(e.nodeName)}function d(e,t){return Y.getParents(e,t,Y.getRoot())}function f(e){return 1===e.nodeType&&"_mce_caret"===e.id}function h(){g({valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,t,n){ue(n,function(t,n){Y.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),ue("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){g(e,{block:e,remove:"all"})}),g(s.settings.formats)}function p(){s.addShortcut("meta+b","bold_desc","Bold"),s.addShortcut("meta+i","italic_desc","Italic"),s.addShortcut("meta+u","underline_desc","Underline");for(var e=1;6>=e;e++)s.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);s.addShortcut("access+7","",["FormatBlock",!1,"p"]),s.addShortcut("access+8","",["FormatBlock",!1,"div"]),s.addShortcut("access+9","",["FormatBlock",!1,"address"])}function m(e){return e?j[e]:j}function g(e,t){e&&("string"!=typeof e?ue(e,function(e,t){g(t,e)}):(t=t.length?t:[t],ue(t,function(e){e.deep===oe&&(e.deep=!e.selector),e.split===oe&&(e.split=!e.selector||e.inline),e.remove===oe&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),j[e]=t))}function v(e){return e&&j[e]&&delete j[e],j}function y(e,t){var n=m(t);if(n)for(var r=0;r<n.length;r++)if(n[r].inherit===!1&&Y.is(e,n[r].selector))return!0;return!1}function b(e){var t;return s.dom.getParent(e,function(e){return t=s.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function C(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=b(e.parentNode),s.dom.getStyle(e,"color")&&t?s.dom.setStyle(e,"text-decoration",t):s.dom.getStyle(e,"text-decoration")===t&&s.dom.setStyle(e,"text-decoration",null))}function x(t,n,r){function i(e,t){if(t=t||d,e){if(t.onformat&&t.onformat(e,t,n,r),ue(t.styles,function(t,r){Y.setStyle(e,r,M(t,n))}),t.styles){var i=Y.getAttrib(e,"style");i&&e.setAttribute("data-mce-style",i)}ue(t.attributes,function(t,r){Y.setAttrib(e,r,M(t,n))}),ue(t.classes,function(t){t=M(t,n),Y.hasClass(e,t)||Y.addClass(e,t)})}}function o(){function t(t,n){var i=new e(n);for(r=i.prev2();r;r=i.prev2()){if(3==r.nodeType&&r.data.length>0)return r;if(r.childNodes.length>1||r==t||"BR"==r.tagName)return r}}var n=s.selection.getRng(),i=n.startContainer,o=n.endContainer;if(i!=o&&0===n.endOffset){var a=t(i,o),l=3==a.nodeType?a.data.length:a.childNodes.length;n.setEnd(a,l)}return n}function c(e,r,o){var a=[],s,c,h=!0;s=d.inline||d.block,c=Y.create(s),i(c),K.walk(e,function(e){function r(e){var m,v,y,b,C;return C=h,m=e.nodeName.toLowerCase(),v=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&ae(e)&&(C=h,h="true"===ae(e),b=!0),B(m,"br")?(p=0,void(d.block&&Y.remove(e))):d.wrapper&&E(e,t,n)?void(p=0):h&&!b&&d.block&&!d.wrapper&&l(m)&&G(v,s)?(e=Y.rename(e,s),i(e),a.push(e),void(p=0)):d.selector&&(ue(u,function(t){return"collapsed"in t&&t.collapsed!==g?void 0:Y.is(e,t.selector)&&!f(e)?(i(e,t),y=!0,!1):void 0}),!d.inline||y)?void(p=0):void(!h||b||!G(s,m)||!G(v,s)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||f(e)||d.inline&&J(e)?(p=0,ue(de(e.childNodes),r),b&&(h=C),p=0):(p||(p=Y.clone(c,ne),e.parentNode.insertBefore(p,e),a.push(p)),p.appendChild(e)))}var p;ue(e,r)}),d.links===!0&&ue(a,function(e){function t(e){"A"===e.nodeName&&i(e,d),ue(de(e.childNodes),t)}t(e)}),ue(a,function(e){function r(e){var t=0;return ue(e.childNodes,function(e){P(e)||ce(e)||t++}),t}function o(e){var t,n;return ue(e.childNodes,function(e){return 1!=e.nodeType||ce(e)||f(e)?void 0:(t=e,ne)}),t&&!ce(t)&&A(t,d)&&(n=Y.clone(t,ne),i(n),Y.replace(n,e,re),Y.remove(t,1)),n||e}var s;if(s=r(e),(a.length>1||!J(e))&&0===s)return void Y.remove(e,1);if(d.inline||d.wrapper){if(d.exact||1!==s||(e=o(e)),ue(u,function(t){ue(Y.select(t.inline,e),function(e){ce(e)||F(t,n,e,t.exact?e:null)})}),E(e.parentNode,t,n))return Y.remove(e,1),e=0,re;d.merge_with_parents&&Y.getParent(e.parentNode,function(r){return E(r,t,n)?(Y.remove(e,1),e=0,re):void 0}),e&&d.merge_siblings!==!1&&(e=W(U(e),e),e=W(e,U(e,re)))}})}var u=m(t),d=u[0],h,p,g=!r&&X.isCollapsed();if("false"!==ae(X.getNode())){if(d){if(r)r.nodeType?(p=Y.createRng(),p.setStartBefore(r),p.setEndAfter(r),c(H(p,u),null,!0)):c(r,null,!0);else if(g&&d.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length)$("apply",t,n);else{var v=s.selection.getNode();Q||!u[0].defaultBlock||Y.getParent(v,Y.isBlock)||x(u[0].defaultBlock),s.selection.setRng(o()),h=X.getBookmark(),c(H(X.getRng(re),u),h),d.styles&&(d.styles.color||d.styles.textDecoration)&&(fe(v,C,"childNodes"),C(v)),X.moveToBookmark(h),q(X.getRng(re)),s.nodeChanged()}a.postProcess(t,s)}}else{r=X.getNode();for(var y=0,b=u.length;b>y;y++)if(u[y].ceFalseOverride&&Y.is(r,u[y].selector))return void i(r,u[y])}}function w(e,t,n,r){function i(e){var n,r,o,a,s;if(1===e.nodeType&&ae(e)&&(a=y,y="true"===ae(e),s=!0),n=de(e.childNodes),y&&!s)for(r=0,o=h.length;o>r&&!F(h[r],t,e,e);r++);if(p.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(y=a)}}function o(n){var i;return ue(d(n.parentNode).reverse(),function(n){var o;i||"_start"==n.id||"_end"==n.id||(o=E(n,e,t,r),o&&o.split!==!1&&(i=n))}),i}function a(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode, o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=Y.clone(o,ne),c=0;c<h.length;c++)if(F(h[c],t,a,a)){a=0;break}a&&(s&&a.appendChild(s),l||(l=a),s=a)}!i||p.mixed&&J(e)||(n=Y.split(e,n)),s&&(r.parentNode.insertBefore(s,r),l.appendChild(r))}return n}function l(e){return a(o(e),e,e,!0)}function u(e){var t=Y.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return ce(n)&&(n=n[e?"firstChild":"lastChild"]),3==n.nodeType&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),Y.remove(t,!0),n}function f(e){var t,n,r=e.commonAncestorContainer;if(e=H(e,h,re),p.split){if(t=V(e,re),n=V(e),t!=n){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"==t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&c(n)&&n.firstChild&&(n=n.firstChild||n),Y.isChildOf(t,n)&&!J(n)&&!c(t)&&!c(n))return t=O(t,"span",{id:"_start","data-mce-type":"bookmark"}),l(t),void(t=u(re));t=O(t,"span",{id:"_start","data-mce-type":"bookmark"}),n=O(n,"span",{id:"_end","data-mce-type":"bookmark"}),l(t),l(n),t=u(re),n=u()}else t=n=l(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=Z(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=Z(n)+1}K.walk(e,function(e){ue(e,function(e){i(e),1===e.nodeType&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===b(e.parentNode)&&F({deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})}var h=m(e),p=h[0],g,v,y=!0;if(n)return void(n.nodeType?(v=Y.createRng(),v.setStartBefore(n),v.setEndAfter(n),f(v)):f(n));if("false"!==ae(X.getNode()))X.isCollapsed()&&p.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length?$("remove",e,t,r):(g=X.getBookmark(),f(X.getRng(re)),X.moveToBookmark(g),p.inline&&_(e,t,X.getStart())&&q(X.getRng(!0)),s.nodeChanged());else{n=X.getNode();for(var C=0,x=h.length;x>C&&(!h[C].ceFalseOverride||!F(h[C],t,n,n));C++);}}function N(e,t,n){var r=m(e);!_(e,t,n)||"toggle"in r[0]&&!r[0].toggle?x(e,t,n):w(e,t,n)}function E(e,t,n,r){function i(e,t,i){var o,a,s=t[i],l;if(t.onmatch)return t.onmatch(e,t,i);if(s)if(s.length===oe){for(o in s)if(s.hasOwnProperty(o)){if(a="attributes"===i?Y.getAttrib(e,o):D(e,o),r&&!a&&!t.exact)return;if((!r||t.exact)&&!B(a,L(M(s[o],n),o)))return}}else for(l=0;l<s.length;l++)if("attributes"===i?Y.getAttrib(e,s[l]):D(e,s[l]))return t;return t}var o=m(t),a,s,l;if(o&&e)for(s=0;s<o.length;s++)if(a=o[s],A(e,a)&&i(e,a,"attributes")&&i(e,a,"styles")){if(l=a.classes)for(s=0;s<l.length;s++)if(!Y.hasClass(e,l[s]))return;return a}}function _(e,t,n){function r(n){var r=Y.getRoot();return n===r?!1:(n=Y.getParent(n,function(n){return y(n,e)?!0:n.parentNode===r||!!E(n,e,t,!0)}),E(n,e,t))}var i;return n?r(n):(n=X.getNode(),r(n)?re:(i=X.getStart(),i!=n&&r(i)?re:ne))}function S(e,t){var n,r=[],i={};return n=X.getStart(),Y.getParent(n,function(n){var o,a;for(o=0;o<e.length;o++)a=e[o],!i[a]&&E(n,a,t)&&(i[a]=!0,r.push(a))},Y.getRoot()),r}function k(e){var t=m(e),n,r,i,o,a;if(t)for(n=X.getStart(),r=d(n),o=t.length-1;o>=0;o--){if(a=t[o].selector,!a||t[o].defaultBlock)return re;for(i=r.length-1;i>=0;i--)if(Y.is(r[i],a))return re}return ne}function T(e,t,n){var r;return ie||(ie={},r={},s.on("NodeChange",function(e){var t=d(e.element),n={};t=i.grep(t,function(e){return 1==e.nodeType&&!e.getAttribute("data-mce-bogus")}),ue(ie,function(e,i){ue(t,function(o){return E(o,i,{},e.similar)?(r[i]||(ue(e,function(e){e(!0,{node:o,format:i,parents:t})}),r[i]=e),n[i]=e,!1):y(o,i)?!1:void 0})}),ue(r,function(i,o){n[o]||(delete r[o],ue(i,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),ue(e.split(","),function(e){ie[e]||(ie[e]=[],ie[e].similar=n),ie[e].push(t)}),this}function R(e){return o.getCssText(s,e)}function A(e,t){return B(e,t.inline)?re:B(e,t.block)?re:t.selector?1==e.nodeType&&Y.is(e,t.selector):void 0}function B(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function D(e,t){return L(Y.getStyle(e,t),t)}function L(e,t){return"color"!=t&&"backgroundColor"!=t||(e=Y.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function M(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function P(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function O(e,t,n){var r=Y.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function H(t,n,r){function i(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=Y.getRoot(),3==r.nodeType&&!P(r)&&(e?v>0:b<r.nodeValue.length))return r;for(;;){if(!n[0].block_expand&&J(i))return i;for(o=i[a];o;o=o[a])if(!ce(o)&&!P(o)&&!t(o))return i;if(i==s||i.parentNode==s){r=i;break}i=i.parentNode}return r}function o(e,t){for(t===oe&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)e=e.childNodes[t],e&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}}function a(e){for(var t=e;t;){if(1===t.nodeType&&ae(t))return"false"===ae(t)?t:e;t=t.parentNode}return e}function c(t,n,i){function o(e,t){var n,o,a=e.nodeValue;return"undefined"==typeof t&&(t=i?a.length:0),i?(n=a.lastIndexOf(" ",t),o=a.lastIndexOf("\xa0",t),n=n>o?n:o,-1===n||r||n++):(n=a.indexOf(" ",t),o=a.indexOf("\xa0",t),n=-1!==n&&(-1===o||o>n)?n:o),n}var a,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(a=new e(t,Y.getParent(t,J)||s.getBody());l=a[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(J(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function u(e,r){var i,o,a,s;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=d(e),o=0;o<i.length;o++)for(a=0;a<n.length;a++)if(s=n[a],!("collapsed"in s&&s.collapsed!==t.collapsed)&&Y.is(i[o],s.selector))return i[o];return e}function f(e,t){var r,i=Y.getRoot();if(n[0].wrapper||(r=Y.getParent(e,n[0].block,i)),r||(r=Y.getParent(3==e.nodeType?e.parentNode:e,function(e){return e!=i&&l(e)})),r&&n[0].wrapper&&(r=d(r,"ul,ol").reverse()[0]||r),!r)for(r=e;r[t]&&!J(r[t])&&(r=r[t],!B(r,"br")););return r||e}var h,p,m,g=t.startContainer,v=t.startOffset,y=t.endContainer,b=t.endOffset;if(1==g.nodeType&&g.hasChildNodes()&&(h=g.childNodes.length-1,g=g.childNodes[v>h?h:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(h=y.childNodes.length-1,y=y.childNodes[b>h?h:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=a(g),y=a(y),(ce(g.parentNode)||ce(g))&&(g=ce(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(ce(y.parentNode)||ce(y))&&(y=ce(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=c(g,v,!0),m&&(g=m.container,v=m.offset),m=c(y,b),m&&(y=m.container,b=m.offset)),p=o(y,b),p.node)){for(;p.node&&0===p.offset&&p.node.previousSibling;)p=o(p.node.previousSibling);p.node&&p.offset>0&&3===p.node.nodeType&&" "===p.node.nodeValue.charAt(p.offset-1)&&p.offset>1&&(y=p.node,y.splitText(p.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=i(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=i())),n[0].selector&&n[0].expand!==ne&&!n[0].inline&&(g=u(g,"previousSibling"),y=u(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(J(g)||(g=i(!0)),J(y)||(y=i()))),1==g.nodeType&&(v=Z(g),g=g.parentNode),1==y.nodeType&&(b=Z(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function I(e,t){return t.links&&"A"==e.tagName}function F(e,t,n,r){var i,o,a;if(!A(n,e)&&!I(n,e))return ne;if("all"!=e.remove)for(ue(e.styles,function(i,o){i=L(M(i,t),o),"number"==typeof o&&(o=i,r=0),(e.remove_similar||!r||B(D(r,o),i))&&Y.setStyle(n,o,""),a=1}),a&&""===Y.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),ue(e.attributes,function(e,i){var o;if(e=M(e,t),"number"==typeof i&&(i=e,r=0),!r||B(Y.getAttrib(r,i),e)){if("class"==i&&(e=Y.getAttrib(n,i),e&&(o="",ue(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void Y.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),te.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),ue(e.classes,function(e){e=M(e,t),r&&!Y.hasClass(r,e)||Y.removeClass(n,e)}),o=Y.getAttribs(n),i=0;i<o.length;i++){var s=o[i].nodeName;if(0!==s.indexOf("_")&&0!==s.indexOf("data-"))return ne}return"none"!=e.remove?(z(n,e),re):void 0}function z(e,t){function n(e,t,n){return e=U(e,t,n),!e||"BR"==e.nodeName||J(e)}var r=e.parentNode,i;t.block&&(Q?r==Y.getRoot()&&(t.list_block&&B(e,t.list_block)||ue(de(e.childNodes),function(e){G(Q,e.nodeName.toLowerCase())?i?i.appendChild(e):(i=O(e,Q),Y.setAttribs(i,s.settings.forced_root_block_attrs)):i=0})):J(e)&&!J(r)&&(n(e,ne)||n(e.firstChild,re,1)||e.insertBefore(Y.create("br"),e.firstChild),n(e,re)||n(e.lastChild,ne,1)||e.appendChild(Y.create("br")))),t.selector&&t.inline&&!B(t.inline,e)||Y.remove(e,1)}function U(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1==e.nodeType||!P(e))return e}function W(e,t){function n(e,t){for(i=e;i;i=i[t]){if(3==i.nodeType&&0!==i.nodeValue.length)return e;if(1==i.nodeType&&!ce(i))return i}return e}var i,o,a=new r(Y);if(e&&t&&(e=n(e,"previousSibling"),t=n(t,"nextSibling"),a.compare(e,t))){for(i=e.nextSibling;i&&i!=t;)o=i,i=i.nextSibling,e.appendChild(o);return Y.remove(t),ue(de(t.childNodes),function(t){e.appendChild(t)}),e}return t}function V(t,n){var r,i,o;return r=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1==r.nodeType&&(o=r.childNodes.length-1,!n&&i&&i--,r=r.childNodes[i>o?o:i]),3===r.nodeType&&n&&i>=r.nodeValue.length&&(r=new e(r,s.getBody()).next()||r),3!==r.nodeType||n||0!==i||(r=new e(r,s.getBody()).prev()||r),r}function $(t,n,r,i){function o(e){var t=Y.create("span",{id:g,"data-mce-bogus":!0,style:v?"color:red":""});return e&&t.appendChild(s.getDoc().createTextNode(ee)),t}function a(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==ee||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function c(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=X.getRng(!0),a(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),Y.remove(e)):(n=u(e),n.nodeValue.charAt(0)===ee&&(n.deleteData(0,1),r.startContainer==n&&r.startOffset>0&&r.setStart(n,r.startOffset-1),r.endContainer==n&&r.endOffset>0&&r.setEnd(n,r.endOffset-1)),Y.remove(e,1)),X.setRng(r);else if(e=c(X.getStart()),!e)for(;e=Y.get(g);)d(e,!1)}function f(){var e,t,i,a,s,l,d;e=X.getRng(!0),a=e.startOffset,l=e.startContainer,d=l.nodeValue,t=c(X.getStart()),t&&(i=u(t)),d&&a>0&&a<d.length&&/\w/.test(d.charAt(a))&&/\w/.test(d.charAt(a-1))?(s=X.getBookmark(),e.collapse(!0),e=H(e,m(n)),e=K.split(e),x(n,r,e),X.moveToBookmark(s)):(t&&i.nodeValue===ee?x(n,r,t):(t=o(!0),i=t.firstChild,e.insertNode(t),a=1,x(n,r,t)),X.setCursorLocation(i,a))}function h(){var e=X.getRng(!0),t,a,s,c,u,d,f=[],h,p;for(t=e.startContainer,a=e.startOffset,u=t,3==t.nodeType&&(a!=t.nodeValue.length&&(c=!0),u=u.parentNode);u;){if(E(u,n,r,i)){d=u;break}u.nextSibling&&(c=!0),f.push(u),u=u.parentNode}if(d)if(c)s=X.getBookmark(),e.collapse(!0),e=H(e,m(n),!0),e=K.split(e),w(n,r,e),X.moveToBookmark(s);else{for(p=o(),u=p,h=f.length-1;h>=0;h--)u.appendChild(Y.clone(f[h],!1)),u=u.firstChild;u.appendChild(Y.doc.createTextNode(ee)),u=u.firstChild;var g=Y.getParent(d,l);g&&Y.isEmpty(g)?d.parentNode.replaceChild(p,d):Y.insertAfter(p,d),X.setCursorLocation(u,1),Y.isEmpty(d)&&Y.remove(d)}}function p(){var e;e=c(X.getStart()),e&&!Y.isEmpty(e)&&fe(e,function(e){1!=e.nodeType||e.id===g||Y.isEmpty(e)||Y.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var g="_mce_caret",v=s.settings.caret_debug;s._hasCaretEvents||(le=function(){var e=[],t;if(a(c(X.getStart()),e))for(t=e.length;t--;)Y.setAttrib(e[t],"data-mce-bogus","1")},se=function(e){var t=e.keyCode;d(),8==t&&X.isCollapsed()&&X.getStart().innerHTML==ee&&d(c(X.getStart())),37!=t&&39!=t||d(c(X.getStart())),p()},s.on("SetContent",function(e){e.selection&&p()}),s._hasCaretEvents=!0),"apply"==t?f():h()}function q(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if((t.startContainer!=t.endContainer||!u(t.startContainer.childNodes[t.startOffset]))&&(3==n.nodeType&&r>=n.nodeValue.length&&(r=Z(n),n=n.parentNode,i=!0),1==n.nodeType))for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,Y.getParent(n,Y.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!P(a))return l=Y.create("a",{"data-mce-bogus":"all"},ee),a.parentNode.insertBefore(l,a),t.setStart(a,0),X.setRng(t),void Y.remove(l)}var j={},Y=s.dom,X=s.selection,K=new t(Y),G=s.schema.isValidChild,J=Y.isBlock,Q=s.settings.forced_root_block,Z=Y.nodeIndex,ee="\ufeff",te=/^(src|href|style)$/,ne=!1,re=!0,ie,oe,ae=Y.getContentEditable,se,le,ce=n.isBookmarkNode,ue=i.each,de=i.grep,fe=i.walk,he=i.extend;he(this,{get:m,register:g,unregister:v,apply:x,remove:w,toggle:N,match:_,matchAll:S,matchNode:E,canApply:k,formatChanged:T,getCssText:R}),h(),p(),s.on("BeforeGetContent",function(e){le&&"raw"!=e.format&&le()}),s.on("mouseup keydown",function(e){se&&se(e)})}}),r(Q,[I,d],function(e,t){return function(e){function n(){return e.serializer.getTrimmedContent()}function r(t){e.setDirty(t)}function i(e){o.typing=!1,o.add({},e)}var o=this,a=0,s=[],l,c,u=0;return e.on("init",function(){o.add()}),e.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&o.beforeChange()}),e.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&i(e)}),e.on("ObjectResizeStart Cut",function(){o.beforeChange()}),e.on("SaveContent ObjectResized blur",i),e.on("DragEnd",i),e.on("KeyUp",function(a){var l=a.keyCode;a.isDefaultPrevented()||((l>=33&&36>=l||l>=37&&40>=l||45==l||13==l||a.ctrlKey)&&(i(),e.nodeChanged()),(46==l||8==l||t.mac&&(91==l||93==l))&&e.nodeChanged(),c&&o.typing&&(e.isDirty()||(r(s[0]&&n()!=s[0].content),e.isDirty()&&e.fire("change",{level:s[0],lastLevel:null})),e.fire("TypingUndo"),c=!1,e.nodeChanged()))}),e.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented()){if(t>=33&&36>=t||t>=37&&40>=t||45==t)return void(o.typing&&i(e));var n=e.ctrlKey&&!e.altKey||e.metaKey;!(16>t||t>20)||224==t||91==t||o.typing||n||(o.beforeChange(),o.typing=!0,o.add({},e),c=!0)}}),e.on("MouseDown",function(e){o.typing&&i(e)}),e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),e.on("AddUndo Undo Redo ClearUndos",function(t){t.isDefaultPrevented()||e.nodeChanged()}),o={data:s,typing:!1,beforeChange:function(){u||(l=e.selection.getBookmark(2,!0))},add:function(t,i){var o,c=e.settings,d;if(t=t||{},t.content=n(),u||e.removed)return null;if(d=s[a],e.fire("BeforeAddUndo",{level:t,lastLevel:d,originalEvent:i}).isDefaultPrevented())return null;if(d&&d.content==t.content)return null;if(s[a]&&(s[a].beforeBookmark=l),c.custom_undo_redo_levels&&s.length>c.custom_undo_redo_levels){for(o=0;o<s.length-1;o++)s[o]=s[o+1];s.length--,a=s.length}t.bookmark=e.selection.getBookmark(2,!0),a<s.length-1&&(s.length=a+1),s.push(t),a=s.length-1;var f={level:t,lastLevel:d,originalEvent:i};return e.fire("AddUndo",f),a>0&&(r(!0),e.fire("change",f)),t},undo:function(){var t;return o.typing&&(o.add(),o.typing=!1),a>0&&(t=s[--a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.beforeBookmark),r(!0),e.fire("undo",{level:t})),t},redo:function(){var t;return a<s.length-1&&(t=s[++a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.bookmark),r(!0),e.fire("redo",{level:t})),t},clear:function(){s=[],a=0,o.typing=!1,o.data=s,e.fire("ClearUndos")},hasUndo:function(){return a>0||o.typing&&s[0]&&n()!=s[0].content},hasRedo:function(){return a<s.length-1&&!this.typing},transact:function(e){o.beforeChange();try{u++,e()}finally{u--}return o.add()},extra:function(t,n){var r,i;o.transact(t)&&(i=s[a].bookmark,r=s[a-1],e.setContent(r.content,{format:"raw"}),e.selection.moveToBookmark(r.beforeBookmark),o.transact(n)&&(s[a-1].beforeBookmark=i))}}}}),r(Z,[y,T,d],function(e,t,n){var r=n.ie&&n.ie<11;return function(i){function o(o){function h(e){return e&&a.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==a.getContentEditable(e)}function p(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}function m(e){var t;a.isBlock(e)&&(t=s.getRng(),e.appendChild(a.create("span",null,"\xa0")),s.select(e),e.lastChild.outerHTML="",s.setRng(t))}function g(e){var t=e,n=[],r;if(t){for(;t=t.firstChild;){if(a.isBlock(t))return;1!=t.nodeType||d[t.nodeName.toLowerCase()]||n.push(t)}for(r=n.length;r--;)t=n[r],!t.hasChildNodes()||t.firstChild==t.lastChild&&""===t.firstChild.nodeValue?a.remove(t):"A"==t.nodeName&&" "===(t.innerText||t.textContent)&&a.remove(t)}}function v(t){function r(e){for(;e;){if(1==e.nodeType||3==e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}var i,o,l,c=t,u;if(t){if(n.ie&&n.ie<9&&M&&M.firstChild&&M.firstChild==M.lastChild&&"BR"==M.firstChild.tagName&&a.remove(M.firstChild),/^(LI|DT|DD)$/.test(t.nodeName)){var d=r(t.firstChild);d&&/^(UL|OL|DL)$/.test(d.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(l=a.createRng(),n.ie||t.normalize(),t.hasChildNodes()){for(i=new e(t,t);o=i.current();){if(3==o.nodeType){l.setStart(o,0),l.setEnd(o,0);break}if(f[o.nodeName.toLowerCase()]){l.setStartBefore(o),l.setEndBefore(o);break}c=o,o=i.next()}o||(l.setStart(c,0),l.setEnd(c,0))}else"BR"==t.nodeName?t.nextSibling&&a.isBlock(t.nextSibling)?((!P||9>P)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}}function y(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function b(e){e.innerHTML=r?"":'<br data-mce-bogus="1">'}function C(e){var t=D,n,i,o,s=u.getTextInlineElements();if(e||"TABLE"==z?(n=a.create(e||W),y(n)):n=M.cloneNode(!1),o=n,l.keep_styles!==!1)do if(s[t.nodeName]){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while((t=t.parentNode)&&t!=B);return r||(o.innerHTML='<br data-mce-bogus="1">'),n}function x(t){var n,r,i;if(3==D.nodeType&&(t?L>0:L<D.nodeValue.length))return!1;if(D.parentNode==M&&V&&!t)return!0;if(t&&1==D.nodeType&&D==M.firstChild)return!0;if("TABLE"===D.nodeName||D.previousSibling&&"TABLE"==D.previousSibling.nodeName)return V&&!t||!V&&t;for(n=new e(D,M),3==D.nodeType&&(t&&0===L?n.prev():t||L!=D.nodeValue.length||n.next());r=n.current();){if(1===r.nodeType){if(!r.getAttribute("data-mce-bogus")&&(i=r.nodeName.toLowerCase(),d[i]&&"br"!==i))return!1}else if(3===r.nodeType&&!/^[ \t\r\n]*$/.test(r.nodeValue))return!1;t?n.prev():n.next()}return!0}function w(e,t){var n,r,o,s,l,c,d=W||"P";if(r=a.getParent(e,a.isBlock),!r||!h(r)){if(r=r||B,c=r==i.getBody()||p(r)?r.nodeName.toLowerCase():r.parentNode.nodeName.toLowerCase(),!r.hasChildNodes())return n=a.create(d),y(n),r.appendChild(n),R.setStart(n,0),R.setEnd(n,0),n;for(s=e;s.parentNode!=r;)s=s.parentNode;for(;s&&!a.isBlock(s);)o=s,s=s.previousSibling;if(o&&u.isValidChild(c,d.toLowerCase())){for(n=a.create(d),y(n),o.parentNode.insertBefore(n,o),s=o;s&&!a.isBlock(s);)l=s.nextSibling,n.appendChild(s),s=l;R.setStart(e,t),R.setEnd(e,t)}}return e}function N(){function e(e){for(var t=F[e?"firstChild":"lastChild"];t&&1!=t.nodeType;)t=t[e?"nextSibling":"previousSibling"];return t===M}function t(){var e=F.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:F}if(F!=i.getBody()){var n=F.parentNode.nodeName;/^(OL|UL|LI)$/.test(n)&&(W="LI"),H=W?C(W):a.create("BR"),e(!0)&&e()?"LI"==n?a.insertAfter(H,t()):a.replace(H,F):e(!0)?"LI"==n?(a.insertAfter(H,t()),H.appendChild(a.doc.createTextNode(" ")),H.appendChild(F)):F.parentNode.insertBefore(H,F):e()?(a.insertAfter(H,t()),m(H)):(F=t(),A=R.cloneRange(),A.setStartAfter(M),A.setEndAfter(F),I=A.extractContents(),"LI"==W&&"LI"==I.firstChild.nodeName?(H=I.firstChild,a.insertAfter(I,F)):(a.insertAfter(I,F),a.insertAfter(H,F))),a.remove(M),v(H),c.add()}}function E(){i.execCommand("InsertLineBreak",!1,o)}function _(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function S(e){var t=a.getRoot(),n,r;for(n=e;n!==t&&"false"!==a.getContentEditable(n);)"true"===a.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function k(e){var t;r||(e.normalize(),t=e.lastChild,t&&!/^(left|right)$/gi.test(a.getStyle(t,"float",!0))||a.add(e,"br"))}function T(){H=/^(H[1-6]|PRE|FIGURE)$/.test(z)&&"HGROUP"!=U?C(W):C(),l.end_container_on_empty_block&&h(F)&&a.isEmpty(M)?H=a.split(F,M):a.insertAfter(H,M),v(H)}var R,A,B,D,L,M,P,O,H,I,F,z,U,W,V;if(R=s.getRng(!0),!o.isDefaultPrevented()){if(!R.collapsed)return void i.execCommand("Delete");if(new t(a).normalize(R),D=R.startContainer,L=R.startOffset,W=(l.force_p_newlines?"p":"")||l.forced_root_block,W=W?W.toUpperCase():"",P=a.doc.documentMode,O=o.shiftKey,1==D.nodeType&&D.hasChildNodes()&&(V=L>D.childNodes.length-1,D=D.childNodes[Math.min(L,D.childNodes.length-1)]||D,L=V&&3==D.nodeType?D.nodeValue.length:0),B=S(D)){if(c.beforeChange(),!a.isBlock(B)&&B!=a.getRoot())return void(W&&!O||E());if((W&&!O||!W&&O)&&(D=w(D,L)),M=a.getParent(D,a.isBlock),F=M?a.getParent(M.parentNode,a.isBlock):null,z=M?M.nodeName.toUpperCase():"",U=F?F.nodeName.toUpperCase():"","LI"!=U||o.ctrlKey||(M=F,z=U),/^(LI|DT|DD)$/.test(z)){if(!W&&O)return void E();if(a.isEmpty(M))return void N()}if("PRE"==z&&l.br_in_pre!==!1){if(!O)return void E()}else if(!W&&!O&&"LI"!=z||W&&O)return void E();W&&M===i.getBody()||(W=W||"P",x()?T():x(!0)?(H=M.parentNode.insertBefore(C(),M),m(H),v(M)):(A=R.cloneRange(),A.setEndAfter(M),I=A.extractContents(),_(I),H=I.firstChild,a.insertAfter(I,M),g(H),k(M),a.isEmpty(M)&&b(M),H.normalize(),a.isEmpty(H)?(a.remove(H),T()):v(H)),a.setAttrib(H,"id",""),i.fire("NewBlock",{newBlock:H}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements(),f=u.getMoveCaretBeforeOnEnterElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(ee,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,h,p,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){p=t,t=t.nextSibling,r.remove(p);continue}h||(h=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(h,t),g=!0),p=t,t=t.nextSibling,h.appendChild(p)}else h=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(te,[z,y,_,$,k,U],function(e,t,n,r,i,o){function a(e){return e>0}function s(e){return 0>e}function l(e,n,r,i,o){var l=new t(e,i);if(s(n)){if(C(e)&&(e=l.prev(!0),r(e)))return e;for(;e=l.prev(o);)if(r(e))return e}if(a(n)){if(C(e)&&(e=l.next(!0),r(e)))return e;for(;e=l.next(o);)if(r(e))return e}return null}function c(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode)if(b(e))return e;return t}function u(e,t){for(;e&&e!=t;){if(x(e))return e;e=e.parentNode}return null}function d(e,t,n){return u(e.container(),n)==u(t.container(),n)}function f(e,t,n){return c(e.container(),n)==c(t.container(),n)}function h(e,t){var n,r;return t?(n=t.container(),r=t.offset(),E(n)?n.childNodes[r+e]:null):null}function p(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n}function m(e,t,n){return u(t,e)==u(n,e)}function g(e,t,n){var r,i;for(i=e?"previousSibling":"nextSibling";n&&n!=t;){if(r=n[i],w(r)&&(r=r[i]),C(r)){if(m(t,r,n))return r;break}if(_(r))break;n=n.parentNode}return null}function v(e,t,r){var o,a,s,l,c=N(g,!0,t),u=N(g,!1,t);if(a=r.startContainer,s=r.startOffset,i.isCaretContainerBlock(a)){if(E(a)||(a=a.parentNode),l=a.getAttribute("data-mce-caret"),"before"==l&&(o=a.nextSibling,C(o)))return S(o);if("after"==l&&(o=a.previousSibling,C(o)))return k(o)}if(!r.collapsed)return r;if(n.isText(a)){if(w(a)){if(1===e){if(o=u(a))return S(o);if(o=c(a))return k(o)}if(-1===e){if(o=c(a))return k(o);if(o=u(a))return S(o)}return r}if(i.endsWithCaretContainer(a)&&s>=a.data.length-1)return 1===e&&(o=u(a))?S(o):r;if(i.startsWithCaretContainer(a)&&1>=s)return-1===e&&(o=c(a))?k(o):r;if(s===a.data.length)return o=u(a),o?S(o):r;if(0===s)return o=c(a),o?k(o):r}return r}function y(e,t){return C(h(e,t))}var b=n.isContentEditableTrue,C=n.isContentEditableFalse,x=n.matchStyleValues("display","block table table-cell table-caption"),w=i.isCaretContainer,N=e.curry,E=n.isElement,_=o.isCaretCandidate,S=N(p,!0),k=N(p,!1);return{isForwards:a,isBackwards:s,findNode:l,getEditingHost:c,getParentBlock:u,isInSameBlock:d,isInSameEditingHost:f,isBeforeContentEditableFalse:N(y,0),isAfterContentEditableFalse:N(y,-1),normalizeRange:v}}),r(ne,[_,U,$,te,p,z],function(e,t,n,r,i,o){function a(e,t){for(var n=[];e&&e!=t;)n.push(e),e=e.parentNode;return n}function s(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null}function l(e,t){if(m(e)){if(v(t.previousSibling)&&!f(t.previousSibling))return n.before(t);if(f(t))return n(t,0)}if(g(e)){if(v(t.nextSibling)&&!f(t.nextSibling))return n.after(t);if(f(t))return n(t,t.data.length)}return g(e)?p(t)?n.before(t):n.after(t):n.before(t)}function c(t,i){var o;return e.isBr(t)?(o=u(1,n.after(t),i),o?!r.isInSameBlock(n.before(t),n.before(o),i):!1):!1}function u(e,t,p){var C,x,w,N,E,_,S;if(!h(p)||!t)return null;if(S=t,C=S.container(),x=S.offset(),f(C)){if(g(e)&&x>0)return n(C,--x);if(m(e)&&x<C.length)return n(C,++x);w=C}else{if(g(e)&&x>0&&(N=s(C,x-1),v(N)))return!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,E.data.length):n.after(E):f(N)?n(N,N.data.length):n.before(N);if(m(e)&&x<C.childNodes.length&&(N=s(C,x),v(N)))return c(N,p)?u(e,n.after(N),p):!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,0):n.before(E):f(N)?n(N,0):n.after(N);w=S.getNode()}return(m(e)&&S.isAtEnd()||g(e)&&S.isAtStart())&&(w=r.findNode(w,e,o.constant(!0),p,!0),b(w))?l(e,w):(N=r.findNode(w,e,b,p),_=i.last(i.filter(a(C,p),d)),!_||N&&_.contains(N)?N?l(e,N):null:S=m(e)?n.after(_):n.before(_))}var d=e.isContentEditableFalse,f=e.isText,h=e.isElement,p=e.isBr,m=r.isForwards,g=r.isBackwards,v=t.isCaretCandidate,y=t.isAtomic,b=t.isEditableCaretCandidate;return function(e){return{next:function(t){return u(1,t,e)},prev:function(t){return u(-1,t,e)}}}}),r(re,[m,ne,$],function(e,t,n){var r=function(e){var t=e.firstChild,n=e.lastChild;return t&&"meta"===t.name&&(t=t.next),n&&"mce_marker"===n.attr("id")&&(n=n.prev),t&&t===n?"ul"===t.name||"ol"===t.name:!1},i=function(e){var t=e.firstChild,n=e.lastChild;return t&&"META"===t.nodeName&&t.parentNode.removeChild(t),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),e},o=function(e,t,n){var r=t.serialize(n),o=e.createFragment(r);return i(o)},a=function(t){return e.grep(t.childNodes,function(e){return"LI"===e.nodeName})},s=function(e){return!e.firstChild},l=function(e){return e.length>0&&s(e[e.length-1])?e.slice(0,-1):e},c=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},u=function(e,t){return!!c(e,t)},d=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]},f=function(e,r){var i=n.before(e),o=new t(r),a=o.next(i);return a?a.toRange():null},h=function(e,r){var i=n.after(e),o=new t(r),a=o.prev(i);return a?a.toRange():null},p=function(t,n,r,i){var o=d(t,i),a=t.parentNode;return a.insertBefore(o[0],t),e.each(n,function(e){a.insertBefore(e,t)}),a.insertBefore(o[1],t),a.removeChild(t),h(n[n.length-1],r)},m=function(t,n,r){var i=t.parentNode;return e.each(n,function(e){i.insertBefore(e,t)}),f(t,r)},g=function(e,t,n,r){return r.insertAfter(t.reverse(),e),h(t[0],n)},v=function(e,r,i,s){var u=o(r,e,s),d=c(r,i.startContainer),f=l(a(u.firstChild)),h=1,v=2,y=r.getRoot(),b=function(e){var o=n.fromRangeStart(i),a=new t(r.getRoot()),s=e===h?a.prev(o):a.next(o);return s?c(r,s.getNode())!==d:!0};return b(h)?m(d,f,y):b(v)?g(d,f,y,r):p(d,f,y,i)};return{isListFragment:r,insertAtCaret:v,isParentBlockLi:u,trimListItems:l,listItems:a}}),r(ie,[d,m,P,ne,$,X,_,re],function(e,t,n,r,i,o,a,s){var l=a.matchNodeNames("td th"),c=function(a,c,u){function d(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=D.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i<r.length?e=e.replace(/ (<br>|)$/," "):t("nextSibling")||(e=e.replace(/( | )(<br>|)$/," "))),e}function f(){var e,t,n;e=D.getRng(!0),t=e.startContainer,n=e.startOffset,3==t.nodeType&&e.collapsed&&("\xa0"===t.data[n]?(t.deleteData(n,1),/[\u00a0| ]$/.test(c)||(c+=" ")):"\xa0"===t.data[n-1]&&(t.deleteData(n-1,1),/[\u00a0| ]$/.test(c)||(c=" "+c)))}function h(){if(A){var e=a.getBody(),n=new o(L);t.each(L.select("*[data-mce-fragment]"),function(t){for(var r=t.parentNode;r&&r!=e;r=r.parentNode)B[t.nodeName.toLowerCase()]&&n.compare(r,t)&&L.remove(t,!0)})}}function p(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}function m(e){t.each(e.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")})}function g(e){return!!e.getAttribute("data-mce-fragment")}function v(e){return e&&!a.schema.getShortEndedElements()[e.nodeName]}function y(t){function n(e){for(var t=a.getBody();e&&e!==t;e=e.parentNode)if("false"===a.dom.getContentEditable(e))return e;return null}function o(e){var t=i.fromRangeStart(e),n=new r(a.getBody());return t=n.next(t),t?t.toRange():void 0}var s,c,u;if(t){if(D.scrollIntoView(t),s=n(t))return L.remove(t),void D.select(s);S=L.createRng(),k=t.previousSibling,k&&3==k.nodeType?(S.setStart(k,k.nodeValue.length),e.ie||(T=t.nextSibling,T&&3==T.nodeType&&(k.appendData(T.data),T.parentNode.removeChild(T)))):(S.setStartBefore(t),S.setEndBefore(t)),c=L.getParent(t,L.isBlock),L.remove(t),c&&L.isEmpty(c)&&(a.$(c).empty(),S.setStart(c,0),S.setEnd(c,0),l(c)||g(c)||!(u=o(S))?L.add(c,L.create("br",{"data-mce-bogus":"1"})):(S=u,L.remove(c))),D.setRng(S)}}var b,C,x,w,N,E,_,S,k,T,R,A,B=a.schema.getTextInlineElements(),D=a.selection,L=a.dom;/^ | $/.test(c)&&(c=d(c)),b=a.parser,A=u.merge,C=new n({validate:a.settings.validate},a.schema),R='<span id="mce_marker" data-mce-type="bookmark">​</span>',E={content:c,format:"html",selection:!0},a.fire("BeforeSetContent",E),c=E.content,-1==c.indexOf("{$caret}")&&(c+="{$caret}"),c=c.replace(/\{\$caret\}/,R),S=D.getRng();var M=S.startContainer||(S.parentElement?S.parentElement():null),P=a.getBody();M===P&&D.isCollapsed()&&L.isBlock(P.firstChild)&&v(P.firstChild)&&L.isEmpty(P.firstChild)&&(S=L.createRng(),S.setStart(P.firstChild,0),S.setEnd(P.firstChild,0),D.setRng(S)),D.isCollapsed()||(a.selection.setRng(a.selection.getRng()),a.getDoc().execCommand("Delete",!1,null), f()),x=D.getNode();var O={context:x.nodeName.toLowerCase(),data:u.data};if(N=b.parse(c,O),u.paste===!0&&s.isListFragment(N)&&s.isParentBlockLi(L,x))return S=s.insertAtCaret(C,L,a.selection.getRng(!0),N),a.selection.setRng(S),void a.fire("SetContent",E);if(p(N),k=N.lastChild,"mce_marker"==k.attr("id"))for(_=k,k=k.prev;k;k=k.walk(!0))if(3==k.type||!L.isBlock(k.name)){a.schema.isValidChild(k.parent.name,"span")&&k.parent.insert(_,k,"br"===k.name);break}if(a._selectionOverrides.showBlockCaretContainer(x),O.invalid){for(D.setContent(R),x=D.getNode(),w=a.getBody(),9==x.nodeType?x=k=w:k=x;k!==w;)x=k,k=k.parentNode;c=x==w?w.innerHTML:L.getOuterHTML(x),c=C.serialize(b.parse(c.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return C.serialize(N)}))),x==w?L.setHTML(w,c):L.setOuterHTML(x,c)}else c=C.serialize(N),k=x.firstChild,T=x.lastChild,!k||k===T&&"BR"===k.nodeName?L.setHTML(x,c):D.setContent(c);h(),y(L.get("mce_marker")),m(a.getBody()),a.fire("SetContent",E),a.addVisual()},u=function(e){var n;return"string"!=typeof e?(n=t.extend({paste:e.paste,data:{paste:e.paste}},e),{content:e.content,details:n}):{content:e,details:{}}},d=function(e,t){var n=u(t);c(e,n.content,n.details)};return{insertAtCaret:d}}),r(oe,[d,m,T,y,ie],function(e,n,r,i,o){var a=n.each,s=n.extend,l=n.map,c=n.inArray,u=n.explode,d=e.ie&&e.ie<11,f=!0,h=!1;return function(n){function p(e,t,r,i){var o,s,l=0;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||i&&i.skip_focus||n.focus(),i=n.fire("BeforeExecCommand",{command:e,ui:t,value:r}),i.isDefaultPrevented())return!1;if(s=e.toLowerCase(),o=B.exec[s])return o(s,t,r),n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;if(a(n.plugins,function(i){return i.execCommand&&i.execCommand(e,t,r)?(n.fire("ExecCommand",{command:e,ui:t,value:r}),l=!0,!1):void 0}),l)return l;if(n.theme&&n.theme.execCommand&&n.theme.execCommand(e,t,r))return n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;try{l=n.getDoc().execCommand(e,t,r)}catch(c){}return l?(n.fire("ExecCommand",{command:e,ui:t,value:r}),!0):!1}function m(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.state[e])return t(e);try{return n.getDoc().queryCommandState(e)}catch(r){}return!1}}function g(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.value[e])return t(e);try{return n.getDoc().queryCommandValue(e)}catch(r){}}}function v(e,t){t=t||"exec",a(e,function(e,n){a(n.toLowerCase().split(","),function(n){B[t][n]=e})})}function y(e,t,r){e=e.toLowerCase(),B.exec[e]=function(e,i,o,a){return t.call(r||n,i,o,a)}}function b(e){if(e=e.toLowerCase(),B.exec[e])return!0;try{return n.getDoc().queryCommandSupported(e)}catch(t){}return!1}function C(e,t,r){e=e.toLowerCase(),B.state[e]=function(){return t.call(r||n)}}function x(e,t,r){e=e.toLowerCase(),B.value[e]=function(){return t.call(r||n)}}function w(e){return e=e.toLowerCase(),!!B.exec[e]}function N(e,r,i){return r===t&&(r=h),i===t&&(i=null),n.getDoc().execCommand(e,r,i)}function E(e){return A.match(e)}function _(e,r){A.toggle(e,r?{value:r}:t),n.nodeChanged()}function S(e){L=R.getBookmark(e)}function k(){R.moveToBookmark(L)}var T,R,A,B={state:{},exec:{},value:{}},D=n.settings,L;n.on("PreInit",function(){T=n.dom,R=n.selection,D=n.settings,A=n.formatter}),s(this,{execCommand:p,queryCommandState:m,queryCommandValue:g,queryCommandSupported:b,addCommands:v,addCommand:y,addQueryStateHandler:C,addQueryValueHandler:x,hasCustomCommand:w}),v({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(t){var r=n.getDoc(),i;try{N(t)}catch(o){i=f}if("paste"!==t||r.queryCommandEnabled(t)||(i=!0),i||!r.queryCommandSupported(t)){var a=n.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");e.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),n.notificationManager.open({text:a,type:"error"})}},unlink:function(){if(R.isCollapsed()){var e=R.getNode();return void("A"==e.tagName&&n.dom.remove(e,!0))}A.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"==t&&(t="justify"),a("left,center,right,justify".split(","),function(e){t!=e&&A.remove("align"+e)}),"none"!=t&&_("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;N(e),t=T.getParent(R.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(S(),T.split(n,t),k()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){_(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){_(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=u(D.font_size_style_values),r=u(D.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),_(e,n)},RemoveFormat:function(e){A.remove(e)},mceBlockQuote:function(){_("blockquote")},FormatBlock:function(e,t,n){return _(n||"p")},mceCleanup:function(){var e=R.getBookmark();n.setContent(n.getContent({cleanup:f}),{cleanup:f}),R.moveToBookmark(e)},mceRemoveNode:function(e,t,r){var i=r||R.getNode();i!=n.getBody()&&(S(),n.dom.remove(i,f),k())},mceSelectNodeDepth:function(e,t,r){var i=0;T.getParent(R.getNode(),function(e){return 1==e.nodeType&&i++==r?(R.select(e),h):void 0},n.getBody())},mceSelectNode:function(e,t,n){R.select(n)},mceInsertContent:function(e,t,r){o.insertAtCaret(n,r)},mceInsertRawHTML:function(e,t,r){R.setContent("tiny_mce_marker"),n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return r}))},mceToggleFormat:function(e,t,n){_(n)},mceSetContent:function(e,t,r){n.setContent(r)},"Indent,Outdent":function(e){var t,r,i;t=D.indentation,r=/[a-z%]+$/i.exec(t),t=parseInt(t,10),m("InsertUnorderedList")||m("InsertOrderedList")?N(e):(D.forced_root_block||T.getParent(R.getNode(),T.isBlock)||A.apply("div"),a(R.getSelectedBlocks(),function(o){if("false"!==T.getContentEditable(o)&&"LI"!=o.nodeName){var a=n.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==T.getStyle(o,"direction",!0)?"Right":"Left","outdent"==e?(i=Math.max(0,parseInt(o.style[a]||0,10)-t),T.setStyle(o,a,i?i+r:"")):(i=parseInt(o.style[a]||0,10)+t+r,T.setStyle(o,a,i))}}))},mceRepaint:function(){},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual,n.addVisual()},mceReplaceContent:function(e,t,r){n.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,R.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=T.getParent(R.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||A.remove("link"),n.href&&A.apply("link",n,r)},selectAll:function(){var e=T.getRoot(),t;R.getRng().setStart?(t=T.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),R.setRng(t)):(t=R.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){N("Delete");var e=n.getBody();T.isEmpty(e)&&(n.setContent(""),e.firstChild&&T.isBlock(e.firstChild)?n.selection.setCursorLocation(e.firstChild,0):n.selection.setCursorLocation(e,0))},mceNewDocument:function(){n.setContent("")},InsertLineBreak:function(e,t,o){function a(){for(var e=new i(m,v),t,r=n.schema.getNonEmptyElements();t=e.next();)if(r[t.nodeName.toLowerCase()]||t.length>0)return!0}var s=o,l,c,u,h=R.getRng(!0);new r(T).normalize(h);var p=h.startOffset,m=h.startContainer;if(1==m.nodeType&&m.hasChildNodes()){var g=p>m.childNodes.length-1;m=m.childNodes[Math.min(p,m.childNodes.length-1)]||m,p=g&&3==m.nodeType?m.nodeValue.length:0}var v=T.getParent(m,T.isBlock),y=v?v.nodeName.toUpperCase():"",b=v?T.getParent(v.parentNode,T.isBlock):null,C=b?b.nodeName.toUpperCase():"",x=s&&s.ctrlKey;"LI"!=C||x||(v=b,y=C),m&&3==m.nodeType&&p>=m.nodeValue.length&&(d||a()||(l=T.create("br"),h.insertNode(l),h.setStartAfter(l),h.setEndAfter(l),c=!0)),l=T.create("br"),h.insertNode(l);var w=T.doc.documentMode;return d&&"PRE"==y&&(!w||8>w)&&l.parentNode.insertBefore(T.doc.createTextNode("\r"),l),u=T.create("span",{}," "),l.parentNode.insertBefore(u,l),R.scrollIntoView(u),T.remove(u),c?(h.setStartBefore(l),h.setEndBefore(l)):(h.setStartAfter(l),h.setEndAfter(l)),R.setRng(h),n.undoManager.add(),f}}),v({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=R.isCollapsed()?[T.getParent(R.getNode(),T.isBlock)]:R.getSelectedBlocks(),r=l(n,function(e){return!!A.matchNode(e,t)});return-1!==c(r,f)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return E(e)},mceBlockQuote:function(){return E("blockquote")},Outdent:function(){var e;if(D.inline_styles){if((e=T.getParent(R.getStart(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f;if((e=T.getParent(R.getEnd(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f}return m("InsertUnorderedList")||m("InsertOrderedList")||!D.inline_styles&&!!T.getParent(R.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=T.getParent(R.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),v({"FontSize,FontName":function(e){var t=0,n;return(n=T.getParent(R.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),v({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}),r(ae,[m],function(e){function t(e,o){var a=this,s,l;if(e=r(e),o=a.settings=o||{},s=o.base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(a.source=e);var c=0===e.indexOf("//");0!==e.indexOf("/")||c||(e=(s?s.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(l=o.base_uri?o.base_uri.path:new t(location.href).directory,""===o.base_uri.protocol?e="//mce_host"+a.toAbsPath(l,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(s&&s.protocol||"http")+"://mce_host"+a.toAbsPath(l,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(i,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),a[t]=r}),s&&(a.protocol||(a.protocol=s.protocol),a.userInfo||(a.userInfo=s.userInfo),a.port||"mce_host"!==a.host||(a.port=s.port),a.host&&"mce_host"!==a.host||(a.host=s.host),a.source=""),c&&(a.protocol="")}var n=e.each,r=e.trim,i="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),o={ftp:21,http:80,https:443,mailto:25};return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(n&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=o[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.length<n.length)for(o=0,a=n.length;a>o;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}},t.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},t}),r(se,[m],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r=this;if(!o&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],"function"==typeof f&&c[d]?u[d]=s(d,f):u[d]=f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(le,[m],function(e){function t(t){function n(){return!1}function r(){return!0}function i(e,i){var o,s,l,c;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=u),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=r},i.stopPropagation=function(){i.isPropagationStopped=r},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=r},i.isDefaultPrevented=n,i.isPropagationStopped=n,i.isImmediatePropagationStopped=n),t.beforeFire&&t.beforeFire(i),o=d[e])for(s=0,l=o.length;l>s;s++){if(c=o[s],c.once&&a(e,c.func),i.isImmediatePropagationStopped())return i.stopPropagation(),i;if(c.func.call(u,i)===!1)return i.preventDefault(),i}return i}function o(t,r,i,o){var a,s,l;if(r===!1&&(r=n),r)for(r={func:r},o&&e.extend(r,o),s=t.toLowerCase().split(" "),l=s.length;l--;)t=s[l],a=d[t],a||(a=d[t]=[],f(t,!0)),i?a.unshift(r):a.push(r);return c}function a(e,t){var n,r,i,o,a;if(e)for(o=e.toLowerCase().split(" "),n=o.length;n--;){if(e=o[n],r=d[e],!e){for(i in d)f(i,!1),delete d[i];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),d[e]=r);else r.length=0;r.length||(f(e,!1),delete d[e])}}else{for(e in d)f(e,!1);d={}}return c}function s(e,t,n){return o(e,t,n,{once:!0})}function l(e){return e=e.toLowerCase(),!(!d[e]||0===d[e].length)}var c=this,u,d={},f;t=t||{},u=t.scope||c,f=t.toggleEvent||n,c.fire=i,c.on=o,c.off=a,c.once=s,c.has=l}var n=e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," ");return t.isNative=function(e){return!!n[e.toLowerCase()]},t}),r(ce,[],function(){function e(e){this.create=e.create}return e.create=function(t,n){return new e({create:function(e,r){function i(t){e.set(r,t.value)}function o(e){t.set(n,e.value)}var a;return e.on("change:"+r,o),t.on("change:"+n,i),a=e._bindings,a||(a=e._bindings=[],e.on("destroy",function(){for(var e=a.length;e--;)a[e]()})),a.push(function(){t.off("change:"+n,i)}),t.get(n)}})},e}),r(ue,[le],function(e){function t(t){return t._eventDispatcher||(t._eventDispatcher=new e({scope:t,toggleEvent:function(n,r){e.isNative(n)&&t.toggleNativeEvent&&t.toggleNativeEvent(n,r)}})),t._eventDispatcher}return{fire:function(e,n,r){var i=this;if(i.removed&&"remove"!==e)return n;if(n=t(i).fire(e,n,r),r!==!1&&i.parent)for(var o=i.parent();o&&!n.isPropagationStopped();)o.fire(e,n,!1),o=o.parent();return n},on:function(e,n,r){return t(this).on(e,n,r)},off:function(e,n){return t(this).off(e,n)},once:function(e,n){return t(this).once(e,n)},hasEventListeners:function(e){return t(this).has(e)}}}),r(de,[ce,ue,se,m],function(e,t,n,r){function i(e){return e.nodeType>0}function o(e,t){var n,a;if(e===t)return!0;if(null===e||null===t)return e===t;if("object"!=typeof e||"object"!=typeof t)return e===t;if(r.isArray(t)){if(e.length!==t.length)return!1;for(n=e.length;n--;)if(!o(e[n],t[n]))return!1}if(i(e)||i(t))return e===t;a={};for(n in t){if(!o(e[n],t[n]))return!1;a[n]=!0}for(n in e)if(!a[n]&&!o(e[n],t[n]))return!1;return!0}return n.extend({Mixins:[t],init:function(t){var n,r;t=t||{};for(n in t)r=t[n],r instanceof e&&(t[n]=r.create(this,n));this.data=t},set:function(t,n){var r,i,a=this.data[t];if(n instanceof e&&(n=n.create(this,t)),"object"==typeof t){for(r in t)this.set(r,t[r]);return this}return o(a,n)||(this.data[t]=n,i={target:this,name:t,value:n,oldValue:a},this.fire("change:"+t,i),this.fire("change",i)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(t){return e.create(this,t)},destroy:function(){this.fire("destroy")}})}),r(fe,[se],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.classes.contains(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.pseudo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a<n.length;a++)">"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,h,p;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,p=e,h=0,i=o-1;i>=0;i--)for(c=a[i];p;){if(c.pseudo)for(f=p.parent().items(),u=d=f.length;u--&&f[u]!==p;);for(s=0,l=c.length;l>s;s++)if(!c[s](p,u,d)){s=l+1;break}if(s===l){h++;break}if(i===o-1)break;p=p.parent()}if(h===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(he,[m,fe,se],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].classes.contains(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(e){return this.each(function(t){t.classes.add(e)})},removeClass:function(e){return this.each(function(t){t.classes.remove(e)})}},e.each("fire on off show hide append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(pe,[d,m,w],function(e,t,n){var r=0,i={id:function(){return"mceu_"+r++},create:function(e,r,i){var o=document.createElement(e);return n.DOM.setAttribs(o,r),"string"==typeof i?o.innerHTML=i:t.each(i,function(e){e.nodeType&&o.appendChild(e)}),o},createFragment:function(e){return n.DOM.createFragment(e)},getWindowSize:function(){return n.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return n.DOM.getPos(e,t||i.getContainer())},getContainer:function(){return e.container?e.container:document.body},getViewPort:function(e){return n.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return n.DOM.addClass(e,t)},removeClass:function(e,t){return n.DOM.removeClass(e,t)},hasClass:function(e,t){return n.DOM.hasClass(e,t)},toggleClass:function(e,t,r){return n.DOM.toggleClass(e,t,r)},css:function(e,t,r){return n.DOM.setStyle(e,t,r)},getRuntimeStyle:function(e,t){return n.DOM.getStyle(e,t,!0)},on:function(e,t,r,i){return n.DOM.bind(e,t,r,i)},off:function(e,t,r){return n.DOM.unbind(e,t,r)},fire:function(e,t,r){return n.DOM.fire(e,t,r)},innerHtml:function(e,t){n.DOM.setHTML(e,t)}};return i}),r(me,[],function(){return{parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}}}}),r(ge,[m],function(e){function t(){}function n(e){this.cls=[],this.cls._map={},this.onchange=e||t,this.prefix=""}return e.extend(n.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){for(var t=0;t<this.cls.length&&this.cls[t]!==e;t++);this.cls.splice(t,1),delete this.cls._map[e],this._change()}return this},toggle:function(e,t){var n=this.contains(e);return n!==t&&(n?this.remove(e):this.add(e),this._change()),this},contains:function(e){return!!this.cls._map[e]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),n.prototype.toString=function(){var e;if(this.clsValue)return this.clsValue;e="";for(var t=0;t<this.cls.length;t++)t>0&&(e+=" "),e+=this.prefix+this.cls[t];return e},n}),r(ve,[u],function(e){var t={},n;return{add:function(r){var i=r.parent();if(i){if(!i._layout||i._layout.isNative())return;t[i._id]||(t[i._id]=i),n||(n=!0,e.requestAnimationFrame(function(){var e,r;n=!1;for(e in t)r=t[e],r.state.get("rendered")&&r.reflow();t={}},document.body))}},remove:function(e){t[e._id]&&delete t[e._id]}}}),r(ye,[se,m,le,de,he,pe,g,me,ge,ve],function(e,t,n,r,i,o,a,s,l,c){function u(e){return e._eventDispatcher||(e._eventDispatcher=new n({scope:e,toggleEvent:function(t,r){r&&n.isNative(t)&&(e._nativeEvents||(e._nativeEvents={}),e._nativeEvents[t]=!0,e.state.get("rendered")&&d(e))}})),e._eventDispatcher}function d(e){function t(t){var n=e.getParentCtrl(t.target);n&&n.fire(t.type,t)}function n(){var e=c._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),c._lastHoverCtrl=null)}function r(t){var n=e.getParentCtrl(t.target),r=c._lastHoverCtrl,i=0,o,a,s;if(n!==r){if(c._lastHoverCtrl=n,a=n.parents().toArray().reverse(),a.push(n),r){for(s=r.parents().toArray().reverse(),s.push(r),i=0;i<s.length&&a[i]===s[i];i++);for(o=s.length-1;o>=i;o--)r=s[o],r.fire("mouseleave",{target:r.getEl()})}for(o=i;o<a.length;o++)n=a[o],n.fire("mouseenter",{target:n.getEl()})}}function i(t){t.preventDefault(),"mousewheel"==t.type?(t.deltaY=-1/40*t.wheelDelta,t.wheelDeltaX&&(t.deltaX=-1/40*t.wheelDeltaX)):(t.deltaX=0,t.deltaY=t.detail),t=e.fire("wheel",t)}var o,s,l,c,u,d;if(u=e._nativeEvents){for(l=e.parents().toArray(),l.unshift(e),o=0,s=l.length;!c&&s>o;o++)c=l[o]._eventsRoot;for(c||(c=l[l.length-1]||e),e._eventsRoot=c,s=o,o=0;s>o;o++)l[o]._eventsRoot=c;var p=c._delegates;p||(p=c._delegates={});for(d in u){if(!u)return!1;"wheel"!==d||h?("mouseenter"===d||"mouseleave"===d?c._hasMouseEnter||(a(c.getEl()).on("mouseleave",n).on("mouseover",r),c._hasMouseEnter=1):p[d]||(a(c.getEl()).on(d,t),p[d]=!0),u[d]=!1):f?a(e.getEl()).on("mousewheel",i):a(e.getEl()).on("DOMMouseScroll",i)}}}var f="onmousewheel"in document,h=!1,p="mce-",m,g=0,v={Statics:{classPrefix:p},isRtl:function(){return m.rtl},classPrefix:p,init:function(e){function n(e){var t;for(e=e.split(" "),t=0;t<e.length;t++)i.classes.add(e[t])}var i=this,o,c;i.settings=e=t.extend({},i.Defaults,e),i._id=e.id||"mceu_"+g++,i._aria={role:e.role},i._elmCache={},i.$=a,i.state=new r({visible:!0,active:!1,disabled:!1,value:""}),i.data=new r(e.data),i.classes=new l(function(){i.state.get("rendered")&&(i.getEl().className=this.toString())}),i.classes.prefix=i.classPrefix,o=e.classes,o&&(i.Defaults&&(c=i.Defaults.classes,c&&o!=c&&n(c)),n(o)),t.each("title text name visible disabled active value".split(" "),function(t){t in e&&i[t](e[t])}),i.on("click",function(){return i.disabled()?!1:void 0}),i.settings=e,i.borderBox=s.parseBox(e.border),i.paddingBox=s.parseBox(e.padding),i.marginBox=s.parseBox(e.margin),e.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){return o.getContainer()},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},initLayoutRect:function(){var e=this,t=e.settings,n,r,i=e.getEl(),a,l,c,u,d,f,h,p;n=e.borderBox=e.borderBox||s.measureBox(i,"border"),e.paddingBox=e.paddingBox||s.measureBox(i,"padding"),e.marginBox=e.marginBox||s.measureBox(i,"margin"),p=o.getSize(i),f=t.minWidth,h=t.minHeight,c=f||p.width,u=h||p.height,a=t.width,l=t.height,d=t.autoResize,d="undefined"!=typeof d?d:!a&&!l,a=a||c,l=l||u;var m=n.left+n.right,g=n.top+n.bottom,v=t.maxWidth||65535,y=t.maxHeight||65535;return e._layoutRect=r={x:t.x||0,y:t.y||0,w:a,h:l,deltaW:m,deltaH:g,contentW:a-m,contentH:l-g,innerW:a-m,innerH:l-g,startMinWidth:f||0,startMinHeight:h||0,minW:Math.min(c,v),minH:Math.min(u,y),maxW:v,maxH:y,autoResize:d,scrollW:0},e._lastLayoutRect={},r},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,l;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=i<n.minW?n.minW:i,i=i>n.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=i<n.minH?n.minH:i,i=i>n.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=i<n.minW-o?n.minW-o:i,i=i>n.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=i<n.minH-a?n.minH-a:i,i=i>n.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,r.x===n.x&&r.y===n.y&&r.w===n.w&&r.h===n.h||(l=m.repaintControls,l&&l.map&&!l.map[t._id]&&(l.push(t),l.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o,a,s,l,c,u;c=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,i=e._layoutRect,l=e._lastRepaintRect||{},o=e.borderBox,a=o.left+o.right,s=o.top+o.bottom,i.x!==l.x&&(t.left=c(i.x)+"px",l.x=i.x),i.y!==l.y&&(t.top=c(i.y)+"px",l.y=i.y),i.w!==l.w&&(u=c(i.w-a),t.width=(u>=0?u:0)+"px",l.w=i.w),i.h!==l.h&&(u=c(i.h-s),t.height=(u>=0?u:0)+"px",l.h=i.h),e._hasBody&&i.innerW!==l.innerW&&(u=c(i.innerW),r=e.getEl("body"),r&&(n=r.style,n.width=(u>=0?u:0)+"px"),l.innerW=i.innerW),e._hasBody&&i.innerH!==l.innerH&&(u=c(i.innerH),r=r||e.getEl("body"),r&&(n=n||r.style,n.height=(u>=0?u:0)+"px"),l.innerH=i.innerH),e._lastRepaintRect=l,e.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,o.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){function n(e){var t,n;return"string"!=typeof e?e:function(i){return t||r.parentsAndSelf().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t?t.call(n,i):(i.action=e,void this.fire("execute",i))}}var r=this;return u(r).on(e,n(t)),r},off:function(e,t){return u(this).off(e,t),this},fire:function(e,t,n){var r=this;if(t=t||{},t.control||(t.control=r),t=u(r).fire(e,t),n!==!1&&r.parent)for(var i=r.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return u(this).has(e)},parents:function(e){var t=this,n,r=new i;for(n=t.parent();n;n=n.parent())r.add(n);return e&&(r=r.filter(e)),r},parentsAndSelf:function(e){return new i(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=a("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return m.translate?m.translate(e):e},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),r,i; if(e.items){var o=e.items().toArray();for(i=o.length;i--;)o[i].remove()}n&&n.items&&(r=[],n.items().each(function(t){t!==e&&r.push(t)}),n.items().set(r),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&a(t).off();var s=e.getRoot().controlIdLookup;return s&&delete s[e._id],t&&t.parentNode&&t.parentNode.removeChild(t),e.state.set("rendered",!1),e.state.destroy(),e.fire("remove"),e},renderBefore:function(e){return a(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return a(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var e=this,t=e.settings,n,r,i,o,s;e.$el=a(e.getEl()),e.state.set("rendered",!0);for(o in t)0===o.indexOf("on")&&e.on(o.substr(2),t[o]);if(e._eventsRoot){for(i=e.parent();!s&&i;i=i.parent())s=i._eventsRoot;if(s)for(o in s._nativeEvents)e._nativeEvents[o]=!0}d(e),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e.settings.border&&(r=e.borderBox,e.$el.css({"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var u in e._aria)e.aria(u,e._aria[u]);e.state.get("visible")===!1&&(e.getEl().style.display="none"),e.bindStates(),e.state.on("change:visible",function(t){var n=t.value,r;e.state.get("rendered")&&(e.getEl().style.display=n===!1?"none":"",e.getEl().getBoundingClientRect()),r=e.parent(),r&&(r._lastRect=null),e.fire(n?"show":"hide"),c.add(e)}),e.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){c.remove(this);var e=this.parent();return e._layout&&!e._layout.isNative()&&e.reflow(),this}};return t.each("text title visible disabled active value".split(" "),function(e){v[e]=function(t){return 0===arguments.length?this.state.get(e):("undefined"!=typeof t&&this.state.set(e,t),this)}}),m=e.extend(v)}),r(be,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(Ce,[],function(){return function(e){function t(e){return e&&1===e.nodeType}function n(e){return e=e||C,t(e)?e.getAttribute("role"):null}function r(e){for(var t,r=e||C;r=r.parentNode;)if(t=n(r))return t}function i(e){var n=C;return t(n)?n.getAttribute("aria-"+e):void 0}function o(e){var t=e.tagName.toUpperCase();return"INPUT"==t||"TEXTAREA"==t||"SELECT"==t}function a(e){return o(e)&&!e.hidden?!0:!!/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(n(e))}function s(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){a(e)&&n.push(e);for(var r=0;r<e.childNodes.length;r++)t(e.childNodes[r])}}var n=[];return t(e||b.getEl()),n}function l(e){var t,n;e=e||x,n=e.parents().toArray(),n.unshift(e);for(var r=0;r<n.length&&(t=n[r],!t.settings.ariaRoot);r++);return t}function c(e){var t=l(e),n=s(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?u(t.lastAriaIndex,n):u(0,n)}function u(e,t){return 0>e?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function d(e,t){var n=-1,r=l();t=t||s(r.getEl());for(var i=0;i<t.length;i++)t[i]===C&&(n=i);n+=e,r.lastAriaIndex=u(n,t)}function f(){var e=r();"tablist"==e?d(-1,s(C.parentNode)):x.parent().submenu?v():d(-1)}function h(){var e=n(),t=r();"tablist"==t?d(1,s(C.parentNode)):"menuitem"==e&&"menu"==t&&i("haspopup")?y():d(1)}function p(){d(-1)}function m(){var e=n(),t=r();"menuitem"==e&&"menubar"==t?y():"button"==e&&i("haspopup")?y({key:"down"}):d(1)}function g(e){var t=r();if("tablist"==t){var n=s(x.getEl("body"))[0];n&&n.focus()}else d(e.shiftKey?-1:1)}function v(){x.fire("cancel")}function y(e){e=e||{},x.fire("click",{target:C,aria:e})}var b=e.root,C,x;try{C=document.activeElement}catch(w){C=document.body}return x=b.getParentCtrl(C),b.on("keydown",function(e){function t(e,t){o(C)||"slider"!==n(C)&&t(e)!==!1&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,f);break;case 39:t(e,h);break;case 38:t(e,p);break;case 40:t(e,m);break;case 27:v();break;case 14:case 13:case 32:t(e,y);break;case 9:g(e)!==!1&&e.preventDefault()}}),b.on("focusin",function(e){C=e.target,x=e.control}),{focusFirst:c}}}),r(xe,[ye,he,fe,be,Ce,m,g,ge,ve],function(e,t,n,r,i,o,a,s,l){var c={};return e.extend({init:function(e){var n=this;n._super(e),e=n.settings,e.fixed&&n.state.set("fixed",!0),n._items=new t,n.isRtl()&&n.classes.add("rtl"),n.bodyClasses=new s(function(){n.state.get("rendered")&&(n.getEl("body").className=this.toString())}),n.bodyClasses.prefix=n.classPrefix,n.classes.add("container"),n.bodyClasses.add("container-body"),e.containerCls&&n.classes.add(e.containerCls),n._layout=r.create((e.layout||"")+"layout"),n.settings.items?n.add(n.settings.items):n.add(n.render()),n._hasBody=!0},items:function(){return this._items},find:function(e){return e=c[e]=c[e]||new n(e),e.find(this)},add:function(e){var t=this;return t.items().add(t.create(e)).parent(t),t},focus:function(e){var t=this,n,r,i;return e&&(r=t.keyboardNav||t.parents().eq(-1)[0].keyboardNav)?void r.focusFirst(t):(i=t.find("*"),t.statusbar&&i.add(t.statusbar.items()),i.each(function(e){return e.settings.autofocus?(n=null,!1):void(e.canFocus&&(n=n||e))}),n&&n.focus(),t)},replace:function(e,t){for(var n,r=this.items(),i=r.length;i--;)if(r[i]===e){r[i]=t;break}i>=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,i,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r;t.parent(e),t.state.get("rendered")||(r=e.getEl("body"),r.hasChildNodes()&&n<=r.childNodes.length-1?a(r.childNodes[n]).before(t.renderHtml()):a(r).append(t.renderHtml()),t.postRender(),l.add(t))}),e._layout.applyClasses(e.items().filter(":visible")),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t<i.length-1&&(t+=1),t>=0&&t<i.length&&(o=i.slice(0,t).toArray(),a=i.slice(t).toArray(),i.set(o.concat(e,a))),r.renderNew()},fromJSON:function(e){var t=this;for(var n in e)t.find("#"+n).value(e[n]);return t},toJSON:function(){var e=this,t={};return e.find("*").each(function(e){var n=e.name(),r=e.value();n&&"undefined"!=typeof r&&(t[n]=r)}),t},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e.state.set("rendered",!0),e.settings.style&&e.$el.css(e.settings.style),e.settings.border&&(t=e.borderBox,e.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(l.remove(this),this.visible()){for(e.repaintControls=[],e.repaintControls.map={},this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(we,[g],function(e){function t(e){var t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}function n(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}return function(r,i){function o(){return s.getElementById(i.handle||r)}var a,s=i.document||document,l,c,u,d,f,h;i=i||{},c=function(r){var c=t(s),p,m;n(r),r.preventDefault(),l=r.button,p=o(),f=r.screenX,h=r.screenY,m=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,a=e("<div>").css({position:"absolute",top:0,left:0,width:c.width,height:c.height,zIndex:2147483647,opacity:1e-4,cursor:m}).appendTo(s.body),e(s).on("mousemove touchmove",d).on("mouseup touchend",u),i.start(r)},d=function(e){return n(e),e.button!==l?u(e):(e.deltaX=e.screenX-f,e.deltaY=e.screenY-h,e.preventDefault(),void i.drag(e))},u=function(t){n(t),e(s).off("mousemove touchmove",d).off("mouseup touchend",u),a.remove(),i.stop&&i.stop(t)},this.destroy=function(){e(o()).off()},e(o()).on("mousedown touchstart",c)}}),r(Ne,[g,we],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,h,p,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),e(i.getEl("absend")).css(y,i.layoutRect()[l]-1),!c)return void e(f).css("display","none");e(f).css("display","block"),d=i.getEl("body"),h=i.getEl("scroll"+t+"t"),p=d["client"+s]-2*o,p-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=p/m,v={},v[y]=d["offset"+a]+o,v[b]=p,e(f).css(v),v={},v[y]=d["scroll"+a]*g,v[b]=p*g,e(h).css(v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;e(i.getEl()).append('<div id="'+u+'" class="'+d+"scrollbar "+d+"scrollbar-"+n+'"><div id="'+u+'t" class="'+d+'scrollbar-thumb"></div></div>'),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e("#"+u).addClass(d+"active")},drag:function(e){var t,u,d,f,h=i.layoutRect();u=h.contentW>h.innerW,d=h.contentH>h.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e("#"+u).removeClass(d+"active")}})}i.classes.add("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e(i.getEl("body")).on("scroll",n)),n())}}}),r(Ee,[xe,Ne],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}})}),r(_e,[pe],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,h;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t.state.get("fixed")&&"static"==e.getRuntimeStyle(document.body,"position")&&(a-=f.x,s-=f.y),i=t.getEl(),h=e.getSize(i),l=h.width,c=h.height,h=e.getSize(n),u=h.width,d=h.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o<r.length;o++){var a=t(this,n,r[o]);if(this.state.get("fixed")){if(a.x>0&&a.x+a.w<i.w&&a.y>0&&a.y+a.h<i.h)return r[o]}else if(a.x>i.x&&a.x+a.w<i.w+i.x&&a.y>i.y&&a.y+a.h<i.h+i.y)return r[o]}return r[0]},moveRel:function(e,n){"string"!=typeof n&&(n=this.testMoveRel(e,n));var r=t(this,e,n);return this.moveTo(r.x,r.y)},moveBy:function(e,t){var n=this,r=n.layoutRect();return n.moveTo(r.x+e,r.y+t),n},moveTo:function(t,n){function r(e,t,n){return 0>e?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i.state.get("rendered")?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(Se,[pe],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(ke,[Ee,_e,Se,pe,g,u],function(e,t,n,r,i,o){function a(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}function s(e){for(var t=v.length;t--;){var n=v[t],r=n.getParentCtrl(e.target);if(n.settings.autohide){if(r&&(a(r,n)||n.parent()===r))continue;e=n.fire("autohide",{target:e.target}),e.isDefaultPrevented()||n.hide()}}}function l(){p||(p=function(e){2!=e.button&&s(e)},i(document).on("click touchstart",p))}function c(){m||(m=function(){var e;for(e=v.length;e--;)d(v[e])},i(window).on("scroll",m))}function u(){if(!g){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;g=function(){document.all&&t==e.clientWidth&&n==e.clientHeight||(t=e.clientWidth,n=e.clientHeight,C.hideAll())},i(window).on("resize",g)}}function d(e){function t(t,n){for(var r,i=0;i<v.length;i++)if(v[i]!=e)for(r=v[i].parent();r&&(r=r.parent());)r==e&&v[i].fixed(t).moveBy(0,n).repaint()}var n=r.getViewPort().y;e.settings.autofix&&(e.state.get("fixed")?e._autoFixY>n&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY<n&&(e.fixed(!0).layoutRect({y:0}).repaint(),t(!0,n-e._autoFixY))))}function f(e,t){var n,r=C.zIndex||65535,o;if(e)y.push(t);else for(n=y.length;n--;)y[n]===t&&y.splice(n,1);if(y.length)for(n=0;n<y.length;n++)y[n].modal&&(r++,o=y[n]),y[n].getEl().style.zIndex=r,y[n].zIndex=r,r++;var a=i("#"+t.classPrefix+"modal-block",t.getContainerElm())[0];o?i(a).css("z-index",o.zIndex-1):a&&(a.parentNode.removeChild(a),b=!1),C.currentZIndex=r}function h(e){var t;for(t=v.length;t--;)v[t]===e&&v.splice(t,1);for(t=y.length;t--;)y[t]===e&&y.splice(t,1)}var p,m,g,v=[],y=[],b,C=e.extend({Mixins:[t,n],init:function(e){var t=this;t._super(e),t._eventsRoot=t,t.classes.add("floatpanel"),e.autohide&&(l(),u(),v.push(t)),e.autofix&&(c(),t.on("move",function(){d(this)})),t.on("postrender show",function(e){if(e.control==t){var n,r=t.classPrefix;t.modal&&!b&&(n=i("#"+r+"modal-block",t.getContainerElm()),n[0]||(n=i('<div id="'+r+'modal-block" class="'+r+"reset "+r+'fade"></div>').appendTo(t.getContainerElm())),o.setTimeout(function(){n.addClass(r+"in"),i(t.getEl()).addClass(r+"in")}),b=!0),f(!0,t)}}),t.on("show",function(){t.parents().each(function(e){return e.state.get("fixed")?(t.fixed(!0),!1):void 0})}),e.popover&&(t._preBodyHtml='<div class="'+t.classPrefix+'arrow"></div>',t.classes.add("popover").add("bottom").add(t.isRtl()?"end":"start")),t.aria("label",e.ariaLabel),t.aria("labelledby",t._id),t.aria("describedby",t.describedBy||t._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!=e){if(t.state.get("rendered")){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e=this,t,n=e._super();for(t=v.length;t--&&v[t]!==e;);return-1===t&&v.push(e),n},hide:function(){return h(this),f(!1,this),this._super()},hideAll:function(){C.hideAll()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||(e.remove(),f(!1,e)),e},remove:function(){h(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return C.hideAll=function(){for(var e=v.length;e--;){var t=v[e];t&&t.settings.autohide&&(t.hide(),v.splice(e,1))}},C}),r(Te,[ke,Ee,pe,g,we,me,d,u],function(e,t,n,r,i,o,a,s){function l(e){var t="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0",n=r("meta[name=viewport]")[0],i;a.overrideViewPort!==!1&&(n||(n=document.createElement("meta"),n.setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),i=n.getAttribute("content"),i&&"undefined"!=typeof f&&(f=i),n.setAttribute("content",e?t:f))}function c(e){for(var t=0;t<d.length;t++)if(d[t]._fullscreen)return;r([document.documentElement,document.body]).removeClass(e+"fullscreen")}function u(){function e(){var e,t=n.getWindowSize(),r;for(e=0;e<d.length;e++)r=d[e].layoutRect(),d[e].moveTo(d[e].settings.x||Math.max(0,t.w/2-r.w/2),d[e].settings.y||Math.max(0,t.h/2-r.h/2))}if(!a.desktop){var t={w:window.innerWidth,h:window.innerHeight};s.setInterval(function(){var e=window.innerWidth,n=window.innerHeight;t.w==e&&t.h==n||(t={w:e,h:n},r(window).trigger("resize"))},100)}r(window).on("resize",e)}var d=[],f="",h=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var r=this;r._super(e),r.isRtl()&&r.classes.add("rtl"),r.classes.add("window"),r.bodyClasses.add("window-body"),r.state.set("fixed",!0),e.buttons&&(r.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:r.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),r.statusbar.classes.add("foot"),r.statusbar.parent(r)),r.on("click",function(e){var t=r.classPrefix+"close";(n.hasClass(e.target,t)||n.hasClass(e.target.parentNode,t))&&r.close()}),r.on("cancel",function(){r.close()}),r.aria("describedby",r.describedBy||r._id+"-none"),r.aria("label",e.title),r._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=e.settings.x||Math.max(0,a.w/2-t.w/2),t.y=e.settings.y||Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='<div id="'+n+'-head" class="'+r+'window-head"><div id="'+n+'-title" class="'+r+'title">'+e.encode(i.title)+'</div><div id="'+n+'-dragh" class="'+r+'dragh"></div><button type="button" class="'+r+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),i.url&&(s='<iframe src="'+i.url+'" tabindex="-1"></iframe>'),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.bodyClasses+'">'+s+"</div>"+a+"</div></div>"},fullscreen:function(e){var t=this,i=document.documentElement,a,l=t.classPrefix,c;if(e!=t._fullscreen)if(r(window).on("resize",function(){var e;if(t._fullscreen)if(a)t._timer||(t._timer=s.setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(a=!0)}}),c=t.layoutRect(),t._fullscreen=e,e){t._initial={x:c.x,y:c.y,w:c.w,h:c.h},t.borderBox=o.parseBox("0"),t.getEl("head").style.display="none",c.deltaH-=c.headerH+2,r([i,document.body]).addClass(l+"fullscreen"),t.classes.add("fullscreen");var u=n.getWindowSize();t.moveTo(0,0).resizeTo(u.w,u.h)}else t.borderBox=o.parseBox(t.settings.border),t.getEl("head").style.display="",c.deltaH+=c.headerH,r([i,document.body]).removeClass(l+"fullscreen"),t.classes.remove("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.classes.add("in"),e.fire("open")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()}),d.push(e),l(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t;for(e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),t=d.length;t--;)d[t]===e&&d.splice(t,1);l(d.length>0),c(e.classPrefix)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});return u(),h}),r(Re,[Te],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){function r(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),o(t)}}}var i,o=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:i=[r("Ok",!0,!0),r("Cancel",!1)];break;case t.YES_NO:case t.YES_NO_CANCEL:i=[r("Yes",1,!0),r("No",0)],n.buttons==t.YES_NO_CANCEL&&i.push(r("Cancel",-1));break;default:i=[r("Ok",!0,!0)]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:i,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){o(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(Ae,[Te,Re],function(e,t){return function(n){function r(){return s.length?s[s.length-1]:void 0}function i(e){n.fire("OpenWindow",{win:e})}function o(e){n.fire("CloseWindow",{win:e})}var a=this,s=[];a.windows=s,n.on("remove",function(){for(var e=s.length;e--;)s[e].close()}),a.open=function(t,r){var a;return n.editorManager.setActive(n),t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body,data:t.data,callbacks:t.commands}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){a.find("form")[0].submit()}},{text:"Cancel",onclick:function(){a.close()}}]),a=new e(t),s.push(a),a.on("close",function(){for(var e=s.length;e--;)s[e]===a&&s.splice(e,1);s.length||n.focus(),o(a)}),t.data&&a.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),a.features=t||{},a.params=r||{},1===s.length&&n.nodeChanged(),a=a.renderTo().reflow(),i(a),a},a.alert=function(e,r,a){var s;s=t.alert(e,function(){r?r.call(a||this):n.focus()}),s.on("close",function(){o(s)}),i(s)},a.confirm=function(e,n,r){var a;a=t.confirm(e,function(e){n.call(r||this,e)}),a.on("close",function(){o(a)}),i(a)},a.close=function(){r()&&r().close()},a.getParams=function(){return r()?r().params:null},a.setParams=function(e){r()&&(r().params=e)},a.getWindows=function(){return s}}}),r(Be,[ye,_e],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'" role="presentation"><div class="'+t+'tooltip-arrow"></div><div class="'+t+'tooltip-inner">'+e.encode(e.state.get("text"))+"</div></div>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)}),e._super()},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(De,[ye,Be],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.classes.toggle("tooltip-n","bc-tc"==i),r.classes.toggle("tooltip-nw","bc-tl"==i),r.classes.toggle("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){function e(e){n.aria("disabled",e),n.classes.toggle("disabled",e)}function t(e){n.aria("pressed",e),n.classes.toggle("active",e)}var n=this;return n.state.on("change:disabled",function(t){e(t.value)}),n.state.on("change:active",function(e){t(e.value)}),n.state.get("disabled")&&e(!0),n.state.get("active")&&t(!0),n._super()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(Le,[De],function(e){return e.extend({Defaults:{value:0},init:function(e){var t=this;t._super(e),t.classes.add("progress"),t.settings.filter||(t.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this,t=e._id,n=this.classPrefix;return'<div id="'+t+'" class="'+e.classes+'"><div class="'+n+'bar-container"><div class="'+n+'bar"></div></div><div class="'+n+'text">0%</div></div>'},postRender:function(){var e=this;return e._super(),e.value(e.settings.value),e},bindStates:function(){function e(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}var t=this;return t.state.on("change:value",function(t){e(t.value)}),e(t.state.get("value")),t._super()}})}),r(Me,[ye,_e,Le,u],function(e,t,n,r){return e.extend({Mixins:[t],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||e.timeout>0)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new n),t.on("click",function(e){-1!=e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e=this,t=e.classPrefix,n="",r="",i="",o="";return e.icon&&(n='<i class="'+t+"ico "+t+"i-"+e.icon+'"></i>'),e.color&&(o=' style="background-color: '+e.color+'"'),e.closeButton&&(r='<button type="button" class="'+t+'close" aria-hidden="true">\xd7</button>'),e.progressBar&&(i=e.progressBar.renderHtml()),'<div id="'+e._id+'" class="'+e.classes+'"'+o+' role="presentation">'+n+'<div class="'+t+'notification-inner">'+e.state.get("text")+"</div>"+i+r+"</div>"},postRender:function(){var e=this;return r.setTimeout(function(){e.$el.addClass(e.classPrefix+"in")}),e._super()},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().childNodes[1].innerHTML=t.value}),e.progressBar&&e.progressBar.bindStates(),e._super()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||e.remove(),e},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(Pe,[Me,u],function(e,t){return function(n){function r(){return l.length?l[l.length-1]:void 0}function i(){t.requestAnimationFrame(function(){o(),a()})}function o(){for(var e=0;e<l.length;e++)l[e].moveTo(0,0)}function a(){if(l.length>0){var e=l.slice(0,1)[0],t=n.inline?n.getElement():n.getContentAreaContainer();if(e.moveRel(t,"tc-tc"),l.length>1)for(var r=1;r<l.length;r++)l[r].moveRel(l[r-1].getEl(),"bc-tc")}}var s=this,l=[];s.notifications=l,n.on("remove",function(){for(var e=l.length;e--;)l[e].close()}),n.on("ResizeEditor",a),n.on("ResizeWindow",i),s.open=function(t){var r;return n.editorManager.setActive(n),r=new e(t),l.push(r),t.timeout>0&&(r.timer=setTimeout(function(){r.close()},t.timeout)),r.on("close",function(){var e=l.length;for(r.timer&&n.getWin().clearTimeout(r.timer);e--;)l[e]===r&&l.splice(e,1);a()}),r.renderTo(),a(),r},s.close=function(){r()&&r().close()},s.getNotifications=function(){return l},n.on("SkinLoaded",function(){var e=n.settings.service_message;e&&n.notificationManager.open({text:e,type:"warning",timeout:0,icon:""})})}}),r(Oe,[w],function(e){function t(t,n,r){for(var i=[];n&&n!=t;n=n.parentNode)i.push(e.nodeIndex(n,r));return i}function n(e,t){var n,r,i;for(r=e,n=t.length-1;n>=0;n--){if(i=r.childNodes,t[n]>i.length-1)return null;r=i[t[n]]}return r}return{create:t,resolve:n}}),r(He,[I,T,y,Oe,A,C,d,m,u,k,$,ne],function(e,t,n,r,i,o,a,s,l,c,u,d){return function(f){function h(e,t){try{f.getDoc().execCommand(e,!1,t)}catch(n){}}function p(){var e=f.getDoc().documentMode;return e?e:6}function m(e){return e.isDefaultPrevented()}function g(e){var t,n;e.dataTransfer&&(f.selection.isCollapsed()&&"IMG"==e.target.tagName&&re.select(e.target),t=f.selection.getContent(),t.length>0&&(n=ue+escape(f.id)+","+escape(t),e.dataTransfer.setData(de,n)))}function v(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(de),t&&t.indexOf(ue)>=0)?(t=t.substr(ue.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}function y(e){f.queryCommandSupported("mceInsertClipboardContent")?f.execCommand("mceInsertClipboardContent",!1,{content:e}):f.execCommand("mceInsertContent",!1,e)}function b(){function i(e){var t=C.schema.getBlockElements(),n=f.getBody();if("BR"!=e.nodeName)return!1;for(;e!=n&&!t[e.nodeName];e=e.parentNode)if(e.nextSibling)return!1;return!0}function o(e,t){var n;for(n=e.nextSibling;n&&n!=t;n=n.nextSibling)if((3!=n.nodeType||0!==Z.trim(n.data).length)&&n!==t)return!1;return n===t}function a(e,t,r){var o,a,s;for(s=C.schema.getNonEmptyElements(),o=new n(r||e,e);a=o[t?"next":"prev"]();){if(s[a.nodeName]&&!i(a))return a;if(3==a.nodeType&&a.data.length>0)return a}}function c(e){var n,r,i,o,s;if(!e.collapsed&&(n=C.getParent(t.getNode(e.startContainer,e.startOffset),C.isBlock), r=C.getParent(t.getNode(e.endContainer,e.endOffset),C.isBlock),s=f.schema.getTextBlockElements(),n!=r&&s[n.nodeName]&&s[r.nodeName]&&"false"!==C.getContentEditable(n)&&"false"!==C.getContentEditable(r)))return e.deleteContents(),i=a(n,!1),o=a(r,!0),C.isEmpty(r)||Z(n).append(r.childNodes),Z(r).remove(),i?1==i.nodeType?"BR"==i.nodeName?(e.setStartBefore(i),e.setEndBefore(i)):(e.setStartAfter(i),e.setEndAfter(i)):(e.setStart(i,i.data.length),e.setEnd(i,i.data.length)):o&&(1==o.nodeType?(e.setStartBefore(o),e.setEndBefore(o)):(e.setStart(o,0),e.setEnd(o,0))),x.setRng(e),!0}function u(e,n){var r,i,s,l,c,u;if(!e.collapsed)return e;if(c=e.startContainer,u=e.startOffset,3==c.nodeType)if(n){if(u<c.data.length)return e}else if(u>0)return e;if(r=t.getNode(e.startContainer,e.startOffset),s=C.getParent(r,C.isBlock),i=a(f.getBody(),n,r),l=C.getParent(i,C.isBlock),!r||!i)return e;if(l&&s!=l)if(n){if(!o(s,l))return e;1==r.nodeType?"BR"==r.nodeName?e.setStartBefore(r):e.setStartAfter(r):e.setStart(r,r.data.length),1==i.nodeType?e.setEnd(i,0):e.setEndBefore(i)}else{if(!o(l,s))return e;1==i.nodeType?"BR"==i.nodeName?e.setStartBefore(i):e.setStartAfter(i):e.setStart(i,i.data.length),1==r.nodeType?e.setEnd(r,0):e.setEndBefore(r)}return e}function d(e){var t=x.getRng();return t=u(t,e),c(t)?!0:void 0}function h(e,t){function n(e,n){return m=Z(n).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),l=e.cloneNode(!1),m=s.map(m,function(e){return e=e.cloneNode(!1),l.hasChildNodes()?(e.appendChild(l.firstChild),l.appendChild(e)):l.appendChild(e),l.appendChild(e),e}),m.length?(p=C.create("br"),m[0].appendChild(p),C.replace(l,e),t.setStartBefore(p),t.setEndBefore(p),f.selection.setRng(t),p):null}function i(e){return e&&f.schema.getTextBlockElements()[e.tagName]}var o,a,l,c,u,d,h,p,m;if(t.collapsed&&(d=t.startContainer,h=t.startOffset,a=C.getParent(d,C.isBlock),i(a)))if(1==d.nodeType){if(d=d.childNodes[h],d&&"BR"!=d.tagName)return;if(u=e?a.nextSibling:a.previousSibling,C.isEmpty(a)&&i(u)&&C.isEmpty(u)&&n(a,d))return C.remove(u),!0}else if(3==d.nodeType){if(o=r.create(a,d),c=a.cloneNode(!0),d=r.resolve(c,o),e){if(h>=d.data.length)return;d.deleteData(h,1)}else{if(0>=h)return;d.deleteData(h-1,1)}if(C.isEmpty(c))return n(a,d)}}function p(e){var t,n,r;d(e)||(s.each(f.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&f.dom.setAttrib(e,"style",f.dom.getAttrib(e,"style"))}),t=new w(function(){}),t.observe(f.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),f.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),n=f.selection.getRng(),r=n.startContainer.parentNode,s.each(t.takeRecords(),function(e){if(C.isChildOf(e.target,f.getBody())){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}s.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),C.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),f.selection.setRng(n))}})}}),t.disconnect(),s.each(f.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")}))}var b=f.getDoc(),C=f.dom,x=f.selection,w=window.MutationObserver,N,E;w||(N=!0,w=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMSubtreeModified",e,!1),r.removeEventListener("DOMNodeInsertedIntoDocument",e,!1),r.removeEventListener("DOMNodeInserted",e,!1),r.removeEventListener("DOMAttrModified",t,!1)},this.takeRecords=function(){return n}}),f.on("keydown",function(e){var t=e.keyCode==te,n=e.ctrlKey||e.metaKey;if(!m(e)&&(t||e.keyCode==ee)){var r=f.selection.getRng(),i=r.startContainer,o=r.startOffset;if(t&&e.shiftKey)return;if(h(t,r))return void e.preventDefault();if(!n&&r.collapsed&&3==i.nodeType&&(t?o<i.data.length:o>0))return;e.preventDefault(),n&&f.selection.getSel().modify("extend",t?"forward":"backward",e.metaKey?"lineboundary":"word"),p(t)}}),f.on("keypress",function(t){if(!m(t)&&!x.isCollapsed()&&t.charCode>31&&!e.metaKeyPressed(t)){var n,r,i,o,a,s;n=f.selection.getRng(),s=String.fromCharCode(t.charCode),t.preventDefault(),r=Z(n.startContainer).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),p(!0),r=r.filter(function(e,t){return!Z.contains(f.getBody(),t)}),r.length?(i=C.createFragment(),r.each(function(e,t){t=t.cloneNode(!1),i.hasChildNodes()?(t.appendChild(i.firstChild),i.appendChild(t)):(a=t,i.appendChild(t)),i.appendChild(t)}),a.appendChild(f.getDoc().createTextNode(s)),o=C.getParent(n.startContainer,C.isBlock),C.isEmpty(o)?Z(o).empty().append(i):n.insertNode(i),n.setStart(a.firstChild,1),n.setEnd(a.firstChild,1),f.selection.setRng(n)):f.selection.setContent(s)}}),f.addCommand("Delete",function(){p()}),f.addCommand("ForwardDelete",function(){p(!0)}),N||(f.on("dragstart",function(e){E=x.getRng(),g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);n&&(e.preventDefault(),l.setEditorTimeout(f,function(){var r=t.getCaretRangeFromPoint(e.x,e.y,b);E&&(x.setRng(E),E=null),p(),x.setRng(r),y(n.html)}))}}),f.on("cut",function(e){m(e)||!e.clipboardData||f.selection.isCollapsed()||(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",f.selection.getContent()),e.clipboardData.setData("text/plain",f.selection.getContent({format:"text"})),l.setEditorTimeout(f,function(){p(!0)}))}))}function C(){function e(e){var t=ne.create("body"),n=e.cloneContents();return t.appendChild(n),re.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(f.getBody()),t.compareRanges(n,r)}var i=e(n),o=ne.createRng();o.selectNode(f.getBody());var a=e(o);return i===a}f.on("keydown",function(e){var t=e.keyCode,r,i;if(!m(e)&&(t==te||t==ee)){if(r=f.selection.isCollapsed(),i=f.getBody(),r&&!ne.isEmpty(i))return;if(!r&&!n(f.selection.getRng()))return;e.preventDefault(),f.setContent(""),i.firstChild&&ne.isBlock(i.firstChild)?f.selection.setCursorLocation(i.firstChild,0):f.selection.setCursorLocation(i,0),f.nodeChanged()}})}function x(){f.shortcuts.add("meta+a",null,"SelectAll")}function w(){f.settings.content_editable||ne.bind(f.getDoc(),"mousedown mouseup",function(e){var t;if(e.target==f.getDoc().documentElement)if(t=re.getRng(),f.getBody().focus(),"mousedown"==e.type){if(c.isCaretContainer(t.startContainer))return;re.placeCaretAt(e.clientX,e.clientY)}else re.setRng(t)})}function N(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee){if(!f.getBody().getElementsByTagName("hr").length)return;if(re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return ne.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(ne.remove(n),e.preventDefault())}}})}function E(){window.Range.prototype.getClientRects||f.on("mousedown",function(e){if(!m(e)&&"HTML"===e.target.nodeName){var t=f.getBody();t.blur(),l.setEditorTimeout(f,function(){t.focus()})}})}function _(){f.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==ne.getContentEditableParent(t)&&(e.preventDefault(),re.getSel().setBaseAndExtent(t,0,t,1),f.nodeChanged()),"A"==t.nodeName&&ne.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),re.select(t))})}function S(){function e(){var e=ne.getAttribs(re.getStart().cloneNode(!1));return function(){var t=re.getStart();t!==f.getBody()&&(ne.setAttrib(t,"style",null),Q(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!re.isCollapsed()&&ne.getParent(re.getStart(),ne.isBlock)!=ne.getParent(re.getEnd(),ne.isBlock)}f.on("keypress",function(n){var r;return m(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),f.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),ne.bind(f.getDoc(),"cut",function(n){var r;!m(n)&&t()&&(r=e(),l.setEditorTimeout(f,function(){r()}))})}function k(){document.body.setAttribute("role","application")}function T(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee&&re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function R(){p()>7||(h("RespectVisibilityInDesign",!0),f.contentStyles.push(".mceHideBrInPre pre br {display: none}"),ne.addClass(f.getBody(),"mceHideBrInPre"),oe.addNodeFilter("pre",function(e){for(var t=e.length,n,r,o,a;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)o=n[r],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new i("#text",3),o,!0).value="\n"}),ae.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function A(){ne.bind(f.getBody(),"mouseup",function(){var e,t=re.getNode();"IMG"==t.nodeName&&((e=ne.getStyle(t,"width"))&&(ne.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"width","")),(e=ne.getStyle(t,"height"))&&(ne.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"height","")))})}function B(){f.on("keydown",function(t){var n,r,i,o,a;if(!m(t)&&t.keyCode==e.BACKSPACE&&(n=re.getRng(),r=n.startContainer,i=n.startOffset,o=ne.getRoot(),a=r,n.collapsed&&0===i)){for(;a&&a.parentNode&&a.parentNode.firstChild==a&&a.parentNode!=o;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(f.formatter.toggle("blockquote",null,a),n=ne.createRng(),n.setStart(r,0),n.setEnd(r,0),re.setRng(n))}})}function D(){function e(){K(),h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),ie.object_resizing||h("enableObjectResizing",!1)}ie.readonly||f.on("BeforeExecCommand MouseDown",e)}function L(){function e(){Q(ne.select("a"),function(e){var t=e.parentNode,n=ne.getRoot();if(t.lastChild===e){for(;t&&!ne.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}ne.add(t,"br",{"data-mce-bogus":1})}})}f.on("SetContent ExecCommand",function(t){"setcontent"!=t.type&&"mceInsertLink"!==t.command||e()})}function M(){ie.forced_root_block&&f.on("init",function(){h("DefaultParagraphSeparator",ie.forced_root_block)})}function P(){f.on("keydown",function(e){var t;m(e)||e.keyCode!=ee||(t=f.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),f.undoManager.beforeChange(),ne.remove(t.item(0)),f.undoManager.add()))})}function O(){var e;p()>=10&&(e="",Q("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),f.contentStyles.push(e+"{padding-right: 1px !important}"))}function H(){p()<9&&(oe.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),ae.addNodeFilter("noscript",function(e){for(var t=e.length,n,r,a;t--;)n=e[t],r=e[t].firstChild,r?r.value=o.decode(r.value):(a=n.attributes.map["data-mce-innertext"],a&&(n.attr("data-mce-innertext",null),r=new i("#text",3),r.value=a,r.raw=!0,n.append(r)))}))}function I(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),ne.unbind(r,"mouseup",n),ne.unbind(r,"mousemove",t),a=o=0}var r=ne.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,ne.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(ne.bind(r,"mouseup",n),ne.bind(r,"mousemove",t),ne.getRoot().focus(),a.select())}})}function F(){f.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||re.normalize()},!0)}function z(){f.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function U(){f.inline||f.on("keydown",function(){document.activeElement==document.body&&f.getWin().focus()})}function W(){f.inline||(f.contentStyles.push("body {min-height: 150px}"),f.on("click",function(e){var t;if("HTML"==e.target.nodeName){if(a.ie>11)return void f.getBody().focus();t=f.selection.getRng(),f.getBody().focus(),f.selection.setRng(t),f.selection.normalize(),f.nodeChanged()}}))}function V(){a.mac&&f.on("keydown",function(t){!e.metaKeyPressed(t)||t.shiftKey||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),f.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","lineboundary"))})}function $(){h("AutoUrlDetect",!1)}function q(){f.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),f.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function j(){f.on("init",function(){f.dom.bind(f.getBody(),"submit",function(e){e.preventDefault()})})}function Y(){oe.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}function X(){f.on("dragstart",function(e){g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);if(n&&n.id!=f.id){e.preventDefault();var r=t.getCaretRangeFromPoint(e.x,e.y,f.getDoc());re.setRng(r),y(n.html)}}})}function K(){var e,t;G()&&(e=f.getBody(),t=e.parentNode,t.removeChild(e),t.appendChild(e),e.focus())}function G(){var e;return se?(e=f.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}function J(){function t(e){var t=new d(e.getBody()),n=e.selection.getRng(),r=u.fromRangeStart(n),i=u.fromRangeEnd(n);return!e.selection.isCollapsed()&&!t.prev(r)&&!t.next(i)}f.on("keypress",function(n){!m(n)&&!re.isCollapsed()&&n.charCode>31&&!e.metaKeyPressed(n)&&t(f)&&(n.preventDefault(),f.setContent(String.fromCharCode(n.charCode)),f.selection.select(f.getBody(),!0),f.selection.collapse(!1),f.nodeChanged())}),f.on("keydown",function(e){var n=e.keyCode;m(e)||n!=te&&n!=ee||t(f)&&(e.preventDefault(),f.setContent(""),f.nodeChanged())})}var Q=s.each,Z=f.$,ee=e.BACKSPACE,te=e.DELETE,ne=f.dom,re=f.selection,ie=f.settings,oe=f.parser,ae=f.serializer,se=a.gecko,le=a.ie,ce=a.webkit,ue="data:text/mce-internal,",de=le?"Text":"URL";return B(),C(),a.windowsPhone||F(),ce&&(J(),b(),w(),_(),M(),j(),T(),Y(),a.iOS?(U(),W(),q()):x()),le&&a.ie<11&&(N(),k(),R(),A(),P(),O(),H(),I()),a.ie>=11&&(W(),T()),a.ie&&(x(),$(),X()),se&&(J(),N(),E(),S(),D(),L(),z(),V(),T()),{refreshContentEditable:K,isHidden:G}}}),r(Ie,[ue,w,m],function(e,t,n){function r(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=o.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()}function i(e,t){function n(e){return!e.hidden&&!e.readonly}var i=r(e,t),s;if(e.delegates||(e.delegates={}),!e.delegates[t])if(e.settings.event_root){if(a||(a={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&a){for(t in a)e.dom.unbind(r(e,t));a=null}})),a[t])return;s=function(r){for(var i=r.target,a=e.editorManager.editors,s=a.length;s--;){var l=a[s].getBody();(l===i||o.isChildOf(i,l))&&n(a[s])&&a[s].fire(t,r)}},a[t]=s,o.bind(i,t,s)}else s=function(r){n(e)&&e.fire(t,r)},o.bind(i,t,s),e.delegates[t]=s}var o=t.DOM,a,s={bindPendingEventDelegates:function(){var e=this;n.each(e._pendingNativeEvents,function(t){i(e,t)})},toggleNativeEvent:function(e,t){var n=this;"focus"!=e&&"blur"!=e&&(t?n.initialized?i(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(r(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e=this,t;if(e.delegates){for(t in e.delegates)e.dom.unbind(r(e,t),t,e.delegates[t]);delete e.delegates}e.inline||(e.getBody().onload=null,e.dom.unbind(e.getWin()),e.dom.unbind(e.getDoc())),e.dom.unbind(e.getBody()),e.dom.unbind(e.getContainer())}};return s=n.extend({},e,s)}),r(Fe,[],function(){function e(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}}function t(e){var t,n;return t=e.getBody(),n=function(t){e.dom.getParents(t.target,"a").length>0&&t.preventDefault()},e.dom.bind(t,"click",n),{unbind:function(){e.dom.unbind(t,"click",n)}}}function n(n,r){n._clickBlocker&&(n._clickBlocker.unbind(),n._clickBlocker=null),r?(n._clickBlocker=t(n),n.selection.controlSelection.hideResizeRect(),n.readonly=!0,n.getBody().contentEditable=!1):(n.readonly=!1,n.getBody().contentEditable=!0,e(n,"StyleWithCSS",!1),e(n,"enableInlineTableEditing",!1),e(n,"enableObjectResizing",!1),n.focus(),n.nodeChanged())}function r(e,t){var r=e.readonly?"readonly":"design";t!=r&&(e.initialized?n(e,"readonly"==t):e.on("init",function(){n(e,"readonly"==t)}),e.fire("SwitchMode",{mode:t}))}return{setMode:r}}),r(ze,[m,d],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122},o=e.makeMap("alt,ctrl,shift,meta,access");return function(a){function s(e){var a,s,l={};n(r(e,"+"),function(e){e in o?l[e]=!0:/^[0-9]{2,}$/.test(e)?l.keyCode=parseInt(e,10):(l.charCode=e.charCodeAt(0),l.keyCode=i[e]||e.toUpperCase().charCodeAt(0))}),a=[l.keyCode];for(s in o)l[s]?a.push(s):l[s]=!1;return l.id=a.join(","),l.access&&(l.alt=!0,t.mac?l.ctrl=!0:l.shift=!0),l.meta&&(t.mac?l.meta=!0:(l.ctrl=!0,l.meta=!1)),l}function l(t,n,i,o){var l;return l=e.map(r(t,">"),s),l[l.length-1]=e.extend(l[l.length-1],{func:i,scope:o||a}),e.extend(l[0],{desc:a.translate(n),subpatterns:l.slice(1)})}function c(e){return e.altKey||e.ctrlKey||e.metaKey}function u(e){return e.keyCode>=112&&e.keyCode<=123}function d(e,t){return t?t.ctrl!=e.ctrlKey||t.meta!=e.metaKey?!1:t.alt!=e.altKey||t.shift!=e.shiftKey?!1:e.keyCode==t.keyCode||e.charCode&&e.charCode==t.charCode?(e.preventDefault(),!0):!1:!1}function f(e){return e.func?e.func.call(e.scope):null}var h=this,p={},m=[];a.on("keyup keypress keydown",function(e){!c(e)&&!u(e)||e.isDefaultPrevented()||(n(p,function(t){return d(e,t)?(m=t.subpatterns.slice(0),"keydown"==e.type&&f(t),!0):void 0}),d(e,m[0])&&(1===m.length&&"keydown"==e.type&&f(m[0]),m.shift()))}),h.add=function(t,i,o,s){var c;return c=o,"string"==typeof o?o=function(){a.execCommand(c,!1,null)}:e.isArray(c)&&(o=function(){a.execCommand(c[0],c[1],c[2])}),n(r(e.trim(t.toLowerCase())),function(e){var t=l(e,i,o,s);p[t.id]=t}),!0},h.remove=function(e){var t=l(e);return p[t.id]?(delete p[t.id],!0):!1}}}),r(Ue,[c,m,z],function(e,t,n){return function(r,i){function o(e){var t,n;return n={"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"},t=n[e.blob().type.toLowerCase()]||"dat",e.id()+"."+t}function a(e,t){return e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t}function s(e){return{id:e.id,blob:e.blob,base64:e.base64,filename:n.constant(o(e))}}function l(e,t,n,r){var s,l;s=new XMLHttpRequest,s.open("POST",i.url),s.withCredentials=i.credentials,s.upload.onprogress=function(e){r(e.loaded/e.total*100)},s.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+s.status)},s.onload=function(){var e;return 200!=s.status?void n("HTTP Error: "+s.status):(e=JSON.parse(s.responseText),e&&"string"==typeof e.location?void t(a(i.basePath,e.location)):void n("Invalid JSON: "+s.responseText))},l=new FormData,l.append("file",e.blob(),o(e)),s.send(l)}function c(){return new e(function(e){e([])})}function u(e,t){return{url:t,blobInfo:e,status:!0}}function d(e,t){return{url:"",blobInfo:e,status:!1,error:t}}function f(e,n){t.each(y[e],function(e){e(n)}),delete y[e]}function h(t,n,i){return r.markPending(t.blobUri()),new e(function(e){var o,a,l=function(){};try{var c=function(){o&&(o.close(),a=l)},h=function(n){c(),r.markUploaded(t.blobUri(),n),f(t.blobUri(),u(t,n)),e(u(t,n))},p=function(){c(),r.removeFailed(t.blobUri()),f(t.blobUri(),d(t,p)),e(d(t,p))};a=function(e){0>e||e>100||(o||(o=i()),o.progressBar.value(e))},n(s(t),h,p,a)}catch(m){e(d(t,m.message))}})}function p(e){return e===l}function m(t){var n=t.blobUri();return new e(function(e){y[n]=y[n]||[],y[n].push(e)})}function g(n,o){return n=t.grep(n,function(e){return!r.isUploaded(e.blobUri())}),e.all(t.map(n,function(e){return r.isPending(e.blobUri())?m(e):h(e,i.handler,o)}))}function v(e,t){return!i.url&&p(i.handler)?c():g(e,t)}var y={};return i=t.extend({credentials:!1,handler:l},i),{upload:v}}}),r(We,[c],function(e){function t(t){return new e(function(e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="blob",n.onload=function(){200==this.status&&e(this.response)},n.send()})}function n(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}}function r(t){return new e(function(e){var r,i,o;t=n(t);try{r=atob(t.data)}catch(a){return void e(new Blob([]))}for(i=new Uint8Array(r.length),o=0;o<i.length;o++)i[o]=r.charCodeAt(o);e(new Blob([i],{type:t.type}))})}function i(e){return 0===e.indexOf("blob:")?t(e):0===e.indexOf("data:")?r(e):null}function o(t){return new e(function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)})}return{uriToBlob:i,blobToDataUri:o,parseDataUri:n}}),r(Ve,[c,p,z,We,d],function(e,t,n,r,i){var o=0;return function(a,s){function l(l,u){function d(e,t){var n,i;return 0===e.src.indexOf("blob:")?(i=s.getByUri(e.src),void(i&&t({image:e,blobInfo:i}))):(n=r.parseDataUri(e.src).data,i=s.findFirst(function(e){return e.base64()===n}),void(i?t({image:e,blobInfo:i}):r.uriToBlob(e.src).then(function(r){var i="blobid"+o++,a=s.create(i,r,n);s.add(a),t({image:e,blobInfo:a})})))}var f,h;return u||(u=n.constant(!0)),f=t.filter(l.getElementsByTagName("img"),function(e){var t=e.src;return i.fileApi?e.hasAttribute("data-mce-bogus")?!1:e.hasAttribute("data-mce-placeholder")?!1:t&&t!=i.transparentSrc?0===t.indexOf("blob:")?!a.isUploaded(t):0===t.indexOf("data:")?u(e):!1:!1:!1}),h=t.map(f,function(t){var n;return c[t.src]?new e(function(e){c[t.src].then(function(n){e({image:t,blobInfo:n.blobInfo})})}):(n=new e(function(e){d(t,e)}).then(function(e){return delete c[e.image.src],e})["catch"](function(e){return delete c[t.src],e}),c[t.src]=n,n)}),e.all(h)}var c={};return{findAll:l}}}),r($e,[p,z],function(e,t){return function(){function n(e,t,n){return{id:u(e),blob:u(t),base64:u(n),blobUri:u(URL.createObjectURL(t))}}function r(e){i(e.id())||c.push(e)}function i(e){return o(function(t){return t.id()===e})}function o(t){return e.filter(c,t)[0]}function a(e){return o(function(t){return t.blobUri()==e})}function s(t){c=e.filter(c,function(e){return e.blobUri()===t?(URL.revokeObjectURL(e.blobUri()),!1):!0})}function l(){e.each(c,function(e){URL.revokeObjectURL(e.blobUri())}),c=[]}var c=[],u=t.constant;return{create:n,add:r,get:i,getByUri:a,findFirst:o,removeByUri:s,destroy:l}}}),r(qe,[],function(){return function(){function e(e,t){return{status:e,resultUri:t}}function t(e){return e in d}function n(e){var t=d[e];return t?t.resultUri:null}function r(e){return t(e)?d[e].status===c:!1}function i(e){return t(e)?d[e].status===u:!1}function o(t){d[t]=e(c,null)}function a(t,n){d[t]=e(u,n)}function s(e){delete d[e]}function l(){d={}}var c=1,u=2,d={};return{hasBlobUri:t,getResultUri:n,isPending:r,isUploaded:i,markPending:o,markUploaded:a,removeFailed:s,destroy:l}}}),r(je,[p,Ue,Ve,$e,qe],function(e,t,n,r,i){return function(o){function a(e){return function(t){return o.selection?e(t):[]}}function s(e,t,n){var r=0;do r=e.indexOf(t,r),-1!==r&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1);while(-1!==r);return e}function l(e,t,n){return e=s(e,'src="'+t+'"','src="'+n+'"'),e=s(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')}function c(t,n){e.each(o.undoManager.data,function(e){e.content=l(e.content,t,n)})}function u(){return o.notificationManager.open({text:o.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}function d(e,t){y.removeByUri(e.src),c(e.src,t),o.$(e).attr({src:t,"data-mce-src":o.convertURL(t,"src")})}function f(n){return b||(b=new t(w,{url:x.images_upload_url,basePath:x.images_upload_base_path,credentials:x.images_upload_credentials,handler:x.images_upload_handler})),m().then(a(function(t){var r;return r=e.map(t,function(e){return e.blobInfo}),b.upload(r,u).then(a(function(r){return r=e.map(r,function(e,n){var r=t[n].image;return e.status&&o.settings.images_replace_blob_uris!==!1&&d(r,e.url),{element:r,status:e.status}}),n&&n(r),r}))}))}function h(e){return x.automatic_uploads!==!1?f(e):void 0}function p(e){return x.images_dataimg_filter?x.images_dataimg_filter(e):!0}function m(){return C||(C=new n(w,y)),C.findAll(o.getBody(),p).then(a(function(t){return e.each(t,function(e){c(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),t}))}function g(){y.destroy(),w.destroy(),C=b=null}function v(t){return t.replace(/src="(blob:[^"]+)"/g,function(t,n){var r=w.getResultUri(n);if(r)return'src="'+r+'"';var i=y.getByUri(n);return i||(i=e.reduce(o.editorManager.editors,function(e,t){return e||t.editorUpload.blobCache.getByUri(n)},null)),i?'src="data:'+i.blob().type+";base64,"+i.base64()+'"':t})}var y=new r,b,C,x=o.settings,w=new i;return o.on("setContent",function(){o.settings.automatic_uploads!==!1?h():m()}),o.on("RawSaveContent",function(e){e.content=v(e.content)}),o.on("getContent",function(e){e.source_view||"raw"==e.format||(e.content=v(e.content))}),o.on("PostRender",function(){o.parser.addNodeFilter("img",function(t){e.each(t,function(e){var t=e.attr("src");if(!y.getByUri(t)){var n=w.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:y,uploadImages:f,uploadImagesAuto:h,scanForImages:m,destroy:g}}}),r(Ye,[k,$,_,T,g,W,u],function(e,t,n,r,i,o,a){var s=n.isContentEditableFalse;return function(t,n){function r(e,n){var r=o.collapse(e.getBoundingClientRect(),n),i,a,s,l,c;return"BODY"==t.tagName?(i=t.ownerDocument.documentElement,a=t.scrollLeft||i.scrollLeft,s=t.scrollTop||i.scrollTop):(c=t.getBoundingClientRect(),a=t.scrollLeft-c.left,s=t.scrollTop-c.top),r.left+=a,r.right+=a,r.top+=s,r.bottom+=s,r.width=1,l=e.offsetWidth-e.clientWidth,l>0&&(n&&(l*=-1),r.left+=l,r.right+=l),r}function l(){var n,r,o,a,s;for(n=i("*[contentEditable=false]",t),a=0;a<n.length;a++)r=n[a],o=r.previousSibling,e.endsWithCaretContainer(o)&&(s=o.data,1==s.length?o.parentNode.removeChild(o):o.deleteData(s.length-1,1)),o=r.nextSibling,e.startsWithCaretContainer(o)&&(s=o.data,1==s.length?o.parentNode.removeChild(o):o.deleteData(0,1));return null}function c(o,a){var l,c,f;return u(),n(a)?(g=e.insertBlock("p",a,o),l=r(a,o),i(g).css("top",l.top),m=i('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(l).appendTo(t),o&&m.addClass("mce-visual-caret-before"),d(),c=a.ownerDocument.createRange(),f=g.firstChild,c.setStart(f,0),c.setEnd(f,1),c):(g=e.insertInline(a,o),c=a.ownerDocument.createRange(),s(g.nextSibling)?(c.setStart(g,0),c.setEnd(g,0)):(c.setStart(g,1),c.setEnd(g,1)),c)}function u(){l(),g&&(e.remove(g),g=null),m&&(m.remove(),m=null),clearInterval(p)}function d(){p=a.setInterval(function(){i("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden")},500)}function f(){a.clearInterval(p)}function h(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"}var p,m,g;return{show:c,hide:u,getCss:h,destroy:f}}}),r(Xe,[p,_,W],function(e,t,n){function r(i){function o(t){return e.map(t,function(e){return e=n.clone(e),e.node=i,e})}if(e.isArray(i))return e.reduce(i,function(e,t){return e.concat(r(t))},[]);if(t.isElement(i))return o(i.getClientRects());if(t.isText(i)){var a=i.ownerDocument.createRange();return a.setStart(i,0),a.setEnd(i,i.data.length),o(a.getClientRects())}}return{getClientRects:r}}),r(Ke,[z,p,Xe,U,te,ne,$,W],function(e,t,n,r,i,o,a,s){function l(e,t,n,o){for(;o=i.findNode(o,e,r.isEditableCaretCandidate,t);)if(n(o))return}function c(e,r,i,o,a,s){function c(o){var s,l,c;for(c=n.getClientRects(o),-1==e&&(c=c.reverse()),s=0;s<c.length;s++)if(l=c[s],!i(l,h)){if(f.length>0&&r(l,t.last(f))&&u++,l.line=u,a(l))return!0;f.push(l)}}var u=0,d,f=[],h;return(h=t.last(s.getClientRects()))?(d=s.getNode(),c(d),l(e,o,c,d),f):f}function u(e,t){return t.line>e}function d(e,t){return t.line===e}function f(e,n,r,i){function l(n){return 1==e?t.last(n.getClientRects()):t.last(n.getClientRects())}var c=new o(n),u,d,f,h,p=[],m=0,g,v;1==e?(u=c.next,d=s.isBelow,f=s.isAbove,h=a.after(i)):(u=c.prev,d=s.isAbove,f=s.isBelow,h=a.before(i)),v=l(h);do if(h.isVisible()&&(g=l(h),!f(g,v))){if(p.length>0&&d(g,t.last(p))&&m++,g=s.clone(g),g.position=h,g.line=m,r(g))return p;p.push(g)}while(h=u(h));return p}var h=e.curry,p=h(c,-1,s.isAbove,s.isBelow),m=h(c,1,s.isBelow,s.isAbove);return{upUntil:p,downUntil:m,positionsUntil:f,isAboveLine:h(u),isLine:h(d)}}),r(Ge,[z,p,_,Xe,W,te,U],function(e,t,n,r,i,o,a){function s(e,t){return Math.abs(e.left-t)}function l(e,t){return Math.abs(e.right-t)}function c(e,n){function r(e,t){return e>=t.left&&e<=t.right}return t.reduce(e,function(e,t){var i,o;return i=Math.min(s(e,n),l(e,n)),o=Math.min(s(t,n),l(t,n)),r(n,t)?t:r(n,e)?e:o==i&&m(t.node)?t:i>o?t:e})}function u(e,t,n,r){for(;r=g(r,e,a.isEditableCaretCandidate,t);)if(n(r))return}function d(e,n){function o(e,i){var o;return o=t.filter(r.getClientRects(i),function(t){return!e(t,n)}),a=a.concat(o),0===o.length}var a=[];return a.push(n),u(-1,e,v(o,i.isAbove),n.node),u(1,e,v(o,i.isBelow),n.node),a}function f(e){return t.filter(t.toArray(e.getElementsByTagName("*")),m)}function h(e,t){return{node:e.node,before:s(e,t)<l(e,t)}}function p(e,n,i){var o,a;return o=r.getClientRects(f(e)),o=t.filter(o,function(e){return i>=e.top&&i<=e.bottom}),a=c(o,n),a&&(a=c(d(e,a),n),a&&m(a.node))?h(a,n):null}var m=n.isContentEditableFalse,g=o.findNode,v=e.curry;return{findClosestClientRect:c,findLineNodeRects:d,closestCaret:p}}),r(Je,[],function(){var e=function(e){var t,n,r,i;return i=e.getBoundingClientRect(),t=e.ownerDocument,n=t.documentElement,r=t.defaultView,{top:i.top+r.pageYOffset-n.clientTop,left:i.left+r.pageXOffset-n.clientLeft}},t=function(t){return t.inline?e(t.getBody()):{left:0,top:0}},n=function(e){var t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}},r=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},i={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:i},i=function(t,n){if(n.target.ownerDocument!==t.getDoc()){var i=e(t.getContentAreaContainer()),o=r(t);return{left:n.pageX-i.left+o.left,top:n.pageY-i.top+o.top}}return{left:n.pageX,top:n.pageY}},o=function(e,t,n){return{pageX:n.left-e.left+t.left,pageY:n.top-e.top+t.top}},a=function(e,r){return o(t(e),n(e),i(e,r))};return{calc:a}}),r(Qe,[_,p,z,u,w,Je],function(e,t,n,r,i,o){var a=e.isContentEditableFalse,s=e.isContentEditableTrue,l=function(e){return a(e)},c=function(e,t,n){return t===n||e.dom.isChildOf(t,n)?!1:!a(t)},u=function(e){var t=e.cloneNode(!0);return t.removeAttribute("data-mce-selected"),t},d=function(e,t,n,r){var i=t.cloneNode(!0);e.dom.setStyles(i,{width:n,height:r}),e.dom.setAttrib(i,"data-mce-selected",null);var o=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(o,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(i,{margin:0,boxSizing:"border-box"}),o.appendChild(i),o},f=function(e,t){e.parentNode!==t&&t.appendChild(e)},h=function(e,t,n,r,i,o){var a=0,s=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>i&&(a=t.pageX+n-i), t.pageY+r>o&&(s=t.pageY+r-o),e.style.width=n-a+"px",e.style.height=r-s+"px"},p=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},m=function(e){return 0===e.button},g=function(e){return e.element},v=function(e,t){return{pageX:t.pageX-e.relX,pageY:t.pageY+5}},y=function(e,r){return function(i){if(m(i)){var o=t.find(r.dom.getParents(i.target),n.or(a,s));if(l(o)){var c=r.dom.getPos(o),u=r.getBody(),f=r.getDoc().documentElement;e.element=o,e.screenX=i.screenX,e.screenY=i.screenY,e.maxX=(r.inline?u.scrollWidth:f.offsetWidth)-2,e.maxY=(r.inline?u.scrollHeight:f.offsetHeight)-2,e.relX=i.pageX-c.x,e.relY=i.pageY-c.y,e.width=o.offsetWidth,e.height=o.offsetHeight,e.ghost=d(r,o,e.width,e.height)}}}},b=function(e,t){var n=r.throttle(function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n)},0);return function(r){var i=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(g(e)&&!e.dragging&&i>10){var a=t.fire("dragstart",{target:e.element});if(a.isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){var s=v(e,o.calc(t,r));f(e.ghost,t.getBody()),h(e.ghost,s,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY)}}},C=function(e,t){return function(n){if(e.dragging&&c(t,t.selection.getNode(),e.element)){var r=u(e.element),i=t.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});i.isDefaultPrevented()||(r=i.targetClone,t.undoManager.transact(function(){p(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret()}))}w(e)}},x=function(e,t){return function(){w(e),e.dragging&&t.fire("dragend")}},w=function(e){e.dragging=!1,e.element=null,p(e.ghost)},N=function(e){var t={},n,r,o,a,s,l;n=i.DOM,l=document,r=y(t,e),o=b(t,e),a=C(t,e),s=x(t,e),e.on("mousedown",r),e.on("mousemove",o),e.on("mouseup",a),n.bind(l,"mousemove",o),n.bind(l,"mouseup",s),e.on("remove",function(){n.unbind(l,"mousemove",o),n.unbind(l,"mouseup",s)})},E=function(e){e.on("drop",function(t){var n="undefined"!=typeof t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(a(n)||a(e.dom.getContentEditableParent(n)))&&t.preventDefault()})},_=function(e){N(e),E(e)};return{init:_}}),r(Ze,[d,ne,$,k,te,Ye,Ke,Ge,_,T,W,I,z,p,u,Qe,S],function(e,t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g){function v(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function y(c){function y(){var e=c.dom.get(le);return e?e.getElementsByTagName("*")[0]:e}function S(e){return c.dom.isBlock(e)}function k(e){e&&c.selection.setRng(e)}function T(){return c.selection.getRng()}function R(e,t){c.selection.scrollIntoView(e,t)}function A(e,t,n){var r;return r=c.fire("ShowCaret",{target:t,direction:e,before:n}),r.isDefaultPrevented()?null:(R(t,-1===e),se.show(n,t))}function B(e){var t;return se.hide(),t=c.fire("BeforeObjectSelected",{target:e}),t.isDefaultPrevented()?null:D(e)}function D(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}function L(e,t){var n=i.isInSameBlock(e,t);return!n&&l.isBr(e.getNode())?!0:n}function M(e,t){return t=i.normalizeRange(e,re,t),-1==e?n.fromRangeStart(t):n.fromRangeEnd(t)}function P(e){return r.isCaretContainerBlock(e.startContainer)}function O(e,t,n,r){var i,o,a,s;return!r.collapsed&&(i=_(r),x(i))?A(e,i,-1==e):(s=P(r),o=M(e,r),n(o)?B(o.getNode(-1==e)):(o=t(o))?n(o)?A(e,o.getNode(-1==e),1==e):(a=t(o),n(a)&&L(o,a)?A(e,a.getNode(-1==e),1==e):s?$(o.toRange()):null):s?r:null)}function H(e,t,n){var r,i,o,l,c,u,d,f,p;if(p=_(n),r=M(e,n),i=t(re,a.isAboveLine(1),r),o=h.filter(i,a.isLine(1)),c=h.last(r.getClientRects()),E(r)&&(p=r.getNode()),N(r)&&(p=r.getNode(!0)),!c)return null;if(u=c.left,l=s.findClosestClientRect(o,u),l&&x(l.node))return d=Math.abs(u-l.left),f=Math.abs(u-l.right),A(e,l.node,f>d);if(p){var m=a.positionsUntil(e,re,a.isAboveLine(1),p);if(l=s.findClosestClientRect(h.filter(m,a.isLine(1)),u))return $(l.position.toRange());if(l=h.last(h.filter(m,a.isLine(0))))return $(l.position.toRange())}}function I(t,r){function i(){var t=c.dom.create(c.settings.forced_root_block);return(!e.ie||e.ie>=11)&&(t.innerHTML='<br data-mce-bogus="1">'),t}var o,a,s;if(r.collapsed&&c.settings.forced_root_block){if(o=c.dom.getParent(r.startContainer,"PRE"),!o)return;a=1==t?oe(n.fromRangeStart(r)):ae(n.fromRangeStart(r)),a||(s=i(),1==t?c.$(o).after(s):c.$(o).before(s),c.selection.select(s,!0),c.selection.collapse())}}function F(e,t,n,r){var i;return(i=O(e,t,n,r))?i:(i=I(e,r),i?i:null)}function z(e,t,n){var r;return(r=H(e,t,n))?r:(r=I(e,n),r?r:null)}function U(){return ue("*[data-mce-caret]")[0]}function W(e){e=ue(e),e.attr("data-mce-caret")&&(se.hide(),e.removeAttr("data-mce-caret"),e.removeAttr("data-mce-bogus"),e.removeAttr("style"),k(T()),R(e[0]))}function V(e){var t,r;return e=i.normalizeRange(1,re,e),t=n.fromRangeStart(e),x(t.getNode())?A(1,t.getNode(),!t.isAtEnd()):x(t.getNode(!0))?A(1,t.getNode(!0),!1):(r=c.dom.getParent(t.getNode(),f.or(x,C)),x(r)?A(1,r,!1):(se.hide(),null))}function $(e){var t;return e&&e.collapsed?(t=V(e),t?t:e):e}function q(e){var t,i,o,a;return x(e)?(x(e.previousSibling)&&(o=e.previousSibling),i=ae(n.before(e)),i||(t=oe(n.after(e))),t&&w(t.getNode())&&(a=t.getNode()),r.remove(e.previousSibling),r.remove(e.nextSibling),c.dom.remove(e),ee(),c.dom.isEmpty(c.getBody())?(c.setContent(""),void c.focus()):o?n.after(o).toRange():a?n.before(a).toRange():i?i.toRange():t?t.toRange():null):null}function j(e){var t=c.schema.getTextBlockElements();return e.nodeName in t}function Y(e){return c.dom.isEmpty(e)}function X(e,t,r){var i=c.dom,o,a,s,l;if(o=i.getParent(t.getNode(),i.isBlock),a=i.getParent(r.getNode(),i.isBlock),-1===e){if(l=r.getNode(!0),N(r)&&S(l))return j(o)?(Y(o)&&i.remove(o),n.after(l).toRange()):q(r.getNode(!0))}else if(l=t.getNode(),E(t)&&S(l))return j(a)?(Y(a)&&i.remove(a),n.before(l).toRange()):q(t.getNode());if(o===a||!j(o)||!j(a))return null;for(;s=o.firstChild;)a.appendChild(s);return c.dom.remove(o),r.toRange()}function K(e,t,n,i){var o,a,s,l;return!i.collapsed&&(o=_(i),x(o))?$(q(o)):(a=M(e,i),n(a)&&r.isCaretContainerBlock(i.startContainer)?(l=-1==e?ie.prev(a):ie.next(a),l?$(l.toRange()):i):t(a)?$(q(a.getNode(-1==e))):(s=-1==e?ie.prev(a):ie.next(a),t(s)?-1===e?X(e,a,s):X(e,s,a):void 0))}function G(){function r(e,t){var n=t(T());n&&!e.isDefaultPrevented()&&(e.preventDefault(),k(n))}function i(e){for(var t=c.getBody();e&&e!=t;){if(C(e)||x(e))return e;e=e.parentNode}return null}function o(e,t,n){return n.collapsed?!1:h.reduce(n.getClientRects(),function(n,r){return n||u.containsXY(r,e,t)},!1)}function l(e){var t=!1;e.on("touchstart",function(){t=!1}),e.on("touchmove",function(){t=!0}),e.on("touchend",function(e){var n=i(e.target);x(n)?t||(e.preventDefault(),Z(B(n))):ee()})}function f(){var e,t=i(c.selection.getNode());C(t)&&S(t)&&c.dom.isEmpty(t)&&(e=c.dom.create("br",{"data-mce-bogus":"1"}),c.$(t).empty().append(e),c.selection.setRng(n.before(e).toRange()))}function g(e){var t=U();if(t)return"compositionstart"==e.type?(e.preventDefault(),e.stopPropagation(),void W(t)):void(" "!=t.innerHTML&&W(t))}function v(e){var t;switch(e.keyCode){case d.DELETE:t=f();break;case d.BACKSPACE:t=f()}t&&e.preventDefault()}var w=b(F,1,oe,E),_=b(F,-1,ae,N),R=b(K,1,E,N),D=b(K,-1,N,E),L=b(z,-1,a.upUntil),M=b(z,1,a.downUntil);c.on("mouseup",function(){var e=T();e.collapsed&&k(V(e))}),c.on("click",function(e){var t;t=i(e.target),t&&x(t)&&(e.preventDefault(),c.focus())});var P=function(e){var r=new t(e);if(!e.firstChild)return!1;var i=n.before(e.firstChild),o=r.next(i);return o&&!E(o)&&!N(o)},O=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n===r},H=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n&&!O(n,r)&&P(n)};l(c),c.on("mousedown",function(e){var t;if(t=i(e.target))x(t)?(e.preventDefault(),Z(B(t))):(ee(),o(e.clientX,e.clientY,c.selection.getRng())||c.selection.placeCaretAt(e.clientX,e.clientY));else{ee(),se.hide();var n=s.closestCaret(re,e.clientX,e.clientY);n&&(H(e.target,n.node)||(e.preventDefault(),c.getBody().focus(),k(A(1,n.node,n.before))))}}),c.on("keydown",function(e){if(!d.modifierPressed(e))switch(e.keyCode){case d.RIGHT:r(e,w);break;case d.DOWN:r(e,M);break;case d.LEFT:r(e,_);break;case d.UP:r(e,L);break;case d.DELETE:r(e,R);break;case d.BACKSPACE:r(e,D);break;default:x(c.selection.getNode())&&e.preventDefault()}}),c.on("keyup compositionstart",function(e){g(e),v(e)},!0),c.on("cut",function(){var e=c.selection.getNode();x(e)&&p.setEditorTimeout(c,function(){k($(q(e)))})}),c.on("getSelectionRange",function(e){var t=e.range;if(ce){if(!ce.parentNode)return void(ce=null);t=t.cloneRange(),t.selectNode(ce),e.range=t}}),c.on("setSelectionRange",function(e){var t;t=Z(e.range),t&&(e.range=t)}),c.on("focus",function(){p.setEditorTimeout(c,function(){c.selection.setRng($(c.selection.getRng()))},0)}),c.on("copy",function(t){var n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!e.ie){var r=y();r&&(t.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),m.init(c)}function J(){var e=c.contentStyles,t=".mce-content-body";e.push(se.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")}function Q(e){return r.isCaretContainer(e.startContainer)||r.isCaretContainer(e.endContainer)}function Z(t){var n,r=c.$,i=c.dom,o,a,s,l,u,d,f,h,p;if(!t)return ee(),null;if(t.collapsed){if(ee(),!Q(t)){if(f=M(1,t),x(f.getNode()))return A(1,f.getNode(),!f.isAtEnd());if(x(f.getNode(!0)))return A(1,f.getNode(!0),!1)}return null}return s=t.startContainer,l=t.startOffset,u=t.endOffset,3==s.nodeType&&0==l&&x(s.parentNode)&&(s=s.parentNode,l=i.nodeIndex(s),s=s.parentNode),1!=s.nodeType?(ee(),null):(u==l+1&&(n=s.childNodes[l]),x(n)?(h=p=n.cloneNode(!0),d=c.fire("ObjectSelected",{target:n,targetClone:h}),d.isDefaultPrevented()?(ee(),null):(h=d.targetClone,o=r("#"+le),0===o.length&&(o=r('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",le),o.appendTo(c.getBody())),t=c.dom.createRng(),h===p&&e.ie?(o.empty().append(g.ZWSP).append(h).append(g.ZWSP),t.setStart(o[0].firstChild,0),t.setEnd(o[0].lastChild,1)):(o.empty().append("\xa0").append(h).append("\xa0"),t.setStart(o[0].firstChild,1),t.setEnd(o[0].lastChild,0)),o.css({top:i.getPos(n,c.getBody()).y}),o[0].focus(),a=c.selection.getSel(),a.removeAllRanges(),a.addRange(t),c.$("*[data-mce-selected]").removeAttr("data-mce-selected"),n.setAttribute("data-mce-selected",1),ce=n,t)):(ee(),null))}function ee(){ce&&(ce.removeAttribute("data-mce-selected"),c.$("#"+le).remove(),ce=null)}function te(){se.destroy(),ce=null}function ne(){se.hide()}var re=c.getBody(),ie=new t(re),oe=b(v,ie.next),ae=b(v,ie.prev),se=new o(c.getBody(),S),le="sel-"+c.dom.uniqueId(),ce,ue=c.$;return e.ceFalse&&(G(),J()),{showBlockCaretContainer:W,hideFakeCaret:ne,destroy:te}}var b=f.curry,C=l.isContentEditableTrue,x=l.isContentEditableFalse,w=l.isElement,N=i.isAfterContentEditableFalse,E=i.isBeforeContentEditableFalse,_=c.getSelectedNode;return y}),r(et,[],function(){var e=0,t=function(){var e=function(){return Math.round(4294967295*Math.random()).toString(36)},t=(new Date).getTime();return"s"+t.toString(36)+e()+e()+e()},n=function(n){return n+e++ +t()};return{uuid:n}}),r(tt,[w,g,E,R,A,O,P,Y,J,Q,Z,ee,oe,ae,N,f,Ae,Pe,B,L,He,d,m,u,Ie,Fe,ze,je,Ze,et],function(e,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A){function B(e,t,i){var o=this,a,s,l;a=o.documentBaseUrl=i.documentBaseURL,s=i.baseURI,l=i.defaultSettings,t=P({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:a,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o,ie7_compat:!0},l,t),l&&l.external_plugins&&t.external_plugins&&(t.external_plugins=P({},l.external_plugins,t.external_plugins)),o.settings=t,r.language=t.language||"en",r.languageLoad=t.language_load,r.baseURL=i.baseURL,o.id=t.id=e,o.setDirty(!1),o.plugins={},o.documentBaseURI=new p(t.document_base_url||a,{base_uri:s}),o.baseURI=s,o.contentCSS=[],o.contentStyles=[],o.shortcuts=new k(o),o.loadedCSS={},o.editorCommands=new h(o),t.target&&(o.targetElm=t.target),o.suffix=i.suffix,o.editorManager=i,o.inline=t.inline,o.settings.content_editable=o.inline,t.cache_suffix&&(w.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),t.override_viewport===!1&&(w.overrideViewPort=!1),i.fire("SetupEditor",o),o.execCallback("setup",o),o.$=n.overrideDefaults(function(){return{context:o.inline?o.getBody():o.getDoc(),element:o.getBody()}})}var D=e.DOM,L=r.ThemeManager,M=r.PluginManager,P=N.extend,O=N.each,H=N.explode,I=N.inArray,F=N.trim,z=N.resolve,U=g.Event,W=w.gecko,V=w.ie;return B.prototype={render:function(){function e(){D.unbind(window,"ready",e),n.render()}function t(){var e=m.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!L.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",L.load(r.theme,t)}N.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),O(r.external_plugins,function(e,t){M.load(t,e),r.plugins+=" "+t}),O(r.plugins.split(/[ ,]/),function(e){if(e=F(e),e&&!M.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=M.dependencies(e);O(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=M.createUrl(t,e),M.load(e.resource,e)})}else M.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!U.domLoaded)return void D.bind(window,"ready",e);if(n.getElement()&&w.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||D.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(D.insertAfter(D.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},D.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.setDirty(!1),a._mceOldSubmit(a)})),n.windowManager=new v(n),n.notificationManager=new y(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=D.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),n.editorManager.add(n),t()}},init:function(){function e(n){var r=M.get(n),i,o;if(i=M.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=F(n),r&&-1===I(m,n)){if(O(M.dependencies(n),function(t){e(t)}),t.plugins[n])return;o=new r(t,i,t.$),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n))}}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,h,p,m=[];if(t.rtl=n.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(n.language),n.aria_label=n.aria_label||D.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=L.get(n.theme),t.theme=new c(t,L.urls[n.theme]),t.theme.init&&t.theme.init(t,L.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""),t.$)):t.theme=n.theme),O(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,h=/^[0-9\.]+(|px)$/i,h.test(""+i)&&(i=Math.max(parseInt(i,10),100)),h.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&O(H(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();if(t.iframeHTML=n.doctype+"<html><head>",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+='<base href="'+t.documentBaseURI.getURI()+'" />'),!w.caretAfter&&n.ie7_compat&&(t.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'),t.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',!/#$/.test(document.location.href))for(p=0;p<t.contentCSS.length;p++){var g=t.contentCSS[p];t.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+N._addCacheSuffix(g)+'" />',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),n.content_security_policy&&(t.iframeHTML+='<meta http-equiv="Content-Security-Policy" content="'+n.content_security_policy+'" />'),t.iframeHTML+='</head><body id="'+d+'" class="mce-content-body '+f+'" data-id="'+t.id+'"><br></body></html>';var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';document.domain!=location.hostname&&w.ie&&w.ie<12&&(u=v);var y=D.create("iframe",{id:t.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}});if(y.onload=function(){y.onload=null,t.fire("load")},D.setAttrib(y,"src",u||'javascript:""'),t.contentAreaContainer=l.iframeContainer,t.iframeElement=y,s=D.add(l.iframeContainer,y),V)try{t.getDoc()}catch(b){s.src=u=v}l.editorContainer&&(D.get(l.editorContainer).style.display=t.orgDisplay,t.hidden=D.isHidden(l.editorContainer)),t.getElement().style.display="none",D.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,r=n.settings,s=n.getElement(),h=n.getDoc(),p,m;r.inline||(n.getElement().style.visibility=n.orgVisibility),t||r.content_editable||(h.open(),h.write(n.iframeHTML),h.close()),r.content_editable&&(n.on("remove",function(){var e=this.getBody();D.removeClass(e,"mce-content-body"),D.removeClass(e,"mce-edit-focus"),D.setAttrib(e,"contentEditable",null)}),D.addClass(s,"mce-content-body"),n.contentDocument=h=r.content_document||document,n.contentWindow=r.content_window||window,n.bodyElement=s,r.content_document=r.content_window=null,r.root_name=s.nodeName.toLowerCase()),p=n.getBody(),p.disabled=!0,n.readonly=r.readonly,n.readonly||(n.inline&&"static"==D.getStyle(p,"position",!0)&&(p.style.position="relative"),p.contentEditable=n.getParam("content_editable_state",!0)),p.disabled=!1,n.editorUpload=new T(n),n.schema=new b(r),n.dom=new e(h,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:n.inline?n.getBody():null,collect:r.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new C(r,n.schema),n.parser.addAttributeFilter("src,href,style,tabindex",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)if(i=e[r],a=i.attr(t),s="data-mce-"+t,!i.attributes.map[s]){if(0===a.indexOf("data:")||0===a.indexOf("blob:"))continue;"style"===t?(a=o.serializeStyle(o.parseStyle(a),i.name),a.length||(a=null),i.attr(s,a),i.attr(t,a)):"tabindex"===t?(i.attr(s,a),i.attr(t,null)):i.attr(s,n.convertURL(a,t,i.name))}}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("type")||"no/type",0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,r,i=n.schema.getNonEmptyElements();t--;)r=e[t],r.isEmpty(i)&&(r.append(new o("br",1)).shortEnded=!0)}),n.serializer=new a(r,n),n.selection=new l(n.dom,n.getWin(),n.serializer,n),n.formatter=new c(n),n.undoManager=new u(n),n.forceBlocks=new f(n),n.enterKey=new d(n),n._nodeChangeDispatcher=new i(n),n._selectionOverrides=new R(n),n.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(h.body.spellcheck=!1,D.setAttrib(p,"spellcheck","false")),n.quirks=new x(n),n.fire("PostRender"),r.directionality&&(p.dir=r.directionality),r.nowrap&&(p.style.whiteSpace="nowrap"),r.protect&&n.on("BeforeSetContent",function(e){O(r.protect,function(t){e.content=e.content.replace(t,function(e){return"<!--mce:protected "+escape(e)+"-->"})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),r.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,n.bindPendingEventDelegates(),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.on("compositionstart compositionend",function(e){n.composing="compositionstart"===e.type}),n.contentStyles.length>0&&(m="",O(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),O(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),r.auto_focus&&E.setEditorTimeout(n,function(){var e;e=r.auto_focus===!0?n:n.editorManager.get(r.auto_focus),e.destroyed||e.focus()},100),s=h=p=null},focus:function(e){function t(e){return n.dom.getParent(e,function(e){return"true"===n.dom.getContentEditable(e)})}var n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l=n.getBody(),c;if(!e){if(o=r.getRng(),o.item&&(a=o.item(0)),n.quirks.refreshContentEditable(),c=t(r.getNode()),n.$.contains(l,c))return c.focus(),r.normalize(),void n.editorManager.setActive(n);if(i||(w.opera||n.getBody().focus(),n.getWin().focus()),W||i){if(l.setActive)try{l.setActive()}catch(u){l.focus()}else l.focus();i&&r.normalize()}a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())}n.editorManager.setActive(n)},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?z(r):0,n=z(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?(e=n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}),this.editorManager.translate(e)):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?O(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(e){e=e.split("="),e.length>1?i[F(e[0])]=F(e[1]):i[F(e[0])]=F(e)}):i=r,i):r},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addContextToolbar:function(e,t){var n=this,r;n.contextToolbars=n.contextToolbars||[],"string"==typeof e&&(r=e,e=function(e){return n.dom.is(e,r)}),n.contextToolbars.push({id:A.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable=!0:(D.show(e.getContainer()),D.hide(e.id)),e.load(),e.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(V&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e==e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(D.hide(e.getContainer()),D.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),"raw"==e.format&&t.fire("RawSaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=D.getParent(t.id,"form"))&&O(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&t.setDirty(!1),r},setContent:function(e,t){var n=this,r=n.getBody(),i,o;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(o=V&&11>V?"":'<br data-mce-bogus="1">',"TABLE"==r.nodeName?e="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(r.nodeName)&&(e="<li>"+o+"</li>"),i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=o,e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):V||e||(e='<br data-mce-bogus="1">'),n.dom.setHTML(r,e),n.fire("SetContent",t)):("raw"!==t.format&&(e=new s({validate:n.validate},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=F(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?t.serializer.getTrimmedContent():"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),"text"!=e.format?e.content=F(n):e.content=n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=P({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!=t&&this.fire("dirty")},setMode:function(e){S.setMode(this,e)},getContainer:function(){var e=this;return e.container||(e.container=D.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=D.get(this.id)),this.targetElm},getWin:function(){var e=this,t;return e.contentWindow||(t=e.iframeElement,t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),O(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||!n.hasVisual?i.removeClass(e,o):i.addClass(e,o));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&n.hasVisual?i.addClass(e,o):i.removeClass(e,o)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&D.remove(e.getElement().nextSibling),e.inline||(V&&10>V&&e.getDoc().execCommand("SelectAll",!1,null),D.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),D.remove(e.getContainer()),e._selectionOverrides.destroy(),e.editorUpload.destroy(),e.destroy())},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),D.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},P(B.prototype,_),B}),r(nt,[],function(){var e={},t="en";return{setCode:function(e){e&&(t=e,this.rtl=this.data[e]?"rtl"===this.data[e]._dir:!1)},getCode:function(){return t},rtl:!1,add:function(t,n){var r=e[t];r||(e[t]=r={});for(var i in n)r[i]=n[i];this.setCode(t)},translate:function(n){var r;if(r=e[t],r||(r={}),"undefined"==typeof n)return n;if("string"!=typeof n&&n.raw)return n.raw;if(n.push){var i=n.slice(1);n=(r[n[0]]||n[0]).replace(/\{([0-9]+)\}/g,function(e,t){return i[t]})}return(r[n]||n).replace(/{context:\w+}$/,"")},data:e}}),r(rt,[w,u,d],function(e,t,n){function r(e){function l(){try{return document.activeElement}catch(e){return document.body}}function c(e,t){if(t&&t.startContainer){if(!e.isChildOf(t.startContainer,e.getRoot())||!e.isChildOf(t.endContainer,e.getRoot()))return;return{startContainer:t.startContainer, startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset}}return t}function u(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function d(e){return!!s.getParent(e,r.isEditorUIElement)}function f(r){var f=r.editor;f.on("init",function(){(f.inline||n.ie)&&("onbeforedeactivate"in document&&n.ie<9?f.dom.bind(f.getBody(),"beforedeactivate",function(e){if(e.target==f.getBody())try{f.lastRng=f.selection.getRng()}catch(t){}}):f.on("nodechange mouseup keyup",function(e){var t=l();"nodechange"==e.type&&e.selectionChange||(t&&t.id==f.id+"_ifr"&&(t=f.getBody()),f.dom.isChildOf(t,f.getBody())&&(f.lastRng=f.selection.getRng()))}),n.webkit&&!i&&(i=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(f.lastRng=n)}},s.bind(document,"selectionchange",i)))}),f.on("setcontent",function(){f.lastRng=null}),f.on("mousedown",function(){f.selection.lastFocusBookmark=null}),f.on("focusin",function(){var t=e.focusedEditor,n;f.selection.lastFocusBookmark&&(n=u(f,f.selection.lastFocusBookmark),f.selection.lastFocusBookmark=null,f.selection.setRng(n)),t!=f&&(t&&t.fire("blur",{focusedEditor:f}),e.setActive(f),e.focusedEditor=f,f.fire("focus",{blurredEditor:t}),f.focus(!0)),f.lastRng=null}),f.on("focusout",function(){t.setEditorTimeout(f,function(){var t=e.focusedEditor;d(l())||t!=f||(f.fire("blur",{focusedEditor:null}),e.focusedEditor=null,f.selection&&(f.selection.lastFocusBookmark=null))})}),o||(o=function(t){var n=e.activeEditor,r;r=t.target,n&&r.ownerDocument==document&&(n.selection&&r!=n.getBody()&&(n.selection.lastFocusBookmark=c(n.dom,n.lastRng)),r==document.body||d(r)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},s.bind(document,"focusin",o)),f.inline&&!a&&(a=function(t){var n=e.activeEditor,r=n.dom;if(n.inline&&r&&!r.isChildOf(t.target,n.getBody())){var i=n.selection.getRng();i.collapsed||(n.lastRng=i)}},s.bind(document,"mouseup",a))}function h(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(s.unbind(document,"selectionchange",i),s.unbind(document,"focusin",o),s.unbind(document,"mouseup",a),i=o=a=null)}e.on("AddEditor",f),e.on("RemoveEditor",h)}var i,o,a,s=e.DOM;return r.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},r}),r(it,[tt,g,w,ae,d,m,c,ue,nt,rt],function(e,t,n,r,i,o,a,s,l,c){function u(e){g(C.editors,function(t){"scroll"===e.type?t.fire("ScrollWindow",e):t.fire("ResizeWindow",e)})}function d(e,n){n!==x&&(n?t(window).on("resize scroll",u):t(window).off("resize scroll",u),x=n)}function f(e){var t=C.editors,n;delete t[e.id];for(var r=0;r<t.length;r++)if(t[r]==e){t.splice(r,1),n=!0;break}return C.activeEditor==e&&(C.activeEditor=t[0]),C.focusedEditor==e&&(C.focusedEditor=null),n}function h(e){return e&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(f(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null),e}var p=n.DOM,m=o.explode,g=o.each,v=o.extend,y=0,b,C,x=!1;return C={$:t,majorVersion:"4",minorVersion:"4.3",releaseDate:"2016-09-01",editors:[],i18n:l,activeEditor:null,setup:function(){var e=this,t,n,i="",o,a;if(n=r.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/")),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else{for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){a=s[l].src;var u=a.substring(a.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(a)){-1!=u.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/"));break}}!t&&document.currentScript&&(a=document.currentScript.src,-1!=a.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/")))}e.baseURL=new r(n).toAbsolute(t),e.documentBaseURL=n,e.baseURI=new r(e.baseURL),e.suffix=i,e.focusManager=new c(e)},overrideDefaults:function(e){var t,n;t=e.base_url,t&&(this.baseURL=new r(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new r(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n),this.defaultSettings=e},init:function(n){function r(e,t){return e.inline&&t.tagName.toLowerCase()in C}function i(e,t){window.console&&!window.test&&window.console.log(e,t)}function s(e){var t=e.id;return t||(t=e.name,t=t&&!p.get(t)?e.name:p.uniqueId(),e.setAttribute("id",t)),t}function l(e){var t=n[e];if(t)return t.apply(f,Array.prototype.slice.call(arguments,2))}function c(e,t){return t.constructor===RegExp?t.test(e.className):p.hasClass(e,t)}function u(e){var t,n=[];if(e.types)return g(e.types,function(e){n=n.concat(p.select(e.selector))}),n;if(e.selector)return p.select(e.selector);if(e.target)return[e.target];switch(e.mode){case"exact":t=e.elements||"",t.length>0&&g(m(t),function(e){var t;(t=p.get(e))?n.push(t):g(document.forms,function(t){g(t.elements,function(t){t.name===e&&(e="mce_editor_"+y++,p.setAttrib(t,"id",e),n.push(t))})})});break;case"textareas":case"specific_textareas":g(p.select("textarea"),function(t){e.editor_deselector&&c(t,e.editor_deselector)||e.editor_selector&&!c(t,e.editor_selector)||n.push(t)})}return n}function d(){function a(t,n,r){var i=new e(t,n,f);m.push(i),i.on("init",function(){++c===y.length&&x(m)}),i.targetElm=i.targetElm||r,i.render()}var c=0,m=[],y;return p.unbind(window,"ready",d),l("onpageload"),y=t.unique(u(n)),n.types?void g(n.types,function(e){o.each(y,function(t){return p.is(t,e.selector)?(a(s(t),v({},n,e),t),!1):!0})}):(o.each(y,function(e){h(f.get(e.id))}),y=o.grep(y,function(e){return!f.get(e.id)}),void g(y,function(e){r(n,e)?i("Could not initialize inline editor on invalid inline target element",e):a(s(e),n,e)}))}var f=this,b,C;C=o.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var x=function(e){b=e};return f.settings=n,p.bind(window,"ready",d),new a(function(e){b?e(b):x=function(t){e(t)}})},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),d(n,!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),b||(b=function(){t.fire("BeforeUnload")},p.bind(window,"beforeunload",b)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void g(p.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(f(i)&&t.fire("RemoveEditor",{editor:i}),r.length||p.unbind(window,"beforeunload",b),i.remove(),d(r,r.length>0),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){g(this.editors,function(e){e.save()})},addI18n:function(e,t){l.add(e,t)},translate:function(e){return l.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},v(C,s),C.setup(),window.tinymce=window.tinyMCE=C,C}),r(ot,[it,m],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(n,r){"html4"===t.settings.schema&&e(r,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(at,[ue,m],function(e,t){var n={send:function(e){function r(){!e.async||4==i.readyState||o++>1e4?(e.success&&1e4>o&&200==i.status?e.success.call(e.success_scope,""+i.responseText,i,e):e.error&&e.error.call(e.error_scope,o>1e4?"TIMED_OUT":"GENERAL",i,e),i=null):setTimeout(r,10)}var i,o=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async!==!1,e.data=e.data||"",n.fire("beforeInitialize",{settings:e}),i=new XMLHttpRequest){if(i.overrideMimeType&&i.overrideMimeType(e.content_type),i.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(i.withCredentials=!0),e.content_type&&i.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&t.each(e.requestheaders,function(e){i.setRequestHeader(e.key,e.value)}),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i=n.fire("beforeSend",{xhr:i,settings:e}).xhr,i.send(e.data),!e.async)return r();setTimeout(r,10)}}};return t.extend(n,e),n}),r(st,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r<t.length;r++)i+=(r>0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(lt,[st,at,m],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(ct,[w],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(ut,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(dt,[w,f,N,E,m,d],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(ft,[se,m],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t=this,n=t.settings,r,i,o,a;r=n.firstControlClass,i=n.lastControlClass,e.each(function(e){e.classes.remove(r).remove(i).add(n.controlClass),e.visible()&&(o||(o=e),a=e)}),o&&o.classes.add(r),a&&a.classes.add(i)},renderHtml:function(e){var t=this,n="";return t.applyClasses(e.items()),e.items().each(function(e){n+=e.renderHtml()}),n},recalc:function(){},postRender:function(){},isNative:function(){return!1}})}),r(ht,[ft],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}})}),r(pt,[De],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t._super(e),e=t.settings,n=t.settings.size,t.on("click mousedown",function(e){e.preventDefault()}),t.on("touchstart",function(e){t.fire("click",e),e.preventDefault()}),e.subtype&&t.classes.add(e.subtype),n&&t.classes.add("btn-"+n),e.icon&&t.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e=this.getEl().firstChild,t;e&&(t=e.style,t.width=t.height="100%"),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("icon"),i,o=e.state.get("text"),a="";return i=e.settings.image,i?(r="none","string"!=typeof i&&(i=window.getSelection?i[0]:i[1]),i=" style=\"background-image: url('"+i+"')\""):i="",o&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(o)+"</span>"),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'<div id="'+t+'" class="'+e.classes+'" tabindex="-1" aria-labelledby="'+t+'"><button role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+i+"></i>":"")+a+"</button></div>"},bindStates:function(){function e(e){var i=n("span."+r,t.getEl());e?(i[0]||(n("button:first",t.getEl()).append('<span class="'+r+'"></span>'),i=n("span."+r,t.getEl())),i.html(t.encode(e))):i.remove(),t.classes.toggle("btn-has-text",!!e)}var t=this,n=t.$,r=t.classPrefix+"txt";return t.state.on("change:text",function(t){e(t.value)}),t.state.on("change:icon",function(n){var r=n.value,i=t.classPrefix;t.settings.icon=r,r=r?i+"ico "+i+"i-"+t.settings.icon:"";var o=t.getEl().firstChild,a=o.getElementsByTagName("i")[0];r?(a&&a==o.firstChild||(a=document.createElement("i"),o.insertBefore(a,o.firstChild)),a.className=r):a&&o.removeChild(a),e(t.state.get("text"))}),t._super()}})}),r(mt,[xe],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(gt,[De],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'" unselectable="on" aria-labelledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'label">'+e.encode(e.state.get("text"))+"</span></div>"},bindStates:function(){function e(e){t.classes.toggle("checked",e),t.aria("checked",e)}var t=this;return t.state.on("change:text",function(e){t.getEl("al").firstChild.data=t.translate(e.value)}),t.state.on("change:checked change:value",function(n){t.fire("change"),e(n.value)}),t.state.on("change:icon",function(e){var n=e.value,r=t.classPrefix;if("undefined"==typeof n)return t.settings.icon;t.settings.icon=n,n=n?r+"ico "+r+"i-"+t.settings.icon:"";var i=t.getEl().firstChild,o=i.getElementsByTagName("i")[0];n?(o&&o==i.firstChild||(o=document.createElement("i"),i.insertBefore(o,i.firstChild)),o.className=n):o&&i.removeChild(o)}),t.state.get("checked")&&e(!0),t._super()}})}),r(vt,[De,be,pe,g],function(e,t,n,r){return e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.classes.add("combobox"),t.subinput=!0,t.ariaTarget="inp",e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){var i=n.target,o=t.getEl();if(r.contains(o,i)||i==o)for(;i&&i!=o;)i.id&&-1!=i.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),i=i.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){var r=t.state.get("value"),i=t.getEl("inp").value;return e.preventDefault(),t.state.set("value",i),r!=i&&t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),t.on("keyup",function(e){"INPUT"==e.target.nodeName&&t.state.set("value",e.target.value)})},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),i=e.getEl("open"),o=e.layoutRect(),a,s;a=i?o.w-n.getSize(i).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(s=e.layoutRect().h-2+"px"),r(t.firstChild).css({width:a,lineHeight:s}),e._super(),e},postRender:function(){var e=this;return r(this.getEl("inp")).on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)}),e._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=e.state.get("value")||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e.state.get("text"),(o||a)&&(s='<div id="'+t+'-open" class="'+r+"btn "+r+'open" tabIndex="-1" role="button"><button id="'+t+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!=o?'<i class="'+o+'"></i>':'<i class="'+r+'caret"></i>')+(a?(o?" ":"")+a:"")+"</button></div>",e.classes.add("has-open")),'<div id="'+t+'" class="'+e.classes+'"><input id="'+t+'-inp" class="'+r+'textbox" value="'+e.encode(i,!1)+'" hidefocus="1"'+l+' placeholder="'+e.encode(n.placeholder)+'" />'+s+"</div>"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl("inp").value!=t.value&&(e.getEl("inp").value=t.value)}),e.state.on("change:disabled",function(t){e.getEl("inp").disabled=t.value}),e._super()},remove:function(){r(this.getEl("inp")).off(),this._super()}})}),r(yt,[vt],function(e){return e.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl().getElementsByTagName("i")[0];if(t)try{t.style.background=e}catch(n){}},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.state.get("rendered")&&e.repaintColor(t.value)}),e._super()}})}),r(bt,[pt,ke],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),r(Ct,[bt,w],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("text"),i=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",a="";return r&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(r)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(i?'<i class="'+i+'"'+o+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+a+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(xt,[],function(){function e(e){function i(e,i,o){var a,s,l,c,u,d;return a=0,s=0,l=0,e/=255,i/=255,o/=255,u=t(e,t(i,o)),d=n(e,n(i,o)),u==d?(l=u,{h:0,s:0,v:100*l}):(c=e==u?i-o:o==u?e-i:o-e,a=e==u?3:o==u?1:5,a=60*(a-c/(d-u)),s=(d-u)/d,l=d,{h:r(a),s:r(100*s),v:r(100*l)})}function o(e,i,o){var a,s,l,c;if(e=(parseInt(e,10)||0)%360,i=parseInt(i,10)/100,o=parseInt(o,10)/100,i=n(0,t(i,1)),o=n(0,t(o,1)),0===i)return void(d=f=h=r(255*o));switch(a=e/60,s=o*i,l=s*(1-Math.abs(a%2-1)),c=o-s,Math.floor(a)){case 0:d=s,f=l,h=0;break;case 1:d=l,f=s,h=0;break;case 2:d=0,f=s,h=l;break;case 3:d=0,f=l,h=s;break;case 4:d=l,f=0,h=s;break;case 5:d=s,f=0,h=l;break;default:d=f=h=0}d=r(255*(d+c)),f=r(255*(f+c)),h=r(255*(h+c))}function a(){function e(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+e(d)+e(f)+e(h)}function s(){return{r:d,g:f,b:h}}function l(){return i(d,f,h)}function c(e){var t;return"object"==typeof e?"r"in e?(d=e.r,f=e.g,h=e.b):"v"in e&&o(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(d=parseInt(t[1],10),f=parseInt(t[2],10),h=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(d=parseInt(t[1],16),f=parseInt(t[2],16),h=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(d=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16),h=parseInt(t[3]+t[3],16)),d=0>d?0:d>255?255:d,f=0>f?0:f>255?255:f,h=0>h?0:h>255?255:h,u}var u=this,d=0,f=0,h=0;e&&c(e),u.toRgb=s,u.toHsv=l,u.toHex=a,u.parse=c}var t=Math.min,n=Math.max,r=Math.round;return e}),r(wt,[De,we,pe,xt],function(e,t,n,r){return e.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){function e(e,t){var r=n.getPos(e),i,o;return i=t.pageX-r.x,o=t.pageY-r.y,i=Math.max(0,Math.min(i/e.clientWidth,1)),o=Math.max(0,Math.min(o/e.clientHeight,1)),{x:i,y:o}}function i(e,t){var i=(360-e.h)/360;n.css(d,{top:100*i+"%"}),t||n.css(h,{left:e.s+"%",top:100-e.v+"%"}),f.style.background=new r({s:100,v:100,h:e.h}).toHex(),s.color().parse({s:e.s,v:e.v,h:e.h})}function o(t){var n;n=e(f,t),c.s=100*n.x,c.v=100*(1-n.y),i(c),s.fire("change")}function a(t){var n;n=e(u,t),c=l.toHsv(),c.h=360*(1-n.y),i(c,!0),s.fire("change")}var s=this,l=s.color(),c,u,d,f,h;u=s.getEl("h"),d=s.getEl("hp"),f=s.getEl("sv"),h=s.getEl("svp"),s._repaint=function(){c=l.toHsv(),i(c)},s._super(),s._svdraghelper=new t(s._id+"-sv",{start:o,drag:o}),s._hdraghelper=new t(s._id+"-h",{start:a,drag:a}),s._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;return arguments.length?(t.color().parse(e),void(t._rendered&&t._repaint())):t.color().toHex()},color:function(){return this._color||(this._color=new r),this._color},renderHtml:function(){function e(){var e,t,n="",i,a;for(i="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",a=o.split(","),e=0,t=a.length-1;t>e;e++)n+='<div class="'+r+'colorpicker-h-chunk" style="height:'+100/t+"%;"+i+a[e]+",endColorstr="+a[e+1]+");-ms-"+i+a[e]+",endColorstr="+a[e+1]+')"></div>';return n}var t=this,n=t._id,r=t.classPrefix,i,o="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",a="background: -ms-linear-gradient(top,"+o+");background: linear-gradient(to bottom,"+o+");";return i='<div id="'+n+'-h" class="'+r+'colorpicker-h" style="'+a+'">'+e()+'<div id="'+n+'-hp" class="'+r+'colorpicker-h-marker"></div></div>','<div id="'+n+'" class="'+t.classes+'"><div id="'+n+'-sv" class="'+r+'colorpicker-sv"><div class="'+r+'colorpicker-overlay1"><div class="'+r+'colorpicker-overlay2"><div id="'+n+'-svp" class="'+r+'colorpicker-selector1"><div class="'+r+'colorpicker-selector2"></div></div></div></div></div>'+i+"</div>"}})}),r(Nt,[De],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.classes.add("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.row()[n],index:n})}),t.row(t.settings.row)},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){var e=this;return'<div id="'+e._id+'" class="'+e.classes+'">'+e._getDataPathHtml(e.state.get("row"))+"</div>"},bindStates:function(){var e=this;return e.state.on("change:row",function(t){e.innerHtml(e._getDataPathHtml(t.value))}),e._super()},_getDataPathHtml:function(e){var t=this,n=e||[],r,i,o="",a=t.classPrefix;for(r=0,i=n.length;i>r;r++)o+=(r>0?'<div class="'+a+'divider" aria-hidden="true"> '+t.settings.delimiter+" </div>":"")+'<div role="button" class="'+a+"path-item"+(r==i-1?" "+a+"last":"")+'" data-index="'+r+'" tabindex="-1" id="'+t._id+"-"+r+'" aria-level="'+r+'">'+n[r].name+"</div>";return o||(o='<div class="'+a+'path-item">\xa0</div>'),o}})}),r(Et,[Nt],function(e){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var t=this,n=t.settings.editor;return n.settings.elementpath!==!1&&(t.on("select",function(e){n.focus(),n.selection.select(this.row()[e.index].element),n.nodeChanged()}),n.on("nodeChange",function(r){for(var i=[],o=r.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=n.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});if(s.isDefaultPrevented()||i.push({name:s.name,element:o[a]}),s.isPropagationStopped())break}t.row(i)})),t._super()}})}),r(_t,[xe],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(St,[xe,_t,m],function(e,t,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,r=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),r.each(function(r){var i,o=r.settings.label;o&&(i=new t(n.extend({items:{type:"label",id:r._id+"-l",text:o,flex:0,forId:r._id,disabled:r.disabled()}},e.settings.formItemDefaults)),i.type="formitem",r.aria("labelledby",r._id+"-l"),"undefined"==typeof r.settings.flex&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.fromJSON(e.settings.data)},bindStates:function(){function e(){var e=0,n=[],r,i,o;if(t.settings.labelGapCalc!==!1)for(o="children"==t.settings.labelGapCalc?t.find("formitem"):t.items(),o.filter("formitem").each(function(t){var r=t.items()[0],i=r.getEl().clientWidth;e=i>e?i:e,n.push(r)}),i=t.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=e+i}var t=this;t._super(),t.on("show",e),e()}})}),r(kt,[St],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}})}),r(Tt,[vt,m],function(e,t){return e.extend({init:function(e){var n=this,r=tinymce.activeEditor,i=r.settings,o,a,s;e.spellcheck=!1,s=i.file_picker_types||i.file_browser_callback_types,s&&(s=t.makeMap(s,/[, ]/)),s&&!s[e.filetype]||(a=i.file_picker_callback,!a||s&&!s[e.filetype]?(a=i.file_browser_callback,!a||s&&!s[e.filetype]||(o=function(){a(n.getEl("inp").id,n.value(),e.filetype,window)})):o=function(){var i=n.fire("beforecall").meta;i=t.extend({filetype:e.filetype},i),a.call(r,function(e,t){n.value(e).fire("change",{meta:t})},n.value(),i)}),o&&(e.icon="browse",e.onaction=o),n._super(e)}})}),r(Rt,[ht],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(At,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v=[],y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F,z=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e.paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,"row-reversed"!=f&&"column-reverse"!=f||(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(S="y",E="h",_="minH",k="maxH",R="innerH",T="top",A="deltaH",B="contentH",O="left",M="w",D="x",L="innerW", P="minW",H="right",I="deltaW",F="contentW"):(S="x",E="w",_="minW",k="maxW",R="innerW",T="left",A="deltaW",B="contentW",O="top",M="h",D="y",L="innerH",P="minH",H="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],N=u=0,t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),m=h.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,p[k]&&v.push(h),p.flex=g),d-=p[_],y=o[O]+p[P]+o[H],y>N&&(N=y);if(x={},0>d?x[_]=i[_]-d+i[A]:x[_]=i[R]-d+i[A],x[P]=N+i[I],x[B]=i[R]-d,x[F]=N,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)h=v[t],p=h.layoutRect(),b=p[k],y=p[_]+p.flex*C,y>b?(d-=p[k]-p[_],u-=p.flex,p.flex=0,p.maxFlexSize=b):p.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[D]=o[O],t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),y=p.maxFlexSize||p[_],"center"===s?x[D]=Math.round(i[L]/2-p[M]/2):"stretch"===s?(x[M]=z(p[P]||0,i[L]-o[O]-o[H]),x[D]=o[O]):"end"===s&&(x[D]=i[L]-p[M]-o.top),p.flex>0&&(y+=p.flex*C),x[E]=y,x[S]=w,h.layoutRect(x),h.recalc&&h.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var W=e.parent();W&&(W._lastRect=null,W.recalc())}}})}),r(Bt,[ft],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}})}),r(Dt,[ye,De,ke,m,w,it,d],function(e,t,n,r,i,o,a){function s(e){e.settings.ui_container&&(a.container=i.DOM.select(e.settings.ui_container)[0])}function l(t){t.on("ScriptsLoaded",function(){t.rtl&&(e.rtl=!0)})}function c(e){function t(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;u(i.parents,function(e){return u(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function r(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function i(){function t(e){var n=[];if(e)return u(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=t(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a,o.cmd=e.cmd}n.push(o)}),n}function n(){var n;return n=t(e.settings.style_formats_merge?e.settings.style_formats?o.concat(e.settings.style_formats):o:e.settings.style_formats||o)}var r=0,i=[],o=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){u(i,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:n(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?e.formatter.getCssText(this.settings.format):void 0},onPostRender:function(){var t=this;t.parent().on("show",function(){var n,r;n=t.settings.format,n&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),r=t.settings.cmd,r&&t.active(e.queryCommandState(r))})},onclick:function(){this.settings.format&&l(this.settings.format),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}function o(t){return function(){var n=this;e.formatter?e.formatter.formatChanged(t,function(e){n.active(e)}):e.on("init",function(){e.formatter.formatChanged(t,function(e){n.active(e)})})}}function a(t){return function(){function n(){return e.undoManager?e.undoManager[t]():!1}var r=this;t="redo"==t?"hasRedo":"hasUndo",r.disabled(!n()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){r.disabled(e.readonly||!n())})}}function s(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function l(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var c;c=i(),u({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:o(n),onclick:function(){l(n)}})}),u({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),u({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:o(n)})}),e.addButton("undo",{tooltip:"Undo",onPostRender:a("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:a("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:s,cmd:"mceToggleVisualAid"}),e.addButton("remove",{tooltip:"Remove",icon:"remove",cmd:"Delete"}),u({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return u(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return u(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return u(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var u=r.each;o.on("AddEditor",function(e){var t=e.editor;l(t),c(t),s(t)}),e.translate=function(e){return o.translate(e)},t.tooltips=!a.iOS}),r(Lt,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E=[],_=[],S,k,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e.paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)_.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),S=c.minW,k=c.minH,E[d]=S>E[d]?S:E[d],_[f]=k>_[f]?k:_[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,N=0,f=0;n>f;f++)N+=_[f]+(f>0?b:0),R-=(f>0?b:0)+_[f];if(w+=g.left+g.right,N+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=N+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var D;D="start"==t.packV?0:R>0?Math.floor(R/n):0;var L=0,M=t.flexWidths;if(M)for(d=0;d<M.length;d++)L+=M[d];else L=r;var P=T/L;for(d=0;r>d;d++)E[d]+=M?M[d]*P:P;for(p=g.top,f=0;n>f;f++){for(h=g.left,s=_[f]+D,d=0;r>d&&(B=A?f*r+r-1-d:f*r+d,u=i[B],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(E[d],c.startMinWidth),c.x=h,c.y=p,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=h+a/2-c.w/2:"right"==v?c.x=h+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=p+s/2-c.h/2:"bottom"==v?c.y=p+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),h+=a+y,u.recalc&&u.recalc();p+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var O=e.parent();O&&(O._lastRect=null,O.recalc())}}})}),r(Mt,[De,u],function(e,t){return e.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,n){var r=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,n&&n()):t.setTimeout(function(){r.html(e)}),this}})}),r(Pt,[De],function(e){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("infobox"),t.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+e.encode(e.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+t+"ico "+t+'i-help"></i></button></div></div>'},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl("body").firstChild.data=e.encode(t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e.state.on("change:help",function(t){e.classes.toggle("has-help",t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ot,[De,pe],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.classes.add("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e=this,t,n,r=e.settings.forId;return!r&&(n=e.settings.forName)&&(t=e.getRoot().find("#"+n)[0],t&&(r=t._id)),r?'<label id="'+e._id+'" class="'+e.classes+'"'+(r?' for="'+r+'"':"")+">"+e.encode(e.state.get("text"))+"</label>":'<span id="'+e._id+'" class="'+e.classes+'">'+e.encode(e.state.get("text"))+"</span>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.innerHtml(e.encode(t.value)),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ht,[xe],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.classes.add("toolbar")},postRender:function(){var e=this;return e.items().each(function(e){e.classes.add("toolbar-item")}),e._super()}})}),r(It,[Ht],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(Ft,[pt,be,It],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(){var e=this,n;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(n=e.state.get("menu")||[],n.length?n={type:"menu",items:n}:n.type=n.type||"menu",n.renderTo?e.menu=n.parent(e).show().renderTo():e.menu=t.create(n).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon,o,a=e.state.get("text"),s="";return o=e.settings.image,o?(i="none","string"!=typeof o&&(o=window.getSelection?o[0]:o[1]),o=" style=\"background-image: url('"+o+"')\""):o="",a&&(e.classes.add("btn-has-text"),s='<span class="'+r+'txt">'+e.encode(a)+"</span>"),i=e.settings.icon?r+"ico "+r+"i-"+i:"",e.aria("role",e.parent()instanceof n?"menuitem":"button"),'<div id="'+t+'" class="'+e.classes+'" tabindex="-1" aria-labelledby="'+t+'"><button id="'+t+'-open" role="presentation" type="button" tabindex="-1">'+(i?'<i class="'+i+'"'+o+"></i>":"")+s+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});return i}),r(zt,[De,be,d,u],function(e,t,n,r){return e.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t=this,n;t._super(e),e=t.settings,t.classes.add("menu-item"),e.menu&&t.classes.add("menu-item-expand"),e.preview&&t.classes.add("menu-item-preview"),n=t.state.get("text"),"-"!==n&&"|"!==n||(t.classes.add("menu-item-sep"),t.aria("role","separator"),t.state.set("text","-")),e.selectable&&(t.aria("role","menuitemcheckbox"),t.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||t.classes.add("menu-item-normal"),t.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&t.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r,i=e.parent();if(i.items().each(function(t){t!==e&&t.hideMenu()}),n.menu){r=e.menu,r?r.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",i.settings.itemDefaults&&(r.itemDefaults=i.settings.itemDefaults),r=e.menu=t.create(r).parent(e).renderTo(),r.reflow(),r.on("cancel",function(t){t.stopPropagation(),e.focus(),r.hide()}),r.on("show hide",function(e){e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),r.on("hide",function(t){t.control===r&&e.classes.remove("selected")}),r.submenu=!0),r._parentMenu=i,r.classes.add("menu-sub");var o=r.testMoveRel(e.getEl(),e.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);r.moveRel(e.getEl(),o),r.rel=o,o="menu-sub-"+o,r.classes.remove(r._lastRel).add(o),r._lastRel=o,e.classes.add("selected"),e.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){function e(e){var t,r,i={};for(i=n.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)r=i[e[t].toLowerCase()],r&&(e[t]=r);return e.join("+")}var t=this,r=t._id,i=t.settings,o=t.classPrefix,a=t.encode(t.state.get("text")),s=t.settings.icon,l="",c=i.shortcut;return s&&t.parent().classes.add("menu-has-icons"),i.image&&(l=" style=\"background-image: url('"+i.image+"')\""),c&&(c=e(c)),s=o+"ico "+o+"i-"+(t.settings.icon||"none"),'<div id="'+r+'" class="'+t.classes+'" tabindex="-1">'+("-"!==a?'<i class="'+s+'"'+l+"></i>\xa0":"")+("-"!==a?'<span id="'+r+'-text" class="'+o+'text">'+a+"</span>":"")+(c?'<div id="'+r+'-shortcut" class="'+o+'menu-shortcut">'+c+"</div>":"")+(i.menu?'<div class="'+o+'caret"></div>':"")+"</div>"},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var i=e.getEl("text");i&&i.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),r.requestAnimationFrame(function(){e.parent().hideAll()})))}),e._super(),e},hover:function(){var e=this;return e.parent().items().each(function(e){e.classes.remove("selected")}),e.classes.toggle("selected",!0),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ut,[g,ye,u],function(e,t,n){return function(r,i){var o=this,a,s=t.classPrefix,l;o.show=function(t,c){function u(){a&&(e(r).append('<div class="'+s+"throbber"+(i?" "+s+"throbber-inline":"")+'"></div>'),c&&c())}return o.hide(),a=!0,t?l=n.setTimeout(u,t):u(),o},o.hide=function(){var e=r.lastChild;return n.clearTimeout(l),e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),a=!1,o}}}),r(Wt,[ke,zt,Ut,m],function(e,t,n,r){return e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var n=e.items,i=n.length;i--;)n[i]=r.extend({},e.itemDefaults,n[i]);t._super(e),t.classes.add("menu")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},load:function(){function e(){t.throbber&&(t.throbber.hide(),t.throbber=null)}var t=this,r,i;i=t.settings.itemsFactory,i&&(t.throbber||(t.throbber=new n(t.getEl("body"),!0),0===t.items().length?(t.throbber.show(),t.fire("loading")):t.throbber.show(100,function(){t.items().remove(),t.fire("loading")}),t.on("hide close",e)),t.requestTime=r=(new Date).getTime(),t.settings.itemsFactory(function(n){return 0===n.length?void t.hide():void(t.requestTime===r&&(t.getEl().style.width="",t.getEl("body").style.width="",e(),t.items().remove(),t.getEl("body").innerHTML="",t.add(n),t.renderNew(),t.fire("loaded")))}))},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.image||n.selectable?(e._hasIcons=!0,!1):void 0}),e.settings.itemsFactory&&e.on("postrender",function(){e.settings.itemsFactory&&e.load()}),e._super()}})}),r(Vt,[Ft,Wt],function(e,t){return e.extend({init:function(e){function t(r){for(var a=0;a<r.length;a++){if(i=r[a].selected||e.value===r[a].value)return o=o||r[a].text,n.state.set("value",r[a].value),!0;if(r[a].menu&&t(r[a].menu))return!0}}var n=this,r,i,o,a;n._super(e),e=n.settings,n._values=r=e.values,r&&("undefined"!=typeof e.value&&t(r),!i&&r.length>0&&(o=r[0].text,n.state.set("value",r[0].value)),n.state.set("menu",r)),n.state.set("text",e.text||o),n.classes.add("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.value()),a=r})},bindStates:function(){function e(e,n){e instanceof t&&e.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}function n(e,t){var r;if(e)for(var i=0;i<e.length;i++){if(e[i].value===t)return e[i];if(e[i].menu&&(r=n(e[i].menu,t)))return r}}var r=this;return r.on("show",function(t){e(t.control,r.value())}),r.state.on("change:value",function(e){var t=n(r.state.get("menu"),e.value);t?r.text(t.text):r.text(r.settings.text)}),r._super()}})}),r($t,[gt],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(qt,[De,we],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"==e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(jt,[De],function(e){function t(e){var t="";if(e)for(var n=0;n<e.length;n++)t+='<option value="'+e[n]+'">'+e[n]+"</option>";return t}return e.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var t=this;t._super(e),t.settings.size&&(t.size=t.settings.size),t.settings.options&&(t._options=t.settings.options),t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e=this,n,r="";return n=t(e._options),e.size&&(r=' size = "'+e.size+'"'),'<select id="'+e._id+'" class="'+e.classes+'"'+r+">"+n+"</select>"},bindStates:function(){var e=this;return e.state.on("change:options",function(n){e.getEl().innerHTML=t(n.value)}),e._super()}})}),r(Yt,[De,we,pe],function(e,t,n){function r(e,t,n){return t>e&&(e=t),e>n&&(e=n),e}function i(e,t,n){e.setAttribute("aria-"+t,n)}function o(e,t){var r,o,a,s,l,c;"v"==e.settings.orientation?(s="top",a="height",o="h"):(s="left",a="width",o="w"),c=e.getEl("handle"),r=(e.layoutRect()[o]||100)-n.getSize(c)[a],l=r*((t-e._minValue)/(e._maxValue-e._minValue))+"px",c.style[s]=l,c.style.height=e.layoutRect().h+"px",i(c,"valuenow",t),i(c,"valuetext",""+e.settings.previewFilter(t)),i(c,"valuemin",e._minValue),i(c,"valuemax",e._maxValue)}return e.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"==e.orientation&&t.classes.add("vertical"),t._minValue=e.minValue||0,t._maxValue=e.maxValue||100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'"><div id="'+t+'-handle" class="'+n+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){function e(e,t,n){return(n+e)/(t-e)}function i(e,t,n){return n*(t-e)-e}function o(t,n){function o(o){var a;a=s.value(),a=i(t,n,e(t,n,a)+.05*o),a=r(a,t,n),s.value(a),s.fire("dragstart",{value:a}),s.fire("drag",{value:a}),s.fire("dragend",{value:a})}s.on("keydown",function(e){switch(e.keyCode){case 37:case 38:o(-1);break;case 39:case 40:o(1)}})}function a(e,i,o){var a,l,c,p,m;s._dragHelper=new t(s._id,{handle:s._id+"-handle",start:function(e){a=e[u],l=parseInt(s.getEl("handle").style[d],10),c=(s.layoutRect()[h]||100)-n.getSize(o)[f],s.fire("dragstart",{value:m})},drag:function(t){var n=t[u]-a;p=r(l+n,0,c),o.style[d]=p+"px",m=e+p/c*(i-e),s.value(m),s.tooltip().text(""+s.settings.previewFilter(m)).show().moveRel(o,"bc tc"),s.fire("drag",{value:m})},stop:function(){s.tooltip().hide(),s.fire("dragend",{value:m})}})}var s=this,l,c,u,d,f,h;l=s._minValue,c=s._maxValue,"v"==s.settings.orientation?(u="screenY",d="top",f="height",h="h"):(u="screenX",d="left",f="width",h="w"),s._super(),o(l,c,s.getEl("handle")),a(l,c,s.getEl("handle"))},repaint:function(){this._super(),o(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){o(e,t.value)}),e._super()}})}),r(Xt,[De],function(e){return e.extend({renderHtml:function(){var e=this;return e.classes.add("spacer"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"></div>'}})}),r(Kt,[Ft,pe,g],function(e,t,n){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,r=e.getEl(),i=e.layoutRect(),o,a;return e._super(),o=r.firstChild,a=r.lastChild,n(o).css({width:i.w-t.getSize(a).width,height:i.h-2}),n(a).css({height:i.h-2}),e},activeMenu:function(e){var t=this;n(t.getEl().lastChild).toggleClass(t.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r,i=e.state.get("icon"),o=e.state.get("text"),a="";return r=e.settings.image,r?(i="none","string"!=typeof r&&(r=window.getSelection?r[0]:r[1]),r=" style=\"background-image: url('"+r+"')\""):r="",i=e.settings.icon?n+"ico "+n+"i-"+i:"",o&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(o)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(i?'<i class="'+i+'"'+r+"></i>":"")+a+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1">'+(e._menuBtnText?(i?"\xa0":"")+e._menuBtnText:"")+' <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void(t&&t.call(this,e));n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Gt,[Bt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}})}),r(Jt,[Ee,g,pe],function(e,t,n){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t(n).removeClass(this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t(n).addClass(this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='<div id="'+o+'" class="'+r+'tab" unselectable="on" role="tab" aria-controls="'+t._id+'" aria-selected="false" tabIndex="-1">'+e.encode(t.settings.title)+"</div>"}),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1"><div id="'+e._id+'-head" class="'+r+'tabs" role="tablist">'+n+'</div><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,t,r,i;r=n.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=n.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,t=e._super(),t.deltaH+=o,t.innerH=t.h-t.deltaH,t}})}),r(Qt,[De,m,pe],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("textbox"),e.multiline?t.classes.add("multiline"):(t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))}),t.on("keyup",function(e){t.state.set("value",e.target.value)}))},repaint:function(){var e=this,t,n,r,i,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e.borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,r=e.settings,i,o;return i={id:e._id,hidefocus:"1"},t.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){i[e]=r[e]}),e.disabled()&&(i.disabled="disabled"),r.subtype&&(i.type=r.subtype),o=n.create(r.multiline?"textarea":"input",i),o.value=e.state.get("value"),o.className=e.classes,o.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e.getEl().value=e.state.get("value"),e._super(),e.$el.on("change",function(t){ e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!=t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.value}),e._super()},remove:function(){this.$el.off(),this._super()}})}),r(Zt,[],function(){var e=this||window,t=function(){return e.tinymce};return"function"==typeof e.define&&(e.define.amd||e.define("ephox/tinymce",[],t)),{}}),a([l,c,u,d,f,h,m,g,v,y,C,w,N,E,T,A,B,D,L,M,P,O,I,F,j,Y,J,Q,oe,ae,se,le,ue,fe,he,ve,ye,be,Ce,xe,we,Ne,Ee,_e,Se,ke,Te,Re,Ae,Be,De,Le,Me,Pe,Ie,ze,tt,nt,rt,it,at,st,lt,ct,ut,dt,ft,ht,pt,mt,gt,vt,yt,bt,Ct,xt,wt,Nt,Et,_t,St,kt,Tt,Rt,At,Bt,Dt,Lt,Mt,Pt,Ot,Ht,It,Ft,zt,Ut,Wt,Vt,$t,qt,jt,Yt,Xt,Kt,Gt,Jt,Qt])}(this); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/tinymce/tinymce.min.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 2147024809 |
| Request Header - size: 501 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/tinymce/tinymce.min.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 385081 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 385,081 bytes. |
// 4.4.3 (2016-09-01)
!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){var r,i,o,a,l;for(r=0;r<n.length;r++){i=e,o=n[r],a=o.split(/[.\/]/);for(var c=0;c<a.length-1;++c)i[a[c]]===t&&(i[a[c]]={}),i=i[a[c]];i[a[a.length-1]]=s[o]}if(e.AMDLC_TESTS){l=e.privateModules||{};for(o in s)l[o]=s[o];for(r=0;r<n.length;r++)delete l[n[r]];e.privateModules=l}}var s={},l="tinymce/geom/Rect",c="tinymce/util/Promise",u="tinymce/util/Delay",d="tinymce/Env",f="tinymce/dom/EventUtils",h="tinymce/dom/Sizzle",p="tinymce/util/Arr",m="tinymce/util/Tools",g="tinymce/dom/DomQuery",v="tinymce/html/Styles",y="tinymce/dom/TreeWalker",b="tinymce/dom/Range",C="tinymce/html/Entities",x="tinymce/dom/StyleSheetLoader",w="tinymce/dom/DOMUtils",N="tinymce/dom/ScriptLoader",E="tinymce/AddOnManager",_="tinymce/dom/NodeType",S="tinymce/text/Zwsp",k="tinymce/caret/CaretContainer",T="tinymce/dom/RangeUtils",R="tinymce/NodeChange",A="tinymce/html/Node",B="tinymce/html/Schema",D="tinymce/html/SaxParser",L="tinymce/html/DomParser",M="tinymce/html/Writer",P="tinymce/html/Serializer",O="tinymce/dom/Serializer",H="tinymce/dom/TridentSelection",I="tinymce/util/VK",F="tinymce/dom/ControlSelection",z="tinymce/util/Fun",U="tinymce/caret/CaretCandidate",W="tinymce/geom/ClientRect",V="tinymce/text/ExtendingChar",$="tinymce/caret/CaretPosition",q="tinymce/caret/CaretBookmark",j="tinymce/dom/BookmarkManager",Y="tinymce/dom/Selection",X="tinymce/dom/ElementUtils",K="tinymce/fmt/Preview",G="tinymce/fmt/Hooks",J="tinymce/Formatter",Q="tinymce/UndoManager",Z="tinymce/EnterKey",ee="tinymce/ForceBlocks",te="tinymce/caret/CaretUtils",ne="tinymce/caret/CaretWalker",re="tinymce/InsertList",ie="tinymce/InsertContent",oe="tinymce/EditorCommands",ae="tinymce/util/URI",se="tinymce/util/Class",le="tinymce/util/EventDispatcher",ce="tinymce/data/Binding",ue="tinymce/util/Observable",de="tinymce/data/ObservableObject",fe="tinymce/ui/Selector",he="tinymce/ui/Collection",pe="tinymce/ui/DomUtils",me="tinymce/ui/BoxUtils",ge="tinymce/ui/ClassList",ve="tinymce/ui/ReflowQueue",ye="tinymce/ui/Control",be="tinymce/ui/Factory",Ce="tinymce/ui/KeyboardNavigation",xe="tinymce/ui/Container",we="tinymce/ui/DragHelper",Ne="tinymce/ui/Scrollable",Ee="tinymce/ui/Panel",_e="tinymce/ui/Movable",Se="tinymce/ui/Resizable",ke="tinymce/ui/FloatPanel",Te="tinymce/ui/Window",Re="tinymce/ui/MessageBox",Ae="tinymce/WindowManager",Be="tinymce/ui/Tooltip",De="tinymce/ui/Widget",Le="tinymce/ui/Progress",Me="tinymce/ui/Notification",Pe="tinymce/NotificationManager",Oe="tinymce/dom/NodePath",He="tinymce/util/Quirks",Ie="tinymce/EditorObservable",Fe="tinymce/Mode",ze="tinymce/Shortcuts",Ue="tinymce/file/Uploader",We="tinymce/file/Conversions",Ve="tinymce/file/ImageScanner",$e="tinymce/file/BlobCache",qe="tinymce/file/UploadStatus",je="tinymce/EditorUpload",Ye="tinymce/caret/FakeCaret",Xe="tinymce/dom/Dimensions",Ke="tinymce/caret/LineWalker",Ge="tinymce/caret/LineUtils",Je="tinymce/dom/MousePosition",Qe="tinymce/DragDropOverrides",Ze="tinymce/SelectionOverrides",et="tinymce/util/Uuid",tt="tinymce/Editor",nt="tinymce/util/I18n",rt="tinymce/FocusManager",it="tinymce/EditorManager",ot="tinymce/LegacyInput",at="tinymce/util/XHR",st="tinymce/util/JSON",lt="tinymce/util/JSONRequest",ct="tinymce/util/JSONP",ut="tinymce/util/LocalStorage",dt="tinymce/Compat",ft="tinymce/ui/Layout",ht="tinymce/ui/AbsoluteLayout",pt="tinymce/ui/Button",mt="tinymce/ui/ButtonGroup",gt="tinymce/ui/Checkbox",vt="tinymce/ui/ComboBox",yt="tinymce/ui/ColorBox",bt="tinymce/ui/PanelButton",Ct="tinymce/ui/ColorButton",xt="tinymce/util/Color",wt="tinymce/ui/ColorPicker",Nt="tinymce/ui/Path",Et="tinymce/ui/ElementPath",_t="tinymce/ui/FormItem",St="tinymce/ui/Form",kt="tinymce/ui/FieldSet",Tt="tinymce/ui/FilePicker",Rt="tinymce/ui/FitLayout",At="tinymce/ui/FlexLayout",Bt="tinymce/ui/FlowLayout",Dt="tinymce/ui/FormatControls",Lt="tinymce/ui/GridLayout",Mt="tinymce/ui/Iframe",Pt="tinymce/ui/InfoBox",Ot="tinymce/ui/Label",Ht="tinymce/ui/Toolbar",It="tinymce/ui/MenuBar",Ft="tinymce/ui/MenuButton",zt="tinymce/ui/MenuItem",Ut="tinymce/ui/Throbber",Wt="tinymce/ui/Menu",Vt="tinymce/ui/ListBox",$t="tinymce/ui/Radio",qt="tinymce/ui/ResizeHandle",jt="tinymce/ui/SelectBox",Yt="tinymce/ui/Slider",Xt="tinymce/ui/Spacer",Kt="tinymce/ui/SplitButton",Gt="tinymce/ui/StackLayout",Jt="tinymce/ui/TabPanel",Qt="tinymce/ui/TextBox",Zt="tinymce/Register";r(l,[],function(){function e(e,t,n){var r,i,a,s,l,u;return r=t.x,i=t.y,a=e.w,s=e.h,l=t.w,u=t.h,n=(n||"").split(""),"b"===n[0]&&(i+=u),"r"===n[1]&&(r+=l),"c"===n[0]&&(i+=c(u/2)),"c"===n[1]&&(r+=c(l/2)),"b"===n[3]&&(i-=s),"r"===n[4]&&(r-=a),"c"===n[3]&&(i-=c(s/2)),"c"===n[4]&&(r-=c(a/2)),o(r,i,a,s)}function t(t,n,r,i){var o,a;for(a=0;a<i.length;a++)if(o=e(t,n,i[a]),o.x>=r.x&&o.x+o.w<=r.w+r.x&&o.y>=r.y&&o.y+o.h<=r.h+r.y)return i[a];return null}function n(e,t,n){return o(e.x-t,e.y-n,e.w+2*t,e.h+2*n)}function r(e,t){var n,r,i,a;return n=l(e.x,t.x),r=l(e.y,t.y),i=s(e.x+e.w,t.x+t.w),a=s(e.y+e.h,t.y+t.h),0>i-n||0>a-r?null:o(n,r,i-n,a-r)}function i(e,t,n){var r,i,a,s,c,u,d,f,h,p;return c=e.x,u=e.y,d=e.x+e.w,f=e.y+e.h,h=t.x+t.w,p=t.y+t.h,r=l(0,t.x-c),i=l(0,t.y-u),a=l(0,d-h),s=l(0,f-p),c+=r,u+=i,n&&(d+=r,f+=i,c-=a,u-=s),d-=a,f-=s,o(c,u,d-c,f-u)}function o(e,t,n,r){return{x:e,y:t,w:n,h:r}}function a(e){return o(e.left,e.top,e.width,e.height)}var s=Math.min,l=Math.max,c=Math.round;return{inflate:n,relativePosition:e,findBestRelativePosition:t,intersect:r,clamp:i,create:o,fromClientRect:a}}),r(c,[],function(){function e(e,t){return function(){e.apply(t,arguments)}}function t(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(t,e(r,this),e(i,this))}function n(e){var t=this;return null===this._state?void this._deferreds.push(e):void l(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=n(t._value)}catch(i){return void e.reject(i)}e.resolve(r)})}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void s(e(n,t),e(r,this),e(i,this))}this._state=!0,this._value=t,o.call(this)}catch(a){i.call(this,a)}}function i(e){this._state=!1,this._value=e,o.call(this)}function o(){for(var e=0,t=this._deferreds.length;t>e;e++)n.call(this,this._deferreds[e]);this._deferreds=null}function a(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function s(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(i){if(r)return;r=!0,n(i)}}if(window.Promise)return window.Promise;var l=t.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)},c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return t.prototype["catch"]=function(e){return this.then(null,e)},t.prototype.then=function(e,r){var i=this;return new t(function(t,o){n.call(i,new a(e,r,t,o))})},t.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&c(arguments[0])?arguments[0]:arguments);return new t(function(t,n){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},n)}e[o]=a,0===--i&&t(e)}catch(l){n(l)}}if(0===e.length)return t([]);for(var i=e.length,o=0;o<e.length;o++)r(o,e[o])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(t){t(e)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.race=function(e){return new t(function(t,n){for(var r=0,i=e.length;i>r;r++)e[r].then(t,n)})},t}),r(u,[c],function(e){function t(e,t){function n(e){window.setTimeout(e,0)}var r,i=window.requestAnimationFrame,o=["ms","moz","webkit"];for(r=0;r<o.length&&!i;r++)i=window[o[r]+"RequestAnimationFrame"];i||(i=n),i(e,t)}function n(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)}function r(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)}function i(e){return clearTimeout(e)}function o(e){return clearInterval(e)}var a;return{requestAnimationFrame:function(n,r){return a?void a.then(n):void(a=new e(function(e){r||(r=document.body),t(e,r)}).then(n))},setTimeout:n,setInterval:r,setEditorTimeout:function(e,t,r){return n(function(){e.removed||t()},r)},setEditorInterval:function(e,t,n){var i;return i=r(function(){e.removed?clearInterval(i):t()},n)},throttle:function(e,t){var r,i;return i=function(){var i=arguments;clearTimeout(r),r=n(function(){e.apply(this,i)},t)},i.stop=function(){clearTimeout(r)},i},clearInterval:o,clearTimeout:i}}),r(d,[],function(){function e(e){return"matchMedia"in window?matchMedia(e).matches:!1}var t=navigator,n=t.userAgent,r,i,o,a,s,l,c,u,d,f,h,p,m;r=window.opera&&window.opera.buildNumber,d=/Android/.test(n),i=/WebKit/.test(n),o=!i&&!r&&/MSIE/gi.test(n)&&/Explorer/gi.test(t.appName),o=o&&/MSIE (\w+)\./.exec(n)[1],a=-1==n.indexOf("Trident/")||-1==n.indexOf("rv:")&&-1==t.appName.indexOf("Netscape")?!1:11,s=-1==n.indexOf("Edge/")||o||a?!1:12,o=o||a||s,l=!i&&!a&&/Gecko/.test(n),c=-1!=n.indexOf("Mac"),u=/(iPad|iPhone)/.test(n),f="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,h=e("only screen and (max-device-width: 480px)")&&(d||u),p=e("only screen and (min-width: 800px)")&&(d||u),m=-1!=n.indexOf("Windows Phone"),s&&(i=!1);var g=!u||f||n.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:r,webkit:i,ie:o,gecko:l,mac:c,iOS:u,android:d,contentEditable:g,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=o,range:window.getSelection&&"Range"in window,documentMode:o&&!s?document.documentMode||7:10,fileApi:f,ceFalse:o===!1||o>8,canHaveCSP:o===!1||o>11,desktop:!h&&!p,windowsPhone:m}}),r(f,[u,d],function(e,t){function n(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function r(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function i(e,t){var n,r=t;return n=e.path,n&&n.length>0&&(r=n[0]),e.deepPath&&(n=e.deepPath(),n&&n.length>0&&(r=n[0])),r}function o(e,n){function r(){return!1}function o(){return!0}var a,s=n||{},l;for(a in e)u[a]||(s[a]=e[a]);if(s.target||(s.target=s.srcElement||document),t.experimentalShadowDom&&(s.target=i(e,s.target)),e&&c.test(e.type)&&e.pageX===l&&e.clientX!==l){var d=s.target.ownerDocument||document,f=d.documentElement,h=d.body;s.pageX=e.clientX+(f&&f.scrollLeft||h&&h.scrollLeft||0)-(f&&f.clientLeft||h&&h.clientLeft||0),s.pageY=e.clientY+(f&&f.scrollTop||h&&h.scrollTop||0)-(f&&f.clientTop||h&&h.clientTop||0)}return s.preventDefault=function(){s.isDefaultPrevented=o,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},s.stopPropagation=function(){s.isPropagationStopped=o,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},s.stopImmediatePropagation=function(){s.isImmediatePropagationStopped=o,s.stopPropagation()},s.isDefaultPrevented||(s.isDefaultPrevented=r,s.isPropagationStopped=r,s.isImmediatePropagationStopped=r),"undefined"==typeof s.metaKey&&(s.metaKey=!1),s}function a(t,i,o){function a(){o.domLoaded||(o.domLoaded=!0,i(u))}function s(){("complete"===c.readyState||"interactive"===c.readyState&&c.body)&&(r(c,"readystatechange",s),a())}function l(){try{c.documentElement.doScroll("left")}catch(t){return void e.setTimeout(l)}a()}var c=t.document,u={type:"ready"};return o.domLoaded?void i(u):(c.addEventListener?"complete"===c.readyState?a():n(t,"DOMContentLoaded",a):(n(c,"readystatechange",s),c.documentElement.doScroll&&t.self===t.top&&l()),void n(t,"load",a))}function s(){function e(e,t){var n,r,o,a,s=i[t];if(n=s&&s[e.type])for(r=0,o=n.length;o>r;r++)if(a=n[r],a&&a.func.call(a.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var t=this,i={},s,c,u,d,f;c=l+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},s=1,t.domLoaded=!1,t.events=i,t.bind=function(r,l,h,p){function m(t){e(o(t||N.event),g)}var g,v,y,b,C,x,w,N=window;if(r&&3!==r.nodeType&&8!==r.nodeType){for(r[c]?g=r[c]:(g=s++,r[c]=g,i[g]={}),p=p||r,l=l.split(" "),y=l.length;y--;)b=l[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),t.domLoaded&&"ready"===b&&"complete"==r.readyState?h.call(p,o({type:b})):(d||(C=f[b],C&&(x=function(t){var n,r;if(n=t.currentTarget,r=t.relatedTarget,r&&n.contains)r=n.contains(r);else for(;r&&r!==n;)r=r.parentNode;r||(t=o(t||N.event),t.type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=n,e(t,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(t){t=o(t||N.event),t.type="focus"===t.type?"focusin":"focusout",e(t,g)}),v=i[g][b],v?"ready"===b&&t.domLoaded?h({type:b}):v.push({func:h,scope:p}):(i[g][b]=v=[{func:h,scope:p}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?a(r,x,t):n(r,C||b,x,w)));return r=v=0,h}},t.unbind=function(e,n,o){var a,s,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return t;if(a=e[c]){if(f=i[a],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],s=f[d]){if(o)for(u=s.length;u--;)if(s[u].func===o){var h=s.nativeHandler,p=s.fakeName,m=s.capture;s=s.slice(0,u).concat(s.slice(u+1)),s.nativeHandler=h,s.fakeName=p,s.capture=m,f[d]=s}o&&0!==s.length||(delete f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture))}}else{for(d in f)s=f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture);f={}}for(d in f)return t;delete i[a];try{delete e[c]}catch(g){e[c]=null}}return t},t.fire=function(n,r,i){var a;if(!n||3===n.nodeType||8===n.nodeType)return t;i=o(null,i),i.type=r,i.target=n;do a=n[c],a&&e(i,a),n=n.parentNode||n.ownerDocument||n.defaultView||n.parentWindow;while(n&&!i.isPropagationStopped());return t},t.clean=function(e){var n,r,i=t.unbind;if(!e||3===e.nodeType||8===e.nodeType)return t;if(e[c]&&i(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(i(e),r=e.getElementsByTagName("*"),n=r.length;n--;)e=r[n],e[c]&&i(e);return t},t.destroy=function(){i={}},t.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var l="mce-data-",c=/^(?:mouse|contextmenu)|click/,u={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1};return s.Event=new s,s.Event.bind(window,"ready",function(){}),s}),r(h,[],function(){function e(e,t,n,r){var i,o,a,s,l,c,d,h,p,m;if((t?t.ownerDocument||t:z)!==D&&B(t),t=t||D,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(M&&!r){if(i=ve.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&I(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&x.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(x.qsa&&(!P||!P.test(e))){if(h=d=F,p=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=_(e),(d=t.getAttribute("id"))?h=d.replace(be,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=c.length;l--;)c[l]=h+f(c[l]);p=ye.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return Z.apply(n,p.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return k(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>w.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[F]=!0,e}function i(e){var t=D.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||X)-(~e.sourceIndex||X);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&typeof e.getElementsByTagName!==Y&&e}function d(){}function f(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[U,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[F]||(t[F]={}),(s=l[r])&&s[0]===U&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),c&&t.push(s)));return a}function v(e,t,n,i,o,a){return i&&!i[F]&&(i=v(i)),o&&!o[F]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,f=[],h=[],p=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,f,e,s,l),b=n?o||(r?e:p||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[h[u]]=!(y[h[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?te.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(p,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return te.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==T)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=w.relative[e[s].type])u=[h(p(u),n)];else{if(n=w.filter[e[s].type].apply(null,e[s].matches),n[F]){for(r=++s;i>r&&!w.relative[e[r].type];r++);return v(s>1&&p(u),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&f(e))}u.push(n)}return p(u)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,s,l,c){var u,d,f,h=0,p="0",m=r&&[],v=[],y=T,b=r||o&&w.find.TAG("*",c),C=U+=null==y?1:Math.random()||.1,x=b.length;for(c&&(T=a!==D&&a);p!==x&&null!=(u=b[p]);p++){if(o&&u){for(d=0;f=t[d++];)if(f(u,a,s)){l.push(u);break}c&&(U=C)}i&&((u=!f&&u)&&h--,r&&m.push(u))}if(h+=p,i&&p!==h){for(d=0;f=n[d++];)f(m,v,a,s);if(r){if(h>0)for(;p--;)m[p]||v[p]||(v[p]=J.call(l));v=g(v)}Z.apply(l,v),c&&!r&&v.length>0&&h+n.length>1&&e.uniqueSort(l)}return c&&(U=C,T=y),m};return i?r(a):a}var C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F="sizzle"+-new Date,z=window.document,U=0,W=0,V=n(),$=n(),q=n(),j=function(e,t){return e===t&&(A=!0),0},Y=typeof t,X=1<<31,K={}.hasOwnProperty,G=[],J=G.pop,Q=G.push,Z=G.push,ee=G.slice,te=G.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},ne="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",re="[\\x20\\t\\r\\n\\f]",ie="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",oe="\\["+re+"*("+ie+")(?:"+re+"*([*^$|!~]?=)"+re+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+re+"*\\]",ae=":("+ie+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp("^"+re+"+|((?:^|[^\\\\])(?:\\\\.)*)"+re+"+$","g"),le=new RegExp("^"+re+"*,"+re+"*"),ce=new RegExp("^"+re+"*([>+~]|"+re+")"+re+"*"),ue=new RegExp("="+re+"*([^\\]'\"]*?)"+re+"*\\]","g"),de=new RegExp(ae),fe=new RegExp("^"+ie+"$"),he={ID:new RegExp("^#("+ie+")"),CLASS:new RegExp("^\\.("+ie+")"),TAG:new RegExp("^("+ie+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+re+"*(even|odd|(([+-]|)(\\d*)n|)"+re+"*(?:([+-]|)"+re+"*(\\d+)|))"+re+"*\\)|)","i"),bool:new RegExp("^(?:"+ne+")$","i"),needsContext:new RegExp("^"+re+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+re+"*((?:-\\d)?\\d*)"+re+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ge=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,be=/'|\\/g,Ce=new RegExp("\\\\([\\da-f]{1,6}"+re+"?|("+re+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Z.apply(G=ee.call(z.childNodes),z.childNodes),G[z.childNodes.length].nodeType}catch(we){Z={apply:G.length?function(e,t){Q.apply(e,ee.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}x=e.support={},E=e.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},B=e.setDocument=function(e){function t(e){try{return e.top}catch(t){}return null}var n,r=e?e.ownerDocument||e:z,o=r.defaultView;return r!==D&&9===r.nodeType&&r.documentElement?(D=r,L=r.documentElement,M=!E(r),o&&o!==t(o)&&(o.addEventListener?o.addEventListener("unload",function(){B()},!1):o.attachEvent&&o.attachEvent("onunload",function(){B()})),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=ge.test(r.getElementsByClassName),x.getById=i(function(e){return L.appendChild(e).id=F,!r.getElementsByName||!r.getElementsByName(F).length}),x.getById?(w.find.ID=function(e,t){if(typeof t.getElementById!==Y&&M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){return e.getAttribute("id")===t}}):(delete w.find.ID,w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),w.find.TAG=x.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Y?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=x.getElementsByClassName&&function(e,t){return M?t.getElementsByClassName(e):void 0},O=[],P=[],(x.qsa=ge.test(r.querySelectorAll))&&(i(function(e){e.innerHTML="<select msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+re+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||P.push("\\["+re+"*(?:value|"+ne+")"),e.querySelectorAll(":checked").length||P.push(":checked")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&P.push("name"+re+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||P.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),P.push(",.*:")})),(x.matchesSelector=ge.test(H=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){x.disconnectedMatch=H.call(e,"div"),H.call(e,"[s!='']:x"),O.push("!=",ae)}),P=P.length&&new RegExp(P.join("|")),O=O.length&&new RegExp(O.join("|")),n=ge.test(L.compareDocumentPosition),I=n||ge.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},j=n?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===z&&I(z,e)?-1:t===r||t.ownerDocument===z&&I(z,t)?1:R?te.call(R,e)-te.call(R,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:R?te.call(R,e)-te.call(R,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===z?-1:c[i]===z?1:0},r):D},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==D&&B(t),n=n.replace(ue,"='$1']"),x.matchesSelector&&M&&(!O||!O.test(n))&&(!P||!P.test(n)))try{var r=H.call(t,n);if(r||x.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,D,null,[t]).length>0},e.contains=function(e,t){return(e.ownerDocument||e)!==D&&B(e),I(e,t)},e.attr=function(e,n){(e.ownerDocument||e)!==D&&B(e);var r=w.attrHandle[n.toLowerCase()],i=r&&K.call(w.attrHandle,n.toLowerCase())?r(e,n,!M):t;return i!==t?i:x.attributes||!M?e.getAttribute(n):(i=e.getAttributeNode(n))&&i.specified?i.value:null},e.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},e.uniqueSort=function(e){var t,n=[],r=0,i=0;if(A=!x.detectDuplicates,R=!x.sortStable&&e.slice(0),e.sort(j),A){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return R=null,e},N=e.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=N(t);return n},w=e.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ce,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(Ce,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=_(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ce,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+re+")"+e+"("+re+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,h,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(u=g[F]||(g[F]={}),c=u[e]||[],h=c[0]===U&&c[1],f=c[0]===U&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(f=h=0)||p.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[U,h,f];break}}else if(y&&(c=(t[F]||(t[F]={}))[e])&&c[0]===U)f=c[1];else for(;(d=++h&&d&&d[m]||(f=h=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[F]||(d[F]={}))[e]=[U,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(t,n){var i,o=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[F]?o(n):o.length>1?(i=[t,t,"",n],w.setFilters.hasOwnProperty(t.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=te.call(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=S(e.replace(se,"$1"));return i[F]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(e){return e=e.replace(Ce,xe),function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(t){return fe.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(Ce,xe).toLowerCase(),function(e){var n;do if(n=M?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}},w.pseudos.nth=w.pseudos.eq;for(C in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})w.pseudos[C]=s(C);for(C in{submit:!0,reset:!0})w.pseudos[C]=l(C);return d.prototype=w.filters=w.pseudos,w.setFilters=new d,_=e.tokenize=function(t,n){var r,i,o,a,s,l,c,u=$[t+" "];if(u)return n?0:u.slice(0);for(s=t,l=[],c=w.preFilter;s;){r&&!(i=le.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=ce.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(se," ")}),s=s.slice(r.length));for(a in w.filter)!(i=he[a].exec(s))||c[a]&&!(i=c[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?e.error(t):$(t,l).slice(0)},S=e.compile=function(e,t){var n,r=[],i=[],o=q[e+" "];if(!o){for(t||(t=_(e)),n=t.length;n--;)o=y(t[n]),o[F]?r.push(o):i.push(o);o=q(e,b(i,r)),o.selector=e}return o},k=e.select=function(e,t,n,r){var i,o,a,s,l,c="function"==typeof e&&e,d=!r&&_(e=c.selector||e);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&x.getById&&9===t.nodeType&&M&&w.relative[o[1].type]){if(t=(w.find.ID(a.matches[0].replace(Ce,xe),t)||[])[0], !t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=he.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((l=w.find[s])&&(r=l(a.matches[0].replace(Ce,xe),ye.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&f(o),!e)return Z.apply(n,r),n;break}}return(c||S(e,d))(r,t,!M,n,ye.test(e)&&u(t.parentNode)||t),n},x.sortStable=F.split("").sort(j).join("")===F,x.detectDuplicates=!!A,B(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(ne,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),e}),r(p,[],function(){function e(e){var t=e,n,r;if(!u(e))for(t=[],n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function n(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function r(e,t){var r=[];return n(e,function(n,i){r.push(t(n,i,e))}),r}function i(e,t){var r=[];return n(e,function(n,i){t&&!t(n,i,e)||r.push(n)}),r}function o(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function a(e,t,n,r){var i=0;for(arguments.length<3&&(n=e[0]);i<e.length;i++)n=t.call(r,n,e[i],i);return n}function s(e,t,n){var r,i;for(r=0,i=e.length;i>r;r++)if(t.call(n,e[r],r,e))return r;return-1}function l(e,n,r){var i=s(e,n,r);return-1!==i?e[i]:t}function c(e){return e[e.length-1]}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{isArray:u,toArray:e,each:n,map:r,filter:i,indexOf:o,reduce:a,findIndex:s,find:l,last:c}}),r(m,[d,p],function(e,n){function r(e){return null===e||e===t?"":(""+e).replace(h,"")}function i(e,r){return r?"array"==r&&n.isArray(e)?!0:typeof e==r:e!==t}function o(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function a(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],c?o[a]=function(){return i[s].apply(this,arguments)}:o[a]=function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function s(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function l(e,t,r,i){i=i||this,e&&(r&&(e=e[r]),n.each(e,function(e,n){return t.call(i,e,n,r)===!1?!1:void l(e,t,r,i)}))}function c(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)r=e[n],t[r]||(t[r]={}),t=t[r];return t}function u(e,t){var n,r;for(t=t||window,e=e.split("."),n=0,r=e.length;r>n&&(t=t[e[n]],t);n++);return t}function d(e,t){return!e||i(e,"array")?e:n.map(e.split(t||","),r)}function f(t){var n=e.cacheSuffix;return n&&(t+=(-1===t.indexOf("?")?"?":"&")+n),t}var h=/^\s*|\s*$/g;return{trim:r,isArray:n.isArray,is:i,toArray:n.toArray,makeMap:o,each:n.each,map:n.map,grep:n.filter,inArray:n.indexOf,extend:s,create:a,walk:l,createNS:c,resolve:u,explode:d,_addCacheSuffix:f}}),r(g,[f,h,m,d],function(e,n,r,i){function o(e){return"undefined"!=typeof e}function a(e){return"string"==typeof e}function s(e){return e&&e==e.window}function l(e,t){var n,r,i;for(t=t||w,i=t.createElement("div"),n=t.createDocumentFragment(),i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return n}function c(e,t,n,r){var i;if(a(t))t=l(t,v(e[0]));else if(t.length&&!t.nodeType){if(t=f.makeArray(t),r)for(i=t.length-1;i>=0;i--)c(e,t[i],n,r);else for(i=0;i<t.length;i++)c(e,t[i],n,r);return e}if(t.nodeType)for(i=e.length;i--;)n.call(e[i],t);return e}function u(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")}function d(e,t,n){var r,i;return t=f(t)[0],e.each(function(){var e=this;n&&r==e.parentNode?i.appendChild(e):(r=e.parentNode,i=t.cloneNode(!1),e.parentNode.insertBefore(i,e),i.appendChild(e))}),e}function f(e,t){return new f.fn.init(e,t)}function h(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1}function p(e){return null===e||e===k?"":(""+e).replace(P,"")}function m(e,t){var n,r,i,o,a;if(e)if(n=e.length,n===o){for(r in e)if(e.hasOwnProperty(r)&&(a=e[r],t.call(a,r,a)===!1))break}else for(i=0;n>i&&(a=e[i],t.call(a,i,a)!==!1);i++);return e}function g(e,t){var n=[];return m(e,function(e,r){t(r,e)&&n.push(r)}),n}function v(e){return e?9==e.nodeType?e:e.ownerDocument:w}function y(e,n,r){var i=[],o=e[n];for("string"!=typeof r&&r instanceof f&&(r=r[0]);o&&9!==o.nodeType;){if(r!==t){if(o===r)break;if("string"==typeof r&&f(o).is(r))break}1===o.nodeType&&i.push(o),o=o[n]}return i}function b(e,n,r,i){var o=[];for(i instanceof f&&(i=i[0]);e;e=e[n])if(!r||e.nodeType===r){if(i!==t){if(e===i)break;if("string"==typeof i&&f(e).is(i))break}o.push(e)}return o}function C(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType==n)return e;return null}function x(e,t,n){m(n,function(n,r){e[n]=e[n]||{},e[n][t]=r})}var w=document,N=Array.prototype.push,E=Array.prototype.slice,_=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,S=e.Event,k,T=r.makeMap("children,contents,next,prev"),R=r.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),A=r.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),B={"for":"htmlFor","class":"className",readonly:"readOnly"},D={"float":"cssFloat"},L={},M={},P=/^\s*|\s*$/g;return f.fn=f.prototype={constructor:f,selector:"",context:null,length:0,init:function(e,t){var n=this,r,i;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(t&&t.nodeType)n.context=t;else{if(t)return f(e).attr(t);n.context=t=document}if(a(e)){if(n.selector=e,r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:_.exec(e),!r)return f(t).find(e);if(r[1])for(i=l(e,v(t)).firstChild;i;)N.call(n,i),i=i.nextSibling;else{if(i=v(t).getElementById(r[2]),!i)return n;if(i.id!==r[2])return n.find(e);n.length=1,n[0]=i}}else this.add(e,!1);return n},toArray:function(){return r.toArray(this)},add:function(e,t){var n=this,r,i;if(a(e))return n.add(f(e));if(t!==!1)for(r=f.unique(n.toArray().concat(f.makeArray(e))),n.length=r.length,i=0;i<r.length;i++)n[i]=r[i];else N.apply(n,f.makeArray(e));return n},attr:function(e,t){var n=this,r;if("object"==typeof e)m(e,function(e,t){n.attr(e,t)});else{if(!o(t)){if(n[0]&&1===n[0].nodeType){if(r=L[e],r&&r.get)return r.get(n[0],e);if(A[e])return n.prop(e)?e:k;t=n[0].getAttribute(e,2),null===t&&(t=k)}return t}this.each(function(){var n;if(1===this.nodeType){if(n=L[e],n&&n.set)return void n.set(this,t);null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2)}})}return n},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if(e=B[e]||e,"object"==typeof e)m(e,function(e,t){n.prop(e,t)});else{if(!o(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1==this.nodeType&&(this[e]=t)})}return n},css:function(e,t){function n(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})}function r(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})}var i=this,a,s;if("object"==typeof e)m(e,function(e,t){i.css(e,t)});else if(o(t))e=n(e),"number"!=typeof t||R[e]||(t+="px"),i.each(function(){var n=this.style;if(s=M[e],s&&s.set)return void s.set(this,t);try{this.style[D[e]||e]=t}catch(i){}null!==t&&""!==t||(n.removeProperty?n.removeProperty(r(e)):n.removeAttribute(e))});else{if(a=i[0],s=M[e],s&&s.get)return s.get(a);if(a.ownerDocument.defaultView)try{return a.ownerDocument.defaultView.getComputedStyle(a,null).getPropertyValue(r(e))}catch(l){return k}else if(a.currentStyle)return a.currentStyle[n(e)]}return i},remove:function(){for(var e=this,t,n=this.length;n--;)t=e[n],S.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var e=this,t,n=this.length;n--;)for(t=e[n];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(e){var t=this,n;if(o(e)){n=t.length;try{for(;n--;)t[n].innerHTML=e}catch(r){f(t[n]).empty().append(e)}return t}return t[0]?t[0].innerHTML:""},text:function(e){var t=this,n;if(o(e)){for(n=t.length;n--;)"innerText"in t[n]?t[n].innerText=e:t[0].textContent=e;return t}return t[0]?t[0].innerText||t[0].textContent:""},append:function(){return c(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return c(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){var e=this;return e[0]&&e[0].parentNode?c(e,arguments,function(e){this.parentNode.insertBefore(e,this)}):e},after:function(){var e=this;return e[0]&&e[0].parentNode?c(e,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):e},appendTo:function(e){return f(e).append(this),this},prependTo:function(e){return f(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return d(this,e)},wrapAll:function(e){return d(this,e,!0)},wrapInner:function(e){return this.each(function(){f(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){f(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),f(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return"string"!=typeof e?n:(-1!==e.indexOf(" ")?m(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(n,r){var i,o;o=u(r,e),o!==t&&(i=r.className,o?r.className=p((" "+i+" ").replace(" "+e+" "," ")):r.className+=i?" "+e:e)}),n)},hasClass:function(e){return u(this[0],e)},each:function(e){return m(this,e)},on:function(e,t){return this.each(function(){S.bind(this,e,t)})},off:function(e,t){return this.each(function(){S.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?S.fire(this,e.type,e):S.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new f(E.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;n>t;t++)f.find(e,this[t],r);return f(r)},filter:function(e){return f("function"==typeof e?g(this.toArray(),function(t,n){return e(n,t)}):f.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof f&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&f(r).is(e)){t.push(r);break}if(r==e){t.push(r);break}r=r.parentNode}}),f(t)},offset:function(e){var t,n,r,i=0,o=0,a;return e?this.css(e):(t=this[0],t&&(n=t.ownerDocument,r=n.documentElement,t.getBoundingClientRect&&(a=t.getBoundingClientRect(),i=a.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,o=a.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:o})},push:N,sort:[].sort,splice:[].splice},r.extend(f,{extend:r.extend,makeArray:function(e){return s(e)||e.nodeType?[e]:r.toArray(e)},inArray:h,isArray:r.isArray,each:m,trim:p,grep:g,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,contains:n.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!=t[r].nodeType&&t.splice(r,1);return t=1===t.length?f.find.matchesSelector(t[0],e)?[t[0]]:[]:f.find.matches(e,t)}}),m({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return y(e,"parentNode")},next:function(e){return C(e,"nextSibling",1)},prev:function(e){return C(e,"previousSibling",1)},children:function(e){return b(e.firstChild,"nextSibling",1)},contents:function(e){return r.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){f.fn[e]=function(n){var r=this,i=[];return r.each(function(){var e=t.call(i,this,n,i);e&&(f.isArray(e)?i.push.apply(i,e):i.push(e))}),this.length>1&&(T[e]||(i=f.unique(i)),0===e.indexOf("parents")&&(i=i.reverse())),i=f(i),n?i.filter(n):i}}),m({parentsUntil:function(e,t){return y(e,"parentNode",t)},nextUntil:function(e,t){return b(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return b(e,"previousSibling",1,t).slice(1)}},function(e,t){f.fn[e]=function(n,r){var i=this,o=[];return i.each(function(){var e=t.call(o,this,n,o);e&&(f.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=f.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse())),o=f(o),r?o.filter(r):o}}),f.fn.is=function(e){return!!e&&this.filter(e).length>0},f.fn.init.prototype=f.fn,f.overrideDefaults=function(e){function t(r,i){return n=n||e(),0===arguments.length&&(r=n.element),i||(i=n.context),new t.fn.init(r,i)}var n;return f.extend(t,this),t},i.ie&&i.ie<8&&(x(L,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?k:t},size:function(e){var t=e.size;return 20===t?k:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?k:t}}),x(L,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),i.ie&&i.ie<9&&(D["float"]="styleFloat",x(M,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),f.attrHooks=L,f.cssHooks=M,f}),r(v,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d,f,h="\ufeff";for(e=e||{},t&&(d=t.getValidStyles(),f=t.getInvalidStyles()),u=("\\\" \\' \\; \\: ; : "+h).split(" "),l=0;l<u.length;l++)c[u[l]]=h+l,c[h+l]=u[l];return{toHex:function(e){return e.replace(r,n)},parse:function(t){function s(e,t,n){var r,i,o,a;if(r=m[e+"-top"+t],r&&(i=m[e+"-right"+t],i&&(o=m[e+"-bottom"+t],o&&(a=m[e+"-left"+t])))){var s=[r,i,o,a];for(l=s.length-1;l--&&s[l]===s[l+1];);l>-1&&n||(m[e+t]=-1==l?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}}function u(e){var t=m[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return m[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}function f(e){return b=!0,c[e]}function h(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function p(t,n,r,i,o,a){if(o=o||a)return o=h(o),"'"+o.replace(/\'/g,"\\'")+"'";if(n=h(n||r||i),!e.allow_script_urls){var s=n.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(s))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"}var m={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),y=y.replace(/\\[0-9a-f]+/g,function(e){return String.fromCharCode(parseInt(e.substr(1),16))}),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(|\/\*|\*\//.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":"color"!==v&&"background-color"!==v||(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,p),m[v]=b?h(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(e,t){function n(t){var n,r,o,a;if(n=d[t])for(r=0,o=n.length;o>r;r++)t=n[r],a=e[t],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+t+": "+a+";")}function r(e,t){var n;return n=f["*"],n&&n[e]?!1:(n=f[t],!n||!n[e])}var i="",o,a;if(t&&d)n("*"),n(t);else for(o in e)a=e[o],a!==s&&a.length>0&&(f&&!r(o,t)||(i+=(i.length>0?" ":"")+o+": "+a+";"));return i}}}}),r(y,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}function r(e,n,r,i){var o,a,s;if(e){if(o=e[r],t&&o===t)return;if(o){if(!i)for(s=o[n];s;s=s[n])if(!s[n])return s;return o}if(a=e.parentNode,a&&a!==t)return a}}var i=e;this.current=function(){return i},this.next=function(e){return i=n(i,"firstChild","nextSibling",e)},this.prev=function(e){return i=n(i,"lastChild","previousSibling",e)},this.prev2=function(e){return i=r(i,"lastChild","previousSibling",e)}}}),r(b,[m],function(e){function t(n){function r(){return P.createDocumentFragment()}function i(e,t){N(F,e,t)}function o(e,t){N(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(M[V]=M[W],M[$]=M[U]):(M[W]=M[V],M[U]=M[$]),M.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function h(e,t){var n=M[W],r=M[U],i=M[V],o=M[$],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function p(){E(I)}function m(){return E(O)}function g(){return E(H)}function v(e){var t=this[W],r=this[U],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=M.extractContents();M.insertNode(e),e.appendChild(t),M.selectNode(e)}function b(){return q(new t(n),{startContainer:M[W],startOffset:M[U],endContainer:M[V],endOffset:M[$],collapsed:M.collapsed,commonAncestorContainer:M.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return M[W]==M[V]&&M[U]==M[$]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function N(e,t,r){var i,o;for(e?(M[W]=t,M[U]=r):(M[V]=t,M[$]=r),i=M[V];i.parentNode;)i=i.parentNode;for(o=M[W];o.parentNode;)o=o.parentNode;o==i?w(M[W],M[U],M[V],M[$])>0&&M.collapse(e):M.collapse(e),M.collapsed=x(),M.commonAncestorContainer=n.findCommonAncestor(M[W],M[V])}function E(e){var t,n=0,r=0,i,o,a,s,l,c;if(M[W]==M[V])return _(e);for(t=M[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[W])return S(t,e);++n}for(t=M[W],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[V])return k(t,e);++r}for(o=r-n,a=M[W];o>0;)a=a.parentNode,o--;for(s=M[V];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function _(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),M[U]==M[$])return t;if(3==M[W].nodeType){if(n=M[W].nodeValue,i=n.substring(M[U],M[$]),e!=H&&(o=M[W],c=M[U],u=M[$]-M[U],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),M.collapse(F)),e==I)return;return i.length>0&&t.appendChild(P.createTextNode(i)),t}for(o=C(M[W],M[U]),a=M[$]-M[U];o&&a>0;)s=o.nextSibling,l=D(o,e),t&&t.appendChild(l),--a,o=s;return e!=H&&M.collapse(F),t}function S(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-M[U],0>=a)return t!=H&&(M.setEndBefore(e),M.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=D(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=H&&(M.setEndBefore(e),M.collapse(z)),n}function k(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=M[$]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=D(o,t),n&&n.appendChild(l),--a,o=s;return t!=H&&(M.setStartAfter(e),M.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=D(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=H&&(M.setStartAfter(e),M.collapse(F)),o}function R(e,t){var n=C(M[V],M[$]-1),r,i,o,a,s,l=n!=M[V];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(M[W],M[U]),r=n!=M[W],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return D(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=M[U],a=o.substring(l),s=o.substring(0,l)):(l=M[$],a=o.substring(0,l),s=o.substring(l)),i!=H&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function D(e,t){return t!=I?t==H?n.clone(e,F):e:void e.parentNode.removeChild(e)}function L(){return n.create("body",null,g()).outerText}var M=this,P=n.doc,O=0,H=1,I=2,F=!0,z=!1,U="startOffset",W="startContainer",V="endContainer",$="endOffset",q=e.extend,j=n.nodeIndex;return q(M,{startContainer:P,startOffset:0,endContainer:P,endOffset:0,collapsed:F,commonAncestorContainer:P,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:h,deleteContents:p,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:L}),M}return t.prototype.toString=function(){return this.toStringIE()},t}),r(C,[m],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),o[r]||(i="&"+e[n+1]+";",a[r]=i,a[i]=r);return a}}var r=e.makeMap,i,o,a,s=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n){return n?(n="x"===n.charAt(0).toLowerCase()?parseInt(n.substr(1),16):parseInt(n,10),n>65535?(n-=65536,String.fromCharCode(55296+(n>>10),56320+(1023&n))):d[n]||String.fromCharCode(n)):a[e]||i[e]||t(e)})}};return f}),r(x,[m,u],function(e,t){return function(n,r){function i(e){n.getElementsByTagName("head")[0].appendChild(e)}function o(r,o,c){function u(){for(var e=b.passed,t=e.length;t--;)e[t]();b.status=2,b.passed=[],b.failed=[]}function d(){for(var e=b.failed,t=e.length;t--;)e[t]();b.status=3,b.passed=[],b.failed=[]}function f(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function h(e,n){e()||((new Date).getTime()-y<l?t.setTimeout(n):d())}function p(){h(function(){for(var e=n.styleSheets,t,r=e.length,i;r--;)if(t=e[r],i=t.ownerNode?t.ownerNode:t.owningElement,i&&i.id===g.id)return u(),!0},p)}function m(){h(function(){try{var e=v.sheet.cssRules;return u(),!!e}catch(t){}},m)}var g,v,y,b;if(r=e._addCacheSuffix(r),s[r]?b=s[r]:(b={passed:[],failed:[]},s[r]=b),o&&b.passed.push(o),c&&b.failed.push(c),1!=b.status){if(2==b.status)return void u();if(3==b.status)return void d();if(b.status=1,g=n.createElement("link"),g.rel="stylesheet",g.type="text/css",g.id="u"+a++,g.async=!1,g.defer=!1,y=(new Date).getTime(),"onload"in g&&!f())g.onload=p,g.onerror=d;else{if(navigator.userAgent.indexOf("Firefox")>0)return v=n.createElement("style"),v.textContent='@import "'+r+'"',m(),void i(v);p()}i(g),g.href=r}}var a=0,s={},l;r=r||{},l=r.maxLoadTime||5e3,this.load=o}}),r(w,[h,g,v,f,y,b,C,d,m,x],function(e,n,r,i,o,a,s,l,c,u){function d(e,t){var n={},r=t.keep_values,i;return i={set:function(n,r,i){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||e,r,i,n[0])),n.attr("data-mce-"+i,r).attr(i,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},n={style:{set:function(e,t){return null!==t&&"object"==typeof t?void e.css(t):(r&&e.attr("data-mce-style",t),void e.attr("style",t))},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serializeStyle(e.parseStyle(n),t[0].nodeName)}}},r&&(n.href=n.src=i),n}function f(e,t){var n=t.attr("style");n=e.serializeStyle(e.parseStyle(n),t[0].nodeName),n||(n=null),t.attr("data-mce-style",n)}function h(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n}function p(e,t){var o=this,a;o.doc=e,o.win=window,o.files={},o.counter=0,o.stdMode=!b||e.documentMode>=8,o.boxModel=!b||"CSS1Compat"==e.compatMode||o.stdMode,o.styleSheetLoader=new u(e),o.boundEvents=[],o.settings=t=t||{},o.schema=t.schema,o.styles=new r({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),o.fixDoc(e),o.events=t.ownEvents?new i(t.proxy):i.Event,o.attrHooks=d(o,t),a=t.schema?t.schema.getBlockElements():{},o.$=n.overrideDefaults(function(){return{context:e,element:o.getRoot()}}),o.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!a[e.nodeName]):!!a[e]}}var m=c.each,g=c.is,v=c.grep,y=c.trim,b=l.ie,C=/^([a-z0-9],?)+$/i,x=/^[ \t\r\n]*$/;return p.prototype={$$:function(e){return"string"==typeof e&&(e=this.get(e)),this.$(e)},root:null,fixDoc:function(e){var t=this.settings,n;if(b&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!b||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.settings.root_element||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),g(n,"string")&&(a=n, n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.settings.root_element||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(C.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=g(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&"undefined"!=typeof t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"</"+e+">":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return e=this.$$(e),t?e.each(function(){for(var e;e=this.firstChild;)3==e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():e.remove(),e.length>1?e.toArray():e[0]},setStyle:function(e,t,n){e=this.$$(e).css(t,n),this.settings.update_styles&&f(this,e)},getStyle:function(e,n,r){return e=this.$$(e),r?e.css(n):(n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=l.ie&&l.ie<12?"styleFloat":"cssFloat"),e[0]&&e[0].style?e[0].style[n]:t)},setStyles:function(e,t){e=this.$$(e).css(t),this.settings.update_styles&&f(this,e)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this,i,o,a=r.settings;""===n&&(n=null),e=r.$$(e),i=e.attr(t),e.length&&(o=r.attrHooks[t],o&&o.set?o.set(e,n,t):e.attr(t,n),i!=n&&a.onSetAttrib&&a.onSetAttrib({attrElm:e,attrName:t,attrValue:n}))},setAttribs:function(e,t){var n=this;n.$$(e).each(function(e,r){m(t,function(e,t){n.setAttrib(r,t,e)})})},getAttrib:function(e,t,n){var r=this,i,o;return e=r.$$(e),e.length&&(i=r.attrHooks[t],o=i&&i.get?i.get(e,t):e.attr(t)),"undefined"==typeof o&&(o=n||""),o},getPos:function(e,t){var r=this,i=0,o=0,a,s=r.doc,l=s.body,c;if(e=r.get(e),t=t||l,e){if(t===l&&e.getBoundingClientRect&&"static"===n(l).css("position"))return c=e.getBoundingClientRect(),t=r.boxModel?s.documentElement:l,i=c.left+(s.documentElement.scrollLeft||l.scrollLeft)-t.clientLeft,o=c.top+(s.documentElement.scrollTop||l.scrollTop)-t.clientTop,{x:i,y:o};for(a=e;a&&a!=t&&a.nodeType;)i+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=e.parentNode;a&&a!=t&&a.nodeType;)i-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode}return{x:i,y:o}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==p.DOM&&n===document){var o=p.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,p.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==p.DOM&&n===document?void p.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void m(e.split(","),function(e){var i;e=c._addCacheSuffix(e),t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),b&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){this.$$(e).addClass(t)},removeClass:function(e,t){this.toggleClass(e,t,!1)},hasClass:function(e,t){return this.$$(e).hasClass(t)},toggleClass:function(e,t,r){this.$$(e).toggleClass(t,r).each(function(){""===this.className&&n(this).attr("class",null)})},show:function(e){this.$$(e).show()},hide:function(e){this.$$(e).hide()},isHidden:function(e){return"none"==this.$$(e).css("display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){e=this.$$(e),b?e.each(function(e,r){if(r.canHaveHTML!==!1){for(;r.firstChild;)r.removeChild(r.firstChild);try{r.innerHTML="<br>"+t,r.removeChild(r.firstChild)}catch(i){n("<div>").html("<br>"+t).contents().slice(1).appendTo(r)}return t}}):e.html(t)},getOuterHTML:function(e){return e=this.get(e),1==e.nodeType&&"outerHTML"in e?e.outerHTML:n("<div>").append(n(e).clone()).html()},setOuterHTML:function(e,t){var r=this;r.$$(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}r.remove(n(this).html(t),!0)})},decode:s.decode,encode:s.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return g(t,"array")&&(e=e.cloneNode(!0)),n&&m(v(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(c.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],m(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(b){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,i,a,s,l,c=0;if(e=e.firstChild){s=new o(e,e.parentNode),t=t||(n.schema?n.schema.getNonEmptyElements():null);do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(i=n.getAttribs(e),r=i.length;r--;)if(l=i[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!x.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new a(this)},nodeIndex:h,split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=y(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.insertBefore(n,e):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(c.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(c.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return e&&1==e.nodeType?(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null):null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&(n=this.getContentEditable(e),null===n);e=e.parentNode);return n},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},p.DOM=new p(document),p.nodeIndex=h,p}),r(N,[w,m],function(e,t){function n(){function e(e,n){function i(){a.remove(l),s&&(s.onreadystatechange=s.onload=s=null),n()}function o(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var a=r,s,l;l=a.uniqueId(),s=document.createElement("script"),s.id=l,s.type="text/javascript",s.src=t._addCacheSuffix(e),"onreadystatechange"in s?s.onreadystatechange=function(){/loaded|complete/.test(s.readyState)&&i()}:s.onload=i,s.onerror=o,(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}var n=0,a=1,s=2,l={},c=[],u={},d=[],f=0,h;this.isDone=function(e){return l[e]==s},this.markDone=function(e){l[e]=s},this.add=this.load=function(e,t,r){var i=l[e];i==h&&(c.push(e),l[e]=n),t&&(u[e]||(u[e]=[]),u[e].push({func:t,scope:r||this}))},this.remove=function(e){delete l[e],delete u[e]},this.loadQueue=function(e,t){this.loadScripts(c,e,t)},this.loadScripts=function(t,n,r){function c(e){i(u[e],function(e){e.func.call(e.scope)}),u[e]=h}var p;d.push({func:n,scope:r||this}),(p=function(){var n=o(t);t.length=0,i(n,function(t){return l[t]==s?void c(t):void(l[t]!=a&&(l[t]=a,f++,e(t,function(){l[t]=s,f--,c(t),p()})))}),f||(i(d,function(e){e.func.call(e.scope)}),d.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(E,[N,m],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){var i=r.language;if(i&&r.languageLoad!==!1){if(n)if(n=","+n+",",-1!=n.indexOf(","+i.substr(0,2)+","))i=i.substr(0,2);else if(-1==n.indexOf(","+i+","))return;e.ScriptLoader.add(this.urls[t]+"/langs/"+i+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},remove:function(e){delete this.urls[e],delete this.lookup[e]},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&(s?a.call(s):a.call(e))}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(_,[],function(){function e(e){return function(t){return!!t&&t.nodeType==e}}function t(e){return e=e.toLowerCase().split(" "),function(t){var n,r;if(t&&t.nodeType)for(r=t.nodeName.toLowerCase(),n=0;n<e.length;n++)if(r===e[n])return!0;return!1}}function n(e,t){return t=t.toLowerCase().split(" "),function(n){var r,i;if(s(n))for(r=0;r<t.length;r++)if(i=getComputedStyle(n,null).getPropertyValue(e),i===t[r])return!0;return!1}}function r(e,t){return function(n){return s(n)&&n[e]===t}}function i(e,t){return function(n){return s(n)&&n.getAttribute(e)===t}}function o(e){return s(e)&&e.hasAttribute("data-mce-bogus")}function a(e){return function(t){if(s(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}}var s=e(1);return{isText:e(3),isElement:s,isComment:e(8),isBr:t("br"),isContentEditableTrue:a("true"),isContentEditableFalse:a("false"),matchNodeNames:t,hasPropValue:r,hasAttributeValue:i,matchStyleValues:n,isBogus:o}}),r(S,[],function(){function e(e){return e==n}function t(e){return e.replace(new RegExp(n,"g"),"")}var n="\ufeff";return{isZwsp:e,ZWSP:n,trim:t}}),r(k,[_,S],function(e,t){function n(e){return p(e)&&(e=e.parentNode),h(e)&&e.hasAttribute("data-mce-caret")}function r(e){return p(e)&&t.isZwsp(e.data)}function i(e){return n(e)||r(e)}function o(e){var t=e.parentNode;t&&t.removeChild(e)}function a(e){try{return e.nodeValue}catch(t){return""}}function s(e,t){0===t.length?o(e):e.nodeValue=t}function l(e,n){var r,o,a,s;if(r=e.ownerDocument,a=r.createTextNode(t.ZWSP),s=e.parentNode,n){if(o=e.previousSibling,p(o)){if(i(o))return o;if(f(o))return o.splitText(o.data.length-1)}s.insertBefore(a,e)}else{if(o=e.nextSibling,p(o)){if(i(o))return o;if(d(o))return o.splitText(1),o}e.nextSibling?s.insertBefore(a,e.nextSibling):s.appendChild(a)}return a}function c(e,t,n){var r,i,o;return r=t.ownerDocument,i=r.createElement(e),i.setAttribute("data-mce-caret",n?"before":"after"),i.setAttribute("data-mce-bogus","all"),i.appendChild(r.createTextNode("\xa0")),o=t.parentNode,n?o.insertBefore(i,t):t.nextSibling?o.insertBefore(i,t.nextSibling):o.appendChild(i),i}function u(e){if(h(e)&&i(e)&&(" "!=e.innerHTML?e.removeAttribute("data-mce-caret"):o(e)),p(e)){var n=t.trim(a(e));s(e,n)}}function d(e){return p(e)&&e.data[0]==t.ZWSP}function f(e){return p(e)&&e.data[e.data.length-1]==t.ZWSP}var h=e.isElement,p=e.isText;return{isCaretContainer:i,isCaretContainerBlock:n,isCaretContainerInline:r,insertInline:l,insertBlock:c,remove:u,startsWithCaretContainer:d,endsWithCaretContainer:f}}),r(T,[m,y,_,b,k],function(e,t,n,r,i){function o(e,t){var n=e.childNodes;return t--,t>n.length-1?t=n.length-1:0>t&&(t=0),n[t]||e}function a(e){this.walk=function(t,n){function r(e){var t;return t=e[0],3===t.nodeType&&t===c&&u>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===f&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function i(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,o){var a=o?"nextSibling":"previousSibling";for(g=e,v=g.parentNode;g&&g!=t;g=v)v=g.parentNode,y=i(g==e?g:g[a],a),y.length&&(o||y.reverse(),n(r(y)))}var c=t.startContainer,u=t.startOffset,d=t.endContainer,f=t.endOffset,h,p,m,g,v,y,b;if(b=e.select("td[data-mce-selected],th[data-mce-selected]"),b.length>0)return void l(b,function(e){n([e])});if(1==c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[u]),1==d.nodeType&&d.hasChildNodes()&&(d=o(d,f)),c==d)return n(r([c]));for(h=e.findCommonAncestor(c,d),g=c;g;g=g.parentNode){if(g===d)return s(c,h,!0);if(g===h)break}for(g=d;g;g=g.parentNode){if(g===c)return s(d,h);if(g===h)break}p=a(c,h)||c,m=a(d,h)||d,s(c,p,!0),y=i(p==c?p:p.nextSibling,"nextSibling",m==d?m.nextSibling:m),y.length&&n(r(y)),s(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&r<n.nodeValue.length&&(i=t(n,r),n=i.previousSibling,o>r?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r<n.nodeValue.length&&(n=t(n,r),r=0),3==i.nodeType&&o>0&&o<i.nodeValue.length&&(i=t(i,o).previousSibling,o=i.nodeValue.length)),{startContainer:n,startOffset:r,endContainer:i,endOffset:o}},this.normalize=function(n){function r(r){function a(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}function s(n,r){for(var i=new t(n,e.getParent(n.parentNode,e.isBlock)||g);n=i[r?"prev":"next"]();)if("BR"===n.nodeName)return!0}function l(e){for(;e&&e!=g;){if(c(e))return!0;e=e.parentNode}return!1}function d(e,t){return e.previousSibling&&e.previousSibling.nodeName==t}function f(n,r){var a,s,l;if(r=r||h,l=e.getParent(r.parentNode,e.isBlock)||g,n&&"BR"==r.nodeName&&C&&e.isEmpty(l))return h=r.parentNode,p=e.nodeIndex(r),void(i=!0);for(a=new t(r,l);v=a[n?"prev":"next"]();){if("false"===e.getContentEditableParent(v)||u(v))return;if(3===v.nodeType&&v.nodeValue.length>0)return h=v,p=n?v.nodeValue.length:0,void(i=!0);if(e.isBlock(v)||y[v.nodeName.toLowerCase()])return;s=v}o&&s&&(h=s,i=!0,p=0)}var h,p,m,g=e.getRoot(),v,y,b,C;if(h=n[(r?"start":"end")+"Container"],p=n[(r?"start":"end")+"Offset"],C=1==h.nodeType&&p===h.childNodes.length,y=e.schema.getNonEmptyElements(),b=r,!u(h)){if(1==h.nodeType&&p>h.childNodes.length-1&&(b=!1),9===h.nodeType&&(h=e.getRoot(),p=0),h===g){if(b&&(v=h.childNodes[p>0?p-1:0])){if(u(v))return;if(y[v.nodeName]||"TABLE"==v.nodeName)return}if(h.hasChildNodes()){if(p=Math.min(!b&&p>0?p-1:p,h.childNodes.length-1),h=h.childNodes[p],p=0,!o&&h===g.lastChild&&"TABLE"===h.nodeName)return;if(l(h)||u(h))return;if(h.hasChildNodes()&&!/TABLE/.test(h.nodeName)){v=h,m=new t(h,g);do{if(c(v)||u(v)){i=!1;break}if(3===v.nodeType&&v.nodeValue.length>0){p=b?0:v.nodeValue.length,h=v,i=!0;break}if(y[v.nodeName.toLowerCase()]&&!a(v)){p=e.nodeIndex(v),h=v.parentNode,"IMG"!=v.nodeName||b||p++,i=!0;break}}while(v=b?m.next():m.prev())}}}o&&(3===h.nodeType&&0===p&&f(!0),1===h.nodeType&&(v=h.childNodes[p],v||(v=h.childNodes[p-1]),!v||"BR"!==v.nodeName||d(v,"A")||s(v)||s(v,!0)||f(!0,v))),b&&!o&&3===h.nodeType&&p===h.nodeValue.length&&f(!1),i&&n["set"+(r?"Start":"End")](h,p)}}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}function s(t,n,r){var i,o,a;if(i=r.elementFromPoint(t,n),o=r.body.createTextRange(),i&&"HTML"!=i.tagName||(i=r.body),o.moveToElementText(i),a=e.toArray(o.getClientRects()),a=a.sort(function(e,t){return e=Math.abs(Math.max(e.top-n,e.bottom-n)),t=Math.abs(Math.max(t.top-n,t.bottom-n)),e-t}),a.length>0){n=(a[0].bottom+a[0].top)/2;try{return o.moveToPoint(t,n),o.collapse(!0),o}catch(s){}}return null}var l=e.each,c=n.isContentEditableFalse,u=i.isCaretContainer;return a.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},a.getCaretRangeFromPoint=function(e,t,n){var r,i;if(n.caretPositionFromPoint)i=n.caretPositionFromPoint(e,t),r=n.createRange(),r.setStart(i.offsetNode,i.offset),r.collapse(!0);else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r=s(e,t,n)}}return r},a.getSelectedNode=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset==n+1?t.childNodes[n]:null},a.getNode=function(e,t){return 1==e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},a}),r(R,[T,d,u],function(e,t,n){return function(r){function i(e){var t,n;if(n=r.$(e).parentsUntil(r.getBody()).add(e),n.length===a.length){for(t=n.length;t>=0&&n[t]===a[t];t--);if(-1===t)return a=n,!0}return a=n,!1}var o,a=[];"onselectionchange"in r.getDoc()||r.on("NodeChange Click MouseUp KeyUp Focus",function(t){var n,i;n=r.selection.getRng(),i={startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset},"nodechange"!=t.type&&e.compareRanges(i,o)||r.fire("SelectionChange"),o=i}),r.on("contextmenu",function(){r.fire("SelectionChange")}),r.on("SelectionChange",function(){var e=r.selection.getStart(!0);!t.range&&r.selection.isCollapsed()||!i(e)&&r.dom.isChildOf(e,r.getBody())&&r.nodeChanged({selectionChange:!0})}),r.on("MouseUp",function(e){e.isDefaultPrevented()||("IMG"==r.selection.getNode().nodeName?n.setEditorTimeout(r,function(){r.nodeChanged()}):r.nodeChanged())}),this.nodeChanged=function(e){var t=r.selection,n,i,o;r.initialized&&t&&!r.settings.disable_nodechange&&!r.readonly&&(o=r.getBody(),n=t.getStart()||o,n.ownerDocument==r.getDoc()&&r.dom.isChildOf(n,o)||(n=o),"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),i=[],r.dom.getParent(n,function(e){return e===o?!0:void i.push(e)}),e=e||{},e.element=n,e.parents=i,r.fire("NodeChange",e))}}}),r(A,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(B,[m],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e,t){var n={},r,i;for(r=0,i=e.length;i>r;r++)n[e[r]]=t||{};return n}var s,c,u,d=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),c=3;c<d.length;c++)"string"==typeof d[c]&&(d[c]=t(d[c])),r.push.apply(r,d[c]);for(e=t(e),s=e.length;s--;)u=[].concat(l,t(n)),a[e[s]]={attributes:i(u),attributesOrder:u,children:i(r,o)}}function r(e,n){var r,i,o,s;for(e=t(e),r=e.length,n=t(n);r--;)for(i=a[e[r]],o=0,s=n.length;s>o;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},l,c,u,d,f,h;return i[e]?i[e]:(l=t("id accesskey class dir lang style tabindex title"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),u=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(l.push.apply(l,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),u.push.apply(u,t("audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(l.push("xml:lang"),h=t("acronym applet basefont big font strike tt"),u.push.apply(u,h),s(h,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),s(f,function(e){n(e,"",d)})),d=d||[].concat(c,u),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),n("address dt dd div caption","",d),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",u),n("blockquote","cite",d),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",d),n("dl","","dt dd"),n("a","href target rel media hreflang type",u),n("q","cite",u),n("ins del","cite datetime",d),n("img","src sizes srcset alt usemap ismap width height"),n("iframe","src name width height",d),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",d,"param"),n("param","name value"),n("map","name",d,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",d),n("th","colspan rowspan headers scope abbr",d),n("form","accept-charset action autocomplete enctype method name novalidate target",d),n("fieldset","disabled form name",d,"legend"),n("label","form for",u),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?d:u),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",d,"li"),n("noscript","",d),"html4"!=e&&(n("wbr"),n("ruby","",u,"rt rp"),n("figcaption","",d),n("mark rt rp summary bdi","",u),n("canvas","width height",d),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",d,"track source"),n("picture","","img source"),n("source","src srcset type media sizes"),n("track","kind src srclang label default"),n("datalist","",u,"option"),n("article section nav aside header footer","",d),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",d,"figcaption"),n("time","datetime",u),n("dialog","open",d),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",u),n("progress","value max",u),n("meter","value min max low high optimum",u),n("details","open",d,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(r("script","language xml:space"),r("style","xml:space"),r("object","declare classid code codebase codetype archive standby align border hspace vspace"),r("embed","align name hspace vspace"),r("param","valuetype type"),r("a","charset name rev shape coords"),r("br","clear"),r("applet","codebase archive code object alt name width height align hspace vspace"),r("img","name longdesc align border hspace vspace"),r("iframe","longdesc frameborder marginwidth marginheight scrolling align"),r("font basefont","size color face"),r("input","usemap align"),r("select","onchange"),r("textarea"),r("h1 h2 h3 h4 h5 h6 div p legend caption","align"),r("ul","type compact"),r("li","type"),r("ol dl menu dir","compact"),r("pre","width xml:space"),r("hr","align noshade size width"),r("isindex","prompt"),r("table","summary width frame rules cellspacing cellpadding align bgcolor"),r("col","width align char charoff valign"),r("colgroup","width align char charoff valign"),r("thead","align char charoff valign"),r("tr","align char charoff valign bgcolor"),r("th","axis align char charoff valign nowrap bgcolor width height"),r("form","accept"),r("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),r("tfoot","align char charoff valign"),r("tbody","align char charoff valign"),r("area","nohref"),r("body","background bgcolor text link vlink alink")),"html4"!=e&&(r("input button select textarea","autofocus"),r("input textarea","placeholder"),r("a","download"),r("link script img","crossorigin"),r("iframe","sandbox seamless allowfullscreen")),s(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,delete a.script,i[e]=a,a)}function r(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),s(e,function(e,r){n[r]=n[r.toUpperCase()]="map"==t?a(e,/[, ]/):c(e,/[, ]/)})),n}var i={},o={},a=e.makeMap,s=e.each,l=e.extend,c=e.explode,u=e.inArray;return function(e){function o(t,n,r){var o=e[t];return o?o=a(o,/[, ]/,a(o.toUpperCase(),/[, ]/)):(o=i[t],o||(o=a(n," ",a(n.toUpperCase()," ")),o=l(o,r),i[t]=o)),o}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function f(e){var n,r,i,o,s,l,c,f,h,p,m,g,v,b,x,w,N,E,_,S=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,k=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),y["@"]&&(w=y["@"].attributes,N=y["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=S.exec(e[n])){if(b=s[1],h=s[2],x=s[3],f=s[5],g={},v=[],l={attributes:g,attributesOrder:v},"#"===b&&(l.paddEmpty=!0),"-"===b&&(l.removeEmpty=!0),"!"===s[4]&&(l.removeEmptyAttrs=!0),w){for(E in w)g[E]=w[E];v.push.apply(v,N)}if(f)for(f=t(f,"|"),i=0,o=f.length;o>i;i++)if(s=k.exec(f[i])){if(c={},m=s[1],p=s[2].replace(/::/g,":"),b=s[3],_=s[4],"!"===m&&(l.attributesRequired=l.attributesRequired||[],l.attributesRequired.push(p),c.required=!0),"-"===m){delete g[p],v.splice(u(v,p),1);continue}b&&("="===b&&(l.attributesDefault=l.attributesDefault||[],l.attributesDefault.push({name:p,value:_}),c.defaultValue=_),":"===b&&(l.attributesForced=l.attributesForced||[],l.attributesForced.push({name:p,value:_}),c.forcedValue=_),"<"===b&&(c.validValues=a(_,"?"))), T.test(p)?(l.attributePatterns=l.attributePatterns||[],c.pattern=d(p),l.attributePatterns.push(c)):(g[p]||v.push(p),g[p]=c)}w||"@"!=h||(w=g,N=v),x&&(l.outputName=h,y[x]=l),T.test(h)?(l.pattern=d(h),C.push(l)):y[h]=l}}function h(e){y={},C=[],f(e),s(N,function(e,t){b[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&(i.text_block_elements=i.block_elements=null,s(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",o=t[2];if(b[o]=b[i],M[o]=i,r||(R[o.toUpperCase()]={},R[o]={}),!y[o]){var a=y[i];a=l({},a),delete a.removeEmptyAttrs,delete a.removeEmpty,y[o]=a}s(b,function(e,t){e[i]&&(b[t]=e=l({},b[t]),e[o]=e[i])})}))}function m(n){var r=/^([+\-]?)(\w+)\[([^\]]+)\]$/;i[e.schema]=null,n&&s(t(n,","),function(e){var n=r.exec(e),i,o;n&&(o=n[1],i=o?b[n[2]]:b[n[2]]={"#comment":{}},i=b[n[2]],s(t(n[3],"|"),function(e){"-"===o?delete i[e]:i[e]={}}))})}function g(e){var t=y[e],n;if(t)return t;for(n=C.length;n--;)if(t=C[n],t.pattern.test(e))return t}var v=this,y={},b={},C=[],x,w,N,E,_,S,k,T,R,A,B,D,L,M={},P={};e=e||{},N=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),x=r(e.valid_styles),w=r(e.invalid_styles,"map"),T=r(e.valid_classes,"map"),E=o("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=o("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),S=o("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),k=o("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),A=o("non_empty_elements","td th iframe video audio object script",S),B=o("move_caret_before_on_enter_elements","table",A),D=o("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),R=o("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption",D),L=o("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),s((e.special||"script noscript style textarea").split(" "),function(e){P[e]=new RegExp("</"+e+"[^>]*>","gi")}),e.valid_elements?h(e.valid_elements):(s(N,function(e,t){y[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},b[t]=e.children}),"html5"!=e.schema&&s(t("strong/b em/i"),function(e){e=t(e,"/"),y[e[1]].outputName=e[0]}),s(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){y[e]&&(y[e].removeEmpty=!0)}),s(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){y[e].paddEmpty=!0}),s(t("span"),function(e){y[e].removeEmptyAttrs=!0})),p(e.custom_elements),m(e.valid_children),f(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&s(c(e.invalid_elements),function(e){y[e]&&delete y[e]}),g("span")||f("span[!data-mce-type|*]"),v.children=b,v.getValidStyles=function(){return x},v.getInvalidStyles=function(){return w},v.getValidClasses=function(){return T},v.getBoolAttrs=function(){return k},v.getBlockElements=function(){return R},v.getTextBlockElements=function(){return D},v.getTextInlineElements=function(){return L},v.getShortEndedElements=function(){return S},v.getSelfClosingElements=function(){return _},v.getNonEmptyElements=function(){return A},v.getMoveCaretBeforeOnEnterElements=function(){return B},v.getWhiteSpaceElements=function(){return E},v.getSpecialElements=function(){return P},v.isValidChild=function(e,t){var n=b[e];return!(!n||!n[t])},v.isValid=function(e,t){var n,r,i=g(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},v.getElementRule=g,v.getCustomElements=function(){return M},v.addValidElements=f,v.setValidElements=h,v.addCustomElements=p,v.addValidChildren=m,v.elements=y}}),r(D,[B,C,m],function(e,t,n){function r(e,t,n){var r=1,i,o,a,s;for(s=e.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g,a.lastIndex=i=n;o=a.exec(t);){if(i=a.lastIndex,"/"===o[1])r--;else if(!o[1]){if(o[2]in s)continue;r++}if(0===r)break}return i}function i(i,a){function s(){}var l=this;i=i||{},l.schema=a=a||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),o("comment cdata text start end pi doctype".split(" "),function(e){e&&(l[e]=i[e]||s)}),l.parse=function(e){function o(e){var t,n;for(t=h.length;t--&&h[t].name!==e;);if(t>=0){for(n=h.length-1;n>=t;n--)e=h[n],e.valid&&l.end(e.name);h.length=t}}function s(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in x?t:z(n||r||o||""),N&&!y&&0!==t.indexOf("data-")){if(a=T[t],!a&&R){for(s=R.length;s--&&(a=R[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(W[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{c=decodeURIComponent(c)}catch(u){c=unescape(c)}if(V.test(c))return;if(!i.allow_html_data_urls&&$.test(c)&&!/^data:image\//i.test(c))return}p.map[t]=n,p.push({name:t,value:n})}var l=this,c,u=0,d,f,h=[],p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F=0,z=t.decode,U,W=n.makeMap("src,href,data,background,formaction,poster"),V=/((java|vb)script|mhtml):/i,$=/^data:/i;for(P=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),O=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,C=a.getShortEndedElements(),M=i.self_closing_elements||a.getSelfClosingElements(),x=a.getBoolAttrs(),N=i.validate,b=i.remove_internals,U=i.fix_self_closing,H=a.getSpecialElements();c=P.exec(e);){if(u<c.index&&l.text(z(e.substr(u,c.index-u))),d=c[6])d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),o(d);else if(d=c[7]){if(d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),w=d in C,U&&M[d]&&h.length>0&&h[h.length-1].name===d&&o(d),!N||(E=a.getElementRule(d))){if(_=!0,N&&(T=E.attributes,R=E.attributePatterns),(k=c[8])?(y=-1!==k.indexOf("data-mce-type"),y&&b&&(_=!1),p=[],p.map={},k.replace(O,s)):(p=[],p.map={}),N&&!y){if(A=E.attributesRequired,B=E.attributesDefault,D=E.attributesForced,L=E.removeEmptyAttrs,L&&!p.length&&(_=!1),D)for(m=D.length;m--;)S=D[m],v=S.name,I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I});if(B)for(m=B.length;m--;)S=B[m],v=S.name,v in p.map||(I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I}));if(A){for(m=A.length;m--&&!(A[m]in p.map););-1===m&&(_=!1)}if(S=p.map["data-mce-bogus"]){if("all"===S){u=r(a,e,P.lastIndex),P.lastIndex=u;continue}_=!1}}_&&l.start(d,p,w)}else _=!1;if(f=H[d]){f.lastIndex=u=c.index+c[0].length,(c=f.exec(e))?(_&&(g=e.substr(u,c.index-u)),u=c.index+c[0].length):(g=e.substr(u),u=e.length),_&&(g.length>0&&l.text(g,!0),l.end(d)),P.lastIndex=u;continue}w||(k&&k.indexOf("/")==k.length-1?_&&l.end(d):h.push({name:d,valid:_}))}else(d=c[1])?(">"===d.charAt(0)&&(d=" "+d),i.allow_conditional_comments||"[if"!==d.substr(0,3)||(d=" "+d),l.comment(d)):(d=c[2])?l.cdata(d):(d=c[3])?l.doctype(d):(d=c[4])&&l.pi(d,c[5]);u=c.index+c[0].length}for(u<e.length&&l.text(z(e.substr(u))),m=h.length-1;m>=0;m--)d=h[m],d.valid&&l.end(d.name)}}var o=n.each;return i.findEndTag=r,i}),r(L,[A,B,D,m],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,h,p,m,g,v,y,b;for(m=i("tr,td,th,tbody,thead,tfoot,table"),p=l.getNonEmptyElements(),g=l.getTextBlockElements(),v=l.getSpecialElements(),n=0;n<t.length;n++)if(r=t[n],r.parent&&!r.fixed)if(g[r.name]&&"li"==r.parent.name){for(y=r.next;y&&g[y.name];)y.name="li",y.fixed=!0,r.parent.insert(y,r.parent),y=y.next;r.unwrap(r)}else{for(a=[r],o=r.parent;o&&!l.isValidChild(o.name,r.name)&&!m[o.name];o=o.parent)a.push(o);if(o&&a.length>1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),h=0;h<a.length-1;h++){for(l.isValidChild(c.name,a[h].name)?(d=u.filterNode(a[h].clone()),c.append(d)):d=c,f=a[h].firstChild;f&&f!=a[h+1];)b=f.next,d.append(f),f=b;c=d}s.isEmpty(p)?o.insert(r,a[0],!0):(o.insert(s,a[0],!0),o.insert(r,s)),o=a[0],(o.isEmpty(p)||o.firstChild===o.lastChild&&"br"===o.firstChild.name)&&o.empty().remove()}else if(r.parent){if("li"===r.name){if(y=r.prev,y&&("ul"===y.name||"ul"===y.name)){y.append(r);continue}if(y=r.next,y&&("ul"===y.name||"ul"===y.name)){y.insert(r,y.firstChild,!0);continue}r.wrap(u.filterNode(new e("ul",1)));continue}l.isValidChild(r.parent.name,"div")&&l.isValidChild("div",r.name)?r.wrap(u.filterNode(new e("div",1))):v[r.name]?r.empty().remove():r.unwrap()}}}var u=this,d={},f=[],h={},p={};r=r||{},r.validate="validate"in r?r.validate:!0,r.root_name=r.root_name||"body",u.schema=l=l||new t,u.filterNode=function(e){var t,n,r;n in d&&(r=h[n],r?r.push(e):h[n]=[e]),t=f.length;for(;t--;)n=f[t].name,n in e.attributes.map&&(r=p[n],r?r.push(e):p[n]=[e]);return e},u.addNodeFilter=function(e,t){o(a(e),function(e){var n=d[e];n||(d[e]=n=[]),n.push(t)})},u.addAttributeFilter=function(e,t){o(a(e),function(e){var n;for(n=0;n<f.length;n++)if(f[n].name===e)return void f[n].callbacks.push(t);f.push({name:e,callbacks:[t]})})},u.parse=function(t,o){function a(){function e(e){e&&(t=e.firstChild,t&&3==t.type&&(t.value=t.value.replace(R,"")),t=e.lastChild,t&&3==t.type&&(t.value=t.value.replace(D,"")))}var t=y.firstChild,n,i;if(l.isValidChild(y.name,I.toLowerCase())){for(;t;)n=t.next,3==t.type||1==t.type&&"p"!==t.name&&!T[t.name]&&!t.attr("data-mce-type")?i?i.append(t):(i=u(I,1),i.attr(r.forced_root_block_attrs),y.insert(i,t),i.append(t)):(e(i),i=null),t=n;e(i)}}function u(t,n){var r=new e(t,n),i;return t in d&&(i=h[t],i?i.push(r):h[t]=[r]),r}function m(e){var t,n,r,i,o=l.getBlockElements();for(t=e.prev;t&&3===t.type;){if(r=t.value.replace(D,""),r.length>0)return void(t.value=r);if(n=t.next){if(3==n.type&&n.value.length){t=t.prev;continue}if(!o[n.name]&&"script"!=n.name&&"style"!=n.name){t=t.prev;continue}}i=t.prev,t.remove(),t=i}}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,N,E,_,S,k,T,R,A=[],B,D,L,M,P,O,H,I;if(o=o||{},h={},p={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),H=l.getNonEmptyElements(),O=l.children,k=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,P=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,L=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,v=new n({validate:k,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(L," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=k?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=O[b.name],s&&O[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(_=p[a],_?_.push(r):p[a]=[r]);T[e]&&m(r),n||(b=r),!B&&P[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=k?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(D,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o}if(B&&P[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(H))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,T[b.name]?b.empty().remove():b.unwrap(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),k&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(S in h){for(_=d[S],C=h[S],N=C.length;N--;)C[N].parent||C.splice(N,1);for(x=0,w=_.length;w>x;x++)_[x](C,S,o)}for(x=0,w=f.length;w>x;x++)if(_=f[x],_.name in p){for(C=p[_.name],N=C.length;N--;)C[N].parent||C.splice(N,1);for(N=0,E=_.callbacks.length;E>N;N++)_.callbacks[N](C,_.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,h,p;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(h=l.getElementRule(c.name),h&&(h.removeEmpty?c.remove():h.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(p=new e("#text",3),p.value="\xa0",i.replace(p))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}}),r.validate&&l.getValidClasses()&&u.addAttributeFilter("class",function(e){for(var t=e.length,n,r,i,o,a,s=l.getValidClasses(),c,u;t--;){for(n=e[t],r=n.attr("class").split(" "),a="",i=0;i<r.length;i++)o=r[i],u=!1,c=s["*"],c&&c[o]&&(u=!0),c=s[n.name],!u&&c&&c[o]&&(u=!0),u&&(a&&(a+=" "),a+=o);a.length||(a=null),n.attr("class",a)}})}}),r(M,[C,m],function(e,t){var n=t.makeMap;return function(t){var r=[],i,o,a,s,l;return t=t||{},i=t.indent,o=n(t.indent_before||""),a=n(t.indent_after||""),s=e.getEncodeFunc(t.entity_encoding||"raw",t.entities),l="html"==t.element_format,{start:function(e,t,n){var c,u,d,f;if(i&&o[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');!n||l?r[r.length]=">":r[r.length]=" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push("</",e,">"),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("<![CDATA[",e,"]]>")},comment:function(e){r.push("<!--",e,"-->")},pi:function(e,t){t?r.push("<?",e," ",s(t),"?>"):r.push("<?",e,"?>"),i&&r.push("\n")},doctype:function(e){r.push("<!DOCTYPE",e,">",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(P,[M,B],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,h,p,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1&&(f=[],f.map={},m=r.getElementRule(e.name))){for(h=0,p=m.attributesOrder.length;p>h;h++)u=m.attributesOrder[h],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(h=0,p=c.length;p>h;h++)u=c[h].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(O,[w,L,D,C,P,A,B,d,m,S],function(e,t,n,r,i,o,a,s,l,c){function u(e){function t(e){return e&&"br"===e.name}var n,r;n=e.lastChild,t(n)&&(r=n.prev,t(r)&&(n.remove(),r.remove()))}var d=l.each,f=l.trim,h=e.DOM,p=["data-mce-selected"];return function(e,o){function m(e){var t=new RegExp(["<span[^>]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","\\s?("+p.join("|")+')="[^"]+"'].join("|"),"gi");return e=c.trim(e.replace(t,""))}function g(){var e=o.getBody().innerHTML,t=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,r,i,a,s,l,c=o.schema;for(e=m(e),l=c.getShortEndedElements();s=t.exec(e);)i=t.lastIndex,a=s[0].length,r=l[s[1]]?i:n.findEndTag(c,e,i),e=e.substring(0,i-a)+e.substring(r),t.lastIndex=i-a;return f(e)}function v(e){-1===l.inArray(p,e)&&(C.addAttributeFilter(e,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),p.push(e))}var y,b,C;return o&&(y=o.dom,b=o.schema),y=y||h,b=b||new a(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,C=new t(e,b),C.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n=e.length,r;n--;)r=e[n],r.attr("tabindex",r.attributes.map["data-mce-tabindex"]),r.attr(t,null)}),C.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,s=e.url_converter,l=e.url_converter_scope,c;r--;)i=t[r],o=i.attributes.map[a],o!==c?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=y.serializeStyle(y.parseStyle(o),i.name):s&&(o=s.call(l,o,n,i.name)),i.attr(n,o.length>0?o:null))}),C.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class"),r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}),C.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),C.addNodeFilter("noscript",function(e){for(var t=e.length,n;t--;)n=e[t].firstChild,n&&(n.value=r.decode(n.value))}),C.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o,a;r--;)i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t?(a=i.attr("type"),a&&i.attr("type","mce-no/type"==a?null:a.replace(/^mce\-/,"")),o.length>0&&(i.firstChild.value="// <![CDATA[\n"+n(o)+"\n// ]]>")):o.length>0&&(i.firstChild.value="<!--\n"+n(o)+"\n-->")}),C.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),C.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&C.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,"ul"!==r.name&&"ol"!==r.name||n.prev&&"li"===n.prev.name&&n.prev.append(n)}),C.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:b,addNodeFilter:C.addNodeFilter,addAttributeFilter:C.addAttributeFilter,serialize:function(t,n){var r=this,o,a,l,h,p,m;return s.ie&&y.select("script,style,select,map").length>0?(p=t.innerHTML,t=t.cloneNode(!1),y.setHTML(t,p)):t=t.cloneNode(!0),o=document.implementation,o.createHTMLDocument&&(a=o.createHTMLDocument(""),d("BODY"==t.nodeName?t.childNodes:[t],function(e){a.body.appendChild(a.importNode(e,!0))}),t="BODY"!=t.nodeName?a.body.firstChild:a.body,l=y.doc,y.doc=a),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,r.onPreProcess(n)),m=C.parse(f(n.getInner?t.innerHTML:y.getOuterHTML(t)),n),u(m),h=new i(e,b),n.content=h.serialize(m),n.cleanup||(n.content=c.trim(n.content),n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||r.onPostProcess(n),l&&(y.doc=l),n.node=null,n.content},addRules:function(e){b.addValidElements(e)},setRules:function(e){b.setValidElements(e)},onPreProcess:function(e){o&&o.fire("PreProcess",e)},onPostProcess:function(e){o&&o.fire("PostProcess",e)},addTempAttr:v,trimHtml:m,getTrimmedContent:g}}}),r(H,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(3==l.nodeType&&(u=l.nodeValue,s+=u.length,s>=i)){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(3==l.nodeType&&(s+=l.nodeValue.length,s>=i)){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,p;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),t!=f&&t!=f.documentElement||(t=h,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(p=t.childNodes,p.length?(n>=p.length?i.insertAfter(a,p[p.length-1]):t.insertBefore(a,p[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="<span></span>",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,h=f.body,p,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=h.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="<span></span><span></span>",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=h.createControlRange(),a.addElement(m),a.select(),p=e.getRng(),p.item&&m===p.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(I,[d],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(t){return e.mac?t.metaKey:t.ctrlKey&&!t.altKey}}}),r(F,[I,m,u,d,_],function(e,t,n,r,i){function o(e,t){for(;t&&t!=e;){if(s(t)||a(t))return t;t=t.parentNode}return null}var a=i.isContentEditableFalse,s=i.isContentEditableTrue;return function(i,s){function l(e){var t=s.settings.object_resizing;return t===!1||r.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:e==s.getBody()?!1:s.dom.is(e,t))}function c(t){var n,r,i,o,a;n=t.screenX-L,r=t.screenY-M,U=n*B[2]+H,W=r*B[3]+I,U=5>U?5:U,W=5>W?5:W,i="IMG"==k.nodeName&&s.settings.resize_img_proportional!==!1?!e.modifierPressed(t):e.modifierPressed(t)||"IMG"==k.nodeName&&B[2]*B[3]!==0,i&&(j(n)>j(r)?(W=Y(U*F),U=Y(W/F)):(U=Y(W/F),W=Y(U*F))),_.setStyles(T,{width:U,height:W}),o=B.startPos.x+n,a=B.startPos.y+r,o=o>0?o:0,a=a>0?a:0,_.setStyles(R,{left:o,top:a,display:"block"}),R.innerHTML=U+" × "+W,B[2]<0&&T.clientWidth<=U&&_.setStyle(T,"left",P+(H-U)),B[3]<0&&T.clientHeight<=W&&_.setStyle(T,"top",O+(I-W)),n=X.scrollWidth-K,r=X.scrollHeight-G,n+r!==0&&_.setStyles(R,{left:o-n,top:a-r}),z||(s.fire("ObjectResizeStart",{target:k,width:H,height:I}),z=!0)}function u(){function e(e,t){t&&(k.style[e]||!s.schema.isValid(k.nodeName.toLowerCase(),e)?_.setStyle(k,e,t):_.setAttrib(k,e,t))}z=!1,e("width",U),e("height",W),_.unbind(V,"mousemove",c),_.unbind(V,"mouseup",u),$!=V&&(_.unbind($,"mousemove",c),_.unbind($,"mouseup",u)),_.remove(T),_.remove(R),q&&"TABLE"!=k.nodeName||d(k),s.fire("ObjectResized",{target:k,width:U,height:W}),_.setAttrib(k,"style",_.getAttrib(k,"style")),s.nodeChanged()}function d(e,t,n){var i,o,a,d,h;f(),x(),i=_.getPos(e,X),P=i.x,O=i.y,h=e.getBoundingClientRect(),o=h.width||h.right-h.left,a=h.height||h.bottom-h.top,k!=e&&(C(),k=e,U=W=0),d=s.fire("ObjectSelected",{target:e}),l(e)&&!d.isDefaultPrevented()?S(A,function(e,i){function s(t){L=t.screenX,M=t.screenY,H=k.clientWidth,I=k.clientHeight,F=I/H,B=e,e.startPos={x:o*e[0]+P,y:a*e[1]+O},K=X.scrollWidth,G=X.scrollHeight,T=k.cloneNode(!0),_.addClass(T,"mce-clonedresizable"),_.setAttrib(T,"data-mce-bogus","all"),T.contentEditable=!1,T.unSelectabe=!0,_.setStyles(T,{left:P,top:O,margin:0}),T.removeAttribute("data-mce-selected"),X.appendChild(T),_.bind(V,"mousemove",c),_.bind(V,"mouseup",u),$!=V&&(_.bind($,"mousemove",c),_.bind($,"mouseup",u)),R=_.add(X,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},H+" × "+I)}var l;return t?void(i==t&&s(n)):(l=_.get("mceResizeHandle"+i),l&&_.remove(l),l=_.add(X,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),r.ie&&(l.contentEditable=!1),_.bind(l,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),s(e)}),e.elm=l,void _.setStyles(l,{left:o*e[0]+P-l.offsetWidth/2,top:a*e[1]+O-l.offsetHeight/2}))}):f(),k.setAttribute("data-mce-selected","1")}function f(){var e,t;x(),k&&k.removeAttribute("data-mce-selected");for(e in A)t=_.get("mceResizeHandle"+e),t&&(_.unbind(t),_.remove(t))}function h(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n,r;if(!z&&!s.removed)return S(_.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),r="mousedown"==e.type?e.target:i.getNode(),r=_.$(r).closest(q?"table":"table,img,hr")[0],t(r,X)&&(w(),n=i.getStart(!0),t(n,r)&&t(i.getEnd(!0),r)&&(!q||r!=n&&"IMG"!==n.nodeName))?void d(r):void f()}function p(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function m(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function g(e){var t=e.srcElement,n,r,i,o,a,l,c;n=t.getBoundingClientRect(),l=D.clientX-n.left,c=D.clientY-n.top;for(r in A)if(i=A[r],o=t.offsetWidth*i[0],a=t.offsetHeight*i[1],j(o-l)<8&&j(a-c)<8){B=i;break}z=!0,s.fire("ObjectResizeStart",{target:k,width:k.clientWidth,height:k.clientHeight}),s.getDoc().selection.empty(),d(t,r,D)}function v(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function y(e){return a(o(s.getBody(),e))}function b(e){var t=e.srcElement;if(y(t))return void v(e);if(t!=k){if(s.fire("ObjectSelected",{target:t}),C(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);"IMG"!=t.nodeName&&"TABLE"!=t.nodeName||(f(),k=t,p(t,"resizestart",g))}}function C(){m(k,"resizestart",g)}function x(){for(var e in A){var t=A[e];t.elm&&(_.unbind(t.elm),delete t.elm)}}function w(){try{s.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function N(e){var t;if(q){t=V.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function E(){k=T=null,q&&(C(),m(X,"controlselect",b))}var _=s.dom,S=t.each,k,T,R,A,B,D,L,M,P,O,H,I,F,z,U,W,V=s.getDoc(),$=document,q=r.ie&&r.ie<11,j=Math.abs,Y=Math.round,X=s.getBody(),K,G;A={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var J=".mce-content-body";return s.contentStyles.push(J+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: box-sizing;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+J+" .mce-resizehandle:hover {background: #000}"+J+" img[data-mce-selected],"+J+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+J+" .mce-clonedresizable {position: absolute;"+(r.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+J+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}"),s.on("init",function(){q?(s.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(f(),N(e.target))}),p(X,"controlselect",b),s.on("mousedown",function(e){D=e})):(w(),r.ie>=11&&(s.on("mousedown click",function(e){var t=e.target,n=t.nodeName;z||!/^(TABLE|IMG|HR)$/.test(n)||y(t)||(s.selection.select(t,"TABLE"==n),"mousedown"==e.type&&s.nodeChanged())}),s.dom.bind(X,"mscontrolselect",function(e){function t(e){n.setEditorTimeout(s,function(){s.selection.select(e)})}return y(e.target)?(e.preventDefault(),void t(e.target)):void(/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&t(e.target)))})));var e=n.throttle(function(e){s.composing||h(e)});s.on("nodechange ResizeEditor ResizeWindow drop",e),s.on("keyup compositionend",function(t){k&&"TABLE"==k.nodeName&&e(t)}),s.on("hide blur",f)}),s.on("remove",x),{isResizable:l,showResizeRect:d,hideResizeRect:f,updateResizeRect:h,controlSelect:N,destroy:E}}}),r(z,[],function(){function e(e){return function(){return e}}function t(e){return function(t){return!e(t)}}function n(e,t){return function(n){return e(t(n))}}function r(){var e=a.call(arguments);return function(t){for(var n=0;n<e.length;n++)if(e[n](t))return!0;return!1}}function i(){var e=a.call(arguments); return function(t){for(var n=0;n<e.length;n++)if(!e[n](t))return!1;return!0}}function o(e){var t=a.call(arguments);return t.length-1>=e.length?e.apply(this,t.slice(1)):function(){var e=t.concat([].slice.call(arguments));return o.apply(this,e)}}var a=[].slice;return{constant:e,negate:t,and:i,or:r,curry:o,compose:n}}),r(U,[_,p,k],function(e,t,n){function r(e){return m(e)?!1:d(e)?!f(e.parentNode):h(e)||u(e)||p(e)||c(e)}function i(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode){if(c(e))return!1;if(l(e))return!0}return!0}function o(e){return c(e)?t.reduce(e.getElementsByTagName("*"),function(e,t){return e||l(t)},!1)!==!0:!1}function a(e){return h(e)||o(e)}function s(e,t){return r(e)&&i(e,t)}var l=e.isContentEditableTrue,c=e.isContentEditableFalse,u=e.isBr,d=e.isText,f=e.matchNodeNames("script style textarea"),h=e.matchNodeNames("img input textarea hr iframe video audio object"),p=e.matchNodeNames("table"),m=n.isCaretContainer;return{isCaretCandidate:r,isInEditable:i,isAtomic:a,isEditableCaretCandidate:s}}),r(W,[],function(){function e(e){return e?{left:u(e.left),top:u(e.top),bottom:u(e.bottom),right:u(e.right),width:u(e.width),height:u(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}}function t(t,n){return t=e(t),n?t.right=t.left:(t.left=t.left+t.width,t.right=t.left),t.width=0,t}function n(e,t){return e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right}function r(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2}function i(e,t){return e.bottom<t.top?!0:e.top>t.bottom?!1:r(t.top-e.bottom,e,t)}function o(e,t){return e.top>t.bottom?!0:e.bottom<t.top?!1:r(t.bottom-e.top,e,t)}function a(e,t){return e.left<t.left}function s(e,t){return e.right>t.right}function l(e,t){return i(e,t)?-1:o(e,t)?1:a(e,t)?-1:s(e,t)?1:0}function c(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom}var u=Math.round;return{clone:e,collapse:t,isEqual:n,isAbove:i,isBelow:o,isLeft:a,isRight:s,compare:l,containsXY:c}}),r(V,[],function(){function e(e){return"string"==typeof e&&e.charCodeAt(0)>=768&&t.test(e)}var t=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]");return{isExtendingChar:e}}),r($,[z,_,w,T,U,W,V],function(e,t,n,r,i,o,a){function s(e){return"createRange"in e?e.createRange():n.DOM.createRng()}function l(e){return e&&/[\r\n\t ]/.test(e)}function c(e){var t=e.startContainer,n=e.startOffset,r;return!!(l(e.toString())&&v(t.parentNode)&&(r=t.data,l(r[n-1])||l(r[n+1])))}function u(e){function t(e){var t=e.ownerDocument,n=s(t),r=t.createTextNode("\xa0"),i=e.parentNode,a;return i.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1),a=o.clone(n.getBoundingClientRect()),i.removeChild(r),a}function n(e){var n,r;return r=e.getClientRects(),n=r.length>0?o.clone(r[0]):o.clone(e.getBoundingClientRect()),b(e)&&0===n.left?t(e):n}function r(e,t){return e=o.collapse(e,t),e.width=1,e.right=e.left+1,e}function i(e){0!==e.height&&(u.length>0&&o.isEqual(e,u[u.length-1])||u.push(e))}function l(e,t){var o=s(e.ownerDocument);if(t<e.data.length){if(a.isExtendingChar(e.data[t]))return u;if(a.isExtendingChar(e.data[t-1])&&(o.setStart(e,t),o.setEnd(e,t+1),!c(o)))return i(r(n(o),!1)),u}t>0&&(o.setStart(e,t-1),o.setEnd(e,t),c(o)||i(r(n(o),!1))),t<e.data.length&&(o.setStart(e,t),o.setEnd(e,t+1),c(o)||i(r(n(o),!0)))}var u=[],d,h;if(y(e.container()))return l(e.container(),e.offset()),u;if(f(e.container()))if(e.isAtEnd())h=x(e.container(),e.offset()),y(h)&&l(h,h.data.length),g(h)&&!b(h)&&i(r(n(h),!1));else{if(h=x(e.container(),e.offset()),y(h)&&l(h,0),g(h)&&e.isAtEnd())return i(r(n(h),!1)),u;d=x(e.container(),e.offset()-1),g(d)&&!b(d)&&(p(d)||p(h)||!g(h))&&i(r(n(d),!1)),g(h)&&i(r(n(h),!0))}return u}function d(t,n,r){function i(){return y(t)?0===n:0===n}function o(){return y(t)?n>=t.data.length:n>=t.childNodes.length}function a(){var e;return e=s(t.ownerDocument),e.setStart(t,n),e.setEnd(t,n),e}function l(){return r||(r=u(new d(t,n))),r}function c(){return l().length>0}function f(e){return e&&t===e.container()&&n===e.offset()}function h(e){return x(t,e?n-1:n)}return{container:e.constant(t),offset:e.constant(n),toRange:a,getClientRects:l,isVisible:c,isAtStart:i,isAtEnd:o,isEqual:f,getNode:h}}var f=t.isElement,h=i.isCaretCandidate,p=t.matchStyleValues("display","block table"),m=t.matchStyleValues("float","left right"),g=e.and(f,h,e.negate(m)),v=e.negate(t.matchStyleValues("white-space","pre pre-line pre-wrap")),y=t.isText,b=t.isBr,C=n.nodeIndex,x=r.getNode;return d.fromRangeStart=function(e){return new d(e.startContainer,e.startOffset)},d.fromRangeEnd=function(e){return new d(e.endContainer,e.endOffset)},d.after=function(e){return new d(e.parentNode,C(e)+1)},d.before=function(e){return new d(e.parentNode,C(e))},d}),r(q,[_,w,z,p,$],function(e,t,n,r,i){function o(e){var t=e.parentNode;return v(t)?o(t):t}function a(e){return e?r.reduce(e.childNodes,function(e,t){return v(t)&&"BR"!=t.nodeName?e=e.concat(a(t)):e.push(t),e},[]):[]}function s(e,t){for(;(e=e.previousSibling)&&g(e);)t+=e.data.length;return t}function l(e){return function(t){return e===t}}function c(t){var n,i,s;return n=a(o(t)),i=r.findIndex(n,l(t),t),n=n.slice(0,i+1),s=r.reduce(n,function(e,t,r){return g(t)&&g(n[r-1])&&e++,e},0),n=r.filter(n,e.matchNodeNames(t.nodeName)),i=r.findIndex(n,l(t),t),i-s}function u(e){var t;return t=g(e)?"text()":e.nodeName.toLowerCase(),t+"["+c(e)+"]"}function d(e,t,n){var r=[];for(t=t.parentNode;t!=e&&(!n||!n(t));t=t.parentNode)r.push(t);return r}function f(t,i){var o,a,l=[],c,f,h;return o=i.container(),a=i.offset(),g(o)?c=s(o,a):(f=o.childNodes,a>=f.length?(c="after",a=f.length-1):c="before",o=f[a]),l.push(u(o)),h=d(t,o),h=r.filter(h,n.negate(e.isBogus)),l=l.concat(r.map(h,function(e){return u(e)})),l.reverse().join("/")+","+c}function h(t,n,i){var o=a(t);return o=r.filter(o,function(e,t){return!g(e)||!g(o[t-1])}),o=r.filter(o,e.matchNodeNames(n)),o[i]}function p(e,t){for(var n=e,r=0,o;g(n);){if(o=n.data.length,t>=r&&r+o>=t){e=n,t-=r;break}if(!g(n.nextSibling)){e=n,t=o;break}r+=o,n=n.nextSibling}return t>e.data.length&&(t=e.data.length),new i(e,t)}function m(e,t){var n,o,a;return t?(n=t.split(","),t=n[0].split("/"),a=n.length>1?n[1]:"before",o=r.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),h(e,t[1],parseInt(t[2],10))):null},e),o?g(o)?p(o,parseInt(a,10)):(a="after"===a?y(o)+1:y(o),new i(o.parentNode,a)):null):null}var g=e.isText,v=e.isBogus,y=t.nodeIndex;return{create:f,resolve:m}}),r(j,[d,m,k,q,$,_],function(e,t,n,r,i,o){function a(a){var l=a.dom;this.getBookmark=function(e,c){function u(e,n){var r=0;return t.each(l.select(e),function(e){return"all"!==e.getAttribute("data-mce-bogus")?e==n?!1:void r++:void 0}),r}function d(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function f(e){function t(e,t){var r=e[t?"startContainer":"endContainer"],i=e[t?"startOffset":"endOffset"],o=[],a,s,u=0;if(3==r.nodeType){if(c)for(a=r.previousSibling;a&&3==a.nodeType;a=a.previousSibling)i+=a.nodeValue.length;o.push(i)}else s=r.childNodes,i>=s.length&&s.length&&(u=1,i=Math.max(0,s.length-1)),o.push(l.nodeIndex(s[i],c)+u);for(;r&&r!=n;r=r.parentNode)o.push(l.nodeIndex(r,c));return o}var n=l.getRoot(),r={};return r.start=t(e,!0),a.isCollapsed()||(r.end=t(e)),r}function h(e){function t(e){var t;if(n.isCaretContainer(e)){if(o.isText(e)&&n.isCaretContainerBlock(e)&&(e=e.parentNode),t=e.previousSibling,s(t))return t;if(t=e.nextSibling,s(t))return t}}return t(e.startContainer)||t(e.endContainer)}var p,m,g,v,y,b,C="",x;if(2==e)return b=a.getNode(),y=b?b.nodeName:null,p=a.getRng(),s(b)||"IMG"==y?{name:y,index:u(y,b)}:a.tridentSel?a.tridentSel.getBookmark(e):(b=h(p),b?(y=b.tagName,{name:y,index:u(y,b)}):f(p));if(3==e)return p=a.getRng(),{start:r.create(l.getRoot(),i.fromRangeStart(p)),end:r.create(l.getRoot(),i.fromRangeEnd(p))};if(e)return{rng:a.getRng()};if(p=a.getRng(),g=l.uniqueId(),v=a.isCollapsed(),x="overflow:hidden;line-height:0px",p.duplicate||p.item){if(p.item)return b=p.item(0),y=b.nodeName,{name:y,index:u(y,b)};m=p.duplicate();try{p.collapse(),p.pasteHTML('<span data-mce-type="bookmark" id="'+g+'_start" style="'+x+'">'+C+"</span>"),v||(m.collapse(!1),p.moveToElementText(m.parentElement()),0===p.compareEndPoints("StartToEnd",m)&&m.move("character",-1),m.pasteHTML('<span data-mce-type="bookmark" id="'+g+'_end" style="'+x+'">'+C+"</span>"))}catch(w){return null}}else{if(b=a.getNode(),y=b.nodeName,"IMG"==y)return{name:y,index:u(y,b)};m=d(p.cloneRange()),v||(m.collapse(!1),m.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_end",style:x},C))),p=d(p),p.collapse(!0),p.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_start",style:x},C))}return a.moveToBookmark({id:g,keep:1}),{id:g}},this.moveToBookmark=function(n){function i(e){var t=n[e?"start":"end"],r,i,o,a;if(t){for(o=t[0],i=d,r=t.length-1;r>=1;r--){if(a=i.childNodes,t[r]>a.length-1)return;i=a[t[r]]}3===i.nodeType&&(o=Math.min(t[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(t[0],i.childNodes.length)),e?u.setStart(i,o):u.setEnd(i,o)}return!0}function o(r){var i=l.get(n.id+"_"+r),o,a,s,c,u=n.keep;if(i&&(o=i.parentNode,"start"==r?(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),f=h=o,p=m=a):(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),h=o,m=a),!u)){for(c=i.previousSibling,s=i.nextSibling,t.each(t.grep(i.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});i=l.get(n.id+"_"+r);)l.remove(i,1);c&&s&&c.nodeType==s.nodeType&&3==c.nodeType&&!e.opera&&(a=c.nodeValue.length,c.appendData(s.nodeValue),l.remove(s),"start"==r?(f=h=c,p=m=a):(h=c,m=a))}}function s(t){return!l.isBlock(t)||t.innerHTML||e.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t}function c(){var e,t;return e=l.createRng(),t=r.resolve(l.getRoot(),n.start),e.setStart(t.container(),t.offset()),t=r.resolve(l.getRoot(),n.end),e.setEnd(t.container(),t.offset()),e}var u,d,f,h,p,m;if(n)if(t.isArray(n.start)){if(u=l.createRng(),d=l.getRoot(),a.tridentSel)return a.tridentSel.moveToBookmark(n);i(!0)&&i()&&a.setRng(u)}else"string"==typeof n.start?a.setRng(c(n)):n.id?(o("start"),o("end"),f&&(u=l.createRng(),u.setStart(s(f),p),u.setEnd(s(h),m),a.setRng(u))):n.name?a.select(l.select(n.name)[n.index]):n.rng&&a.setRng(n.rng)}}var s=o.isContentEditableFalse;return a.isBookmarkNode=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},a}),r(Y,[y,H,F,T,j,_,d,m,$],function(e,n,r,i,o,a,s,l,c){function u(e,t,i,a){var s=this;s.dom=e,s.win=t,s.serializer=i,s.editor=a,s.bookmarkManager=new o(s),s.controlSelection=new r(s,a),s.win.getSelection||(s.tridentSel=new n(s))}var d=l.each,f=l.trim,h=s.ie;return u.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='<span id="__caret">_</span>',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('<span id="__mce_tmp">_</span>'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(e){var t=this,n=t.getRng(),r,i,o,a;if(n.duplicate||n.item){if(n.item)return n.item(0);for(o=n.duplicate(),o.collapse(1),r=o.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),i=a=n.parentElement();a=a.parentNode;)if(a==r){r=i;break}return r}return r=n.startContainer,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[Math.min(r.childNodes.length-1,n.startOffset)])),r&&3==r.nodeType?r.parentNode:r},getEnd:function(e){var t=this,n=t.getRng(),r,i;return n.duplicate||n.item?n.item?n.item(0):(n=n.duplicate(),n.collapse(0),r=n.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),r&&"BODY"==r.nodeName?r.lastChild||r:r):(r=n.endContainer,i=n.endOffset,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[i>0?i-1:i])),r&&3==r.nodeType?r.parentNode:r)},getBookmark:function(e,t){return this.bookmarkManager.getBookmark(e,t)},moveToBookmark:function(e){return this.bookmarkManager.moveToBookmark(e)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a,s,l;if(!n.win)return null;if(a=n.win.document,!e&&n.lastFocusBookmark){var c=n.lastFocusBookmark;return c.startContainer?(i=a.createRange(),i.setStart(c.startContainer,c.startOffset),i.setEnd(c.endContainer,c.endOffset)):i=c,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(u){}if(l=n.editor.fire("GetSelectionRange",{range:i}),l.range!==i)return l.range;if(h&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(u){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r,i,o;if(e)if(e.select){n.explicitRange=null;try{e.select()}catch(a){}}else if(n.tridentSel){if(e.cloneRange)try{n.tridentSel.addRange(e)}catch(a){}}else{if(r=n.getSel(),o=n.editor.fire("SetSelectionRange",{range:e}),e=o.range,r){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(a){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}e.collapsed||e.startContainer!=e.endContainer||!r.setBaseAndExtent||s.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(i=e.startContainer.childNodes[e.startOffset],i&&"IMG"==i.tagName&&n.getSel().setBaseAndExtent(i,0,i,1))}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i,o,a,s,l=t.dom.getRoot();return n?(i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r)):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return s.range&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};d(n.selectorChangedData,function(e,t){d(o,function(n){return i.is(n,t)?(r[t]||(d(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),d(r,function(e,n){a[n]||(delete r[n],d(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){function n(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var r,i,o=this,s=o.dom,l=s.getRoot(),c,u,d=0;if(a.isElement(e)){if(t===!1&&(d=e.offsetHeight),"BODY"!=l.nodeName){var f=o.getScrollContainer();if(f)return r=n(e).y-n(f).y+d,u=f.clientHeight,c=f.scrollTop,void((c>r||r+25>c+u)&&(f.scrollTop=c>r?r:r-u+25))}i=s.getViewPort(o.editor.getWin()),r=s.getPos(e).y+d,c=i.y,u=i.h,(r<i.y||r+25>c+u)&&o.editor.getWin().scrollTo(0,c>r?r:r-u+25)}},placeCaretAt:function(e,t){this.setRng(i.getCaretRangeFromPoint(e,t,this.editor.getDoc()))},_moveEndPoint:function(t,n,r){var i=n,o=new e(n,i),a=this.dom.schema.getNonEmptyElements();do{if(3==n.nodeType&&0!==f(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"==n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(s.ie&&s.ie<11&&this.dom.isBlock(n)&&this.dom.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?o.next():o.prev());"BODY"==i.nodeName&&(r?t.setStart(i,0):t.setEnd(i,i.childNodes.length))},getBoundingClientRect:function(){var e=this.getRng();return e.collapsed?c.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){this.win=null,this.controlSelection.destroy()}},u}),r(X,[j,m],function(e,t){function n(t){this.compare=function(n,i){function o(e){var n={};return r(t.getAttribs(e),function(r){var i=r.nodeName.toLowerCase();0!==i.indexOf("_")&&"style"!==i&&0!==i.indexOf("data-")&&(n[i]=t.getAttrib(e,i))}),n}function a(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(n=t[r],"undefined"==typeof n)return!1;if(e[r]!=n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0}return n.nodeName!=i.nodeName?!1:a(o(n),o(i))&&a(t.parseStyle(t.getAttrib(n,"style")),t.parseStyle(t.getAttrib(i,"style")))?!e.isBookmarkNode(n)&&!e.isBookmarkNode(i):!1}}var r=t.each;return n}),r(K,[m],function(e){function t(e,t){function r(e){return e.replace(/%(\w+)/g,"")}var i,o,a=e.dom,s="",l,c;if(c=e.settings.preview_styles,c===!1)return"";if(c||(c="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),"string"==typeof t){if(t=e.formatter.get(t),!t)return;t=t[0]}return i=t.block||t.inline||"span",o=a.create(i),n(t.styles,function(e,t){e=r(e),e&&a.setStyle(o,t,e)}),n(t.attributes,function(e,t){e=r(e),e&&a.setAttrib(o,t,e)}),n(t.classes,function(e){e=r(e),a.hasClass(o,e)||a.addClass(o,e)}),e.fire("PreviewFormats"),a.setStyles(o,{position:"absolute",left:-65535}),e.getBody().appendChild(o),l=a.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,n(c.split(" "),function(t){var n=a.getStyle(o,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=a.getStyle(e.getBody(),t,!0),"#ffffff"==a.toHex(n).toLowerCase())||"color"==t&&"#000000"==a.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(s+="padding:0 2px;"),s+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),a.remove(o),s}var n=e.each;return{getCssText:t}}),r(G,[p,_,g],function(e,t,n){function r(e,t){var n=o[e];n||(o[e]=n=[]),o[e].push(t)}function i(e,t){s(o[e],function(e){e(t)})}var o=[],a=e.filter,s=e.each;return r("pre",function(r){function i(t){return c(t.previousSibling)&&-1!=e.indexOf(u,t.previousSibling)}function o(e,t){n(t).remove(),n(e).append("<br><br>").append(t.childNodes)}var l=r.selection.getRng(),c,u;c=t.matchNodeNames("pre"),l.collapsed||(u=r.selection.getSelectedBlocks(),s(a(a(u,c),i),function(e){o(e.previousSibling,e)}))}),{postProcess:i}}),r(J,[y,T,j,X,m,K,G],function(e,t,n,r,i,o,a){return function(s){function l(e){return e.nodeType&&(e=e.nodeName),!!s.schema.getTextBlockElements()[e.toLowerCase()]}function c(e){return/^(TH|TD)$/.test(e.nodeName)}function u(e){return e&&/^(IMG)$/.test(e.nodeName)}function d(e,t){return Y.getParents(e,t,Y.getRoot())}function f(e){return 1===e.nodeType&&"_mce_caret"===e.id}function h(){g({valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,t,n){ue(n,function(t,n){Y.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),ue("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){g(e,{block:e,remove:"all"})}),g(s.settings.formats)}function p(){s.addShortcut("meta+b","bold_desc","Bold"),s.addShortcut("meta+i","italic_desc","Italic"),s.addShortcut("meta+u","underline_desc","Underline");for(var e=1;6>=e;e++)s.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);s.addShortcut("access+7","",["FormatBlock",!1,"p"]),s.addShortcut("access+8","",["FormatBlock",!1,"div"]),s.addShortcut("access+9","",["FormatBlock",!1,"address"])}function m(e){return e?j[e]:j}function g(e,t){e&&("string"!=typeof e?ue(e,function(e,t){g(t,e)}):(t=t.length?t:[t],ue(t,function(e){e.deep===oe&&(e.deep=!e.selector),e.split===oe&&(e.split=!e.selector||e.inline),e.remove===oe&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),j[e]=t))}function v(e){return e&&j[e]&&delete j[e],j}function y(e,t){var n=m(t);if(n)for(var r=0;r<n.length;r++)if(n[r].inherit===!1&&Y.is(e,n[r].selector))return!0;return!1}function b(e){var t;return s.dom.getParent(e,function(e){return t=s.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function C(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=b(e.parentNode),s.dom.getStyle(e,"color")&&t?s.dom.setStyle(e,"text-decoration",t):s.dom.getStyle(e,"text-decoration")===t&&s.dom.setStyle(e,"text-decoration",null))}function x(t,n,r){function i(e,t){if(t=t||d,e){if(t.onformat&&t.onformat(e,t,n,r),ue(t.styles,function(t,r){Y.setStyle(e,r,M(t,n))}),t.styles){var i=Y.getAttrib(e,"style");i&&e.setAttribute("data-mce-style",i)}ue(t.attributes,function(t,r){Y.setAttrib(e,r,M(t,n))}),ue(t.classes,function(t){t=M(t,n),Y.hasClass(e,t)||Y.addClass(e,t)})}}function o(){function t(t,n){var i=new e(n);for(r=i.prev2();r;r=i.prev2()){if(3==r.nodeType&&r.data.length>0)return r;if(r.childNodes.length>1||r==t||"BR"==r.tagName)return r}}var n=s.selection.getRng(),i=n.startContainer,o=n.endContainer;if(i!=o&&0===n.endOffset){var a=t(i,o),l=3==a.nodeType?a.data.length:a.childNodes.length;n.setEnd(a,l)}return n}function c(e,r,o){var a=[],s,c,h=!0;s=d.inline||d.block,c=Y.create(s),i(c),K.walk(e,function(e){function r(e){var m,v,y,b,C;return C=h,m=e.nodeName.toLowerCase(),v=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&ae(e)&&(C=h,h="true"===ae(e),b=!0),B(m,"br")?(p=0,void(d.block&&Y.remove(e))):d.wrapper&&E(e,t,n)?void(p=0):h&&!b&&d.block&&!d.wrapper&&l(m)&&G(v,s)?(e=Y.rename(e,s),i(e),a.push(e),void(p=0)):d.selector&&(ue(u,function(t){return"collapsed"in t&&t.collapsed!==g?void 0:Y.is(e,t.selector)&&!f(e)?(i(e,t),y=!0,!1):void 0}),!d.inline||y)?void(p=0):void(!h||b||!G(s,m)||!G(v,s)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||f(e)||d.inline&&J(e)?(p=0,ue(de(e.childNodes),r),b&&(h=C),p=0):(p||(p=Y.clone(c,ne),e.parentNode.insertBefore(p,e),a.push(p)),p.appendChild(e)))}var p;ue(e,r)}),d.links===!0&&ue(a,function(e){function t(e){"A"===e.nodeName&&i(e,d),ue(de(e.childNodes),t)}t(e)}),ue(a,function(e){function r(e){var t=0;return ue(e.childNodes,function(e){P(e)||ce(e)||t++}),t}function o(e){var t,n;return ue(e.childNodes,function(e){return 1!=e.nodeType||ce(e)||f(e)?void 0:(t=e,ne)}),t&&!ce(t)&&A(t,d)&&(n=Y.clone(t,ne),i(n),Y.replace(n,e,re),Y.remove(t,1)),n||e}var s;if(s=r(e),(a.length>1||!J(e))&&0===s)return void Y.remove(e,1);if(d.inline||d.wrapper){if(d.exact||1!==s||(e=o(e)),ue(u,function(t){ue(Y.select(t.inline,e),function(e){ce(e)||F(t,n,e,t.exact?e:null)})}),E(e.parentNode,t,n))return Y.remove(e,1),e=0,re;d.merge_with_parents&&Y.getParent(e.parentNode,function(r){return E(r,t,n)?(Y.remove(e,1),e=0,re):void 0}),e&&d.merge_siblings!==!1&&(e=W(U(e),e),e=W(e,U(e,re)))}})}var u=m(t),d=u[0],h,p,g=!r&&X.isCollapsed();if("false"!==ae(X.getNode())){if(d){if(r)r.nodeType?(p=Y.createRng(),p.setStartBefore(r),p.setEndAfter(r),c(H(p,u),null,!0)):c(r,null,!0);else if(g&&d.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length)$("apply",t,n);else{var v=s.selection.getNode();Q||!u[0].defaultBlock||Y.getParent(v,Y.isBlock)||x(u[0].defaultBlock),s.selection.setRng(o()),h=X.getBookmark(),c(H(X.getRng(re),u),h),d.styles&&(d.styles.color||d.styles.textDecoration)&&(fe(v,C,"childNodes"),C(v)),X.moveToBookmark(h),q(X.getRng(re)),s.nodeChanged()}a.postProcess(t,s)}}else{r=X.getNode();for(var y=0,b=u.length;b>y;y++)if(u[y].ceFalseOverride&&Y.is(r,u[y].selector))return void i(r,u[y])}}function w(e,t,n,r){function i(e){var n,r,o,a,s;if(1===e.nodeType&&ae(e)&&(a=y,y="true"===ae(e),s=!0),n=de(e.childNodes),y&&!s)for(r=0,o=h.length;o>r&&!F(h[r],t,e,e);r++);if(p.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(y=a)}}function o(n){var i;return ue(d(n.parentNode).reverse(),function(n){var o;i||"_start"==n.id||"_end"==n.id||(o=E(n,e,t,r),o&&o.split!==!1&&(i=n))}),i}function a(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode, o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=Y.clone(o,ne),c=0;c<h.length;c++)if(F(h[c],t,a,a)){a=0;break}a&&(s&&a.appendChild(s),l||(l=a),s=a)}!i||p.mixed&&J(e)||(n=Y.split(e,n)),s&&(r.parentNode.insertBefore(s,r),l.appendChild(r))}return n}function l(e){return a(o(e),e,e,!0)}function u(e){var t=Y.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return ce(n)&&(n=n[e?"firstChild":"lastChild"]),3==n.nodeType&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),Y.remove(t,!0),n}function f(e){var t,n,r=e.commonAncestorContainer;if(e=H(e,h,re),p.split){if(t=V(e,re),n=V(e),t!=n){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"==t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&c(n)&&n.firstChild&&(n=n.firstChild||n),Y.isChildOf(t,n)&&!J(n)&&!c(t)&&!c(n))return t=O(t,"span",{id:"_start","data-mce-type":"bookmark"}),l(t),void(t=u(re));t=O(t,"span",{id:"_start","data-mce-type":"bookmark"}),n=O(n,"span",{id:"_end","data-mce-type":"bookmark"}),l(t),l(n),t=u(re),n=u()}else t=n=l(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=Z(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=Z(n)+1}K.walk(e,function(e){ue(e,function(e){i(e),1===e.nodeType&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===b(e.parentNode)&&F({deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})}var h=m(e),p=h[0],g,v,y=!0;if(n)return void(n.nodeType?(v=Y.createRng(),v.setStartBefore(n),v.setEndAfter(n),f(v)):f(n));if("false"!==ae(X.getNode()))X.isCollapsed()&&p.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length?$("remove",e,t,r):(g=X.getBookmark(),f(X.getRng(re)),X.moveToBookmark(g),p.inline&&_(e,t,X.getStart())&&q(X.getRng(!0)),s.nodeChanged());else{n=X.getNode();for(var C=0,x=h.length;x>C&&(!h[C].ceFalseOverride||!F(h[C],t,n,n));C++);}}function N(e,t,n){var r=m(e);!_(e,t,n)||"toggle"in r[0]&&!r[0].toggle?x(e,t,n):w(e,t,n)}function E(e,t,n,r){function i(e,t,i){var o,a,s=t[i],l;if(t.onmatch)return t.onmatch(e,t,i);if(s)if(s.length===oe){for(o in s)if(s.hasOwnProperty(o)){if(a="attributes"===i?Y.getAttrib(e,o):D(e,o),r&&!a&&!t.exact)return;if((!r||t.exact)&&!B(a,L(M(s[o],n),o)))return}}else for(l=0;l<s.length;l++)if("attributes"===i?Y.getAttrib(e,s[l]):D(e,s[l]))return t;return t}var o=m(t),a,s,l;if(o&&e)for(s=0;s<o.length;s++)if(a=o[s],A(e,a)&&i(e,a,"attributes")&&i(e,a,"styles")){if(l=a.classes)for(s=0;s<l.length;s++)if(!Y.hasClass(e,l[s]))return;return a}}function _(e,t,n){function r(n){var r=Y.getRoot();return n===r?!1:(n=Y.getParent(n,function(n){return y(n,e)?!0:n.parentNode===r||!!E(n,e,t,!0)}),E(n,e,t))}var i;return n?r(n):(n=X.getNode(),r(n)?re:(i=X.getStart(),i!=n&&r(i)?re:ne))}function S(e,t){var n,r=[],i={};return n=X.getStart(),Y.getParent(n,function(n){var o,a;for(o=0;o<e.length;o++)a=e[o],!i[a]&&E(n,a,t)&&(i[a]=!0,r.push(a))},Y.getRoot()),r}function k(e){var t=m(e),n,r,i,o,a;if(t)for(n=X.getStart(),r=d(n),o=t.length-1;o>=0;o--){if(a=t[o].selector,!a||t[o].defaultBlock)return re;for(i=r.length-1;i>=0;i--)if(Y.is(r[i],a))return re}return ne}function T(e,t,n){var r;return ie||(ie={},r={},s.on("NodeChange",function(e){var t=d(e.element),n={};t=i.grep(t,function(e){return 1==e.nodeType&&!e.getAttribute("data-mce-bogus")}),ue(ie,function(e,i){ue(t,function(o){return E(o,i,{},e.similar)?(r[i]||(ue(e,function(e){e(!0,{node:o,format:i,parents:t})}),r[i]=e),n[i]=e,!1):y(o,i)?!1:void 0})}),ue(r,function(i,o){n[o]||(delete r[o],ue(i,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),ue(e.split(","),function(e){ie[e]||(ie[e]=[],ie[e].similar=n),ie[e].push(t)}),this}function R(e){return o.getCssText(s,e)}function A(e,t){return B(e,t.inline)?re:B(e,t.block)?re:t.selector?1==e.nodeType&&Y.is(e,t.selector):void 0}function B(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function D(e,t){return L(Y.getStyle(e,t),t)}function L(e,t){return"color"!=t&&"backgroundColor"!=t||(e=Y.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function M(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function P(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function O(e,t,n){var r=Y.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function H(t,n,r){function i(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=Y.getRoot(),3==r.nodeType&&!P(r)&&(e?v>0:b<r.nodeValue.length))return r;for(;;){if(!n[0].block_expand&&J(i))return i;for(o=i[a];o;o=o[a])if(!ce(o)&&!P(o)&&!t(o))return i;if(i==s||i.parentNode==s){r=i;break}i=i.parentNode}return r}function o(e,t){for(t===oe&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)e=e.childNodes[t],e&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}}function a(e){for(var t=e;t;){if(1===t.nodeType&&ae(t))return"false"===ae(t)?t:e;t=t.parentNode}return e}function c(t,n,i){function o(e,t){var n,o,a=e.nodeValue;return"undefined"==typeof t&&(t=i?a.length:0),i?(n=a.lastIndexOf(" ",t),o=a.lastIndexOf("\xa0",t),n=n>o?n:o,-1===n||r||n++):(n=a.indexOf(" ",t),o=a.indexOf("\xa0",t),n=-1!==n&&(-1===o||o>n)?n:o),n}var a,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(a=new e(t,Y.getParent(t,J)||s.getBody());l=a[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(J(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function u(e,r){var i,o,a,s;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=d(e),o=0;o<i.length;o++)for(a=0;a<n.length;a++)if(s=n[a],!("collapsed"in s&&s.collapsed!==t.collapsed)&&Y.is(i[o],s.selector))return i[o];return e}function f(e,t){var r,i=Y.getRoot();if(n[0].wrapper||(r=Y.getParent(e,n[0].block,i)),r||(r=Y.getParent(3==e.nodeType?e.parentNode:e,function(e){return e!=i&&l(e)})),r&&n[0].wrapper&&(r=d(r,"ul,ol").reverse()[0]||r),!r)for(r=e;r[t]&&!J(r[t])&&(r=r[t],!B(r,"br")););return r||e}var h,p,m,g=t.startContainer,v=t.startOffset,y=t.endContainer,b=t.endOffset;if(1==g.nodeType&&g.hasChildNodes()&&(h=g.childNodes.length-1,g=g.childNodes[v>h?h:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(h=y.childNodes.length-1,y=y.childNodes[b>h?h:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=a(g),y=a(y),(ce(g.parentNode)||ce(g))&&(g=ce(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(ce(y.parentNode)||ce(y))&&(y=ce(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=c(g,v,!0),m&&(g=m.container,v=m.offset),m=c(y,b),m&&(y=m.container,b=m.offset)),p=o(y,b),p.node)){for(;p.node&&0===p.offset&&p.node.previousSibling;)p=o(p.node.previousSibling);p.node&&p.offset>0&&3===p.node.nodeType&&" "===p.node.nodeValue.charAt(p.offset-1)&&p.offset>1&&(y=p.node,y.splitText(p.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=i(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=i())),n[0].selector&&n[0].expand!==ne&&!n[0].inline&&(g=u(g,"previousSibling"),y=u(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(J(g)||(g=i(!0)),J(y)||(y=i()))),1==g.nodeType&&(v=Z(g),g=g.parentNode),1==y.nodeType&&(b=Z(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function I(e,t){return t.links&&"A"==e.tagName}function F(e,t,n,r){var i,o,a;if(!A(n,e)&&!I(n,e))return ne;if("all"!=e.remove)for(ue(e.styles,function(i,o){i=L(M(i,t),o),"number"==typeof o&&(o=i,r=0),(e.remove_similar||!r||B(D(r,o),i))&&Y.setStyle(n,o,""),a=1}),a&&""===Y.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),ue(e.attributes,function(e,i){var o;if(e=M(e,t),"number"==typeof i&&(i=e,r=0),!r||B(Y.getAttrib(r,i),e)){if("class"==i&&(e=Y.getAttrib(n,i),e&&(o="",ue(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void Y.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),te.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),ue(e.classes,function(e){e=M(e,t),r&&!Y.hasClass(r,e)||Y.removeClass(n,e)}),o=Y.getAttribs(n),i=0;i<o.length;i++){var s=o[i].nodeName;if(0!==s.indexOf("_")&&0!==s.indexOf("data-"))return ne}return"none"!=e.remove?(z(n,e),re):void 0}function z(e,t){function n(e,t,n){return e=U(e,t,n),!e||"BR"==e.nodeName||J(e)}var r=e.parentNode,i;t.block&&(Q?r==Y.getRoot()&&(t.list_block&&B(e,t.list_block)||ue(de(e.childNodes),function(e){G(Q,e.nodeName.toLowerCase())?i?i.appendChild(e):(i=O(e,Q),Y.setAttribs(i,s.settings.forced_root_block_attrs)):i=0})):J(e)&&!J(r)&&(n(e,ne)||n(e.firstChild,re,1)||e.insertBefore(Y.create("br"),e.firstChild),n(e,re)||n(e.lastChild,ne,1)||e.appendChild(Y.create("br")))),t.selector&&t.inline&&!B(t.inline,e)||Y.remove(e,1)}function U(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1==e.nodeType||!P(e))return e}function W(e,t){function n(e,t){for(i=e;i;i=i[t]){if(3==i.nodeType&&0!==i.nodeValue.length)return e;if(1==i.nodeType&&!ce(i))return i}return e}var i,o,a=new r(Y);if(e&&t&&(e=n(e,"previousSibling"),t=n(t,"nextSibling"),a.compare(e,t))){for(i=e.nextSibling;i&&i!=t;)o=i,i=i.nextSibling,e.appendChild(o);return Y.remove(t),ue(de(t.childNodes),function(t){e.appendChild(t)}),e}return t}function V(t,n){var r,i,o;return r=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1==r.nodeType&&(o=r.childNodes.length-1,!n&&i&&i--,r=r.childNodes[i>o?o:i]),3===r.nodeType&&n&&i>=r.nodeValue.length&&(r=new e(r,s.getBody()).next()||r),3!==r.nodeType||n||0!==i||(r=new e(r,s.getBody()).prev()||r),r}function $(t,n,r,i){function o(e){var t=Y.create("span",{id:g,"data-mce-bogus":!0,style:v?"color:red":""});return e&&t.appendChild(s.getDoc().createTextNode(ee)),t}function a(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==ee||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function c(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=X.getRng(!0),a(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),Y.remove(e)):(n=u(e),n.nodeValue.charAt(0)===ee&&(n.deleteData(0,1),r.startContainer==n&&r.startOffset>0&&r.setStart(n,r.startOffset-1),r.endContainer==n&&r.endOffset>0&&r.setEnd(n,r.endOffset-1)),Y.remove(e,1)),X.setRng(r);else if(e=c(X.getStart()),!e)for(;e=Y.get(g);)d(e,!1)}function f(){var e,t,i,a,s,l,d;e=X.getRng(!0),a=e.startOffset,l=e.startContainer,d=l.nodeValue,t=c(X.getStart()),t&&(i=u(t)),d&&a>0&&a<d.length&&/\w/.test(d.charAt(a))&&/\w/.test(d.charAt(a-1))?(s=X.getBookmark(),e.collapse(!0),e=H(e,m(n)),e=K.split(e),x(n,r,e),X.moveToBookmark(s)):(t&&i.nodeValue===ee?x(n,r,t):(t=o(!0),i=t.firstChild,e.insertNode(t),a=1,x(n,r,t)),X.setCursorLocation(i,a))}function h(){var e=X.getRng(!0),t,a,s,c,u,d,f=[],h,p;for(t=e.startContainer,a=e.startOffset,u=t,3==t.nodeType&&(a!=t.nodeValue.length&&(c=!0),u=u.parentNode);u;){if(E(u,n,r,i)){d=u;break}u.nextSibling&&(c=!0),f.push(u),u=u.parentNode}if(d)if(c)s=X.getBookmark(),e.collapse(!0),e=H(e,m(n),!0),e=K.split(e),w(n,r,e),X.moveToBookmark(s);else{for(p=o(),u=p,h=f.length-1;h>=0;h--)u.appendChild(Y.clone(f[h],!1)),u=u.firstChild;u.appendChild(Y.doc.createTextNode(ee)),u=u.firstChild;var g=Y.getParent(d,l);g&&Y.isEmpty(g)?d.parentNode.replaceChild(p,d):Y.insertAfter(p,d),X.setCursorLocation(u,1),Y.isEmpty(d)&&Y.remove(d)}}function p(){var e;e=c(X.getStart()),e&&!Y.isEmpty(e)&&fe(e,function(e){1!=e.nodeType||e.id===g||Y.isEmpty(e)||Y.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var g="_mce_caret",v=s.settings.caret_debug;s._hasCaretEvents||(le=function(){var e=[],t;if(a(c(X.getStart()),e))for(t=e.length;t--;)Y.setAttrib(e[t],"data-mce-bogus","1")},se=function(e){var t=e.keyCode;d(),8==t&&X.isCollapsed()&&X.getStart().innerHTML==ee&&d(c(X.getStart())),37!=t&&39!=t||d(c(X.getStart())),p()},s.on("SetContent",function(e){e.selection&&p()}),s._hasCaretEvents=!0),"apply"==t?f():h()}function q(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if((t.startContainer!=t.endContainer||!u(t.startContainer.childNodes[t.startOffset]))&&(3==n.nodeType&&r>=n.nodeValue.length&&(r=Z(n),n=n.parentNode,i=!0),1==n.nodeType))for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,Y.getParent(n,Y.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!P(a))return l=Y.create("a",{"data-mce-bogus":"all"},ee),a.parentNode.insertBefore(l,a),t.setStart(a,0),X.setRng(t),void Y.remove(l)}var j={},Y=s.dom,X=s.selection,K=new t(Y),G=s.schema.isValidChild,J=Y.isBlock,Q=s.settings.forced_root_block,Z=Y.nodeIndex,ee="\ufeff",te=/^(src|href|style)$/,ne=!1,re=!0,ie,oe,ae=Y.getContentEditable,se,le,ce=n.isBookmarkNode,ue=i.each,de=i.grep,fe=i.walk,he=i.extend;he(this,{get:m,register:g,unregister:v,apply:x,remove:w,toggle:N,match:_,matchAll:S,matchNode:E,canApply:k,formatChanged:T,getCssText:R}),h(),p(),s.on("BeforeGetContent",function(e){le&&"raw"!=e.format&&le()}),s.on("mouseup keydown",function(e){se&&se(e)})}}),r(Q,[I,d],function(e,t){return function(e){function n(){return e.serializer.getTrimmedContent()}function r(t){e.setDirty(t)}function i(e){o.typing=!1,o.add({},e)}var o=this,a=0,s=[],l,c,u=0;return e.on("init",function(){o.add()}),e.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&o.beforeChange()}),e.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&i(e)}),e.on("ObjectResizeStart Cut",function(){o.beforeChange()}),e.on("SaveContent ObjectResized blur",i),e.on("DragEnd",i),e.on("KeyUp",function(a){var l=a.keyCode;a.isDefaultPrevented()||((l>=33&&36>=l||l>=37&&40>=l||45==l||13==l||a.ctrlKey)&&(i(),e.nodeChanged()),(46==l||8==l||t.mac&&(91==l||93==l))&&e.nodeChanged(),c&&o.typing&&(e.isDirty()||(r(s[0]&&n()!=s[0].content),e.isDirty()&&e.fire("change",{level:s[0],lastLevel:null})),e.fire("TypingUndo"),c=!1,e.nodeChanged()))}),e.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented()){if(t>=33&&36>=t||t>=37&&40>=t||45==t)return void(o.typing&&i(e));var n=e.ctrlKey&&!e.altKey||e.metaKey;!(16>t||t>20)||224==t||91==t||o.typing||n||(o.beforeChange(),o.typing=!0,o.add({},e),c=!0)}}),e.on("MouseDown",function(e){o.typing&&i(e)}),e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),e.on("AddUndo Undo Redo ClearUndos",function(t){t.isDefaultPrevented()||e.nodeChanged()}),o={data:s,typing:!1,beforeChange:function(){u||(l=e.selection.getBookmark(2,!0))},add:function(t,i){var o,c=e.settings,d;if(t=t||{},t.content=n(),u||e.removed)return null;if(d=s[a],e.fire("BeforeAddUndo",{level:t,lastLevel:d,originalEvent:i}).isDefaultPrevented())return null;if(d&&d.content==t.content)return null;if(s[a]&&(s[a].beforeBookmark=l),c.custom_undo_redo_levels&&s.length>c.custom_undo_redo_levels){for(o=0;o<s.length-1;o++)s[o]=s[o+1];s.length--,a=s.length}t.bookmark=e.selection.getBookmark(2,!0),a<s.length-1&&(s.length=a+1),s.push(t),a=s.length-1;var f={level:t,lastLevel:d,originalEvent:i};return e.fire("AddUndo",f),a>0&&(r(!0),e.fire("change",f)),t},undo:function(){var t;return o.typing&&(o.add(),o.typing=!1),a>0&&(t=s[--a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.beforeBookmark),r(!0),e.fire("undo",{level:t})),t},redo:function(){var t;return a<s.length-1&&(t=s[++a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.bookmark),r(!0),e.fire("redo",{level:t})),t},clear:function(){s=[],a=0,o.typing=!1,o.data=s,e.fire("ClearUndos")},hasUndo:function(){return a>0||o.typing&&s[0]&&n()!=s[0].content},hasRedo:function(){return a<s.length-1&&!this.typing},transact:function(e){o.beforeChange();try{u++,e()}finally{u--}return o.add()},extra:function(t,n){var r,i;o.transact(t)&&(i=s[a].bookmark,r=s[a-1],e.setContent(r.content,{format:"raw"}),e.selection.moveToBookmark(r.beforeBookmark),o.transact(n)&&(s[a-1].beforeBookmark=i))}}}}),r(Z,[y,T,d],function(e,t,n){var r=n.ie&&n.ie<11;return function(i){function o(o){function h(e){return e&&a.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==a.getContentEditable(e)}function p(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}function m(e){var t;a.isBlock(e)&&(t=s.getRng(),e.appendChild(a.create("span",null,"\xa0")),s.select(e),e.lastChild.outerHTML="",s.setRng(t))}function g(e){var t=e,n=[],r;if(t){for(;t=t.firstChild;){if(a.isBlock(t))return;1!=t.nodeType||d[t.nodeName.toLowerCase()]||n.push(t)}for(r=n.length;r--;)t=n[r],!t.hasChildNodes()||t.firstChild==t.lastChild&&""===t.firstChild.nodeValue?a.remove(t):"A"==t.nodeName&&" "===(t.innerText||t.textContent)&&a.remove(t)}}function v(t){function r(e){for(;e;){if(1==e.nodeType||3==e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}var i,o,l,c=t,u;if(t){if(n.ie&&n.ie<9&&M&&M.firstChild&&M.firstChild==M.lastChild&&"BR"==M.firstChild.tagName&&a.remove(M.firstChild),/^(LI|DT|DD)$/.test(t.nodeName)){var d=r(t.firstChild);d&&/^(UL|OL|DL)$/.test(d.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(l=a.createRng(),n.ie||t.normalize(),t.hasChildNodes()){for(i=new e(t,t);o=i.current();){if(3==o.nodeType){l.setStart(o,0),l.setEnd(o,0);break}if(f[o.nodeName.toLowerCase()]){l.setStartBefore(o),l.setEndBefore(o);break}c=o,o=i.next()}o||(l.setStart(c,0),l.setEnd(c,0))}else"BR"==t.nodeName?t.nextSibling&&a.isBlock(t.nextSibling)?((!P||9>P)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}}function y(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function b(e){e.innerHTML=r?"":'<br data-mce-bogus="1">'}function C(e){var t=D,n,i,o,s=u.getTextInlineElements();if(e||"TABLE"==z?(n=a.create(e||W),y(n)):n=M.cloneNode(!1),o=n,l.keep_styles!==!1)do if(s[t.nodeName]){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while((t=t.parentNode)&&t!=B);return r||(o.innerHTML='<br data-mce-bogus="1">'),n}function x(t){var n,r,i;if(3==D.nodeType&&(t?L>0:L<D.nodeValue.length))return!1;if(D.parentNode==M&&V&&!t)return!0;if(t&&1==D.nodeType&&D==M.firstChild)return!0;if("TABLE"===D.nodeName||D.previousSibling&&"TABLE"==D.previousSibling.nodeName)return V&&!t||!V&&t;for(n=new e(D,M),3==D.nodeType&&(t&&0===L?n.prev():t||L!=D.nodeValue.length||n.next());r=n.current();){if(1===r.nodeType){if(!r.getAttribute("data-mce-bogus")&&(i=r.nodeName.toLowerCase(),d[i]&&"br"!==i))return!1}else if(3===r.nodeType&&!/^[ \t\r\n]*$/.test(r.nodeValue))return!1;t?n.prev():n.next()}return!0}function w(e,t){var n,r,o,s,l,c,d=W||"P";if(r=a.getParent(e,a.isBlock),!r||!h(r)){if(r=r||B,c=r==i.getBody()||p(r)?r.nodeName.toLowerCase():r.parentNode.nodeName.toLowerCase(),!r.hasChildNodes())return n=a.create(d),y(n),r.appendChild(n),R.setStart(n,0),R.setEnd(n,0),n;for(s=e;s.parentNode!=r;)s=s.parentNode;for(;s&&!a.isBlock(s);)o=s,s=s.previousSibling;if(o&&u.isValidChild(c,d.toLowerCase())){for(n=a.create(d),y(n),o.parentNode.insertBefore(n,o),s=o;s&&!a.isBlock(s);)l=s.nextSibling,n.appendChild(s),s=l;R.setStart(e,t),R.setEnd(e,t)}}return e}function N(){function e(e){for(var t=F[e?"firstChild":"lastChild"];t&&1!=t.nodeType;)t=t[e?"nextSibling":"previousSibling"];return t===M}function t(){var e=F.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:F}if(F!=i.getBody()){var n=F.parentNode.nodeName;/^(OL|UL|LI)$/.test(n)&&(W="LI"),H=W?C(W):a.create("BR"),e(!0)&&e()?"LI"==n?a.insertAfter(H,t()):a.replace(H,F):e(!0)?"LI"==n?(a.insertAfter(H,t()),H.appendChild(a.doc.createTextNode(" ")),H.appendChild(F)):F.parentNode.insertBefore(H,F):e()?(a.insertAfter(H,t()),m(H)):(F=t(),A=R.cloneRange(),A.setStartAfter(M),A.setEndAfter(F),I=A.extractContents(),"LI"==W&&"LI"==I.firstChild.nodeName?(H=I.firstChild,a.insertAfter(I,F)):(a.insertAfter(I,F),a.insertAfter(H,F))),a.remove(M),v(H),c.add()}}function E(){i.execCommand("InsertLineBreak",!1,o)}function _(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function S(e){var t=a.getRoot(),n,r;for(n=e;n!==t&&"false"!==a.getContentEditable(n);)"true"===a.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function k(e){var t;r||(e.normalize(),t=e.lastChild,t&&!/^(left|right)$/gi.test(a.getStyle(t,"float",!0))||a.add(e,"br"))}function T(){H=/^(H[1-6]|PRE|FIGURE)$/.test(z)&&"HGROUP"!=U?C(W):C(),l.end_container_on_empty_block&&h(F)&&a.isEmpty(M)?H=a.split(F,M):a.insertAfter(H,M),v(H)}var R,A,B,D,L,M,P,O,H,I,F,z,U,W,V;if(R=s.getRng(!0),!o.isDefaultPrevented()){if(!R.collapsed)return void i.execCommand("Delete");if(new t(a).normalize(R),D=R.startContainer,L=R.startOffset,W=(l.force_p_newlines?"p":"")||l.forced_root_block,W=W?W.toUpperCase():"",P=a.doc.documentMode,O=o.shiftKey,1==D.nodeType&&D.hasChildNodes()&&(V=L>D.childNodes.length-1,D=D.childNodes[Math.min(L,D.childNodes.length-1)]||D,L=V&&3==D.nodeType?D.nodeValue.length:0),B=S(D)){if(c.beforeChange(),!a.isBlock(B)&&B!=a.getRoot())return void(W&&!O||E());if((W&&!O||!W&&O)&&(D=w(D,L)),M=a.getParent(D,a.isBlock),F=M?a.getParent(M.parentNode,a.isBlock):null,z=M?M.nodeName.toUpperCase():"",U=F?F.nodeName.toUpperCase():"","LI"!=U||o.ctrlKey||(M=F,z=U),/^(LI|DT|DD)$/.test(z)){if(!W&&O)return void E();if(a.isEmpty(M))return void N()}if("PRE"==z&&l.br_in_pre!==!1){if(!O)return void E()}else if(!W&&!O&&"LI"!=z||W&&O)return void E();W&&M===i.getBody()||(W=W||"P",x()?T():x(!0)?(H=M.parentNode.insertBefore(C(),M),m(H),v(M)):(A=R.cloneRange(),A.setEndAfter(M),I=A.extractContents(),_(I),H=I.firstChild,a.insertAfter(I,M),g(H),k(M),a.isEmpty(M)&&b(M),H.normalize(),a.isEmpty(H)?(a.remove(H),T()):v(H)),a.setAttrib(H,"id",""),i.fire("NewBlock",{newBlock:H}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements(),f=u.getMoveCaretBeforeOnEnterElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(ee,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,h,p,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){p=t,t=t.nextSibling,r.remove(p);continue}h||(h=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(h,t),g=!0),p=t,t=t.nextSibling,h.appendChild(p)}else h=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(te,[z,y,_,$,k,U],function(e,t,n,r,i,o){function a(e){return e>0}function s(e){return 0>e}function l(e,n,r,i,o){var l=new t(e,i);if(s(n)){if(C(e)&&(e=l.prev(!0),r(e)))return e;for(;e=l.prev(o);)if(r(e))return e}if(a(n)){if(C(e)&&(e=l.next(!0),r(e)))return e;for(;e=l.next(o);)if(r(e))return e}return null}function c(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode)if(b(e))return e;return t}function u(e,t){for(;e&&e!=t;){if(x(e))return e;e=e.parentNode}return null}function d(e,t,n){return u(e.container(),n)==u(t.container(),n)}function f(e,t,n){return c(e.container(),n)==c(t.container(),n)}function h(e,t){var n,r;return t?(n=t.container(),r=t.offset(),E(n)?n.childNodes[r+e]:null):null}function p(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n}function m(e,t,n){return u(t,e)==u(n,e)}function g(e,t,n){var r,i;for(i=e?"previousSibling":"nextSibling";n&&n!=t;){if(r=n[i],w(r)&&(r=r[i]),C(r)){if(m(t,r,n))return r;break}if(_(r))break;n=n.parentNode}return null}function v(e,t,r){var o,a,s,l,c=N(g,!0,t),u=N(g,!1,t);if(a=r.startContainer,s=r.startOffset,i.isCaretContainerBlock(a)){if(E(a)||(a=a.parentNode),l=a.getAttribute("data-mce-caret"),"before"==l&&(o=a.nextSibling,C(o)))return S(o);if("after"==l&&(o=a.previousSibling,C(o)))return k(o)}if(!r.collapsed)return r;if(n.isText(a)){if(w(a)){if(1===e){if(o=u(a))return S(o);if(o=c(a))return k(o)}if(-1===e){if(o=c(a))return k(o);if(o=u(a))return S(o)}return r}if(i.endsWithCaretContainer(a)&&s>=a.data.length-1)return 1===e&&(o=u(a))?S(o):r;if(i.startsWithCaretContainer(a)&&1>=s)return-1===e&&(o=c(a))?k(o):r;if(s===a.data.length)return o=u(a),o?S(o):r;if(0===s)return o=c(a),o?k(o):r}return r}function y(e,t){return C(h(e,t))}var b=n.isContentEditableTrue,C=n.isContentEditableFalse,x=n.matchStyleValues("display","block table table-cell table-caption"),w=i.isCaretContainer,N=e.curry,E=n.isElement,_=o.isCaretCandidate,S=N(p,!0),k=N(p,!1);return{isForwards:a,isBackwards:s,findNode:l,getEditingHost:c,getParentBlock:u,isInSameBlock:d,isInSameEditingHost:f,isBeforeContentEditableFalse:N(y,0),isAfterContentEditableFalse:N(y,-1),normalizeRange:v}}),r(ne,[_,U,$,te,p,z],function(e,t,n,r,i,o){function a(e,t){for(var n=[];e&&e!=t;)n.push(e),e=e.parentNode;return n}function s(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null}function l(e,t){if(m(e)){if(v(t.previousSibling)&&!f(t.previousSibling))return n.before(t);if(f(t))return n(t,0)}if(g(e)){if(v(t.nextSibling)&&!f(t.nextSibling))return n.after(t);if(f(t))return n(t,t.data.length)}return g(e)?p(t)?n.before(t):n.after(t):n.before(t)}function c(t,i){var o;return e.isBr(t)?(o=u(1,n.after(t),i),o?!r.isInSameBlock(n.before(t),n.before(o),i):!1):!1}function u(e,t,p){var C,x,w,N,E,_,S;if(!h(p)||!t)return null;if(S=t,C=S.container(),x=S.offset(),f(C)){if(g(e)&&x>0)return n(C,--x);if(m(e)&&x<C.length)return n(C,++x);w=C}else{if(g(e)&&x>0&&(N=s(C,x-1),v(N)))return!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,E.data.length):n.after(E):f(N)?n(N,N.data.length):n.before(N);if(m(e)&&x<C.childNodes.length&&(N=s(C,x),v(N)))return c(N,p)?u(e,n.after(N),p):!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,0):n.before(E):f(N)?n(N,0):n.after(N);w=S.getNode()}return(m(e)&&S.isAtEnd()||g(e)&&S.isAtStart())&&(w=r.findNode(w,e,o.constant(!0),p,!0),b(w))?l(e,w):(N=r.findNode(w,e,b,p),_=i.last(i.filter(a(C,p),d)),!_||N&&_.contains(N)?N?l(e,N):null:S=m(e)?n.after(_):n.before(_))}var d=e.isContentEditableFalse,f=e.isText,h=e.isElement,p=e.isBr,m=r.isForwards,g=r.isBackwards,v=t.isCaretCandidate,y=t.isAtomic,b=t.isEditableCaretCandidate;return function(e){return{next:function(t){return u(1,t,e)},prev:function(t){return u(-1,t,e)}}}}),r(re,[m,ne,$],function(e,t,n){var r=function(e){var t=e.firstChild,n=e.lastChild;return t&&"meta"===t.name&&(t=t.next),n&&"mce_marker"===n.attr("id")&&(n=n.prev),t&&t===n?"ul"===t.name||"ol"===t.name:!1},i=function(e){var t=e.firstChild,n=e.lastChild;return t&&"META"===t.nodeName&&t.parentNode.removeChild(t),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),e},o=function(e,t,n){var r=t.serialize(n),o=e.createFragment(r);return i(o)},a=function(t){return e.grep(t.childNodes,function(e){return"LI"===e.nodeName})},s=function(e){return!e.firstChild},l=function(e){return e.length>0&&s(e[e.length-1])?e.slice(0,-1):e},c=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},u=function(e,t){return!!c(e,t)},d=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]},f=function(e,r){var i=n.before(e),o=new t(r),a=o.next(i);return a?a.toRange():null},h=function(e,r){var i=n.after(e),o=new t(r),a=o.prev(i);return a?a.toRange():null},p=function(t,n,r,i){var o=d(t,i),a=t.parentNode;return a.insertBefore(o[0],t),e.each(n,function(e){a.insertBefore(e,t)}),a.insertBefore(o[1],t),a.removeChild(t),h(n[n.length-1],r)},m=function(t,n,r){var i=t.parentNode;return e.each(n,function(e){i.insertBefore(e,t)}),f(t,r)},g=function(e,t,n,r){return r.insertAfter(t.reverse(),e),h(t[0],n)},v=function(e,r,i,s){var u=o(r,e,s),d=c(r,i.startContainer),f=l(a(u.firstChild)),h=1,v=2,y=r.getRoot(),b=function(e){var o=n.fromRangeStart(i),a=new t(r.getRoot()),s=e===h?a.prev(o):a.next(o);return s?c(r,s.getNode())!==d:!0};return b(h)?m(d,f,y):b(v)?g(d,f,y,r):p(d,f,y,i)};return{isListFragment:r,insertAtCaret:v,isParentBlockLi:u,trimListItems:l,listItems:a}}),r(ie,[d,m,P,ne,$,X,_,re],function(e,t,n,r,i,o,a,s){var l=a.matchNodeNames("td th"),c=function(a,c,u){function d(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=D.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i<r.length?e=e.replace(/ (<br>|)$/," "):t("nextSibling")||(e=e.replace(/( | )(<br>|)$/," "))),e}function f(){var e,t,n;e=D.getRng(!0),t=e.startContainer,n=e.startOffset,3==t.nodeType&&e.collapsed&&("\xa0"===t.data[n]?(t.deleteData(n,1),/[\u00a0| ]$/.test(c)||(c+=" ")):"\xa0"===t.data[n-1]&&(t.deleteData(n-1,1),/[\u00a0| ]$/.test(c)||(c=" "+c)))}function h(){if(A){var e=a.getBody(),n=new o(L);t.each(L.select("*[data-mce-fragment]"),function(t){for(var r=t.parentNode;r&&r!=e;r=r.parentNode)B[t.nodeName.toLowerCase()]&&n.compare(r,t)&&L.remove(t,!0)})}}function p(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}function m(e){t.each(e.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")})}function g(e){return!!e.getAttribute("data-mce-fragment")}function v(e){return e&&!a.schema.getShortEndedElements()[e.nodeName]}function y(t){function n(e){for(var t=a.getBody();e&&e!==t;e=e.parentNode)if("false"===a.dom.getContentEditable(e))return e;return null}function o(e){var t=i.fromRangeStart(e),n=new r(a.getBody());return t=n.next(t),t?t.toRange():void 0}var s,c,u;if(t){if(D.scrollIntoView(t),s=n(t))return L.remove(t),void D.select(s);S=L.createRng(),k=t.previousSibling,k&&3==k.nodeType?(S.setStart(k,k.nodeValue.length),e.ie||(T=t.nextSibling,T&&3==T.nodeType&&(k.appendData(T.data),T.parentNode.removeChild(T)))):(S.setStartBefore(t),S.setEndBefore(t)),c=L.getParent(t,L.isBlock),L.remove(t),c&&L.isEmpty(c)&&(a.$(c).empty(),S.setStart(c,0),S.setEnd(c,0),l(c)||g(c)||!(u=o(S))?L.add(c,L.create("br",{"data-mce-bogus":"1"})):(S=u,L.remove(c))),D.setRng(S)}}var b,C,x,w,N,E,_,S,k,T,R,A,B=a.schema.getTextInlineElements(),D=a.selection,L=a.dom;/^ | $/.test(c)&&(c=d(c)),b=a.parser,A=u.merge,C=new n({validate:a.settings.validate},a.schema),R='<span id="mce_marker" data-mce-type="bookmark">​</span>',E={content:c,format:"html",selection:!0},a.fire("BeforeSetContent",E),c=E.content,-1==c.indexOf("{$caret}")&&(c+="{$caret}"),c=c.replace(/\{\$caret\}/,R),S=D.getRng();var M=S.startContainer||(S.parentElement?S.parentElement():null),P=a.getBody();M===P&&D.isCollapsed()&&L.isBlock(P.firstChild)&&v(P.firstChild)&&L.isEmpty(P.firstChild)&&(S=L.createRng(),S.setStart(P.firstChild,0),S.setEnd(P.firstChild,0),D.setRng(S)),D.isCollapsed()||(a.selection.setRng(a.selection.getRng()),a.getDoc().execCommand("Delete",!1,null), f()),x=D.getNode();var O={context:x.nodeName.toLowerCase(),data:u.data};if(N=b.parse(c,O),u.paste===!0&&s.isListFragment(N)&&s.isParentBlockLi(L,x))return S=s.insertAtCaret(C,L,a.selection.getRng(!0),N),a.selection.setRng(S),void a.fire("SetContent",E);if(p(N),k=N.lastChild,"mce_marker"==k.attr("id"))for(_=k,k=k.prev;k;k=k.walk(!0))if(3==k.type||!L.isBlock(k.name)){a.schema.isValidChild(k.parent.name,"span")&&k.parent.insert(_,k,"br"===k.name);break}if(a._selectionOverrides.showBlockCaretContainer(x),O.invalid){for(D.setContent(R),x=D.getNode(),w=a.getBody(),9==x.nodeType?x=k=w:k=x;k!==w;)x=k,k=k.parentNode;c=x==w?w.innerHTML:L.getOuterHTML(x),c=C.serialize(b.parse(c.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return C.serialize(N)}))),x==w?L.setHTML(w,c):L.setOuterHTML(x,c)}else c=C.serialize(N),k=x.firstChild,T=x.lastChild,!k||k===T&&"BR"===k.nodeName?L.setHTML(x,c):D.setContent(c);h(),y(L.get("mce_marker")),m(a.getBody()),a.fire("SetContent",E),a.addVisual()},u=function(e){var n;return"string"!=typeof e?(n=t.extend({paste:e.paste,data:{paste:e.paste}},e),{content:e.content,details:n}):{content:e,details:{}}},d=function(e,t){var n=u(t);c(e,n.content,n.details)};return{insertAtCaret:d}}),r(oe,[d,m,T,y,ie],function(e,n,r,i,o){var a=n.each,s=n.extend,l=n.map,c=n.inArray,u=n.explode,d=e.ie&&e.ie<11,f=!0,h=!1;return function(n){function p(e,t,r,i){var o,s,l=0;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||i&&i.skip_focus||n.focus(),i=n.fire("BeforeExecCommand",{command:e,ui:t,value:r}),i.isDefaultPrevented())return!1;if(s=e.toLowerCase(),o=B.exec[s])return o(s,t,r),n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;if(a(n.plugins,function(i){return i.execCommand&&i.execCommand(e,t,r)?(n.fire("ExecCommand",{command:e,ui:t,value:r}),l=!0,!1):void 0}),l)return l;if(n.theme&&n.theme.execCommand&&n.theme.execCommand(e,t,r))return n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;try{l=n.getDoc().execCommand(e,t,r)}catch(c){}return l?(n.fire("ExecCommand",{command:e,ui:t,value:r}),!0):!1}function m(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.state[e])return t(e);try{return n.getDoc().queryCommandState(e)}catch(r){}return!1}}function g(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.value[e])return t(e);try{return n.getDoc().queryCommandValue(e)}catch(r){}}}function v(e,t){t=t||"exec",a(e,function(e,n){a(n.toLowerCase().split(","),function(n){B[t][n]=e})})}function y(e,t,r){e=e.toLowerCase(),B.exec[e]=function(e,i,o,a){return t.call(r||n,i,o,a)}}function b(e){if(e=e.toLowerCase(),B.exec[e])return!0;try{return n.getDoc().queryCommandSupported(e)}catch(t){}return!1}function C(e,t,r){e=e.toLowerCase(),B.state[e]=function(){return t.call(r||n)}}function x(e,t,r){e=e.toLowerCase(),B.value[e]=function(){return t.call(r||n)}}function w(e){return e=e.toLowerCase(),!!B.exec[e]}function N(e,r,i){return r===t&&(r=h),i===t&&(i=null),n.getDoc().execCommand(e,r,i)}function E(e){return A.match(e)}function _(e,r){A.toggle(e,r?{value:r}:t),n.nodeChanged()}function S(e){L=R.getBookmark(e)}function k(){R.moveToBookmark(L)}var T,R,A,B={state:{},exec:{},value:{}},D=n.settings,L;n.on("PreInit",function(){T=n.dom,R=n.selection,D=n.settings,A=n.formatter}),s(this,{execCommand:p,queryCommandState:m,queryCommandValue:g,queryCommandSupported:b,addCommands:v,addCommand:y,addQueryStateHandler:C,addQueryValueHandler:x,hasCustomCommand:w}),v({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(t){var r=n.getDoc(),i;try{N(t)}catch(o){i=f}if("paste"!==t||r.queryCommandEnabled(t)||(i=!0),i||!r.queryCommandSupported(t)){var a=n.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");e.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),n.notificationManager.open({text:a,type:"error"})}},unlink:function(){if(R.isCollapsed()){var e=R.getNode();return void("A"==e.tagName&&n.dom.remove(e,!0))}A.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"==t&&(t="justify"),a("left,center,right,justify".split(","),function(e){t!=e&&A.remove("align"+e)}),"none"!=t&&_("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;N(e),t=T.getParent(R.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(S(),T.split(n,t),k()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){_(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){_(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=u(D.font_size_style_values),r=u(D.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),_(e,n)},RemoveFormat:function(e){A.remove(e)},mceBlockQuote:function(){_("blockquote")},FormatBlock:function(e,t,n){return _(n||"p")},mceCleanup:function(){var e=R.getBookmark();n.setContent(n.getContent({cleanup:f}),{cleanup:f}),R.moveToBookmark(e)},mceRemoveNode:function(e,t,r){var i=r||R.getNode();i!=n.getBody()&&(S(),n.dom.remove(i,f),k())},mceSelectNodeDepth:function(e,t,r){var i=0;T.getParent(R.getNode(),function(e){return 1==e.nodeType&&i++==r?(R.select(e),h):void 0},n.getBody())},mceSelectNode:function(e,t,n){R.select(n)},mceInsertContent:function(e,t,r){o.insertAtCaret(n,r)},mceInsertRawHTML:function(e,t,r){R.setContent("tiny_mce_marker"),n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return r}))},mceToggleFormat:function(e,t,n){_(n)},mceSetContent:function(e,t,r){n.setContent(r)},"Indent,Outdent":function(e){var t,r,i;t=D.indentation,r=/[a-z%]+$/i.exec(t),t=parseInt(t,10),m("InsertUnorderedList")||m("InsertOrderedList")?N(e):(D.forced_root_block||T.getParent(R.getNode(),T.isBlock)||A.apply("div"),a(R.getSelectedBlocks(),function(o){if("false"!==T.getContentEditable(o)&&"LI"!=o.nodeName){var a=n.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==T.getStyle(o,"direction",!0)?"Right":"Left","outdent"==e?(i=Math.max(0,parseInt(o.style[a]||0,10)-t),T.setStyle(o,a,i?i+r:"")):(i=parseInt(o.style[a]||0,10)+t+r,T.setStyle(o,a,i))}}))},mceRepaint:function(){},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual,n.addVisual()},mceReplaceContent:function(e,t,r){n.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,R.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=T.getParent(R.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||A.remove("link"),n.href&&A.apply("link",n,r)},selectAll:function(){var e=T.getRoot(),t;R.getRng().setStart?(t=T.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),R.setRng(t)):(t=R.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){N("Delete");var e=n.getBody();T.isEmpty(e)&&(n.setContent(""),e.firstChild&&T.isBlock(e.firstChild)?n.selection.setCursorLocation(e.firstChild,0):n.selection.setCursorLocation(e,0))},mceNewDocument:function(){n.setContent("")},InsertLineBreak:function(e,t,o){function a(){for(var e=new i(m,v),t,r=n.schema.getNonEmptyElements();t=e.next();)if(r[t.nodeName.toLowerCase()]||t.length>0)return!0}var s=o,l,c,u,h=R.getRng(!0);new r(T).normalize(h);var p=h.startOffset,m=h.startContainer;if(1==m.nodeType&&m.hasChildNodes()){var g=p>m.childNodes.length-1;m=m.childNodes[Math.min(p,m.childNodes.length-1)]||m,p=g&&3==m.nodeType?m.nodeValue.length:0}var v=T.getParent(m,T.isBlock),y=v?v.nodeName.toUpperCase():"",b=v?T.getParent(v.parentNode,T.isBlock):null,C=b?b.nodeName.toUpperCase():"",x=s&&s.ctrlKey;"LI"!=C||x||(v=b,y=C),m&&3==m.nodeType&&p>=m.nodeValue.length&&(d||a()||(l=T.create("br"),h.insertNode(l),h.setStartAfter(l),h.setEndAfter(l),c=!0)),l=T.create("br"),h.insertNode(l);var w=T.doc.documentMode;return d&&"PRE"==y&&(!w||8>w)&&l.parentNode.insertBefore(T.doc.createTextNode("\r"),l),u=T.create("span",{}," "),l.parentNode.insertBefore(u,l),R.scrollIntoView(u),T.remove(u),c?(h.setStartBefore(l),h.setEndBefore(l)):(h.setStartAfter(l),h.setEndAfter(l)),R.setRng(h),n.undoManager.add(),f}}),v({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=R.isCollapsed()?[T.getParent(R.getNode(),T.isBlock)]:R.getSelectedBlocks(),r=l(n,function(e){return!!A.matchNode(e,t)});return-1!==c(r,f)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return E(e)},mceBlockQuote:function(){return E("blockquote")},Outdent:function(){var e;if(D.inline_styles){if((e=T.getParent(R.getStart(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f;if((e=T.getParent(R.getEnd(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f}return m("InsertUnorderedList")||m("InsertOrderedList")||!D.inline_styles&&!!T.getParent(R.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=T.getParent(R.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),v({"FontSize,FontName":function(e){var t=0,n;return(n=T.getParent(R.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),v({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}),r(ae,[m],function(e){function t(e,o){var a=this,s,l;if(e=r(e),o=a.settings=o||{},s=o.base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(a.source=e);var c=0===e.indexOf("//");0!==e.indexOf("/")||c||(e=(s?s.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(l=o.base_uri?o.base_uri.path:new t(location.href).directory,""===o.base_uri.protocol?e="//mce_host"+a.toAbsPath(l,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(s&&s.protocol||"http")+"://mce_host"+a.toAbsPath(l,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(i,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),a[t]=r}),s&&(a.protocol||(a.protocol=s.protocol),a.userInfo||(a.userInfo=s.userInfo),a.port||"mce_host"!==a.host||(a.port=s.port),a.host&&"mce_host"!==a.host||(a.host=s.host),a.source=""),c&&(a.protocol="")}var n=e.each,r=e.trim,i="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),o={ftp:21,http:80,https:443,mailto:25};return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(n&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=o[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.length<n.length)for(o=0,a=n.length;a>o;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}},t.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},t}),r(se,[m],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r=this;if(!o&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],"function"==typeof f&&c[d]?u[d]=s(d,f):u[d]=f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(le,[m],function(e){function t(t){function n(){return!1}function r(){return!0}function i(e,i){var o,s,l,c;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=u),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=r},i.stopPropagation=function(){i.isPropagationStopped=r},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=r},i.isDefaultPrevented=n,i.isPropagationStopped=n,i.isImmediatePropagationStopped=n),t.beforeFire&&t.beforeFire(i),o=d[e])for(s=0,l=o.length;l>s;s++){if(c=o[s],c.once&&a(e,c.func),i.isImmediatePropagationStopped())return i.stopPropagation(),i;if(c.func.call(u,i)===!1)return i.preventDefault(),i}return i}function o(t,r,i,o){var a,s,l;if(r===!1&&(r=n),r)for(r={func:r},o&&e.extend(r,o),s=t.toLowerCase().split(" "),l=s.length;l--;)t=s[l],a=d[t],a||(a=d[t]=[],f(t,!0)),i?a.unshift(r):a.push(r);return c}function a(e,t){var n,r,i,o,a;if(e)for(o=e.toLowerCase().split(" "),n=o.length;n--;){if(e=o[n],r=d[e],!e){for(i in d)f(i,!1),delete d[i];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),d[e]=r);else r.length=0;r.length||(f(e,!1),delete d[e])}}else{for(e in d)f(e,!1);d={}}return c}function s(e,t,n){return o(e,t,n,{once:!0})}function l(e){return e=e.toLowerCase(),!(!d[e]||0===d[e].length)}var c=this,u,d={},f;t=t||{},u=t.scope||c,f=t.toggleEvent||n,c.fire=i,c.on=o,c.off=a,c.once=s,c.has=l}var n=e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," ");return t.isNative=function(e){return!!n[e.toLowerCase()]},t}),r(ce,[],function(){function e(e){this.create=e.create}return e.create=function(t,n){return new e({create:function(e,r){function i(t){e.set(r,t.value)}function o(e){t.set(n,e.value)}var a;return e.on("change:"+r,o),t.on("change:"+n,i),a=e._bindings,a||(a=e._bindings=[],e.on("destroy",function(){for(var e=a.length;e--;)a[e]()})),a.push(function(){t.off("change:"+n,i)}),t.get(n)}})},e}),r(ue,[le],function(e){function t(t){return t._eventDispatcher||(t._eventDispatcher=new e({scope:t,toggleEvent:function(n,r){e.isNative(n)&&t.toggleNativeEvent&&t.toggleNativeEvent(n,r)}})),t._eventDispatcher}return{fire:function(e,n,r){var i=this;if(i.removed&&"remove"!==e)return n;if(n=t(i).fire(e,n,r),r!==!1&&i.parent)for(var o=i.parent();o&&!n.isPropagationStopped();)o.fire(e,n,!1),o=o.parent();return n},on:function(e,n,r){return t(this).on(e,n,r)},off:function(e,n){return t(this).off(e,n)},once:function(e,n){return t(this).once(e,n)},hasEventListeners:function(e){return t(this).has(e)}}}),r(de,[ce,ue,se,m],function(e,t,n,r){function i(e){return e.nodeType>0}function o(e,t){var n,a;if(e===t)return!0;if(null===e||null===t)return e===t;if("object"!=typeof e||"object"!=typeof t)return e===t;if(r.isArray(t)){if(e.length!==t.length)return!1;for(n=e.length;n--;)if(!o(e[n],t[n]))return!1}if(i(e)||i(t))return e===t;a={};for(n in t){if(!o(e[n],t[n]))return!1;a[n]=!0}for(n in e)if(!a[n]&&!o(e[n],t[n]))return!1;return!0}return n.extend({Mixins:[t],init:function(t){var n,r;t=t||{};for(n in t)r=t[n],r instanceof e&&(t[n]=r.create(this,n));this.data=t},set:function(t,n){var r,i,a=this.data[t];if(n instanceof e&&(n=n.create(this,t)),"object"==typeof t){for(r in t)this.set(r,t[r]);return this}return o(a,n)||(this.data[t]=n,i={target:this,name:t,value:n,oldValue:a},this.fire("change:"+t,i),this.fire("change",i)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(t){return e.create(this,t)},destroy:function(){this.fire("destroy")}})}),r(fe,[se],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.classes.contains(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.pseudo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a<n.length;a++)">"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,h,p;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,p=e,h=0,i=o-1;i>=0;i--)for(c=a[i];p;){if(c.pseudo)for(f=p.parent().items(),u=d=f.length;u--&&f[u]!==p;);for(s=0,l=c.length;l>s;s++)if(!c[s](p,u,d)){s=l+1;break}if(s===l){h++;break}if(i===o-1)break;p=p.parent()}if(h===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(he,[m,fe,se],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].classes.contains(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(e){return this.each(function(t){t.classes.add(e)})},removeClass:function(e){return this.each(function(t){t.classes.remove(e)})}},e.each("fire on off show hide append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(pe,[d,m,w],function(e,t,n){var r=0,i={id:function(){return"mceu_"+r++},create:function(e,r,i){var o=document.createElement(e);return n.DOM.setAttribs(o,r),"string"==typeof i?o.innerHTML=i:t.each(i,function(e){e.nodeType&&o.appendChild(e)}),o},createFragment:function(e){return n.DOM.createFragment(e)},getWindowSize:function(){return n.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return n.DOM.getPos(e,t||i.getContainer())},getContainer:function(){return e.container?e.container:document.body},getViewPort:function(e){return n.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return n.DOM.addClass(e,t)},removeClass:function(e,t){return n.DOM.removeClass(e,t)},hasClass:function(e,t){return n.DOM.hasClass(e,t)},toggleClass:function(e,t,r){return n.DOM.toggleClass(e,t,r)},css:function(e,t,r){return n.DOM.setStyle(e,t,r)},getRuntimeStyle:function(e,t){return n.DOM.getStyle(e,t,!0)},on:function(e,t,r,i){return n.DOM.bind(e,t,r,i)},off:function(e,t,r){return n.DOM.unbind(e,t,r)},fire:function(e,t,r){return n.DOM.fire(e,t,r)},innerHtml:function(e,t){n.DOM.setHTML(e,t)}};return i}),r(me,[],function(){return{parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}}}}),r(ge,[m],function(e){function t(){}function n(e){this.cls=[],this.cls._map={},this.onchange=e||t,this.prefix=""}return e.extend(n.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){for(var t=0;t<this.cls.length&&this.cls[t]!==e;t++);this.cls.splice(t,1),delete this.cls._map[e],this._change()}return this},toggle:function(e,t){var n=this.contains(e);return n!==t&&(n?this.remove(e):this.add(e),this._change()),this},contains:function(e){return!!this.cls._map[e]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),n.prototype.toString=function(){var e;if(this.clsValue)return this.clsValue;e="";for(var t=0;t<this.cls.length;t++)t>0&&(e+=" "),e+=this.prefix+this.cls[t];return e},n}),r(ve,[u],function(e){var t={},n;return{add:function(r){var i=r.parent();if(i){if(!i._layout||i._layout.isNative())return;t[i._id]||(t[i._id]=i),n||(n=!0,e.requestAnimationFrame(function(){var e,r;n=!1;for(e in t)r=t[e],r.state.get("rendered")&&r.reflow();t={}},document.body))}},remove:function(e){t[e._id]&&delete t[e._id]}}}),r(ye,[se,m,le,de,he,pe,g,me,ge,ve],function(e,t,n,r,i,o,a,s,l,c){function u(e){return e._eventDispatcher||(e._eventDispatcher=new n({scope:e,toggleEvent:function(t,r){r&&n.isNative(t)&&(e._nativeEvents||(e._nativeEvents={}),e._nativeEvents[t]=!0,e.state.get("rendered")&&d(e))}})),e._eventDispatcher}function d(e){function t(t){var n=e.getParentCtrl(t.target);n&&n.fire(t.type,t)}function n(){var e=c._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),c._lastHoverCtrl=null)}function r(t){var n=e.getParentCtrl(t.target),r=c._lastHoverCtrl,i=0,o,a,s;if(n!==r){if(c._lastHoverCtrl=n,a=n.parents().toArray().reverse(),a.push(n),r){for(s=r.parents().toArray().reverse(),s.push(r),i=0;i<s.length&&a[i]===s[i];i++);for(o=s.length-1;o>=i;o--)r=s[o],r.fire("mouseleave",{target:r.getEl()})}for(o=i;o<a.length;o++)n=a[o],n.fire("mouseenter",{target:n.getEl()})}}function i(t){t.preventDefault(),"mousewheel"==t.type?(t.deltaY=-1/40*t.wheelDelta,t.wheelDeltaX&&(t.deltaX=-1/40*t.wheelDeltaX)):(t.deltaX=0,t.deltaY=t.detail),t=e.fire("wheel",t)}var o,s,l,c,u,d;if(u=e._nativeEvents){for(l=e.parents().toArray(),l.unshift(e),o=0,s=l.length;!c&&s>o;o++)c=l[o]._eventsRoot;for(c||(c=l[l.length-1]||e),e._eventsRoot=c,s=o,o=0;s>o;o++)l[o]._eventsRoot=c;var p=c._delegates;p||(p=c._delegates={});for(d in u){if(!u)return!1;"wheel"!==d||h?("mouseenter"===d||"mouseleave"===d?c._hasMouseEnter||(a(c.getEl()).on("mouseleave",n).on("mouseover",r),c._hasMouseEnter=1):p[d]||(a(c.getEl()).on(d,t),p[d]=!0),u[d]=!1):f?a(e.getEl()).on("mousewheel",i):a(e.getEl()).on("DOMMouseScroll",i)}}}var f="onmousewheel"in document,h=!1,p="mce-",m,g=0,v={Statics:{classPrefix:p},isRtl:function(){return m.rtl},classPrefix:p,init:function(e){function n(e){var t;for(e=e.split(" "),t=0;t<e.length;t++)i.classes.add(e[t])}var i=this,o,c;i.settings=e=t.extend({},i.Defaults,e),i._id=e.id||"mceu_"+g++,i._aria={role:e.role},i._elmCache={},i.$=a,i.state=new r({visible:!0,active:!1,disabled:!1,value:""}),i.data=new r(e.data),i.classes=new l(function(){i.state.get("rendered")&&(i.getEl().className=this.toString())}),i.classes.prefix=i.classPrefix,o=e.classes,o&&(i.Defaults&&(c=i.Defaults.classes,c&&o!=c&&n(c)),n(o)),t.each("title text name visible disabled active value".split(" "),function(t){t in e&&i[t](e[t])}),i.on("click",function(){return i.disabled()?!1:void 0}),i.settings=e,i.borderBox=s.parseBox(e.border),i.paddingBox=s.parseBox(e.padding),i.marginBox=s.parseBox(e.margin),e.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){return o.getContainer()},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},initLayoutRect:function(){var e=this,t=e.settings,n,r,i=e.getEl(),a,l,c,u,d,f,h,p;n=e.borderBox=e.borderBox||s.measureBox(i,"border"),e.paddingBox=e.paddingBox||s.measureBox(i,"padding"),e.marginBox=e.marginBox||s.measureBox(i,"margin"),p=o.getSize(i),f=t.minWidth,h=t.minHeight,c=f||p.width,u=h||p.height,a=t.width,l=t.height,d=t.autoResize,d="undefined"!=typeof d?d:!a&&!l,a=a||c,l=l||u;var m=n.left+n.right,g=n.top+n.bottom,v=t.maxWidth||65535,y=t.maxHeight||65535;return e._layoutRect=r={x:t.x||0,y:t.y||0,w:a,h:l,deltaW:m,deltaH:g,contentW:a-m,contentH:l-g,innerW:a-m,innerH:l-g,startMinWidth:f||0,startMinHeight:h||0,minW:Math.min(c,v),minH:Math.min(u,y),maxW:v,maxH:y,autoResize:d,scrollW:0},e._lastLayoutRect={},r},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,l;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=i<n.minW?n.minW:i,i=i>n.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=i<n.minH?n.minH:i,i=i>n.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=i<n.minW-o?n.minW-o:i,i=i>n.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=i<n.minH-a?n.minH-a:i,i=i>n.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,r.x===n.x&&r.y===n.y&&r.w===n.w&&r.h===n.h||(l=m.repaintControls,l&&l.map&&!l.map[t._id]&&(l.push(t),l.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o,a,s,l,c,u;c=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,i=e._layoutRect,l=e._lastRepaintRect||{},o=e.borderBox,a=o.left+o.right,s=o.top+o.bottom,i.x!==l.x&&(t.left=c(i.x)+"px",l.x=i.x),i.y!==l.y&&(t.top=c(i.y)+"px",l.y=i.y),i.w!==l.w&&(u=c(i.w-a),t.width=(u>=0?u:0)+"px",l.w=i.w),i.h!==l.h&&(u=c(i.h-s),t.height=(u>=0?u:0)+"px",l.h=i.h),e._hasBody&&i.innerW!==l.innerW&&(u=c(i.innerW),r=e.getEl("body"),r&&(n=r.style,n.width=(u>=0?u:0)+"px"),l.innerW=i.innerW),e._hasBody&&i.innerH!==l.innerH&&(u=c(i.innerH),r=r||e.getEl("body"),r&&(n=n||r.style,n.height=(u>=0?u:0)+"px"),l.innerH=i.innerH),e._lastRepaintRect=l,e.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,o.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){function n(e){var t,n;return"string"!=typeof e?e:function(i){return t||r.parentsAndSelf().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t?t.call(n,i):(i.action=e,void this.fire("execute",i))}}var r=this;return u(r).on(e,n(t)),r},off:function(e,t){return u(this).off(e,t),this},fire:function(e,t,n){var r=this;if(t=t||{},t.control||(t.control=r),t=u(r).fire(e,t),n!==!1&&r.parent)for(var i=r.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return u(this).has(e)},parents:function(e){var t=this,n,r=new i;for(n=t.parent();n;n=n.parent())r.add(n);return e&&(r=r.filter(e)),r},parentsAndSelf:function(e){return new i(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=a("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return m.translate?m.translate(e):e},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),r,i; if(e.items){var o=e.items().toArray();for(i=o.length;i--;)o[i].remove()}n&&n.items&&(r=[],n.items().each(function(t){t!==e&&r.push(t)}),n.items().set(r),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&a(t).off();var s=e.getRoot().controlIdLookup;return s&&delete s[e._id],t&&t.parentNode&&t.parentNode.removeChild(t),e.state.set("rendered",!1),e.state.destroy(),e.fire("remove"),e},renderBefore:function(e){return a(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return a(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var e=this,t=e.settings,n,r,i,o,s;e.$el=a(e.getEl()),e.state.set("rendered",!0);for(o in t)0===o.indexOf("on")&&e.on(o.substr(2),t[o]);if(e._eventsRoot){for(i=e.parent();!s&&i;i=i.parent())s=i._eventsRoot;if(s)for(o in s._nativeEvents)e._nativeEvents[o]=!0}d(e),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e.settings.border&&(r=e.borderBox,e.$el.css({"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var u in e._aria)e.aria(u,e._aria[u]);e.state.get("visible")===!1&&(e.getEl().style.display="none"),e.bindStates(),e.state.on("change:visible",function(t){var n=t.value,r;e.state.get("rendered")&&(e.getEl().style.display=n===!1?"none":"",e.getEl().getBoundingClientRect()),r=e.parent(),r&&(r._lastRect=null),e.fire(n?"show":"hide"),c.add(e)}),e.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){c.remove(this);var e=this.parent();return e._layout&&!e._layout.isNative()&&e.reflow(),this}};return t.each("text title visible disabled active value".split(" "),function(e){v[e]=function(t){return 0===arguments.length?this.state.get(e):("undefined"!=typeof t&&this.state.set(e,t),this)}}),m=e.extend(v)}),r(be,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(Ce,[],function(){return function(e){function t(e){return e&&1===e.nodeType}function n(e){return e=e||C,t(e)?e.getAttribute("role"):null}function r(e){for(var t,r=e||C;r=r.parentNode;)if(t=n(r))return t}function i(e){var n=C;return t(n)?n.getAttribute("aria-"+e):void 0}function o(e){var t=e.tagName.toUpperCase();return"INPUT"==t||"TEXTAREA"==t||"SELECT"==t}function a(e){return o(e)&&!e.hidden?!0:!!/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(n(e))}function s(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){a(e)&&n.push(e);for(var r=0;r<e.childNodes.length;r++)t(e.childNodes[r])}}var n=[];return t(e||b.getEl()),n}function l(e){var t,n;e=e||x,n=e.parents().toArray(),n.unshift(e);for(var r=0;r<n.length&&(t=n[r],!t.settings.ariaRoot);r++);return t}function c(e){var t=l(e),n=s(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?u(t.lastAriaIndex,n):u(0,n)}function u(e,t){return 0>e?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function d(e,t){var n=-1,r=l();t=t||s(r.getEl());for(var i=0;i<t.length;i++)t[i]===C&&(n=i);n+=e,r.lastAriaIndex=u(n,t)}function f(){var e=r();"tablist"==e?d(-1,s(C.parentNode)):x.parent().submenu?v():d(-1)}function h(){var e=n(),t=r();"tablist"==t?d(1,s(C.parentNode)):"menuitem"==e&&"menu"==t&&i("haspopup")?y():d(1)}function p(){d(-1)}function m(){var e=n(),t=r();"menuitem"==e&&"menubar"==t?y():"button"==e&&i("haspopup")?y({key:"down"}):d(1)}function g(e){var t=r();if("tablist"==t){var n=s(x.getEl("body"))[0];n&&n.focus()}else d(e.shiftKey?-1:1)}function v(){x.fire("cancel")}function y(e){e=e||{},x.fire("click",{target:C,aria:e})}var b=e.root,C,x;try{C=document.activeElement}catch(w){C=document.body}return x=b.getParentCtrl(C),b.on("keydown",function(e){function t(e,t){o(C)||"slider"!==n(C)&&t(e)!==!1&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,f);break;case 39:t(e,h);break;case 38:t(e,p);break;case 40:t(e,m);break;case 27:v();break;case 14:case 13:case 32:t(e,y);break;case 9:g(e)!==!1&&e.preventDefault()}}),b.on("focusin",function(e){C=e.target,x=e.control}),{focusFirst:c}}}),r(xe,[ye,he,fe,be,Ce,m,g,ge,ve],function(e,t,n,r,i,o,a,s,l){var c={};return e.extend({init:function(e){var n=this;n._super(e),e=n.settings,e.fixed&&n.state.set("fixed",!0),n._items=new t,n.isRtl()&&n.classes.add("rtl"),n.bodyClasses=new s(function(){n.state.get("rendered")&&(n.getEl("body").className=this.toString())}),n.bodyClasses.prefix=n.classPrefix,n.classes.add("container"),n.bodyClasses.add("container-body"),e.containerCls&&n.classes.add(e.containerCls),n._layout=r.create((e.layout||"")+"layout"),n.settings.items?n.add(n.settings.items):n.add(n.render()),n._hasBody=!0},items:function(){return this._items},find:function(e){return e=c[e]=c[e]||new n(e),e.find(this)},add:function(e){var t=this;return t.items().add(t.create(e)).parent(t),t},focus:function(e){var t=this,n,r,i;return e&&(r=t.keyboardNav||t.parents().eq(-1)[0].keyboardNav)?void r.focusFirst(t):(i=t.find("*"),t.statusbar&&i.add(t.statusbar.items()),i.each(function(e){return e.settings.autofocus?(n=null,!1):void(e.canFocus&&(n=n||e))}),n&&n.focus(),t)},replace:function(e,t){for(var n,r=this.items(),i=r.length;i--;)if(r[i]===e){r[i]=t;break}i>=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,i,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r;t.parent(e),t.state.get("rendered")||(r=e.getEl("body"),r.hasChildNodes()&&n<=r.childNodes.length-1?a(r.childNodes[n]).before(t.renderHtml()):a(r).append(t.renderHtml()),t.postRender(),l.add(t))}),e._layout.applyClasses(e.items().filter(":visible")),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t<i.length-1&&(t+=1),t>=0&&t<i.length&&(o=i.slice(0,t).toArray(),a=i.slice(t).toArray(),i.set(o.concat(e,a))),r.renderNew()},fromJSON:function(e){var t=this;for(var n in e)t.find("#"+n).value(e[n]);return t},toJSON:function(){var e=this,t={};return e.find("*").each(function(e){var n=e.name(),r=e.value();n&&"undefined"!=typeof r&&(t[n]=r)}),t},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e.state.set("rendered",!0),e.settings.style&&e.$el.css(e.settings.style),e.settings.border&&(t=e.borderBox,e.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(l.remove(this),this.visible()){for(e.repaintControls=[],e.repaintControls.map={},this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(we,[g],function(e){function t(e){var t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}function n(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}return function(r,i){function o(){return s.getElementById(i.handle||r)}var a,s=i.document||document,l,c,u,d,f,h;i=i||{},c=function(r){var c=t(s),p,m;n(r),r.preventDefault(),l=r.button,p=o(),f=r.screenX,h=r.screenY,m=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,a=e("<div>").css({position:"absolute",top:0,left:0,width:c.width,height:c.height,zIndex:2147483647,opacity:1e-4,cursor:m}).appendTo(s.body),e(s).on("mousemove touchmove",d).on("mouseup touchend",u),i.start(r)},d=function(e){return n(e),e.button!==l?u(e):(e.deltaX=e.screenX-f,e.deltaY=e.screenY-h,e.preventDefault(),void i.drag(e))},u=function(t){n(t),e(s).off("mousemove touchmove",d).off("mouseup touchend",u),a.remove(),i.stop&&i.stop(t)},this.destroy=function(){e(o()).off()},e(o()).on("mousedown touchstart",c)}}),r(Ne,[g,we],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,h,p,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),e(i.getEl("absend")).css(y,i.layoutRect()[l]-1),!c)return void e(f).css("display","none");e(f).css("display","block"),d=i.getEl("body"),h=i.getEl("scroll"+t+"t"),p=d["client"+s]-2*o,p-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=p/m,v={},v[y]=d["offset"+a]+o,v[b]=p,e(f).css(v),v={},v[y]=d["scroll"+a]*g,v[b]=p*g,e(h).css(v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;e(i.getEl()).append('<div id="'+u+'" class="'+d+"scrollbar "+d+"scrollbar-"+n+'"><div id="'+u+'t" class="'+d+'scrollbar-thumb"></div></div>'),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e("#"+u).addClass(d+"active")},drag:function(e){var t,u,d,f,h=i.layoutRect();u=h.contentW>h.innerW,d=h.contentH>h.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e("#"+u).removeClass(d+"active")}})}i.classes.add("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e(i.getEl("body")).on("scroll",n)),n())}}}),r(Ee,[xe,Ne],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}})}),r(_e,[pe],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,h;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t.state.get("fixed")&&"static"==e.getRuntimeStyle(document.body,"position")&&(a-=f.x,s-=f.y),i=t.getEl(),h=e.getSize(i),l=h.width,c=h.height,h=e.getSize(n),u=h.width,d=h.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o<r.length;o++){var a=t(this,n,r[o]);if(this.state.get("fixed")){if(a.x>0&&a.x+a.w<i.w&&a.y>0&&a.y+a.h<i.h)return r[o]}else if(a.x>i.x&&a.x+a.w<i.w+i.x&&a.y>i.y&&a.y+a.h<i.h+i.y)return r[o]}return r[0]},moveRel:function(e,n){"string"!=typeof n&&(n=this.testMoveRel(e,n));var r=t(this,e,n);return this.moveTo(r.x,r.y)},moveBy:function(e,t){var n=this,r=n.layoutRect();return n.moveTo(r.x+e,r.y+t),n},moveTo:function(t,n){function r(e,t,n){return 0>e?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i.state.get("rendered")?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(Se,[pe],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(ke,[Ee,_e,Se,pe,g,u],function(e,t,n,r,i,o){function a(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}function s(e){for(var t=v.length;t--;){var n=v[t],r=n.getParentCtrl(e.target);if(n.settings.autohide){if(r&&(a(r,n)||n.parent()===r))continue;e=n.fire("autohide",{target:e.target}),e.isDefaultPrevented()||n.hide()}}}function l(){p||(p=function(e){2!=e.button&&s(e)},i(document).on("click touchstart",p))}function c(){m||(m=function(){var e;for(e=v.length;e--;)d(v[e])},i(window).on("scroll",m))}function u(){if(!g){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;g=function(){document.all&&t==e.clientWidth&&n==e.clientHeight||(t=e.clientWidth,n=e.clientHeight,C.hideAll())},i(window).on("resize",g)}}function d(e){function t(t,n){for(var r,i=0;i<v.length;i++)if(v[i]!=e)for(r=v[i].parent();r&&(r=r.parent());)r==e&&v[i].fixed(t).moveBy(0,n).repaint()}var n=r.getViewPort().y;e.settings.autofix&&(e.state.get("fixed")?e._autoFixY>n&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY<n&&(e.fixed(!0).layoutRect({y:0}).repaint(),t(!0,n-e._autoFixY))))}function f(e,t){var n,r=C.zIndex||65535,o;if(e)y.push(t);else for(n=y.length;n--;)y[n]===t&&y.splice(n,1);if(y.length)for(n=0;n<y.length;n++)y[n].modal&&(r++,o=y[n]),y[n].getEl().style.zIndex=r,y[n].zIndex=r,r++;var a=i("#"+t.classPrefix+"modal-block",t.getContainerElm())[0];o?i(a).css("z-index",o.zIndex-1):a&&(a.parentNode.removeChild(a),b=!1),C.currentZIndex=r}function h(e){var t;for(t=v.length;t--;)v[t]===e&&v.splice(t,1);for(t=y.length;t--;)y[t]===e&&y.splice(t,1)}var p,m,g,v=[],y=[],b,C=e.extend({Mixins:[t,n],init:function(e){var t=this;t._super(e),t._eventsRoot=t,t.classes.add("floatpanel"),e.autohide&&(l(),u(),v.push(t)),e.autofix&&(c(),t.on("move",function(){d(this)})),t.on("postrender show",function(e){if(e.control==t){var n,r=t.classPrefix;t.modal&&!b&&(n=i("#"+r+"modal-block",t.getContainerElm()),n[0]||(n=i('<div id="'+r+'modal-block" class="'+r+"reset "+r+'fade"></div>').appendTo(t.getContainerElm())),o.setTimeout(function(){n.addClass(r+"in"),i(t.getEl()).addClass(r+"in")}),b=!0),f(!0,t)}}),t.on("show",function(){t.parents().each(function(e){return e.state.get("fixed")?(t.fixed(!0),!1):void 0})}),e.popover&&(t._preBodyHtml='<div class="'+t.classPrefix+'arrow"></div>',t.classes.add("popover").add("bottom").add(t.isRtl()?"end":"start")),t.aria("label",e.ariaLabel),t.aria("labelledby",t._id),t.aria("describedby",t.describedBy||t._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!=e){if(t.state.get("rendered")){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e=this,t,n=e._super();for(t=v.length;t--&&v[t]!==e;);return-1===t&&v.push(e),n},hide:function(){return h(this),f(!1,this),this._super()},hideAll:function(){C.hideAll()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||(e.remove(),f(!1,e)),e},remove:function(){h(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return C.hideAll=function(){for(var e=v.length;e--;){var t=v[e];t&&t.settings.autohide&&(t.hide(),v.splice(e,1))}},C}),r(Te,[ke,Ee,pe,g,we,me,d,u],function(e,t,n,r,i,o,a,s){function l(e){var t="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0",n=r("meta[name=viewport]")[0],i;a.overrideViewPort!==!1&&(n||(n=document.createElement("meta"),n.setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),i=n.getAttribute("content"),i&&"undefined"!=typeof f&&(f=i),n.setAttribute("content",e?t:f))}function c(e){for(var t=0;t<d.length;t++)if(d[t]._fullscreen)return;r([document.documentElement,document.body]).removeClass(e+"fullscreen")}function u(){function e(){var e,t=n.getWindowSize(),r;for(e=0;e<d.length;e++)r=d[e].layoutRect(),d[e].moveTo(d[e].settings.x||Math.max(0,t.w/2-r.w/2),d[e].settings.y||Math.max(0,t.h/2-r.h/2))}if(!a.desktop){var t={w:window.innerWidth,h:window.innerHeight};s.setInterval(function(){var e=window.innerWidth,n=window.innerHeight;t.w==e&&t.h==n||(t={w:e,h:n},r(window).trigger("resize"))},100)}r(window).on("resize",e)}var d=[],f="",h=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var r=this;r._super(e),r.isRtl()&&r.classes.add("rtl"),r.classes.add("window"),r.bodyClasses.add("window-body"),r.state.set("fixed",!0),e.buttons&&(r.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:r.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),r.statusbar.classes.add("foot"),r.statusbar.parent(r)),r.on("click",function(e){var t=r.classPrefix+"close";(n.hasClass(e.target,t)||n.hasClass(e.target.parentNode,t))&&r.close()}),r.on("cancel",function(){r.close()}),r.aria("describedby",r.describedBy||r._id+"-none"),r.aria("label",e.title),r._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=e.settings.x||Math.max(0,a.w/2-t.w/2),t.y=e.settings.y||Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='<div id="'+n+'-head" class="'+r+'window-head"><div id="'+n+'-title" class="'+r+'title">'+e.encode(i.title)+'</div><div id="'+n+'-dragh" class="'+r+'dragh"></div><button type="button" class="'+r+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),i.url&&(s='<iframe src="'+i.url+'" tabindex="-1"></iframe>'),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.bodyClasses+'">'+s+"</div>"+a+"</div></div>"},fullscreen:function(e){var t=this,i=document.documentElement,a,l=t.classPrefix,c;if(e!=t._fullscreen)if(r(window).on("resize",function(){var e;if(t._fullscreen)if(a)t._timer||(t._timer=s.setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(a=!0)}}),c=t.layoutRect(),t._fullscreen=e,e){t._initial={x:c.x,y:c.y,w:c.w,h:c.h},t.borderBox=o.parseBox("0"),t.getEl("head").style.display="none",c.deltaH-=c.headerH+2,r([i,document.body]).addClass(l+"fullscreen"),t.classes.add("fullscreen");var u=n.getWindowSize();t.moveTo(0,0).resizeTo(u.w,u.h)}else t.borderBox=o.parseBox(t.settings.border),t.getEl("head").style.display="",c.deltaH+=c.headerH,r([i,document.body]).removeClass(l+"fullscreen"),t.classes.remove("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.classes.add("in"),e.fire("open")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()}),d.push(e),l(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t;for(e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),t=d.length;t--;)d[t]===e&&d.splice(t,1);l(d.length>0),c(e.classPrefix)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});return u(),h}),r(Re,[Te],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){function r(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),o(t)}}}var i,o=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:i=[r("Ok",!0,!0),r("Cancel",!1)];break;case t.YES_NO:case t.YES_NO_CANCEL:i=[r("Yes",1,!0),r("No",0)],n.buttons==t.YES_NO_CANCEL&&i.push(r("Cancel",-1));break;default:i=[r("Ok",!0,!0)]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:i,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){o(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(Ae,[Te,Re],function(e,t){return function(n){function r(){return s.length?s[s.length-1]:void 0}function i(e){n.fire("OpenWindow",{win:e})}function o(e){n.fire("CloseWindow",{win:e})}var a=this,s=[];a.windows=s,n.on("remove",function(){for(var e=s.length;e--;)s[e].close()}),a.open=function(t,r){var a;return n.editorManager.setActive(n),t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body,data:t.data,callbacks:t.commands}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){a.find("form")[0].submit()}},{text:"Cancel",onclick:function(){a.close()}}]),a=new e(t),s.push(a),a.on("close",function(){for(var e=s.length;e--;)s[e]===a&&s.splice(e,1);s.length||n.focus(),o(a)}),t.data&&a.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),a.features=t||{},a.params=r||{},1===s.length&&n.nodeChanged(),a=a.renderTo().reflow(),i(a),a},a.alert=function(e,r,a){var s;s=t.alert(e,function(){r?r.call(a||this):n.focus()}),s.on("close",function(){o(s)}),i(s)},a.confirm=function(e,n,r){var a;a=t.confirm(e,function(e){n.call(r||this,e)}),a.on("close",function(){o(a)}),i(a)},a.close=function(){r()&&r().close()},a.getParams=function(){return r()?r().params:null},a.setParams=function(e){r()&&(r().params=e)},a.getWindows=function(){return s}}}),r(Be,[ye,_e],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'" role="presentation"><div class="'+t+'tooltip-arrow"></div><div class="'+t+'tooltip-inner">'+e.encode(e.state.get("text"))+"</div></div>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)}),e._super()},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(De,[ye,Be],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.classes.toggle("tooltip-n","bc-tc"==i),r.classes.toggle("tooltip-nw","bc-tl"==i),r.classes.toggle("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){function e(e){n.aria("disabled",e),n.classes.toggle("disabled",e)}function t(e){n.aria("pressed",e),n.classes.toggle("active",e)}var n=this;return n.state.on("change:disabled",function(t){e(t.value)}),n.state.on("change:active",function(e){t(e.value)}),n.state.get("disabled")&&e(!0),n.state.get("active")&&t(!0),n._super()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(Le,[De],function(e){return e.extend({Defaults:{value:0},init:function(e){var t=this;t._super(e),t.classes.add("progress"),t.settings.filter||(t.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this,t=e._id,n=this.classPrefix;return'<div id="'+t+'" class="'+e.classes+'"><div class="'+n+'bar-container"><div class="'+n+'bar"></div></div><div class="'+n+'text">0%</div></div>'},postRender:function(){var e=this;return e._super(),e.value(e.settings.value),e},bindStates:function(){function e(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}var t=this;return t.state.on("change:value",function(t){e(t.value)}),e(t.state.get("value")),t._super()}})}),r(Me,[ye,_e,Le,u],function(e,t,n,r){return e.extend({Mixins:[t],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||e.timeout>0)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new n),t.on("click",function(e){-1!=e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e=this,t=e.classPrefix,n="",r="",i="",o="";return e.icon&&(n='<i class="'+t+"ico "+t+"i-"+e.icon+'"></i>'),e.color&&(o=' style="background-color: '+e.color+'"'),e.closeButton&&(r='<button type="button" class="'+t+'close" aria-hidden="true">\xd7</button>'),e.progressBar&&(i=e.progressBar.renderHtml()),'<div id="'+e._id+'" class="'+e.classes+'"'+o+' role="presentation">'+n+'<div class="'+t+'notification-inner">'+e.state.get("text")+"</div>"+i+r+"</div>"},postRender:function(){var e=this;return r.setTimeout(function(){e.$el.addClass(e.classPrefix+"in")}),e._super()},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().childNodes[1].innerHTML=t.value}),e.progressBar&&e.progressBar.bindStates(),e._super()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||e.remove(),e},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(Pe,[Me,u],function(e,t){return function(n){function r(){return l.length?l[l.length-1]:void 0}function i(){t.requestAnimationFrame(function(){o(),a()})}function o(){for(var e=0;e<l.length;e++)l[e].moveTo(0,0)}function a(){if(l.length>0){var e=l.slice(0,1)[0],t=n.inline?n.getElement():n.getContentAreaContainer();if(e.moveRel(t,"tc-tc"),l.length>1)for(var r=1;r<l.length;r++)l[r].moveRel(l[r-1].getEl(),"bc-tc")}}var s=this,l=[];s.notifications=l,n.on("remove",function(){for(var e=l.length;e--;)l[e].close()}),n.on("ResizeEditor",a),n.on("ResizeWindow",i),s.open=function(t){var r;return n.editorManager.setActive(n),r=new e(t),l.push(r),t.timeout>0&&(r.timer=setTimeout(function(){r.close()},t.timeout)),r.on("close",function(){var e=l.length;for(r.timer&&n.getWin().clearTimeout(r.timer);e--;)l[e]===r&&l.splice(e,1);a()}),r.renderTo(),a(),r},s.close=function(){r()&&r().close()},s.getNotifications=function(){return l},n.on("SkinLoaded",function(){var e=n.settings.service_message;e&&n.notificationManager.open({text:e,type:"warning",timeout:0,icon:""})})}}),r(Oe,[w],function(e){function t(t,n,r){for(var i=[];n&&n!=t;n=n.parentNode)i.push(e.nodeIndex(n,r));return i}function n(e,t){var n,r,i;for(r=e,n=t.length-1;n>=0;n--){if(i=r.childNodes,t[n]>i.length-1)return null;r=i[t[n]]}return r}return{create:t,resolve:n}}),r(He,[I,T,y,Oe,A,C,d,m,u,k,$,ne],function(e,t,n,r,i,o,a,s,l,c,u,d){return function(f){function h(e,t){try{f.getDoc().execCommand(e,!1,t)}catch(n){}}function p(){var e=f.getDoc().documentMode;return e?e:6}function m(e){return e.isDefaultPrevented()}function g(e){var t,n;e.dataTransfer&&(f.selection.isCollapsed()&&"IMG"==e.target.tagName&&re.select(e.target),t=f.selection.getContent(),t.length>0&&(n=ue+escape(f.id)+","+escape(t),e.dataTransfer.setData(de,n)))}function v(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(de),t&&t.indexOf(ue)>=0)?(t=t.substr(ue.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}function y(e){f.queryCommandSupported("mceInsertClipboardContent")?f.execCommand("mceInsertClipboardContent",!1,{content:e}):f.execCommand("mceInsertContent",!1,e)}function b(){function i(e){var t=C.schema.getBlockElements(),n=f.getBody();if("BR"!=e.nodeName)return!1;for(;e!=n&&!t[e.nodeName];e=e.parentNode)if(e.nextSibling)return!1;return!0}function o(e,t){var n;for(n=e.nextSibling;n&&n!=t;n=n.nextSibling)if((3!=n.nodeType||0!==Z.trim(n.data).length)&&n!==t)return!1;return n===t}function a(e,t,r){var o,a,s;for(s=C.schema.getNonEmptyElements(),o=new n(r||e,e);a=o[t?"next":"prev"]();){if(s[a.nodeName]&&!i(a))return a;if(3==a.nodeType&&a.data.length>0)return a}}function c(e){var n,r,i,o,s;if(!e.collapsed&&(n=C.getParent(t.getNode(e.startContainer,e.startOffset),C.isBlock), r=C.getParent(t.getNode(e.endContainer,e.endOffset),C.isBlock),s=f.schema.getTextBlockElements(),n!=r&&s[n.nodeName]&&s[r.nodeName]&&"false"!==C.getContentEditable(n)&&"false"!==C.getContentEditable(r)))return e.deleteContents(),i=a(n,!1),o=a(r,!0),C.isEmpty(r)||Z(n).append(r.childNodes),Z(r).remove(),i?1==i.nodeType?"BR"==i.nodeName?(e.setStartBefore(i),e.setEndBefore(i)):(e.setStartAfter(i),e.setEndAfter(i)):(e.setStart(i,i.data.length),e.setEnd(i,i.data.length)):o&&(1==o.nodeType?(e.setStartBefore(o),e.setEndBefore(o)):(e.setStart(o,0),e.setEnd(o,0))),x.setRng(e),!0}function u(e,n){var r,i,s,l,c,u;if(!e.collapsed)return e;if(c=e.startContainer,u=e.startOffset,3==c.nodeType)if(n){if(u<c.data.length)return e}else if(u>0)return e;if(r=t.getNode(e.startContainer,e.startOffset),s=C.getParent(r,C.isBlock),i=a(f.getBody(),n,r),l=C.getParent(i,C.isBlock),!r||!i)return e;if(l&&s!=l)if(n){if(!o(s,l))return e;1==r.nodeType?"BR"==r.nodeName?e.setStartBefore(r):e.setStartAfter(r):e.setStart(r,r.data.length),1==i.nodeType?e.setEnd(i,0):e.setEndBefore(i)}else{if(!o(l,s))return e;1==i.nodeType?"BR"==i.nodeName?e.setStartBefore(i):e.setStartAfter(i):e.setStart(i,i.data.length),1==r.nodeType?e.setEnd(r,0):e.setEndBefore(r)}return e}function d(e){var t=x.getRng();return t=u(t,e),c(t)?!0:void 0}function h(e,t){function n(e,n){return m=Z(n).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),l=e.cloneNode(!1),m=s.map(m,function(e){return e=e.cloneNode(!1),l.hasChildNodes()?(e.appendChild(l.firstChild),l.appendChild(e)):l.appendChild(e),l.appendChild(e),e}),m.length?(p=C.create("br"),m[0].appendChild(p),C.replace(l,e),t.setStartBefore(p),t.setEndBefore(p),f.selection.setRng(t),p):null}function i(e){return e&&f.schema.getTextBlockElements()[e.tagName]}var o,a,l,c,u,d,h,p,m;if(t.collapsed&&(d=t.startContainer,h=t.startOffset,a=C.getParent(d,C.isBlock),i(a)))if(1==d.nodeType){if(d=d.childNodes[h],d&&"BR"!=d.tagName)return;if(u=e?a.nextSibling:a.previousSibling,C.isEmpty(a)&&i(u)&&C.isEmpty(u)&&n(a,d))return C.remove(u),!0}else if(3==d.nodeType){if(o=r.create(a,d),c=a.cloneNode(!0),d=r.resolve(c,o),e){if(h>=d.data.length)return;d.deleteData(h,1)}else{if(0>=h)return;d.deleteData(h-1,1)}if(C.isEmpty(c))return n(a,d)}}function p(e){var t,n,r;d(e)||(s.each(f.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&f.dom.setAttrib(e,"style",f.dom.getAttrib(e,"style"))}),t=new w(function(){}),t.observe(f.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),f.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),n=f.selection.getRng(),r=n.startContainer.parentNode,s.each(t.takeRecords(),function(e){if(C.isChildOf(e.target,f.getBody())){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}s.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),C.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),f.selection.setRng(n))}})}}),t.disconnect(),s.each(f.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")}))}var b=f.getDoc(),C=f.dom,x=f.selection,w=window.MutationObserver,N,E;w||(N=!0,w=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMSubtreeModified",e,!1),r.removeEventListener("DOMNodeInsertedIntoDocument",e,!1),r.removeEventListener("DOMNodeInserted",e,!1),r.removeEventListener("DOMAttrModified",t,!1)},this.takeRecords=function(){return n}}),f.on("keydown",function(e){var t=e.keyCode==te,n=e.ctrlKey||e.metaKey;if(!m(e)&&(t||e.keyCode==ee)){var r=f.selection.getRng(),i=r.startContainer,o=r.startOffset;if(t&&e.shiftKey)return;if(h(t,r))return void e.preventDefault();if(!n&&r.collapsed&&3==i.nodeType&&(t?o<i.data.length:o>0))return;e.preventDefault(),n&&f.selection.getSel().modify("extend",t?"forward":"backward",e.metaKey?"lineboundary":"word"),p(t)}}),f.on("keypress",function(t){if(!m(t)&&!x.isCollapsed()&&t.charCode>31&&!e.metaKeyPressed(t)){var n,r,i,o,a,s;n=f.selection.getRng(),s=String.fromCharCode(t.charCode),t.preventDefault(),r=Z(n.startContainer).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),p(!0),r=r.filter(function(e,t){return!Z.contains(f.getBody(),t)}),r.length?(i=C.createFragment(),r.each(function(e,t){t=t.cloneNode(!1),i.hasChildNodes()?(t.appendChild(i.firstChild),i.appendChild(t)):(a=t,i.appendChild(t)),i.appendChild(t)}),a.appendChild(f.getDoc().createTextNode(s)),o=C.getParent(n.startContainer,C.isBlock),C.isEmpty(o)?Z(o).empty().append(i):n.insertNode(i),n.setStart(a.firstChild,1),n.setEnd(a.firstChild,1),f.selection.setRng(n)):f.selection.setContent(s)}}),f.addCommand("Delete",function(){p()}),f.addCommand("ForwardDelete",function(){p(!0)}),N||(f.on("dragstart",function(e){E=x.getRng(),g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);n&&(e.preventDefault(),l.setEditorTimeout(f,function(){var r=t.getCaretRangeFromPoint(e.x,e.y,b);E&&(x.setRng(E),E=null),p(),x.setRng(r),y(n.html)}))}}),f.on("cut",function(e){m(e)||!e.clipboardData||f.selection.isCollapsed()||(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",f.selection.getContent()),e.clipboardData.setData("text/plain",f.selection.getContent({format:"text"})),l.setEditorTimeout(f,function(){p(!0)}))}))}function C(){function e(e){var t=ne.create("body"),n=e.cloneContents();return t.appendChild(n),re.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(f.getBody()),t.compareRanges(n,r)}var i=e(n),o=ne.createRng();o.selectNode(f.getBody());var a=e(o);return i===a}f.on("keydown",function(e){var t=e.keyCode,r,i;if(!m(e)&&(t==te||t==ee)){if(r=f.selection.isCollapsed(),i=f.getBody(),r&&!ne.isEmpty(i))return;if(!r&&!n(f.selection.getRng()))return;e.preventDefault(),f.setContent(""),i.firstChild&&ne.isBlock(i.firstChild)?f.selection.setCursorLocation(i.firstChild,0):f.selection.setCursorLocation(i,0),f.nodeChanged()}})}function x(){f.shortcuts.add("meta+a",null,"SelectAll")}function w(){f.settings.content_editable||ne.bind(f.getDoc(),"mousedown mouseup",function(e){var t;if(e.target==f.getDoc().documentElement)if(t=re.getRng(),f.getBody().focus(),"mousedown"==e.type){if(c.isCaretContainer(t.startContainer))return;re.placeCaretAt(e.clientX,e.clientY)}else re.setRng(t)})}function N(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee){if(!f.getBody().getElementsByTagName("hr").length)return;if(re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return ne.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(ne.remove(n),e.preventDefault())}}})}function E(){window.Range.prototype.getClientRects||f.on("mousedown",function(e){if(!m(e)&&"HTML"===e.target.nodeName){var t=f.getBody();t.blur(),l.setEditorTimeout(f,function(){t.focus()})}})}function _(){f.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==ne.getContentEditableParent(t)&&(e.preventDefault(),re.getSel().setBaseAndExtent(t,0,t,1),f.nodeChanged()),"A"==t.nodeName&&ne.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),re.select(t))})}function S(){function e(){var e=ne.getAttribs(re.getStart().cloneNode(!1));return function(){var t=re.getStart();t!==f.getBody()&&(ne.setAttrib(t,"style",null),Q(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!re.isCollapsed()&&ne.getParent(re.getStart(),ne.isBlock)!=ne.getParent(re.getEnd(),ne.isBlock)}f.on("keypress",function(n){var r;return m(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),f.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),ne.bind(f.getDoc(),"cut",function(n){var r;!m(n)&&t()&&(r=e(),l.setEditorTimeout(f,function(){r()}))})}function k(){document.body.setAttribute("role","application")}function T(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee&&re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function R(){p()>7||(h("RespectVisibilityInDesign",!0),f.contentStyles.push(".mceHideBrInPre pre br {display: none}"),ne.addClass(f.getBody(),"mceHideBrInPre"),oe.addNodeFilter("pre",function(e){for(var t=e.length,n,r,o,a;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)o=n[r],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new i("#text",3),o,!0).value="\n"}),ae.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function A(){ne.bind(f.getBody(),"mouseup",function(){var e,t=re.getNode();"IMG"==t.nodeName&&((e=ne.getStyle(t,"width"))&&(ne.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"width","")),(e=ne.getStyle(t,"height"))&&(ne.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"height","")))})}function B(){f.on("keydown",function(t){var n,r,i,o,a;if(!m(t)&&t.keyCode==e.BACKSPACE&&(n=re.getRng(),r=n.startContainer,i=n.startOffset,o=ne.getRoot(),a=r,n.collapsed&&0===i)){for(;a&&a.parentNode&&a.parentNode.firstChild==a&&a.parentNode!=o;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(f.formatter.toggle("blockquote",null,a),n=ne.createRng(),n.setStart(r,0),n.setEnd(r,0),re.setRng(n))}})}function D(){function e(){K(),h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),ie.object_resizing||h("enableObjectResizing",!1)}ie.readonly||f.on("BeforeExecCommand MouseDown",e)}function L(){function e(){Q(ne.select("a"),function(e){var t=e.parentNode,n=ne.getRoot();if(t.lastChild===e){for(;t&&!ne.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}ne.add(t,"br",{"data-mce-bogus":1})}})}f.on("SetContent ExecCommand",function(t){"setcontent"!=t.type&&"mceInsertLink"!==t.command||e()})}function M(){ie.forced_root_block&&f.on("init",function(){h("DefaultParagraphSeparator",ie.forced_root_block)})}function P(){f.on("keydown",function(e){var t;m(e)||e.keyCode!=ee||(t=f.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),f.undoManager.beforeChange(),ne.remove(t.item(0)),f.undoManager.add()))})}function O(){var e;p()>=10&&(e="",Q("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),f.contentStyles.push(e+"{padding-right: 1px !important}"))}function H(){p()<9&&(oe.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),ae.addNodeFilter("noscript",function(e){for(var t=e.length,n,r,a;t--;)n=e[t],r=e[t].firstChild,r?r.value=o.decode(r.value):(a=n.attributes.map["data-mce-innertext"],a&&(n.attr("data-mce-innertext",null),r=new i("#text",3),r.value=a,r.raw=!0,n.append(r)))}))}function I(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),ne.unbind(r,"mouseup",n),ne.unbind(r,"mousemove",t),a=o=0}var r=ne.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,ne.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(ne.bind(r,"mouseup",n),ne.bind(r,"mousemove",t),ne.getRoot().focus(),a.select())}})}function F(){f.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||re.normalize()},!0)}function z(){f.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function U(){f.inline||f.on("keydown",function(){document.activeElement==document.body&&f.getWin().focus()})}function W(){f.inline||(f.contentStyles.push("body {min-height: 150px}"),f.on("click",function(e){var t;if("HTML"==e.target.nodeName){if(a.ie>11)return void f.getBody().focus();t=f.selection.getRng(),f.getBody().focus(),f.selection.setRng(t),f.selection.normalize(),f.nodeChanged()}}))}function V(){a.mac&&f.on("keydown",function(t){!e.metaKeyPressed(t)||t.shiftKey||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),f.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","lineboundary"))})}function $(){h("AutoUrlDetect",!1)}function q(){f.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),f.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function j(){f.on("init",function(){f.dom.bind(f.getBody(),"submit",function(e){e.preventDefault()})})}function Y(){oe.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}function X(){f.on("dragstart",function(e){g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);if(n&&n.id!=f.id){e.preventDefault();var r=t.getCaretRangeFromPoint(e.x,e.y,f.getDoc());re.setRng(r),y(n.html)}}})}function K(){var e,t;G()&&(e=f.getBody(),t=e.parentNode,t.removeChild(e),t.appendChild(e),e.focus())}function G(){var e;return se?(e=f.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}function J(){function t(e){var t=new d(e.getBody()),n=e.selection.getRng(),r=u.fromRangeStart(n),i=u.fromRangeEnd(n);return!e.selection.isCollapsed()&&!t.prev(r)&&!t.next(i)}f.on("keypress",function(n){!m(n)&&!re.isCollapsed()&&n.charCode>31&&!e.metaKeyPressed(n)&&t(f)&&(n.preventDefault(),f.setContent(String.fromCharCode(n.charCode)),f.selection.select(f.getBody(),!0),f.selection.collapse(!1),f.nodeChanged())}),f.on("keydown",function(e){var n=e.keyCode;m(e)||n!=te&&n!=ee||t(f)&&(e.preventDefault(),f.setContent(""),f.nodeChanged())})}var Q=s.each,Z=f.$,ee=e.BACKSPACE,te=e.DELETE,ne=f.dom,re=f.selection,ie=f.settings,oe=f.parser,ae=f.serializer,se=a.gecko,le=a.ie,ce=a.webkit,ue="data:text/mce-internal,",de=le?"Text":"URL";return B(),C(),a.windowsPhone||F(),ce&&(J(),b(),w(),_(),M(),j(),T(),Y(),a.iOS?(U(),W(),q()):x()),le&&a.ie<11&&(N(),k(),R(),A(),P(),O(),H(),I()),a.ie>=11&&(W(),T()),a.ie&&(x(),$(),X()),se&&(J(),N(),E(),S(),D(),L(),z(),V(),T()),{refreshContentEditable:K,isHidden:G}}}),r(Ie,[ue,w,m],function(e,t,n){function r(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=o.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()}function i(e,t){function n(e){return!e.hidden&&!e.readonly}var i=r(e,t),s;if(e.delegates||(e.delegates={}),!e.delegates[t])if(e.settings.event_root){if(a||(a={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&a){for(t in a)e.dom.unbind(r(e,t));a=null}})),a[t])return;s=function(r){for(var i=r.target,a=e.editorManager.editors,s=a.length;s--;){var l=a[s].getBody();(l===i||o.isChildOf(i,l))&&n(a[s])&&a[s].fire(t,r)}},a[t]=s,o.bind(i,t,s)}else s=function(r){n(e)&&e.fire(t,r)},o.bind(i,t,s),e.delegates[t]=s}var o=t.DOM,a,s={bindPendingEventDelegates:function(){var e=this;n.each(e._pendingNativeEvents,function(t){i(e,t)})},toggleNativeEvent:function(e,t){var n=this;"focus"!=e&&"blur"!=e&&(t?n.initialized?i(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(r(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e=this,t;if(e.delegates){for(t in e.delegates)e.dom.unbind(r(e,t),t,e.delegates[t]);delete e.delegates}e.inline||(e.getBody().onload=null,e.dom.unbind(e.getWin()),e.dom.unbind(e.getDoc())),e.dom.unbind(e.getBody()),e.dom.unbind(e.getContainer())}};return s=n.extend({},e,s)}),r(Fe,[],function(){function e(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}}function t(e){var t,n;return t=e.getBody(),n=function(t){e.dom.getParents(t.target,"a").length>0&&t.preventDefault()},e.dom.bind(t,"click",n),{unbind:function(){e.dom.unbind(t,"click",n)}}}function n(n,r){n._clickBlocker&&(n._clickBlocker.unbind(),n._clickBlocker=null),r?(n._clickBlocker=t(n),n.selection.controlSelection.hideResizeRect(),n.readonly=!0,n.getBody().contentEditable=!1):(n.readonly=!1,n.getBody().contentEditable=!0,e(n,"StyleWithCSS",!1),e(n,"enableInlineTableEditing",!1),e(n,"enableObjectResizing",!1),n.focus(),n.nodeChanged())}function r(e,t){var r=e.readonly?"readonly":"design";t!=r&&(e.initialized?n(e,"readonly"==t):e.on("init",function(){n(e,"readonly"==t)}),e.fire("SwitchMode",{mode:t}))}return{setMode:r}}),r(ze,[m,d],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122},o=e.makeMap("alt,ctrl,shift,meta,access");return function(a){function s(e){var a,s,l={};n(r(e,"+"),function(e){e in o?l[e]=!0:/^[0-9]{2,}$/.test(e)?l.keyCode=parseInt(e,10):(l.charCode=e.charCodeAt(0),l.keyCode=i[e]||e.toUpperCase().charCodeAt(0))}),a=[l.keyCode];for(s in o)l[s]?a.push(s):l[s]=!1;return l.id=a.join(","),l.access&&(l.alt=!0,t.mac?l.ctrl=!0:l.shift=!0),l.meta&&(t.mac?l.meta=!0:(l.ctrl=!0,l.meta=!1)),l}function l(t,n,i,o){var l;return l=e.map(r(t,">"),s),l[l.length-1]=e.extend(l[l.length-1],{func:i,scope:o||a}),e.extend(l[0],{desc:a.translate(n),subpatterns:l.slice(1)})}function c(e){return e.altKey||e.ctrlKey||e.metaKey}function u(e){return e.keyCode>=112&&e.keyCode<=123}function d(e,t){return t?t.ctrl!=e.ctrlKey||t.meta!=e.metaKey?!1:t.alt!=e.altKey||t.shift!=e.shiftKey?!1:e.keyCode==t.keyCode||e.charCode&&e.charCode==t.charCode?(e.preventDefault(),!0):!1:!1}function f(e){return e.func?e.func.call(e.scope):null}var h=this,p={},m=[];a.on("keyup keypress keydown",function(e){!c(e)&&!u(e)||e.isDefaultPrevented()||(n(p,function(t){return d(e,t)?(m=t.subpatterns.slice(0),"keydown"==e.type&&f(t),!0):void 0}),d(e,m[0])&&(1===m.length&&"keydown"==e.type&&f(m[0]),m.shift()))}),h.add=function(t,i,o,s){var c;return c=o,"string"==typeof o?o=function(){a.execCommand(c,!1,null)}:e.isArray(c)&&(o=function(){a.execCommand(c[0],c[1],c[2])}),n(r(e.trim(t.toLowerCase())),function(e){var t=l(e,i,o,s);p[t.id]=t}),!0},h.remove=function(e){var t=l(e);return p[t.id]?(delete p[t.id],!0):!1}}}),r(Ue,[c,m,z],function(e,t,n){return function(r,i){function o(e){var t,n;return n={"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"},t=n[e.blob().type.toLowerCase()]||"dat",e.id()+"."+t}function a(e,t){return e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t}function s(e){return{id:e.id,blob:e.blob,base64:e.base64,filename:n.constant(o(e))}}function l(e,t,n,r){var s,l;s=new XMLHttpRequest,s.open("POST",i.url),s.withCredentials=i.credentials,s.upload.onprogress=function(e){r(e.loaded/e.total*100)},s.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+s.status)},s.onload=function(){var e;return 200!=s.status?void n("HTTP Error: "+s.status):(e=JSON.parse(s.responseText),e&&"string"==typeof e.location?void t(a(i.basePath,e.location)):void n("Invalid JSON: "+s.responseText))},l=new FormData,l.append("file",e.blob(),o(e)),s.send(l)}function c(){return new e(function(e){e([])})}function u(e,t){return{url:t,blobInfo:e,status:!0}}function d(e,t){return{url:"",blobInfo:e,status:!1,error:t}}function f(e,n){t.each(y[e],function(e){e(n)}),delete y[e]}function h(t,n,i){return r.markPending(t.blobUri()),new e(function(e){var o,a,l=function(){};try{var c=function(){o&&(o.close(),a=l)},h=function(n){c(),r.markUploaded(t.blobUri(),n),f(t.blobUri(),u(t,n)),e(u(t,n))},p=function(){c(),r.removeFailed(t.blobUri()),f(t.blobUri(),d(t,p)),e(d(t,p))};a=function(e){0>e||e>100||(o||(o=i()),o.progressBar.value(e))},n(s(t),h,p,a)}catch(m){e(d(t,m.message))}})}function p(e){return e===l}function m(t){var n=t.blobUri();return new e(function(e){y[n]=y[n]||[],y[n].push(e)})}function g(n,o){return n=t.grep(n,function(e){return!r.isUploaded(e.blobUri())}),e.all(t.map(n,function(e){return r.isPending(e.blobUri())?m(e):h(e,i.handler,o)}))}function v(e,t){return!i.url&&p(i.handler)?c():g(e,t)}var y={};return i=t.extend({credentials:!1,handler:l},i),{upload:v}}}),r(We,[c],function(e){function t(t){return new e(function(e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="blob",n.onload=function(){200==this.status&&e(this.response)},n.send()})}function n(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}}function r(t){return new e(function(e){var r,i,o;t=n(t);try{r=atob(t.data)}catch(a){return void e(new Blob([]))}for(i=new Uint8Array(r.length),o=0;o<i.length;o++)i[o]=r.charCodeAt(o);e(new Blob([i],{type:t.type}))})}function i(e){return 0===e.indexOf("blob:")?t(e):0===e.indexOf("data:")?r(e):null}function o(t){return new e(function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)})}return{uriToBlob:i,blobToDataUri:o,parseDataUri:n}}),r(Ve,[c,p,z,We,d],function(e,t,n,r,i){var o=0;return function(a,s){function l(l,u){function d(e,t){var n,i;return 0===e.src.indexOf("blob:")?(i=s.getByUri(e.src),void(i&&t({image:e,blobInfo:i}))):(n=r.parseDataUri(e.src).data,i=s.findFirst(function(e){return e.base64()===n}),void(i?t({image:e,blobInfo:i}):r.uriToBlob(e.src).then(function(r){var i="blobid"+o++,a=s.create(i,r,n);s.add(a),t({image:e,blobInfo:a})})))}var f,h;return u||(u=n.constant(!0)),f=t.filter(l.getElementsByTagName("img"),function(e){var t=e.src;return i.fileApi?e.hasAttribute("data-mce-bogus")?!1:e.hasAttribute("data-mce-placeholder")?!1:t&&t!=i.transparentSrc?0===t.indexOf("blob:")?!a.isUploaded(t):0===t.indexOf("data:")?u(e):!1:!1:!1}),h=t.map(f,function(t){var n;return c[t.src]?new e(function(e){c[t.src].then(function(n){e({image:t,blobInfo:n.blobInfo})})}):(n=new e(function(e){d(t,e)}).then(function(e){return delete c[e.image.src],e})["catch"](function(e){return delete c[t.src],e}),c[t.src]=n,n)}),e.all(h)}var c={};return{findAll:l}}}),r($e,[p,z],function(e,t){return function(){function n(e,t,n){return{id:u(e),blob:u(t),base64:u(n),blobUri:u(URL.createObjectURL(t))}}function r(e){i(e.id())||c.push(e)}function i(e){return o(function(t){return t.id()===e})}function o(t){return e.filter(c,t)[0]}function a(e){return o(function(t){return t.blobUri()==e})}function s(t){c=e.filter(c,function(e){return e.blobUri()===t?(URL.revokeObjectURL(e.blobUri()),!1):!0})}function l(){e.each(c,function(e){URL.revokeObjectURL(e.blobUri())}),c=[]}var c=[],u=t.constant;return{create:n,add:r,get:i,getByUri:a,findFirst:o,removeByUri:s,destroy:l}}}),r(qe,[],function(){return function(){function e(e,t){return{status:e,resultUri:t}}function t(e){return e in d}function n(e){var t=d[e];return t?t.resultUri:null}function r(e){return t(e)?d[e].status===c:!1}function i(e){return t(e)?d[e].status===u:!1}function o(t){d[t]=e(c,null)}function a(t,n){d[t]=e(u,n)}function s(e){delete d[e]}function l(){d={}}var c=1,u=2,d={};return{hasBlobUri:t,getResultUri:n,isPending:r,isUploaded:i,markPending:o,markUploaded:a,removeFailed:s,destroy:l}}}),r(je,[p,Ue,Ve,$e,qe],function(e,t,n,r,i){return function(o){function a(e){return function(t){return o.selection?e(t):[]}}function s(e,t,n){var r=0;do r=e.indexOf(t,r),-1!==r&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1);while(-1!==r);return e}function l(e,t,n){return e=s(e,'src="'+t+'"','src="'+n+'"'),e=s(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')}function c(t,n){e.each(o.undoManager.data,function(e){e.content=l(e.content,t,n)})}function u(){return o.notificationManager.open({text:o.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}function d(e,t){y.removeByUri(e.src),c(e.src,t),o.$(e).attr({src:t,"data-mce-src":o.convertURL(t,"src")})}function f(n){return b||(b=new t(w,{url:x.images_upload_url,basePath:x.images_upload_base_path,credentials:x.images_upload_credentials,handler:x.images_upload_handler})),m().then(a(function(t){var r;return r=e.map(t,function(e){return e.blobInfo}),b.upload(r,u).then(a(function(r){return r=e.map(r,function(e,n){var r=t[n].image;return e.status&&o.settings.images_replace_blob_uris!==!1&&d(r,e.url),{element:r,status:e.status}}),n&&n(r),r}))}))}function h(e){return x.automatic_uploads!==!1?f(e):void 0}function p(e){return x.images_dataimg_filter?x.images_dataimg_filter(e):!0}function m(){return C||(C=new n(w,y)),C.findAll(o.getBody(),p).then(a(function(t){return e.each(t,function(e){c(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),t}))}function g(){y.destroy(),w.destroy(),C=b=null}function v(t){return t.replace(/src="(blob:[^"]+)"/g,function(t,n){var r=w.getResultUri(n);if(r)return'src="'+r+'"';var i=y.getByUri(n);return i||(i=e.reduce(o.editorManager.editors,function(e,t){return e||t.editorUpload.blobCache.getByUri(n)},null)),i?'src="data:'+i.blob().type+";base64,"+i.base64()+'"':t})}var y=new r,b,C,x=o.settings,w=new i;return o.on("setContent",function(){o.settings.automatic_uploads!==!1?h():m()}),o.on("RawSaveContent",function(e){e.content=v(e.content)}),o.on("getContent",function(e){e.source_view||"raw"==e.format||(e.content=v(e.content))}),o.on("PostRender",function(){o.parser.addNodeFilter("img",function(t){e.each(t,function(e){var t=e.attr("src");if(!y.getByUri(t)){var n=w.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:y,uploadImages:f,uploadImagesAuto:h,scanForImages:m,destroy:g}}}),r(Ye,[k,$,_,T,g,W,u],function(e,t,n,r,i,o,a){var s=n.isContentEditableFalse;return function(t,n){function r(e,n){var r=o.collapse(e.getBoundingClientRect(),n),i,a,s,l,c;return"BODY"==t.tagName?(i=t.ownerDocument.documentElement,a=t.scrollLeft||i.scrollLeft,s=t.scrollTop||i.scrollTop):(c=t.getBoundingClientRect(),a=t.scrollLeft-c.left,s=t.scrollTop-c.top),r.left+=a,r.right+=a,r.top+=s,r.bottom+=s,r.width=1,l=e.offsetWidth-e.clientWidth,l>0&&(n&&(l*=-1),r.left+=l,r.right+=l),r}function l(){var n,r,o,a,s;for(n=i("*[contentEditable=false]",t),a=0;a<n.length;a++)r=n[a],o=r.previousSibling,e.endsWithCaretContainer(o)&&(s=o.data,1==s.length?o.parentNode.removeChild(o):o.deleteData(s.length-1,1)),o=r.nextSibling,e.startsWithCaretContainer(o)&&(s=o.data,1==s.length?o.parentNode.removeChild(o):o.deleteData(0,1));return null}function c(o,a){var l,c,f;return u(),n(a)?(g=e.insertBlock("p",a,o),l=r(a,o),i(g).css("top",l.top),m=i('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(l).appendTo(t),o&&m.addClass("mce-visual-caret-before"),d(),c=a.ownerDocument.createRange(),f=g.firstChild,c.setStart(f,0),c.setEnd(f,1),c):(g=e.insertInline(a,o),c=a.ownerDocument.createRange(),s(g.nextSibling)?(c.setStart(g,0),c.setEnd(g,0)):(c.setStart(g,1),c.setEnd(g,1)),c)}function u(){l(),g&&(e.remove(g),g=null),m&&(m.remove(),m=null),clearInterval(p)}function d(){p=a.setInterval(function(){i("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden")},500)}function f(){a.clearInterval(p)}function h(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"}var p,m,g;return{show:c,hide:u,getCss:h,destroy:f}}}),r(Xe,[p,_,W],function(e,t,n){function r(i){function o(t){return e.map(t,function(e){return e=n.clone(e),e.node=i,e})}if(e.isArray(i))return e.reduce(i,function(e,t){return e.concat(r(t))},[]);if(t.isElement(i))return o(i.getClientRects());if(t.isText(i)){var a=i.ownerDocument.createRange();return a.setStart(i,0),a.setEnd(i,i.data.length),o(a.getClientRects())}}return{getClientRects:r}}),r(Ke,[z,p,Xe,U,te,ne,$,W],function(e,t,n,r,i,o,a,s){function l(e,t,n,o){for(;o=i.findNode(o,e,r.isEditableCaretCandidate,t);)if(n(o))return}function c(e,r,i,o,a,s){function c(o){var s,l,c;for(c=n.getClientRects(o),-1==e&&(c=c.reverse()),s=0;s<c.length;s++)if(l=c[s],!i(l,h)){if(f.length>0&&r(l,t.last(f))&&u++,l.line=u,a(l))return!0;f.push(l)}}var u=0,d,f=[],h;return(h=t.last(s.getClientRects()))?(d=s.getNode(),c(d),l(e,o,c,d),f):f}function u(e,t){return t.line>e}function d(e,t){return t.line===e}function f(e,n,r,i){function l(n){return 1==e?t.last(n.getClientRects()):t.last(n.getClientRects())}var c=new o(n),u,d,f,h,p=[],m=0,g,v;1==e?(u=c.next,d=s.isBelow,f=s.isAbove,h=a.after(i)):(u=c.prev,d=s.isAbove,f=s.isBelow,h=a.before(i)),v=l(h);do if(h.isVisible()&&(g=l(h),!f(g,v))){if(p.length>0&&d(g,t.last(p))&&m++,g=s.clone(g),g.position=h,g.line=m,r(g))return p;p.push(g)}while(h=u(h));return p}var h=e.curry,p=h(c,-1,s.isAbove,s.isBelow),m=h(c,1,s.isBelow,s.isAbove);return{upUntil:p,downUntil:m,positionsUntil:f,isAboveLine:h(u),isLine:h(d)}}),r(Ge,[z,p,_,Xe,W,te,U],function(e,t,n,r,i,o,a){function s(e,t){return Math.abs(e.left-t)}function l(e,t){return Math.abs(e.right-t)}function c(e,n){function r(e,t){return e>=t.left&&e<=t.right}return t.reduce(e,function(e,t){var i,o;return i=Math.min(s(e,n),l(e,n)),o=Math.min(s(t,n),l(t,n)),r(n,t)?t:r(n,e)?e:o==i&&m(t.node)?t:i>o?t:e})}function u(e,t,n,r){for(;r=g(r,e,a.isEditableCaretCandidate,t);)if(n(r))return}function d(e,n){function o(e,i){var o;return o=t.filter(r.getClientRects(i),function(t){return!e(t,n)}),a=a.concat(o),0===o.length}var a=[];return a.push(n),u(-1,e,v(o,i.isAbove),n.node),u(1,e,v(o,i.isBelow),n.node),a}function f(e){return t.filter(t.toArray(e.getElementsByTagName("*")),m)}function h(e,t){return{node:e.node,before:s(e,t)<l(e,t)}}function p(e,n,i){var o,a;return o=r.getClientRects(f(e)),o=t.filter(o,function(e){return i>=e.top&&i<=e.bottom}),a=c(o,n),a&&(a=c(d(e,a),n),a&&m(a.node))?h(a,n):null}var m=n.isContentEditableFalse,g=o.findNode,v=e.curry;return{findClosestClientRect:c,findLineNodeRects:d,closestCaret:p}}),r(Je,[],function(){var e=function(e){var t,n,r,i;return i=e.getBoundingClientRect(),t=e.ownerDocument,n=t.documentElement,r=t.defaultView,{top:i.top+r.pageYOffset-n.clientTop,left:i.left+r.pageXOffset-n.clientLeft}},t=function(t){return t.inline?e(t.getBody()):{left:0,top:0}},n=function(e){var t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}},r=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},i={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:i},i=function(t,n){if(n.target.ownerDocument!==t.getDoc()){var i=e(t.getContentAreaContainer()),o=r(t);return{left:n.pageX-i.left+o.left,top:n.pageY-i.top+o.top}}return{left:n.pageX,top:n.pageY}},o=function(e,t,n){return{pageX:n.left-e.left+t.left,pageY:n.top-e.top+t.top}},a=function(e,r){return o(t(e),n(e),i(e,r))};return{calc:a}}),r(Qe,[_,p,z,u,w,Je],function(e,t,n,r,i,o){var a=e.isContentEditableFalse,s=e.isContentEditableTrue,l=function(e){return a(e)},c=function(e,t,n){return t===n||e.dom.isChildOf(t,n)?!1:!a(t)},u=function(e){var t=e.cloneNode(!0);return t.removeAttribute("data-mce-selected"),t},d=function(e,t,n,r){var i=t.cloneNode(!0);e.dom.setStyles(i,{width:n,height:r}),e.dom.setAttrib(i,"data-mce-selected",null);var o=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(o,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(i,{margin:0,boxSizing:"border-box"}),o.appendChild(i),o},f=function(e,t){e.parentNode!==t&&t.appendChild(e)},h=function(e,t,n,r,i,o){var a=0,s=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>i&&(a=t.pageX+n-i), t.pageY+r>o&&(s=t.pageY+r-o),e.style.width=n-a+"px",e.style.height=r-s+"px"},p=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},m=function(e){return 0===e.button},g=function(e){return e.element},v=function(e,t){return{pageX:t.pageX-e.relX,pageY:t.pageY+5}},y=function(e,r){return function(i){if(m(i)){var o=t.find(r.dom.getParents(i.target),n.or(a,s));if(l(o)){var c=r.dom.getPos(o),u=r.getBody(),f=r.getDoc().documentElement;e.element=o,e.screenX=i.screenX,e.screenY=i.screenY,e.maxX=(r.inline?u.scrollWidth:f.offsetWidth)-2,e.maxY=(r.inline?u.scrollHeight:f.offsetHeight)-2,e.relX=i.pageX-c.x,e.relY=i.pageY-c.y,e.width=o.offsetWidth,e.height=o.offsetHeight,e.ghost=d(r,o,e.width,e.height)}}}},b=function(e,t){var n=r.throttle(function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n)},0);return function(r){var i=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(g(e)&&!e.dragging&&i>10){var a=t.fire("dragstart",{target:e.element});if(a.isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){var s=v(e,o.calc(t,r));f(e.ghost,t.getBody()),h(e.ghost,s,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY)}}},C=function(e,t){return function(n){if(e.dragging&&c(t,t.selection.getNode(),e.element)){var r=u(e.element),i=t.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});i.isDefaultPrevented()||(r=i.targetClone,t.undoManager.transact(function(){p(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret()}))}w(e)}},x=function(e,t){return function(){w(e),e.dragging&&t.fire("dragend")}},w=function(e){e.dragging=!1,e.element=null,p(e.ghost)},N=function(e){var t={},n,r,o,a,s,l;n=i.DOM,l=document,r=y(t,e),o=b(t,e),a=C(t,e),s=x(t,e),e.on("mousedown",r),e.on("mousemove",o),e.on("mouseup",a),n.bind(l,"mousemove",o),n.bind(l,"mouseup",s),e.on("remove",function(){n.unbind(l,"mousemove",o),n.unbind(l,"mouseup",s)})},E=function(e){e.on("drop",function(t){var n="undefined"!=typeof t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(a(n)||a(e.dom.getContentEditableParent(n)))&&t.preventDefault()})},_=function(e){N(e),E(e)};return{init:_}}),r(Ze,[d,ne,$,k,te,Ye,Ke,Ge,_,T,W,I,z,p,u,Qe,S],function(e,t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g){function v(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function y(c){function y(){var e=c.dom.get(le);return e?e.getElementsByTagName("*")[0]:e}function S(e){return c.dom.isBlock(e)}function k(e){e&&c.selection.setRng(e)}function T(){return c.selection.getRng()}function R(e,t){c.selection.scrollIntoView(e,t)}function A(e,t,n){var r;return r=c.fire("ShowCaret",{target:t,direction:e,before:n}),r.isDefaultPrevented()?null:(R(t,-1===e),se.show(n,t))}function B(e){var t;return se.hide(),t=c.fire("BeforeObjectSelected",{target:e}),t.isDefaultPrevented()?null:D(e)}function D(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}function L(e,t){var n=i.isInSameBlock(e,t);return!n&&l.isBr(e.getNode())?!0:n}function M(e,t){return t=i.normalizeRange(e,re,t),-1==e?n.fromRangeStart(t):n.fromRangeEnd(t)}function P(e){return r.isCaretContainerBlock(e.startContainer)}function O(e,t,n,r){var i,o,a,s;return!r.collapsed&&(i=_(r),x(i))?A(e,i,-1==e):(s=P(r),o=M(e,r),n(o)?B(o.getNode(-1==e)):(o=t(o))?n(o)?A(e,o.getNode(-1==e),1==e):(a=t(o),n(a)&&L(o,a)?A(e,a.getNode(-1==e),1==e):s?$(o.toRange()):null):s?r:null)}function H(e,t,n){var r,i,o,l,c,u,d,f,p;if(p=_(n),r=M(e,n),i=t(re,a.isAboveLine(1),r),o=h.filter(i,a.isLine(1)),c=h.last(r.getClientRects()),E(r)&&(p=r.getNode()),N(r)&&(p=r.getNode(!0)),!c)return null;if(u=c.left,l=s.findClosestClientRect(o,u),l&&x(l.node))return d=Math.abs(u-l.left),f=Math.abs(u-l.right),A(e,l.node,f>d);if(p){var m=a.positionsUntil(e,re,a.isAboveLine(1),p);if(l=s.findClosestClientRect(h.filter(m,a.isLine(1)),u))return $(l.position.toRange());if(l=h.last(h.filter(m,a.isLine(0))))return $(l.position.toRange())}}function I(t,r){function i(){var t=c.dom.create(c.settings.forced_root_block);return(!e.ie||e.ie>=11)&&(t.innerHTML='<br data-mce-bogus="1">'),t}var o,a,s;if(r.collapsed&&c.settings.forced_root_block){if(o=c.dom.getParent(r.startContainer,"PRE"),!o)return;a=1==t?oe(n.fromRangeStart(r)):ae(n.fromRangeStart(r)),a||(s=i(),1==t?c.$(o).after(s):c.$(o).before(s),c.selection.select(s,!0),c.selection.collapse())}}function F(e,t,n,r){var i;return(i=O(e,t,n,r))?i:(i=I(e,r),i?i:null)}function z(e,t,n){var r;return(r=H(e,t,n))?r:(r=I(e,n),r?r:null)}function U(){return ue("*[data-mce-caret]")[0]}function W(e){e=ue(e),e.attr("data-mce-caret")&&(se.hide(),e.removeAttr("data-mce-caret"),e.removeAttr("data-mce-bogus"),e.removeAttr("style"),k(T()),R(e[0]))}function V(e){var t,r;return e=i.normalizeRange(1,re,e),t=n.fromRangeStart(e),x(t.getNode())?A(1,t.getNode(),!t.isAtEnd()):x(t.getNode(!0))?A(1,t.getNode(!0),!1):(r=c.dom.getParent(t.getNode(),f.or(x,C)),x(r)?A(1,r,!1):(se.hide(),null))}function $(e){var t;return e&&e.collapsed?(t=V(e),t?t:e):e}function q(e){var t,i,o,a;return x(e)?(x(e.previousSibling)&&(o=e.previousSibling),i=ae(n.before(e)),i||(t=oe(n.after(e))),t&&w(t.getNode())&&(a=t.getNode()),r.remove(e.previousSibling),r.remove(e.nextSibling),c.dom.remove(e),ee(),c.dom.isEmpty(c.getBody())?(c.setContent(""),void c.focus()):o?n.after(o).toRange():a?n.before(a).toRange():i?i.toRange():t?t.toRange():null):null}function j(e){var t=c.schema.getTextBlockElements();return e.nodeName in t}function Y(e){return c.dom.isEmpty(e)}function X(e,t,r){var i=c.dom,o,a,s,l;if(o=i.getParent(t.getNode(),i.isBlock),a=i.getParent(r.getNode(),i.isBlock),-1===e){if(l=r.getNode(!0),N(r)&&S(l))return j(o)?(Y(o)&&i.remove(o),n.after(l).toRange()):q(r.getNode(!0))}else if(l=t.getNode(),E(t)&&S(l))return j(a)?(Y(a)&&i.remove(a),n.before(l).toRange()):q(t.getNode());if(o===a||!j(o)||!j(a))return null;for(;s=o.firstChild;)a.appendChild(s);return c.dom.remove(o),r.toRange()}function K(e,t,n,i){var o,a,s,l;return!i.collapsed&&(o=_(i),x(o))?$(q(o)):(a=M(e,i),n(a)&&r.isCaretContainerBlock(i.startContainer)?(l=-1==e?ie.prev(a):ie.next(a),l?$(l.toRange()):i):t(a)?$(q(a.getNode(-1==e))):(s=-1==e?ie.prev(a):ie.next(a),t(s)?-1===e?X(e,a,s):X(e,s,a):void 0))}function G(){function r(e,t){var n=t(T());n&&!e.isDefaultPrevented()&&(e.preventDefault(),k(n))}function i(e){for(var t=c.getBody();e&&e!=t;){if(C(e)||x(e))return e;e=e.parentNode}return null}function o(e,t,n){return n.collapsed?!1:h.reduce(n.getClientRects(),function(n,r){return n||u.containsXY(r,e,t)},!1)}function l(e){var t=!1;e.on("touchstart",function(){t=!1}),e.on("touchmove",function(){t=!0}),e.on("touchend",function(e){var n=i(e.target);x(n)?t||(e.preventDefault(),Z(B(n))):ee()})}function f(){var e,t=i(c.selection.getNode());C(t)&&S(t)&&c.dom.isEmpty(t)&&(e=c.dom.create("br",{"data-mce-bogus":"1"}),c.$(t).empty().append(e),c.selection.setRng(n.before(e).toRange()))}function g(e){var t=U();if(t)return"compositionstart"==e.type?(e.preventDefault(),e.stopPropagation(),void W(t)):void(" "!=t.innerHTML&&W(t))}function v(e){var t;switch(e.keyCode){case d.DELETE:t=f();break;case d.BACKSPACE:t=f()}t&&e.preventDefault()}var w=b(F,1,oe,E),_=b(F,-1,ae,N),R=b(K,1,E,N),D=b(K,-1,N,E),L=b(z,-1,a.upUntil),M=b(z,1,a.downUntil);c.on("mouseup",function(){var e=T();e.collapsed&&k(V(e))}),c.on("click",function(e){var t;t=i(e.target),t&&x(t)&&(e.preventDefault(),c.focus())});var P=function(e){var r=new t(e);if(!e.firstChild)return!1;var i=n.before(e.firstChild),o=r.next(i);return o&&!E(o)&&!N(o)},O=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n===r},H=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n&&!O(n,r)&&P(n)};l(c),c.on("mousedown",function(e){var t;if(t=i(e.target))x(t)?(e.preventDefault(),Z(B(t))):(ee(),o(e.clientX,e.clientY,c.selection.getRng())||c.selection.placeCaretAt(e.clientX,e.clientY));else{ee(),se.hide();var n=s.closestCaret(re,e.clientX,e.clientY);n&&(H(e.target,n.node)||(e.preventDefault(),c.getBody().focus(),k(A(1,n.node,n.before))))}}),c.on("keydown",function(e){if(!d.modifierPressed(e))switch(e.keyCode){case d.RIGHT:r(e,w);break;case d.DOWN:r(e,M);break;case d.LEFT:r(e,_);break;case d.UP:r(e,L);break;case d.DELETE:r(e,R);break;case d.BACKSPACE:r(e,D);break;default:x(c.selection.getNode())&&e.preventDefault()}}),c.on("keyup compositionstart",function(e){g(e),v(e)},!0),c.on("cut",function(){var e=c.selection.getNode();x(e)&&p.setEditorTimeout(c,function(){k($(q(e)))})}),c.on("getSelectionRange",function(e){var t=e.range;if(ce){if(!ce.parentNode)return void(ce=null);t=t.cloneRange(),t.selectNode(ce),e.range=t}}),c.on("setSelectionRange",function(e){var t;t=Z(e.range),t&&(e.range=t)}),c.on("focus",function(){p.setEditorTimeout(c,function(){c.selection.setRng($(c.selection.getRng()))},0)}),c.on("copy",function(t){var n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!e.ie){var r=y();r&&(t.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),m.init(c)}function J(){var e=c.contentStyles,t=".mce-content-body";e.push(se.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")}function Q(e){return r.isCaretContainer(e.startContainer)||r.isCaretContainer(e.endContainer)}function Z(t){var n,r=c.$,i=c.dom,o,a,s,l,u,d,f,h,p;if(!t)return ee(),null;if(t.collapsed){if(ee(),!Q(t)){if(f=M(1,t),x(f.getNode()))return A(1,f.getNode(),!f.isAtEnd());if(x(f.getNode(!0)))return A(1,f.getNode(!0),!1)}return null}return s=t.startContainer,l=t.startOffset,u=t.endOffset,3==s.nodeType&&0==l&&x(s.parentNode)&&(s=s.parentNode,l=i.nodeIndex(s),s=s.parentNode),1!=s.nodeType?(ee(),null):(u==l+1&&(n=s.childNodes[l]),x(n)?(h=p=n.cloneNode(!0),d=c.fire("ObjectSelected",{target:n,targetClone:h}),d.isDefaultPrevented()?(ee(),null):(h=d.targetClone,o=r("#"+le),0===o.length&&(o=r('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",le),o.appendTo(c.getBody())),t=c.dom.createRng(),h===p&&e.ie?(o.empty().append(g.ZWSP).append(h).append(g.ZWSP),t.setStart(o[0].firstChild,0),t.setEnd(o[0].lastChild,1)):(o.empty().append("\xa0").append(h).append("\xa0"),t.setStart(o[0].firstChild,1),t.setEnd(o[0].lastChild,0)),o.css({top:i.getPos(n,c.getBody()).y}),o[0].focus(),a=c.selection.getSel(),a.removeAllRanges(),a.addRange(t),c.$("*[data-mce-selected]").removeAttr("data-mce-selected"),n.setAttribute("data-mce-selected",1),ce=n,t)):(ee(),null))}function ee(){ce&&(ce.removeAttribute("data-mce-selected"),c.$("#"+le).remove(),ce=null)}function te(){se.destroy(),ce=null}function ne(){se.hide()}var re=c.getBody(),ie=new t(re),oe=b(v,ie.next),ae=b(v,ie.prev),se=new o(c.getBody(),S),le="sel-"+c.dom.uniqueId(),ce,ue=c.$;return e.ceFalse&&(G(),J()),{showBlockCaretContainer:W,hideFakeCaret:ne,destroy:te}}var b=f.curry,C=l.isContentEditableTrue,x=l.isContentEditableFalse,w=l.isElement,N=i.isAfterContentEditableFalse,E=i.isBeforeContentEditableFalse,_=c.getSelectedNode;return y}),r(et,[],function(){var e=0,t=function(){var e=function(){return Math.round(4294967295*Math.random()).toString(36)},t=(new Date).getTime();return"s"+t.toString(36)+e()+e()+e()},n=function(n){return n+e++ +t()};return{uuid:n}}),r(tt,[w,g,E,R,A,O,P,Y,J,Q,Z,ee,oe,ae,N,f,Ae,Pe,B,L,He,d,m,u,Ie,Fe,ze,je,Ze,et],function(e,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A){function B(e,t,i){var o=this,a,s,l;a=o.documentBaseUrl=i.documentBaseURL,s=i.baseURI,l=i.defaultSettings,t=P({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:a,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o,ie7_compat:!0},l,t),l&&l.external_plugins&&t.external_plugins&&(t.external_plugins=P({},l.external_plugins,t.external_plugins)),o.settings=t,r.language=t.language||"en",r.languageLoad=t.language_load,r.baseURL=i.baseURL,o.id=t.id=e,o.setDirty(!1),o.plugins={},o.documentBaseURI=new p(t.document_base_url||a,{base_uri:s}),o.baseURI=s,o.contentCSS=[],o.contentStyles=[],o.shortcuts=new k(o),o.loadedCSS={},o.editorCommands=new h(o),t.target&&(o.targetElm=t.target),o.suffix=i.suffix,o.editorManager=i,o.inline=t.inline,o.settings.content_editable=o.inline,t.cache_suffix&&(w.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),t.override_viewport===!1&&(w.overrideViewPort=!1),i.fire("SetupEditor",o),o.execCallback("setup",o),o.$=n.overrideDefaults(function(){return{context:o.inline?o.getBody():o.getDoc(),element:o.getBody()}})}var D=e.DOM,L=r.ThemeManager,M=r.PluginManager,P=N.extend,O=N.each,H=N.explode,I=N.inArray,F=N.trim,z=N.resolve,U=g.Event,W=w.gecko,V=w.ie;return B.prototype={render:function(){function e(){D.unbind(window,"ready",e),n.render()}function t(){var e=m.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!L.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",L.load(r.theme,t)}N.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),O(r.external_plugins,function(e,t){M.load(t,e),r.plugins+=" "+t}),O(r.plugins.split(/[ ,]/),function(e){if(e=F(e),e&&!M.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=M.dependencies(e);O(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=M.createUrl(t,e),M.load(e.resource,e)})}else M.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!U.domLoaded)return void D.bind(window,"ready",e);if(n.getElement()&&w.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||D.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(D.insertAfter(D.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},D.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.setDirty(!1),a._mceOldSubmit(a)})),n.windowManager=new v(n),n.notificationManager=new y(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=D.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),n.editorManager.add(n),t()}},init:function(){function e(n){var r=M.get(n),i,o;if(i=M.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=F(n),r&&-1===I(m,n)){if(O(M.dependencies(n),function(t){e(t)}),t.plugins[n])return;o=new r(t,i,t.$),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n))}}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,h,p,m=[];if(t.rtl=n.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(n.language),n.aria_label=n.aria_label||D.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=L.get(n.theme),t.theme=new c(t,L.urls[n.theme]),t.theme.init&&t.theme.init(t,L.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""),t.$)):t.theme=n.theme),O(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,h=/^[0-9\.]+(|px)$/i,h.test(""+i)&&(i=Math.max(parseInt(i,10),100)),h.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&O(H(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();if(t.iframeHTML=n.doctype+"<html><head>",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+='<base href="'+t.documentBaseURI.getURI()+'" />'),!w.caretAfter&&n.ie7_compat&&(t.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'),t.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',!/#$/.test(document.location.href))for(p=0;p<t.contentCSS.length;p++){var g=t.contentCSS[p];t.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+N._addCacheSuffix(g)+'" />',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),n.content_security_policy&&(t.iframeHTML+='<meta http-equiv="Content-Security-Policy" content="'+n.content_security_policy+'" />'),t.iframeHTML+='</head><body id="'+d+'" class="mce-content-body '+f+'" data-id="'+t.id+'"><br></body></html>';var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';document.domain!=location.hostname&&w.ie&&w.ie<12&&(u=v);var y=D.create("iframe",{id:t.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}});if(y.onload=function(){y.onload=null,t.fire("load")},D.setAttrib(y,"src",u||'javascript:""'),t.contentAreaContainer=l.iframeContainer,t.iframeElement=y,s=D.add(l.iframeContainer,y),V)try{t.getDoc()}catch(b){s.src=u=v}l.editorContainer&&(D.get(l.editorContainer).style.display=t.orgDisplay,t.hidden=D.isHidden(l.editorContainer)),t.getElement().style.display="none",D.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,r=n.settings,s=n.getElement(),h=n.getDoc(),p,m;r.inline||(n.getElement().style.visibility=n.orgVisibility),t||r.content_editable||(h.open(),h.write(n.iframeHTML),h.close()),r.content_editable&&(n.on("remove",function(){var e=this.getBody();D.removeClass(e,"mce-content-body"),D.removeClass(e,"mce-edit-focus"),D.setAttrib(e,"contentEditable",null)}),D.addClass(s,"mce-content-body"),n.contentDocument=h=r.content_document||document,n.contentWindow=r.content_window||window,n.bodyElement=s,r.content_document=r.content_window=null,r.root_name=s.nodeName.toLowerCase()),p=n.getBody(),p.disabled=!0,n.readonly=r.readonly,n.readonly||(n.inline&&"static"==D.getStyle(p,"position",!0)&&(p.style.position="relative"),p.contentEditable=n.getParam("content_editable_state",!0)),p.disabled=!1,n.editorUpload=new T(n),n.schema=new b(r),n.dom=new e(h,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:n.inline?n.getBody():null,collect:r.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new C(r,n.schema),n.parser.addAttributeFilter("src,href,style,tabindex",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)if(i=e[r],a=i.attr(t),s="data-mce-"+t,!i.attributes.map[s]){if(0===a.indexOf("data:")||0===a.indexOf("blob:"))continue;"style"===t?(a=o.serializeStyle(o.parseStyle(a),i.name),a.length||(a=null),i.attr(s,a),i.attr(t,a)):"tabindex"===t?(i.attr(s,a),i.attr(t,null)):i.attr(s,n.convertURL(a,t,i.name))}}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("type")||"no/type",0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,r,i=n.schema.getNonEmptyElements();t--;)r=e[t],r.isEmpty(i)&&(r.append(new o("br",1)).shortEnded=!0)}),n.serializer=new a(r,n),n.selection=new l(n.dom,n.getWin(),n.serializer,n),n.formatter=new c(n),n.undoManager=new u(n),n.forceBlocks=new f(n),n.enterKey=new d(n),n._nodeChangeDispatcher=new i(n),n._selectionOverrides=new R(n),n.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(h.body.spellcheck=!1,D.setAttrib(p,"spellcheck","false")),n.quirks=new x(n),n.fire("PostRender"),r.directionality&&(p.dir=r.directionality),r.nowrap&&(p.style.whiteSpace="nowrap"),r.protect&&n.on("BeforeSetContent",function(e){O(r.protect,function(t){e.content=e.content.replace(t,function(e){return"<!--mce:protected "+escape(e)+"-->"})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),r.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,n.bindPendingEventDelegates(),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.on("compositionstart compositionend",function(e){n.composing="compositionstart"===e.type}),n.contentStyles.length>0&&(m="",O(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),O(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),r.auto_focus&&E.setEditorTimeout(n,function(){var e;e=r.auto_focus===!0?n:n.editorManager.get(r.auto_focus),e.destroyed||e.focus()},100),s=h=p=null},focus:function(e){function t(e){return n.dom.getParent(e,function(e){return"true"===n.dom.getContentEditable(e)})}var n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l=n.getBody(),c;if(!e){if(o=r.getRng(),o.item&&(a=o.item(0)),n.quirks.refreshContentEditable(),c=t(r.getNode()),n.$.contains(l,c))return c.focus(),r.normalize(),void n.editorManager.setActive(n);if(i||(w.opera||n.getBody().focus(),n.getWin().focus()),W||i){if(l.setActive)try{l.setActive()}catch(u){l.focus()}else l.focus();i&&r.normalize()}a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())}n.editorManager.setActive(n)},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?z(r):0,n=z(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?(e=n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}),this.editorManager.translate(e)):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?O(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(e){e=e.split("="),e.length>1?i[F(e[0])]=F(e[1]):i[F(e[0])]=F(e)}):i=r,i):r},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addContextToolbar:function(e,t){var n=this,r;n.contextToolbars=n.contextToolbars||[],"string"==typeof e&&(r=e,e=function(e){return n.dom.is(e,r)}),n.contextToolbars.push({id:A.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable=!0:(D.show(e.getContainer()),D.hide(e.id)),e.load(),e.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(V&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e==e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(D.hide(e.getContainer()),D.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),"raw"==e.format&&t.fire("RawSaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=D.getParent(t.id,"form"))&&O(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&t.setDirty(!1),r},setContent:function(e,t){var n=this,r=n.getBody(),i,o;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(o=V&&11>V?"":'<br data-mce-bogus="1">',"TABLE"==r.nodeName?e="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(r.nodeName)&&(e="<li>"+o+"</li>"),i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=o,e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):V||e||(e='<br data-mce-bogus="1">'),n.dom.setHTML(r,e),n.fire("SetContent",t)):("raw"!==t.format&&(e=new s({validate:n.validate},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=F(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?t.serializer.getTrimmedContent():"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),"text"!=e.format?e.content=F(n):e.content=n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=P({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!=t&&this.fire("dirty")},setMode:function(e){S.setMode(this,e)},getContainer:function(){var e=this;return e.container||(e.container=D.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=D.get(this.id)),this.targetElm},getWin:function(){var e=this,t;return e.contentWindow||(t=e.iframeElement,t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),O(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||!n.hasVisual?i.removeClass(e,o):i.addClass(e,o));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&n.hasVisual?i.addClass(e,o):i.removeClass(e,o)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&D.remove(e.getElement().nextSibling),e.inline||(V&&10>V&&e.getDoc().execCommand("SelectAll",!1,null),D.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),D.remove(e.getContainer()),e._selectionOverrides.destroy(),e.editorUpload.destroy(),e.destroy())},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),D.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},P(B.prototype,_),B}),r(nt,[],function(){var e={},t="en";return{setCode:function(e){e&&(t=e,this.rtl=this.data[e]?"rtl"===this.data[e]._dir:!1)},getCode:function(){return t},rtl:!1,add:function(t,n){var r=e[t];r||(e[t]=r={});for(var i in n)r[i]=n[i];this.setCode(t)},translate:function(n){var r;if(r=e[t],r||(r={}),"undefined"==typeof n)return n;if("string"!=typeof n&&n.raw)return n.raw;if(n.push){var i=n.slice(1);n=(r[n[0]]||n[0]).replace(/\{([0-9]+)\}/g,function(e,t){return i[t]})}return(r[n]||n).replace(/{context:\w+}$/,"")},data:e}}),r(rt,[w,u,d],function(e,t,n){function r(e){function l(){try{return document.activeElement}catch(e){return document.body}}function c(e,t){if(t&&t.startContainer){if(!e.isChildOf(t.startContainer,e.getRoot())||!e.isChildOf(t.endContainer,e.getRoot()))return;return{startContainer:t.startContainer, startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset}}return t}function u(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function d(e){return!!s.getParent(e,r.isEditorUIElement)}function f(r){var f=r.editor;f.on("init",function(){(f.inline||n.ie)&&("onbeforedeactivate"in document&&n.ie<9?f.dom.bind(f.getBody(),"beforedeactivate",function(e){if(e.target==f.getBody())try{f.lastRng=f.selection.getRng()}catch(t){}}):f.on("nodechange mouseup keyup",function(e){var t=l();"nodechange"==e.type&&e.selectionChange||(t&&t.id==f.id+"_ifr"&&(t=f.getBody()),f.dom.isChildOf(t,f.getBody())&&(f.lastRng=f.selection.getRng()))}),n.webkit&&!i&&(i=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(f.lastRng=n)}},s.bind(document,"selectionchange",i)))}),f.on("setcontent",function(){f.lastRng=null}),f.on("mousedown",function(){f.selection.lastFocusBookmark=null}),f.on("focusin",function(){var t=e.focusedEditor,n;f.selection.lastFocusBookmark&&(n=u(f,f.selection.lastFocusBookmark),f.selection.lastFocusBookmark=null,f.selection.setRng(n)),t!=f&&(t&&t.fire("blur",{focusedEditor:f}),e.setActive(f),e.focusedEditor=f,f.fire("focus",{blurredEditor:t}),f.focus(!0)),f.lastRng=null}),f.on("focusout",function(){t.setEditorTimeout(f,function(){var t=e.focusedEditor;d(l())||t!=f||(f.fire("blur",{focusedEditor:null}),e.focusedEditor=null,f.selection&&(f.selection.lastFocusBookmark=null))})}),o||(o=function(t){var n=e.activeEditor,r;r=t.target,n&&r.ownerDocument==document&&(n.selection&&r!=n.getBody()&&(n.selection.lastFocusBookmark=c(n.dom,n.lastRng)),r==document.body||d(r)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},s.bind(document,"focusin",o)),f.inline&&!a&&(a=function(t){var n=e.activeEditor,r=n.dom;if(n.inline&&r&&!r.isChildOf(t.target,n.getBody())){var i=n.selection.getRng();i.collapsed||(n.lastRng=i)}},s.bind(document,"mouseup",a))}function h(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(s.unbind(document,"selectionchange",i),s.unbind(document,"focusin",o),s.unbind(document,"mouseup",a),i=o=a=null)}e.on("AddEditor",f),e.on("RemoveEditor",h)}var i,o,a,s=e.DOM;return r.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},r}),r(it,[tt,g,w,ae,d,m,c,ue,nt,rt],function(e,t,n,r,i,o,a,s,l,c){function u(e){g(C.editors,function(t){"scroll"===e.type?t.fire("ScrollWindow",e):t.fire("ResizeWindow",e)})}function d(e,n){n!==x&&(n?t(window).on("resize scroll",u):t(window).off("resize scroll",u),x=n)}function f(e){var t=C.editors,n;delete t[e.id];for(var r=0;r<t.length;r++)if(t[r]==e){t.splice(r,1),n=!0;break}return C.activeEditor==e&&(C.activeEditor=t[0]),C.focusedEditor==e&&(C.focusedEditor=null),n}function h(e){return e&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(f(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null),e}var p=n.DOM,m=o.explode,g=o.each,v=o.extend,y=0,b,C,x=!1;return C={$:t,majorVersion:"4",minorVersion:"4.3",releaseDate:"2016-09-01",editors:[],i18n:l,activeEditor:null,setup:function(){var e=this,t,n,i="",o,a;if(n=r.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/")),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else{for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){a=s[l].src;var u=a.substring(a.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(a)){-1!=u.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/"));break}}!t&&document.currentScript&&(a=document.currentScript.src,-1!=a.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/")))}e.baseURL=new r(n).toAbsolute(t),e.documentBaseURL=n,e.baseURI=new r(e.baseURL),e.suffix=i,e.focusManager=new c(e)},overrideDefaults:function(e){var t,n;t=e.base_url,t&&(this.baseURL=new r(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new r(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n),this.defaultSettings=e},init:function(n){function r(e,t){return e.inline&&t.tagName.toLowerCase()in C}function i(e,t){window.console&&!window.test&&window.console.log(e,t)}function s(e){var t=e.id;return t||(t=e.name,t=t&&!p.get(t)?e.name:p.uniqueId(),e.setAttribute("id",t)),t}function l(e){var t=n[e];if(t)return t.apply(f,Array.prototype.slice.call(arguments,2))}function c(e,t){return t.constructor===RegExp?t.test(e.className):p.hasClass(e,t)}function u(e){var t,n=[];if(e.types)return g(e.types,function(e){n=n.concat(p.select(e.selector))}),n;if(e.selector)return p.select(e.selector);if(e.target)return[e.target];switch(e.mode){case"exact":t=e.elements||"",t.length>0&&g(m(t),function(e){var t;(t=p.get(e))?n.push(t):g(document.forms,function(t){g(t.elements,function(t){t.name===e&&(e="mce_editor_"+y++,p.setAttrib(t,"id",e),n.push(t))})})});break;case"textareas":case"specific_textareas":g(p.select("textarea"),function(t){e.editor_deselector&&c(t,e.editor_deselector)||e.editor_selector&&!c(t,e.editor_selector)||n.push(t)})}return n}function d(){function a(t,n,r){var i=new e(t,n,f);m.push(i),i.on("init",function(){++c===y.length&&x(m)}),i.targetElm=i.targetElm||r,i.render()}var c=0,m=[],y;return p.unbind(window,"ready",d),l("onpageload"),y=t.unique(u(n)),n.types?void g(n.types,function(e){o.each(y,function(t){return p.is(t,e.selector)?(a(s(t),v({},n,e),t),!1):!0})}):(o.each(y,function(e){h(f.get(e.id))}),y=o.grep(y,function(e){return!f.get(e.id)}),void g(y,function(e){r(n,e)?i("Could not initialize inline editor on invalid inline target element",e):a(s(e),n,e)}))}var f=this,b,C;C=o.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var x=function(e){b=e};return f.settings=n,p.bind(window,"ready",d),new a(function(e){b?e(b):x=function(t){e(t)}})},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),d(n,!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),b||(b=function(){t.fire("BeforeUnload")},p.bind(window,"beforeunload",b)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void g(p.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(f(i)&&t.fire("RemoveEditor",{editor:i}),r.length||p.unbind(window,"beforeunload",b),i.remove(),d(r,r.length>0),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){g(this.editors,function(e){e.save()})},addI18n:function(e,t){l.add(e,t)},translate:function(e){return l.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},v(C,s),C.setup(),window.tinymce=window.tinyMCE=C,C}),r(ot,[it,m],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(n,r){"html4"===t.settings.schema&&e(r,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(at,[ue,m],function(e,t){var n={send:function(e){function r(){!e.async||4==i.readyState||o++>1e4?(e.success&&1e4>o&&200==i.status?e.success.call(e.success_scope,""+i.responseText,i,e):e.error&&e.error.call(e.error_scope,o>1e4?"TIMED_OUT":"GENERAL",i,e),i=null):setTimeout(r,10)}var i,o=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async!==!1,e.data=e.data||"",n.fire("beforeInitialize",{settings:e}),i=new XMLHttpRequest){if(i.overrideMimeType&&i.overrideMimeType(e.content_type),i.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(i.withCredentials=!0),e.content_type&&i.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&t.each(e.requestheaders,function(e){i.setRequestHeader(e.key,e.value)}),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i=n.fire("beforeSend",{xhr:i,settings:e}).xhr,i.send(e.data),!e.async)return r();setTimeout(r,10)}}};return t.extend(n,e),n}),r(st,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r<t.length;r++)i+=(r>0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(lt,[st,at,m],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(ct,[w],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(ut,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(dt,[w,f,N,E,m,d],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(ft,[se,m],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t=this,n=t.settings,r,i,o,a;r=n.firstControlClass,i=n.lastControlClass,e.each(function(e){e.classes.remove(r).remove(i).add(n.controlClass),e.visible()&&(o||(o=e),a=e)}),o&&o.classes.add(r),a&&a.classes.add(i)},renderHtml:function(e){var t=this,n="";return t.applyClasses(e.items()),e.items().each(function(e){n+=e.renderHtml()}),n},recalc:function(){},postRender:function(){},isNative:function(){return!1}})}),r(ht,[ft],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}})}),r(pt,[De],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t._super(e),e=t.settings,n=t.settings.size,t.on("click mousedown",function(e){e.preventDefault()}),t.on("touchstart",function(e){t.fire("click",e),e.preventDefault()}),e.subtype&&t.classes.add(e.subtype),n&&t.classes.add("btn-"+n),e.icon&&t.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e=this.getEl().firstChild,t;e&&(t=e.style,t.width=t.height="100%"),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("icon"),i,o=e.state.get("text"),a="";return i=e.settings.image,i?(r="none","string"!=typeof i&&(i=window.getSelection?i[0]:i[1]),i=" style=\"background-image: url('"+i+"')\""):i="",o&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(o)+"</span>"),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'<div id="'+t+'" class="'+e.classes+'" tabindex="-1" aria-labelledby="'+t+'"><button role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+i+"></i>":"")+a+"</button></div>"},bindStates:function(){function e(e){var i=n("span."+r,t.getEl());e?(i[0]||(n("button:first",t.getEl()).append('<span class="'+r+'"></span>'),i=n("span."+r,t.getEl())),i.html(t.encode(e))):i.remove(),t.classes.toggle("btn-has-text",!!e)}var t=this,n=t.$,r=t.classPrefix+"txt";return t.state.on("change:text",function(t){e(t.value)}),t.state.on("change:icon",function(n){var r=n.value,i=t.classPrefix;t.settings.icon=r,r=r?i+"ico "+i+"i-"+t.settings.icon:"";var o=t.getEl().firstChild,a=o.getElementsByTagName("i")[0];r?(a&&a==o.firstChild||(a=document.createElement("i"),o.insertBefore(a,o.firstChild)),a.className=r):a&&o.removeChild(a),e(t.state.get("text"))}),t._super()}})}),r(mt,[xe],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(gt,[De],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'" unselectable="on" aria-labelledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'label">'+e.encode(e.state.get("text"))+"</span></div>"},bindStates:function(){function e(e){t.classes.toggle("checked",e),t.aria("checked",e)}var t=this;return t.state.on("change:text",function(e){t.getEl("al").firstChild.data=t.translate(e.value)}),t.state.on("change:checked change:value",function(n){t.fire("change"),e(n.value)}),t.state.on("change:icon",function(e){var n=e.value,r=t.classPrefix;if("undefined"==typeof n)return t.settings.icon;t.settings.icon=n,n=n?r+"ico "+r+"i-"+t.settings.icon:"";var i=t.getEl().firstChild,o=i.getElementsByTagName("i")[0];n?(o&&o==i.firstChild||(o=document.createElement("i"),i.insertBefore(o,i.firstChild)),o.className=n):o&&i.removeChild(o)}),t.state.get("checked")&&e(!0),t._super()}})}),r(vt,[De,be,pe,g],function(e,t,n,r){return e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.classes.add("combobox"),t.subinput=!0,t.ariaTarget="inp",e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){var i=n.target,o=t.getEl();if(r.contains(o,i)||i==o)for(;i&&i!=o;)i.id&&-1!=i.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),i=i.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){var r=t.state.get("value"),i=t.getEl("inp").value;return e.preventDefault(),t.state.set("value",i),r!=i&&t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),t.on("keyup",function(e){"INPUT"==e.target.nodeName&&t.state.set("value",e.target.value)})},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),i=e.getEl("open"),o=e.layoutRect(),a,s;a=i?o.w-n.getSize(i).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(s=e.layoutRect().h-2+"px"),r(t.firstChild).css({width:a,lineHeight:s}),e._super(),e},postRender:function(){var e=this;return r(this.getEl("inp")).on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)}),e._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=e.state.get("value")||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e.state.get("text"),(o||a)&&(s='<div id="'+t+'-open" class="'+r+"btn "+r+'open" tabIndex="-1" role="button"><button id="'+t+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!=o?'<i class="'+o+'"></i>':'<i class="'+r+'caret"></i>')+(a?(o?" ":"")+a:"")+"</button></div>",e.classes.add("has-open")),'<div id="'+t+'" class="'+e.classes+'"><input id="'+t+'-inp" class="'+r+'textbox" value="'+e.encode(i,!1)+'" hidefocus="1"'+l+' placeholder="'+e.encode(n.placeholder)+'" />'+s+"</div>"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl("inp").value!=t.value&&(e.getEl("inp").value=t.value)}),e.state.on("change:disabled",function(t){e.getEl("inp").disabled=t.value}),e._super()},remove:function(){r(this.getEl("inp")).off(),this._super()}})}),r(yt,[vt],function(e){return e.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl().getElementsByTagName("i")[0];if(t)try{t.style.background=e}catch(n){}},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.state.get("rendered")&&e.repaintColor(t.value)}),e._super()}})}),r(bt,[pt,ke],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),r(Ct,[bt,w],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("text"),i=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",a="";return r&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(r)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(i?'<i class="'+i+'"'+o+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+a+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(xt,[],function(){function e(e){function i(e,i,o){var a,s,l,c,u,d;return a=0,s=0,l=0,e/=255,i/=255,o/=255,u=t(e,t(i,o)),d=n(e,n(i,o)),u==d?(l=u,{h:0,s:0,v:100*l}):(c=e==u?i-o:o==u?e-i:o-e,a=e==u?3:o==u?1:5,a=60*(a-c/(d-u)),s=(d-u)/d,l=d,{h:r(a),s:r(100*s),v:r(100*l)})}function o(e,i,o){var a,s,l,c;if(e=(parseInt(e,10)||0)%360,i=parseInt(i,10)/100,o=parseInt(o,10)/100,i=n(0,t(i,1)),o=n(0,t(o,1)),0===i)return void(d=f=h=r(255*o));switch(a=e/60,s=o*i,l=s*(1-Math.abs(a%2-1)),c=o-s,Math.floor(a)){case 0:d=s,f=l,h=0;break;case 1:d=l,f=s,h=0;break;case 2:d=0,f=s,h=l;break;case 3:d=0,f=l,h=s;break;case 4:d=l,f=0,h=s;break;case 5:d=s,f=0,h=l;break;default:d=f=h=0}d=r(255*(d+c)),f=r(255*(f+c)),h=r(255*(h+c))}function a(){function e(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+e(d)+e(f)+e(h)}function s(){return{r:d,g:f,b:h}}function l(){return i(d,f,h)}function c(e){var t;return"object"==typeof e?"r"in e?(d=e.r,f=e.g,h=e.b):"v"in e&&o(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(d=parseInt(t[1],10),f=parseInt(t[2],10),h=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(d=parseInt(t[1],16),f=parseInt(t[2],16),h=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(d=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16),h=parseInt(t[3]+t[3],16)),d=0>d?0:d>255?255:d,f=0>f?0:f>255?255:f,h=0>h?0:h>255?255:h,u}var u=this,d=0,f=0,h=0;e&&c(e),u.toRgb=s,u.toHsv=l,u.toHex=a,u.parse=c}var t=Math.min,n=Math.max,r=Math.round;return e}),r(wt,[De,we,pe,xt],function(e,t,n,r){return e.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){function e(e,t){var r=n.getPos(e),i,o;return i=t.pageX-r.x,o=t.pageY-r.y,i=Math.max(0,Math.min(i/e.clientWidth,1)),o=Math.max(0,Math.min(o/e.clientHeight,1)),{x:i,y:o}}function i(e,t){var i=(360-e.h)/360;n.css(d,{top:100*i+"%"}),t||n.css(h,{left:e.s+"%",top:100-e.v+"%"}),f.style.background=new r({s:100,v:100,h:e.h}).toHex(),s.color().parse({s:e.s,v:e.v,h:e.h})}function o(t){var n;n=e(f,t),c.s=100*n.x,c.v=100*(1-n.y),i(c),s.fire("change")}function a(t){var n;n=e(u,t),c=l.toHsv(),c.h=360*(1-n.y),i(c,!0),s.fire("change")}var s=this,l=s.color(),c,u,d,f,h;u=s.getEl("h"),d=s.getEl("hp"),f=s.getEl("sv"),h=s.getEl("svp"),s._repaint=function(){c=l.toHsv(),i(c)},s._super(),s._svdraghelper=new t(s._id+"-sv",{start:o,drag:o}),s._hdraghelper=new t(s._id+"-h",{start:a,drag:a}),s._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;return arguments.length?(t.color().parse(e),void(t._rendered&&t._repaint())):t.color().toHex()},color:function(){return this._color||(this._color=new r),this._color},renderHtml:function(){function e(){var e,t,n="",i,a;for(i="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",a=o.split(","),e=0,t=a.length-1;t>e;e++)n+='<div class="'+r+'colorpicker-h-chunk" style="height:'+100/t+"%;"+i+a[e]+",endColorstr="+a[e+1]+");-ms-"+i+a[e]+",endColorstr="+a[e+1]+')"></div>';return n}var t=this,n=t._id,r=t.classPrefix,i,o="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",a="background: -ms-linear-gradient(top,"+o+");background: linear-gradient(to bottom,"+o+");";return i='<div id="'+n+'-h" class="'+r+'colorpicker-h" style="'+a+'">'+e()+'<div id="'+n+'-hp" class="'+r+'colorpicker-h-marker"></div></div>','<div id="'+n+'" class="'+t.classes+'"><div id="'+n+'-sv" class="'+r+'colorpicker-sv"><div class="'+r+'colorpicker-overlay1"><div class="'+r+'colorpicker-overlay2"><div id="'+n+'-svp" class="'+r+'colorpicker-selector1"><div class="'+r+'colorpicker-selector2"></div></div></div></div></div>'+i+"</div>"}})}),r(Nt,[De],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.classes.add("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.row()[n],index:n})}),t.row(t.settings.row)},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){var e=this;return'<div id="'+e._id+'" class="'+e.classes+'">'+e._getDataPathHtml(e.state.get("row"))+"</div>"},bindStates:function(){var e=this;return e.state.on("change:row",function(t){e.innerHtml(e._getDataPathHtml(t.value))}),e._super()},_getDataPathHtml:function(e){var t=this,n=e||[],r,i,o="",a=t.classPrefix;for(r=0,i=n.length;i>r;r++)o+=(r>0?'<div class="'+a+'divider" aria-hidden="true"> '+t.settings.delimiter+" </div>":"")+'<div role="button" class="'+a+"path-item"+(r==i-1?" "+a+"last":"")+'" data-index="'+r+'" tabindex="-1" id="'+t._id+"-"+r+'" aria-level="'+r+'">'+n[r].name+"</div>";return o||(o='<div class="'+a+'path-item">\xa0</div>'),o}})}),r(Et,[Nt],function(e){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var t=this,n=t.settings.editor;return n.settings.elementpath!==!1&&(t.on("select",function(e){n.focus(),n.selection.select(this.row()[e.index].element),n.nodeChanged()}),n.on("nodeChange",function(r){for(var i=[],o=r.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=n.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});if(s.isDefaultPrevented()||i.push({name:s.name,element:o[a]}),s.isPropagationStopped())break}t.row(i)})),t._super()}})}),r(_t,[xe],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(St,[xe,_t,m],function(e,t,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,r=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),r.each(function(r){var i,o=r.settings.label;o&&(i=new t(n.extend({items:{type:"label",id:r._id+"-l",text:o,flex:0,forId:r._id,disabled:r.disabled()}},e.settings.formItemDefaults)),i.type="formitem",r.aria("labelledby",r._id+"-l"),"undefined"==typeof r.settings.flex&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.fromJSON(e.settings.data)},bindStates:function(){function e(){var e=0,n=[],r,i,o;if(t.settings.labelGapCalc!==!1)for(o="children"==t.settings.labelGapCalc?t.find("formitem"):t.items(),o.filter("formitem").each(function(t){var r=t.items()[0],i=r.getEl().clientWidth;e=i>e?i:e,n.push(r)}),i=t.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=e+i}var t=this;t._super(),t.on("show",e),e()}})}),r(kt,[St],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}})}),r(Tt,[vt,m],function(e,t){return e.extend({init:function(e){var n=this,r=tinymce.activeEditor,i=r.settings,o,a,s;e.spellcheck=!1,s=i.file_picker_types||i.file_browser_callback_types,s&&(s=t.makeMap(s,/[, ]/)),s&&!s[e.filetype]||(a=i.file_picker_callback,!a||s&&!s[e.filetype]?(a=i.file_browser_callback,!a||s&&!s[e.filetype]||(o=function(){a(n.getEl("inp").id,n.value(),e.filetype,window)})):o=function(){var i=n.fire("beforecall").meta;i=t.extend({filetype:e.filetype},i),a.call(r,function(e,t){n.value(e).fire("change",{meta:t})},n.value(),i)}),o&&(e.icon="browse",e.onaction=o),n._super(e)}})}),r(Rt,[ht],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(At,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v=[],y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F,z=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e.paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,"row-reversed"!=f&&"column-reverse"!=f||(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(S="y",E="h",_="minH",k="maxH",R="innerH",T="top",A="deltaH",B="contentH",O="left",M="w",D="x",L="innerW", P="minW",H="right",I="deltaW",F="contentW"):(S="x",E="w",_="minW",k="maxW",R="innerW",T="left",A="deltaW",B="contentW",O="top",M="h",D="y",L="innerH",P="minH",H="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],N=u=0,t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),m=h.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,p[k]&&v.push(h),p.flex=g),d-=p[_],y=o[O]+p[P]+o[H],y>N&&(N=y);if(x={},0>d?x[_]=i[_]-d+i[A]:x[_]=i[R]-d+i[A],x[P]=N+i[I],x[B]=i[R]-d,x[F]=N,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)h=v[t],p=h.layoutRect(),b=p[k],y=p[_]+p.flex*C,y>b?(d-=p[k]-p[_],u-=p.flex,p.flex=0,p.maxFlexSize=b):p.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[D]=o[O],t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),y=p.maxFlexSize||p[_],"center"===s?x[D]=Math.round(i[L]/2-p[M]/2):"stretch"===s?(x[M]=z(p[P]||0,i[L]-o[O]-o[H]),x[D]=o[O]):"end"===s&&(x[D]=i[L]-p[M]-o.top),p.flex>0&&(y+=p.flex*C),x[E]=y,x[S]=w,h.layoutRect(x),h.recalc&&h.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var W=e.parent();W&&(W._lastRect=null,W.recalc())}}})}),r(Bt,[ft],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}})}),r(Dt,[ye,De,ke,m,w,it,d],function(e,t,n,r,i,o,a){function s(e){e.settings.ui_container&&(a.container=i.DOM.select(e.settings.ui_container)[0])}function l(t){t.on("ScriptsLoaded",function(){t.rtl&&(e.rtl=!0)})}function c(e){function t(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;u(i.parents,function(e){return u(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function r(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function i(){function t(e){var n=[];if(e)return u(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=t(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a,o.cmd=e.cmd}n.push(o)}),n}function n(){var n;return n=t(e.settings.style_formats_merge?e.settings.style_formats?o.concat(e.settings.style_formats):o:e.settings.style_formats||o)}var r=0,i=[],o=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){u(i,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:n(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?e.formatter.getCssText(this.settings.format):void 0},onPostRender:function(){var t=this;t.parent().on("show",function(){var n,r;n=t.settings.format,n&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),r=t.settings.cmd,r&&t.active(e.queryCommandState(r))})},onclick:function(){this.settings.format&&l(this.settings.format),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}function o(t){return function(){var n=this;e.formatter?e.formatter.formatChanged(t,function(e){n.active(e)}):e.on("init",function(){e.formatter.formatChanged(t,function(e){n.active(e)})})}}function a(t){return function(){function n(){return e.undoManager?e.undoManager[t]():!1}var r=this;t="redo"==t?"hasRedo":"hasUndo",r.disabled(!n()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){r.disabled(e.readonly||!n())})}}function s(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function l(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var c;c=i(),u({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:o(n),onclick:function(){l(n)}})}),u({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),u({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:o(n)})}),e.addButton("undo",{tooltip:"Undo",onPostRender:a("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:a("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:s,cmd:"mceToggleVisualAid"}),e.addButton("remove",{tooltip:"Remove",icon:"remove",cmd:"Delete"}),u({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return u(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return u(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return u(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var u=r.each;o.on("AddEditor",function(e){var t=e.editor;l(t),c(t),s(t)}),e.translate=function(e){return o.translate(e)},t.tooltips=!a.iOS}),r(Lt,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E=[],_=[],S,k,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e.paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)_.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),S=c.minW,k=c.minH,E[d]=S>E[d]?S:E[d],_[f]=k>_[f]?k:_[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,N=0,f=0;n>f;f++)N+=_[f]+(f>0?b:0),R-=(f>0?b:0)+_[f];if(w+=g.left+g.right,N+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=N+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var D;D="start"==t.packV?0:R>0?Math.floor(R/n):0;var L=0,M=t.flexWidths;if(M)for(d=0;d<M.length;d++)L+=M[d];else L=r;var P=T/L;for(d=0;r>d;d++)E[d]+=M?M[d]*P:P;for(p=g.top,f=0;n>f;f++){for(h=g.left,s=_[f]+D,d=0;r>d&&(B=A?f*r+r-1-d:f*r+d,u=i[B],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(E[d],c.startMinWidth),c.x=h,c.y=p,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=h+a/2-c.w/2:"right"==v?c.x=h+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=p+s/2-c.h/2:"bottom"==v?c.y=p+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),h+=a+y,u.recalc&&u.recalc();p+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var O=e.parent();O&&(O._lastRect=null,O.recalc())}}})}),r(Mt,[De,u],function(e,t){return e.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,n){var r=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,n&&n()):t.setTimeout(function(){r.html(e)}),this}})}),r(Pt,[De],function(e){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("infobox"),t.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+e.encode(e.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+t+"ico "+t+'i-help"></i></button></div></div>'},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl("body").firstChild.data=e.encode(t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e.state.on("change:help",function(t){e.classes.toggle("has-help",t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ot,[De,pe],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.classes.add("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e=this,t,n,r=e.settings.forId;return!r&&(n=e.settings.forName)&&(t=e.getRoot().find("#"+n)[0],t&&(r=t._id)),r?'<label id="'+e._id+'" class="'+e.classes+'"'+(r?' for="'+r+'"':"")+">"+e.encode(e.state.get("text"))+"</label>":'<span id="'+e._id+'" class="'+e.classes+'">'+e.encode(e.state.get("text"))+"</span>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.innerHtml(e.encode(t.value)),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ht,[xe],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.classes.add("toolbar")},postRender:function(){var e=this;return e.items().each(function(e){e.classes.add("toolbar-item")}),e._super()}})}),r(It,[Ht],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(Ft,[pt,be,It],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(){var e=this,n;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(n=e.state.get("menu")||[],n.length?n={type:"menu",items:n}:n.type=n.type||"menu",n.renderTo?e.menu=n.parent(e).show().renderTo():e.menu=t.create(n).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon,o,a=e.state.get("text"),s="";return o=e.settings.image,o?(i="none","string"!=typeof o&&(o=window.getSelection?o[0]:o[1]),o=" style=\"background-image: url('"+o+"')\""):o="",a&&(e.classes.add("btn-has-text"),s='<span class="'+r+'txt">'+e.encode(a)+"</span>"),i=e.settings.icon?r+"ico "+r+"i-"+i:"",e.aria("role",e.parent()instanceof n?"menuitem":"button"),'<div id="'+t+'" class="'+e.classes+'" tabindex="-1" aria-labelledby="'+t+'"><button id="'+t+'-open" role="presentation" type="button" tabindex="-1">'+(i?'<i class="'+i+'"'+o+"></i>":"")+s+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});return i}),r(zt,[De,be,d,u],function(e,t,n,r){return e.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t=this,n;t._super(e),e=t.settings,t.classes.add("menu-item"),e.menu&&t.classes.add("menu-item-expand"),e.preview&&t.classes.add("menu-item-preview"),n=t.state.get("text"),"-"!==n&&"|"!==n||(t.classes.add("menu-item-sep"),t.aria("role","separator"),t.state.set("text","-")),e.selectable&&(t.aria("role","menuitemcheckbox"),t.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||t.classes.add("menu-item-normal"),t.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&t.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r,i=e.parent();if(i.items().each(function(t){t!==e&&t.hideMenu()}),n.menu){r=e.menu,r?r.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",i.settings.itemDefaults&&(r.itemDefaults=i.settings.itemDefaults),r=e.menu=t.create(r).parent(e).renderTo(),r.reflow(),r.on("cancel",function(t){t.stopPropagation(),e.focus(),r.hide()}),r.on("show hide",function(e){e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),r.on("hide",function(t){t.control===r&&e.classes.remove("selected")}),r.submenu=!0),r._parentMenu=i,r.classes.add("menu-sub");var o=r.testMoveRel(e.getEl(),e.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);r.moveRel(e.getEl(),o),r.rel=o,o="menu-sub-"+o,r.classes.remove(r._lastRel).add(o),r._lastRel=o,e.classes.add("selected"),e.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){function e(e){var t,r,i={};for(i=n.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)r=i[e[t].toLowerCase()],r&&(e[t]=r);return e.join("+")}var t=this,r=t._id,i=t.settings,o=t.classPrefix,a=t.encode(t.state.get("text")),s=t.settings.icon,l="",c=i.shortcut;return s&&t.parent().classes.add("menu-has-icons"),i.image&&(l=" style=\"background-image: url('"+i.image+"')\""),c&&(c=e(c)),s=o+"ico "+o+"i-"+(t.settings.icon||"none"),'<div id="'+r+'" class="'+t.classes+'" tabindex="-1">'+("-"!==a?'<i class="'+s+'"'+l+"></i>\xa0":"")+("-"!==a?'<span id="'+r+'-text" class="'+o+'text">'+a+"</span>":"")+(c?'<div id="'+r+'-shortcut" class="'+o+'menu-shortcut">'+c+"</div>":"")+(i.menu?'<div class="'+o+'caret"></div>':"")+"</div>"},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var i=e.getEl("text");i&&i.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),r.requestAnimationFrame(function(){e.parent().hideAll()})))}),e._super(),e},hover:function(){var e=this;return e.parent().items().each(function(e){e.classes.remove("selected")}),e.classes.toggle("selected",!0),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ut,[g,ye,u],function(e,t,n){return function(r,i){var o=this,a,s=t.classPrefix,l;o.show=function(t,c){function u(){a&&(e(r).append('<div class="'+s+"throbber"+(i?" "+s+"throbber-inline":"")+'"></div>'),c&&c())}return o.hide(),a=!0,t?l=n.setTimeout(u,t):u(),o},o.hide=function(){var e=r.lastChild;return n.clearTimeout(l),e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),a=!1,o}}}),r(Wt,[ke,zt,Ut,m],function(e,t,n,r){return e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var n=e.items,i=n.length;i--;)n[i]=r.extend({},e.itemDefaults,n[i]);t._super(e),t.classes.add("menu")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},load:function(){function e(){t.throbber&&(t.throbber.hide(),t.throbber=null)}var t=this,r,i;i=t.settings.itemsFactory,i&&(t.throbber||(t.throbber=new n(t.getEl("body"),!0),0===t.items().length?(t.throbber.show(),t.fire("loading")):t.throbber.show(100,function(){t.items().remove(),t.fire("loading")}),t.on("hide close",e)),t.requestTime=r=(new Date).getTime(),t.settings.itemsFactory(function(n){return 0===n.length?void t.hide():void(t.requestTime===r&&(t.getEl().style.width="",t.getEl("body").style.width="",e(),t.items().remove(),t.getEl("body").innerHTML="",t.add(n),t.renderNew(),t.fire("loaded")))}))},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.image||n.selectable?(e._hasIcons=!0,!1):void 0}),e.settings.itemsFactory&&e.on("postrender",function(){e.settings.itemsFactory&&e.load()}),e._super()}})}),r(Vt,[Ft,Wt],function(e,t){return e.extend({init:function(e){function t(r){for(var a=0;a<r.length;a++){if(i=r[a].selected||e.value===r[a].value)return o=o||r[a].text,n.state.set("value",r[a].value),!0;if(r[a].menu&&t(r[a].menu))return!0}}var n=this,r,i,o,a;n._super(e),e=n.settings,n._values=r=e.values,r&&("undefined"!=typeof e.value&&t(r),!i&&r.length>0&&(o=r[0].text,n.state.set("value",r[0].value)),n.state.set("menu",r)),n.state.set("text",e.text||o),n.classes.add("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.value()),a=r})},bindStates:function(){function e(e,n){e instanceof t&&e.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}function n(e,t){var r;if(e)for(var i=0;i<e.length;i++){if(e[i].value===t)return e[i];if(e[i].menu&&(r=n(e[i].menu,t)))return r}}var r=this;return r.on("show",function(t){e(t.control,r.value())}),r.state.on("change:value",function(e){var t=n(r.state.get("menu"),e.value);t?r.text(t.text):r.text(r.settings.text)}),r._super()}})}),r($t,[gt],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(qt,[De,we],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"==e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(jt,[De],function(e){function t(e){var t="";if(e)for(var n=0;n<e.length;n++)t+='<option value="'+e[n]+'">'+e[n]+"</option>";return t}return e.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var t=this;t._super(e),t.settings.size&&(t.size=t.settings.size),t.settings.options&&(t._options=t.settings.options),t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e=this,n,r="";return n=t(e._options),e.size&&(r=' size = "'+e.size+'"'),'<select id="'+e._id+'" class="'+e.classes+'"'+r+">"+n+"</select>"},bindStates:function(){var e=this;return e.state.on("change:options",function(n){e.getEl().innerHTML=t(n.value)}),e._super()}})}),r(Yt,[De,we,pe],function(e,t,n){function r(e,t,n){return t>e&&(e=t),e>n&&(e=n),e}function i(e,t,n){e.setAttribute("aria-"+t,n)}function o(e,t){var r,o,a,s,l,c;"v"==e.settings.orientation?(s="top",a="height",o="h"):(s="left",a="width",o="w"),c=e.getEl("handle"),r=(e.layoutRect()[o]||100)-n.getSize(c)[a],l=r*((t-e._minValue)/(e._maxValue-e._minValue))+"px",c.style[s]=l,c.style.height=e.layoutRect().h+"px",i(c,"valuenow",t),i(c,"valuetext",""+e.settings.previewFilter(t)),i(c,"valuemin",e._minValue),i(c,"valuemax",e._maxValue)}return e.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"==e.orientation&&t.classes.add("vertical"),t._minValue=e.minValue||0,t._maxValue=e.maxValue||100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'"><div id="'+t+'-handle" class="'+n+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){function e(e,t,n){return(n+e)/(t-e)}function i(e,t,n){return n*(t-e)-e}function o(t,n){function o(o){var a;a=s.value(),a=i(t,n,e(t,n,a)+.05*o),a=r(a,t,n),s.value(a),s.fire("dragstart",{value:a}),s.fire("drag",{value:a}),s.fire("dragend",{value:a})}s.on("keydown",function(e){switch(e.keyCode){case 37:case 38:o(-1);break;case 39:case 40:o(1)}})}function a(e,i,o){var a,l,c,p,m;s._dragHelper=new t(s._id,{handle:s._id+"-handle",start:function(e){a=e[u],l=parseInt(s.getEl("handle").style[d],10),c=(s.layoutRect()[h]||100)-n.getSize(o)[f],s.fire("dragstart",{value:m})},drag:function(t){var n=t[u]-a;p=r(l+n,0,c),o.style[d]=p+"px",m=e+p/c*(i-e),s.value(m),s.tooltip().text(""+s.settings.previewFilter(m)).show().moveRel(o,"bc tc"),s.fire("drag",{value:m})},stop:function(){s.tooltip().hide(),s.fire("dragend",{value:m})}})}var s=this,l,c,u,d,f,h;l=s._minValue,c=s._maxValue,"v"==s.settings.orientation?(u="screenY",d="top",f="height",h="h"):(u="screenX",d="left",f="width",h="w"),s._super(),o(l,c,s.getEl("handle")),a(l,c,s.getEl("handle"))},repaint:function(){this._super(),o(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){o(e,t.value)}),e._super()}})}),r(Xt,[De],function(e){return e.extend({renderHtml:function(){var e=this;return e.classes.add("spacer"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"></div>'}})}),r(Kt,[Ft,pe,g],function(e,t,n){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,r=e.getEl(),i=e.layoutRect(),o,a;return e._super(),o=r.firstChild,a=r.lastChild,n(o).css({width:i.w-t.getSize(a).width,height:i.h-2}),n(a).css({height:i.h-2}),e},activeMenu:function(e){var t=this;n(t.getEl().lastChild).toggleClass(t.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r,i=e.state.get("icon"),o=e.state.get("text"),a="";return r=e.settings.image,r?(i="none","string"!=typeof r&&(r=window.getSelection?r[0]:r[1]),r=" style=\"background-image: url('"+r+"')\""):r="",i=e.settings.icon?n+"ico "+n+"i-"+i:"",o&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(o)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(i?'<i class="'+i+'"'+r+"></i>":"")+a+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1">'+(e._menuBtnText?(i?"\xa0":"")+e._menuBtnText:"")+' <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void(t&&t.call(this,e));n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Gt,[Bt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}})}),r(Jt,[Ee,g,pe],function(e,t,n){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t(n).removeClass(this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t(n).addClass(this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='<div id="'+o+'" class="'+r+'tab" unselectable="on" role="tab" aria-controls="'+t._id+'" aria-selected="false" tabIndex="-1">'+e.encode(t.settings.title)+"</div>"}),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1"><div id="'+e._id+'-head" class="'+r+'tabs" role="tablist">'+n+'</div><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,t,r,i;r=n.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=n.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,t=e._super(),t.deltaH+=o,t.innerH=t.h-t.deltaH,t}})}),r(Qt,[De,m,pe],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("textbox"),e.multiline?t.classes.add("multiline"):(t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))}),t.on("keyup",function(e){t.state.set("value",e.target.value)}))},repaint:function(){var e=this,t,n,r,i,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e.borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,r=e.settings,i,o;return i={id:e._id,hidefocus:"1"},t.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){i[e]=r[e]}),e.disabled()&&(i.disabled="disabled"),r.subtype&&(i.type=r.subtype),o=n.create(r.multiline?"textarea":"input",i),o.value=e.state.get("value"),o.className=e.classes,o.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e.getEl().value=e.state.get("value"),e._super(),e.$el.on("change",function(t){ e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!=t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.value}),e._super()},remove:function(){this.$el.off(),this._super()}})}),r(Zt,[],function(){var e=this||window,t=function(){return e.tinymce};return"function"==typeof e.define&&(e.define.amd||e.define("ephox/tinymce",[],t)),{}}),a([l,c,u,d,f,h,m,g,v,y,C,w,N,E,T,A,B,D,L,M,P,O,I,F,j,Y,J,Q,oe,ae,se,le,ue,fe,he,ve,ye,be,Ce,xe,we,Ne,Ee,_e,Se,ke,Te,Re,Ae,Be,De,Le,Me,Pe,Ie,ze,tt,nt,rt,it,at,st,lt,ct,ut,dt,ft,ht,pt,mt,gt,vt,yt,bt,Ct,xt,wt,Nt,Et,_t,St,kt,Tt,Rt,At,Bt,Dt,Lt,Mt,Pt,Ot,Ht,It,Ft,zt,Ut,Wt,Vt,$t,qt,jt,Yt,Xt,Kt,Gt,Jt,Qt])}(this); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/tinymce/tinymce.min.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 2147483647 |
| Request Header - size: 501 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/tinymce/tinymce.min.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 385081 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 385,081 bytes. |
// 4.4.3 (2016-09-01)
!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){var r,i,o,a,l;for(r=0;r<n.length;r++){i=e,o=n[r],a=o.split(/[.\/]/);for(var c=0;c<a.length-1;++c)i[a[c]]===t&&(i[a[c]]={}),i=i[a[c]];i[a[a.length-1]]=s[o]}if(e.AMDLC_TESTS){l=e.privateModules||{};for(o in s)l[o]=s[o];for(r=0;r<n.length;r++)delete l[n[r]];e.privateModules=l}}var s={},l="tinymce/geom/Rect",c="tinymce/util/Promise",u="tinymce/util/Delay",d="tinymce/Env",f="tinymce/dom/EventUtils",h="tinymce/dom/Sizzle",p="tinymce/util/Arr",m="tinymce/util/Tools",g="tinymce/dom/DomQuery",v="tinymce/html/Styles",y="tinymce/dom/TreeWalker",b="tinymce/dom/Range",C="tinymce/html/Entities",x="tinymce/dom/StyleSheetLoader",w="tinymce/dom/DOMUtils",N="tinymce/dom/ScriptLoader",E="tinymce/AddOnManager",_="tinymce/dom/NodeType",S="tinymce/text/Zwsp",k="tinymce/caret/CaretContainer",T="tinymce/dom/RangeUtils",R="tinymce/NodeChange",A="tinymce/html/Node",B="tinymce/html/Schema",D="tinymce/html/SaxParser",L="tinymce/html/DomParser",M="tinymce/html/Writer",P="tinymce/html/Serializer",O="tinymce/dom/Serializer",H="tinymce/dom/TridentSelection",I="tinymce/util/VK",F="tinymce/dom/ControlSelection",z="tinymce/util/Fun",U="tinymce/caret/CaretCandidate",W="tinymce/geom/ClientRect",V="tinymce/text/ExtendingChar",$="tinymce/caret/CaretPosition",q="tinymce/caret/CaretBookmark",j="tinymce/dom/BookmarkManager",Y="tinymce/dom/Selection",X="tinymce/dom/ElementUtils",K="tinymce/fmt/Preview",G="tinymce/fmt/Hooks",J="tinymce/Formatter",Q="tinymce/UndoManager",Z="tinymce/EnterKey",ee="tinymce/ForceBlocks",te="tinymce/caret/CaretUtils",ne="tinymce/caret/CaretWalker",re="tinymce/InsertList",ie="tinymce/InsertContent",oe="tinymce/EditorCommands",ae="tinymce/util/URI",se="tinymce/util/Class",le="tinymce/util/EventDispatcher",ce="tinymce/data/Binding",ue="tinymce/util/Observable",de="tinymce/data/ObservableObject",fe="tinymce/ui/Selector",he="tinymce/ui/Collection",pe="tinymce/ui/DomUtils",me="tinymce/ui/BoxUtils",ge="tinymce/ui/ClassList",ve="tinymce/ui/ReflowQueue",ye="tinymce/ui/Control",be="tinymce/ui/Factory",Ce="tinymce/ui/KeyboardNavigation",xe="tinymce/ui/Container",we="tinymce/ui/DragHelper",Ne="tinymce/ui/Scrollable",Ee="tinymce/ui/Panel",_e="tinymce/ui/Movable",Se="tinymce/ui/Resizable",ke="tinymce/ui/FloatPanel",Te="tinymce/ui/Window",Re="tinymce/ui/MessageBox",Ae="tinymce/WindowManager",Be="tinymce/ui/Tooltip",De="tinymce/ui/Widget",Le="tinymce/ui/Progress",Me="tinymce/ui/Notification",Pe="tinymce/NotificationManager",Oe="tinymce/dom/NodePath",He="tinymce/util/Quirks",Ie="tinymce/EditorObservable",Fe="tinymce/Mode",ze="tinymce/Shortcuts",Ue="tinymce/file/Uploader",We="tinymce/file/Conversions",Ve="tinymce/file/ImageScanner",$e="tinymce/file/BlobCache",qe="tinymce/file/UploadStatus",je="tinymce/EditorUpload",Ye="tinymce/caret/FakeCaret",Xe="tinymce/dom/Dimensions",Ke="tinymce/caret/LineWalker",Ge="tinymce/caret/LineUtils",Je="tinymce/dom/MousePosition",Qe="tinymce/DragDropOverrides",Ze="tinymce/SelectionOverrides",et="tinymce/util/Uuid",tt="tinymce/Editor",nt="tinymce/util/I18n",rt="tinymce/FocusManager",it="tinymce/EditorManager",ot="tinymce/LegacyInput",at="tinymce/util/XHR",st="tinymce/util/JSON",lt="tinymce/util/JSONRequest",ct="tinymce/util/JSONP",ut="tinymce/util/LocalStorage",dt="tinymce/Compat",ft="tinymce/ui/Layout",ht="tinymce/ui/AbsoluteLayout",pt="tinymce/ui/Button",mt="tinymce/ui/ButtonGroup",gt="tinymce/ui/Checkbox",vt="tinymce/ui/ComboBox",yt="tinymce/ui/ColorBox",bt="tinymce/ui/PanelButton",Ct="tinymce/ui/ColorButton",xt="tinymce/util/Color",wt="tinymce/ui/ColorPicker",Nt="tinymce/ui/Path",Et="tinymce/ui/ElementPath",_t="tinymce/ui/FormItem",St="tinymce/ui/Form",kt="tinymce/ui/FieldSet",Tt="tinymce/ui/FilePicker",Rt="tinymce/ui/FitLayout",At="tinymce/ui/FlexLayout",Bt="tinymce/ui/FlowLayout",Dt="tinymce/ui/FormatControls",Lt="tinymce/ui/GridLayout",Mt="tinymce/ui/Iframe",Pt="tinymce/ui/InfoBox",Ot="tinymce/ui/Label",Ht="tinymce/ui/Toolbar",It="tinymce/ui/MenuBar",Ft="tinymce/ui/MenuButton",zt="tinymce/ui/MenuItem",Ut="tinymce/ui/Throbber",Wt="tinymce/ui/Menu",Vt="tinymce/ui/ListBox",$t="tinymce/ui/Radio",qt="tinymce/ui/ResizeHandle",jt="tinymce/ui/SelectBox",Yt="tinymce/ui/Slider",Xt="tinymce/ui/Spacer",Kt="tinymce/ui/SplitButton",Gt="tinymce/ui/StackLayout",Jt="tinymce/ui/TabPanel",Qt="tinymce/ui/TextBox",Zt="tinymce/Register";r(l,[],function(){function e(e,t,n){var r,i,a,s,l,u;return r=t.x,i=t.y,a=e.w,s=e.h,l=t.w,u=t.h,n=(n||"").split(""),"b"===n[0]&&(i+=u),"r"===n[1]&&(r+=l),"c"===n[0]&&(i+=c(u/2)),"c"===n[1]&&(r+=c(l/2)),"b"===n[3]&&(i-=s),"r"===n[4]&&(r-=a),"c"===n[3]&&(i-=c(s/2)),"c"===n[4]&&(r-=c(a/2)),o(r,i,a,s)}function t(t,n,r,i){var o,a;for(a=0;a<i.length;a++)if(o=e(t,n,i[a]),o.x>=r.x&&o.x+o.w<=r.w+r.x&&o.y>=r.y&&o.y+o.h<=r.h+r.y)return i[a];return null}function n(e,t,n){return o(e.x-t,e.y-n,e.w+2*t,e.h+2*n)}function r(e,t){var n,r,i,a;return n=l(e.x,t.x),r=l(e.y,t.y),i=s(e.x+e.w,t.x+t.w),a=s(e.y+e.h,t.y+t.h),0>i-n||0>a-r?null:o(n,r,i-n,a-r)}function i(e,t,n){var r,i,a,s,c,u,d,f,h,p;return c=e.x,u=e.y,d=e.x+e.w,f=e.y+e.h,h=t.x+t.w,p=t.y+t.h,r=l(0,t.x-c),i=l(0,t.y-u),a=l(0,d-h),s=l(0,f-p),c+=r,u+=i,n&&(d+=r,f+=i,c-=a,u-=s),d-=a,f-=s,o(c,u,d-c,f-u)}function o(e,t,n,r){return{x:e,y:t,w:n,h:r}}function a(e){return o(e.left,e.top,e.width,e.height)}var s=Math.min,l=Math.max,c=Math.round;return{inflate:n,relativePosition:e,findBestRelativePosition:t,intersect:r,clamp:i,create:o,fromClientRect:a}}),r(c,[],function(){function e(e,t){return function(){e.apply(t,arguments)}}function t(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(t,e(r,this),e(i,this))}function n(e){var t=this;return null===this._state?void this._deferreds.push(e):void l(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=n(t._value)}catch(i){return void e.reject(i)}e.resolve(r)})}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void s(e(n,t),e(r,this),e(i,this))}this._state=!0,this._value=t,o.call(this)}catch(a){i.call(this,a)}}function i(e){this._state=!1,this._value=e,o.call(this)}function o(){for(var e=0,t=this._deferreds.length;t>e;e++)n.call(this,this._deferreds[e]);this._deferreds=null}function a(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function s(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(i){if(r)return;r=!0,n(i)}}if(window.Promise)return window.Promise;var l=t.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)},c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return t.prototype["catch"]=function(e){return this.then(null,e)},t.prototype.then=function(e,r){var i=this;return new t(function(t,o){n.call(i,new a(e,r,t,o))})},t.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&c(arguments[0])?arguments[0]:arguments);return new t(function(t,n){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},n)}e[o]=a,0===--i&&t(e)}catch(l){n(l)}}if(0===e.length)return t([]);for(var i=e.length,o=0;o<e.length;o++)r(o,e[o])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(t){t(e)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.race=function(e){return new t(function(t,n){for(var r=0,i=e.length;i>r;r++)e[r].then(t,n)})},t}),r(u,[c],function(e){function t(e,t){function n(e){window.setTimeout(e,0)}var r,i=window.requestAnimationFrame,o=["ms","moz","webkit"];for(r=0;r<o.length&&!i;r++)i=window[o[r]+"RequestAnimationFrame"];i||(i=n),i(e,t)}function n(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)}function r(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)}function i(e){return clearTimeout(e)}function o(e){return clearInterval(e)}var a;return{requestAnimationFrame:function(n,r){return a?void a.then(n):void(a=new e(function(e){r||(r=document.body),t(e,r)}).then(n))},setTimeout:n,setInterval:r,setEditorTimeout:function(e,t,r){return n(function(){e.removed||t()},r)},setEditorInterval:function(e,t,n){var i;return i=r(function(){e.removed?clearInterval(i):t()},n)},throttle:function(e,t){var r,i;return i=function(){var i=arguments;clearTimeout(r),r=n(function(){e.apply(this,i)},t)},i.stop=function(){clearTimeout(r)},i},clearInterval:o,clearTimeout:i}}),r(d,[],function(){function e(e){return"matchMedia"in window?matchMedia(e).matches:!1}var t=navigator,n=t.userAgent,r,i,o,a,s,l,c,u,d,f,h,p,m;r=window.opera&&window.opera.buildNumber,d=/Android/.test(n),i=/WebKit/.test(n),o=!i&&!r&&/MSIE/gi.test(n)&&/Explorer/gi.test(t.appName),o=o&&/MSIE (\w+)\./.exec(n)[1],a=-1==n.indexOf("Trident/")||-1==n.indexOf("rv:")&&-1==t.appName.indexOf("Netscape")?!1:11,s=-1==n.indexOf("Edge/")||o||a?!1:12,o=o||a||s,l=!i&&!a&&/Gecko/.test(n),c=-1!=n.indexOf("Mac"),u=/(iPad|iPhone)/.test(n),f="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,h=e("only screen and (max-device-width: 480px)")&&(d||u),p=e("only screen and (min-width: 800px)")&&(d||u),m=-1!=n.indexOf("Windows Phone"),s&&(i=!1);var g=!u||f||n.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:r,webkit:i,ie:o,gecko:l,mac:c,iOS:u,android:d,contentEditable:g,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=o,range:window.getSelection&&"Range"in window,documentMode:o&&!s?document.documentMode||7:10,fileApi:f,ceFalse:o===!1||o>8,canHaveCSP:o===!1||o>11,desktop:!h&&!p,windowsPhone:m}}),r(f,[u,d],function(e,t){function n(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function r(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function i(e,t){var n,r=t;return n=e.path,n&&n.length>0&&(r=n[0]),e.deepPath&&(n=e.deepPath(),n&&n.length>0&&(r=n[0])),r}function o(e,n){function r(){return!1}function o(){return!0}var a,s=n||{},l;for(a in e)u[a]||(s[a]=e[a]);if(s.target||(s.target=s.srcElement||document),t.experimentalShadowDom&&(s.target=i(e,s.target)),e&&c.test(e.type)&&e.pageX===l&&e.clientX!==l){var d=s.target.ownerDocument||document,f=d.documentElement,h=d.body;s.pageX=e.clientX+(f&&f.scrollLeft||h&&h.scrollLeft||0)-(f&&f.clientLeft||h&&h.clientLeft||0),s.pageY=e.clientY+(f&&f.scrollTop||h&&h.scrollTop||0)-(f&&f.clientTop||h&&h.clientTop||0)}return s.preventDefault=function(){s.isDefaultPrevented=o,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},s.stopPropagation=function(){s.isPropagationStopped=o,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},s.stopImmediatePropagation=function(){s.isImmediatePropagationStopped=o,s.stopPropagation()},s.isDefaultPrevented||(s.isDefaultPrevented=r,s.isPropagationStopped=r,s.isImmediatePropagationStopped=r),"undefined"==typeof s.metaKey&&(s.metaKey=!1),s}function a(t,i,o){function a(){o.domLoaded||(o.domLoaded=!0,i(u))}function s(){("complete"===c.readyState||"interactive"===c.readyState&&c.body)&&(r(c,"readystatechange",s),a())}function l(){try{c.documentElement.doScroll("left")}catch(t){return void e.setTimeout(l)}a()}var c=t.document,u={type:"ready"};return o.domLoaded?void i(u):(c.addEventListener?"complete"===c.readyState?a():n(t,"DOMContentLoaded",a):(n(c,"readystatechange",s),c.documentElement.doScroll&&t.self===t.top&&l()),void n(t,"load",a))}function s(){function e(e,t){var n,r,o,a,s=i[t];if(n=s&&s[e.type])for(r=0,o=n.length;o>r;r++)if(a=n[r],a&&a.func.call(a.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var t=this,i={},s,c,u,d,f;c=l+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},s=1,t.domLoaded=!1,t.events=i,t.bind=function(r,l,h,p){function m(t){e(o(t||N.event),g)}var g,v,y,b,C,x,w,N=window;if(r&&3!==r.nodeType&&8!==r.nodeType){for(r[c]?g=r[c]:(g=s++,r[c]=g,i[g]={}),p=p||r,l=l.split(" "),y=l.length;y--;)b=l[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),t.domLoaded&&"ready"===b&&"complete"==r.readyState?h.call(p,o({type:b})):(d||(C=f[b],C&&(x=function(t){var n,r;if(n=t.currentTarget,r=t.relatedTarget,r&&n.contains)r=n.contains(r);else for(;r&&r!==n;)r=r.parentNode;r||(t=o(t||N.event),t.type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=n,e(t,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(t){t=o(t||N.event),t.type="focus"===t.type?"focusin":"focusout",e(t,g)}),v=i[g][b],v?"ready"===b&&t.domLoaded?h({type:b}):v.push({func:h,scope:p}):(i[g][b]=v=[{func:h,scope:p}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?a(r,x,t):n(r,C||b,x,w)));return r=v=0,h}},t.unbind=function(e,n,o){var a,s,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return t;if(a=e[c]){if(f=i[a],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],s=f[d]){if(o)for(u=s.length;u--;)if(s[u].func===o){var h=s.nativeHandler,p=s.fakeName,m=s.capture;s=s.slice(0,u).concat(s.slice(u+1)),s.nativeHandler=h,s.fakeName=p,s.capture=m,f[d]=s}o&&0!==s.length||(delete f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture))}}else{for(d in f)s=f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture);f={}}for(d in f)return t;delete i[a];try{delete e[c]}catch(g){e[c]=null}}return t},t.fire=function(n,r,i){var a;if(!n||3===n.nodeType||8===n.nodeType)return t;i=o(null,i),i.type=r,i.target=n;do a=n[c],a&&e(i,a),n=n.parentNode||n.ownerDocument||n.defaultView||n.parentWindow;while(n&&!i.isPropagationStopped());return t},t.clean=function(e){var n,r,i=t.unbind;if(!e||3===e.nodeType||8===e.nodeType)return t;if(e[c]&&i(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(i(e),r=e.getElementsByTagName("*"),n=r.length;n--;)e=r[n],e[c]&&i(e);return t},t.destroy=function(){i={}},t.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var l="mce-data-",c=/^(?:mouse|contextmenu)|click/,u={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1};return s.Event=new s,s.Event.bind(window,"ready",function(){}),s}),r(h,[],function(){function e(e,t,n,r){var i,o,a,s,l,c,d,h,p,m;if((t?t.ownerDocument||t:z)!==D&&B(t),t=t||D,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(M&&!r){if(i=ve.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&I(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&x.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(x.qsa&&(!P||!P.test(e))){if(h=d=F,p=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=_(e),(d=t.getAttribute("id"))?h=d.replace(be,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=c.length;l--;)c[l]=h+f(c[l]);p=ye.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return Z.apply(n,p.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return k(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>w.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[F]=!0,e}function i(e){var t=D.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||X)-(~e.sourceIndex||X);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&typeof e.getElementsByTagName!==Y&&e}function d(){}function f(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[U,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[F]||(t[F]={}),(s=l[r])&&s[0]===U&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),c&&t.push(s)));return a}function v(e,t,n,i,o,a){return i&&!i[F]&&(i=v(i)),o&&!o[F]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,f=[],h=[],p=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,f,e,s,l),b=n?o||(r?e:p||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[h[u]]=!(y[h[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?te.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(p,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return te.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==T)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=w.relative[e[s].type])u=[h(p(u),n)];else{if(n=w.filter[e[s].type].apply(null,e[s].matches),n[F]){for(r=++s;i>r&&!w.relative[e[r].type];r++);return v(s>1&&p(u),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&f(e))}u.push(n)}return p(u)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,s,l,c){var u,d,f,h=0,p="0",m=r&&[],v=[],y=T,b=r||o&&w.find.TAG("*",c),C=U+=null==y?1:Math.random()||.1,x=b.length;for(c&&(T=a!==D&&a);p!==x&&null!=(u=b[p]);p++){if(o&&u){for(d=0;f=t[d++];)if(f(u,a,s)){l.push(u);break}c&&(U=C)}i&&((u=!f&&u)&&h--,r&&m.push(u))}if(h+=p,i&&p!==h){for(d=0;f=n[d++];)f(m,v,a,s);if(r){if(h>0)for(;p--;)m[p]||v[p]||(v[p]=J.call(l));v=g(v)}Z.apply(l,v),c&&!r&&v.length>0&&h+n.length>1&&e.uniqueSort(l)}return c&&(U=C,T=y),m};return i?r(a):a}var C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F="sizzle"+-new Date,z=window.document,U=0,W=0,V=n(),$=n(),q=n(),j=function(e,t){return e===t&&(A=!0),0},Y=typeof t,X=1<<31,K={}.hasOwnProperty,G=[],J=G.pop,Q=G.push,Z=G.push,ee=G.slice,te=G.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},ne="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",re="[\\x20\\t\\r\\n\\f]",ie="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",oe="\\["+re+"*("+ie+")(?:"+re+"*([*^$|!~]?=)"+re+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+re+"*\\]",ae=":("+ie+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp("^"+re+"+|((?:^|[^\\\\])(?:\\\\.)*)"+re+"+$","g"),le=new RegExp("^"+re+"*,"+re+"*"),ce=new RegExp("^"+re+"*([>+~]|"+re+")"+re+"*"),ue=new RegExp("="+re+"*([^\\]'\"]*?)"+re+"*\\]","g"),de=new RegExp(ae),fe=new RegExp("^"+ie+"$"),he={ID:new RegExp("^#("+ie+")"),CLASS:new RegExp("^\\.("+ie+")"),TAG:new RegExp("^("+ie+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+re+"*(even|odd|(([+-]|)(\\d*)n|)"+re+"*(?:([+-]|)"+re+"*(\\d+)|))"+re+"*\\)|)","i"),bool:new RegExp("^(?:"+ne+")$","i"),needsContext:new RegExp("^"+re+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+re+"*((?:-\\d)?\\d*)"+re+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ge=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,be=/'|\\/g,Ce=new RegExp("\\\\([\\da-f]{1,6}"+re+"?|("+re+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Z.apply(G=ee.call(z.childNodes),z.childNodes),G[z.childNodes.length].nodeType}catch(we){Z={apply:G.length?function(e,t){Q.apply(e,ee.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}x=e.support={},E=e.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},B=e.setDocument=function(e){function t(e){try{return e.top}catch(t){}return null}var n,r=e?e.ownerDocument||e:z,o=r.defaultView;return r!==D&&9===r.nodeType&&r.documentElement?(D=r,L=r.documentElement,M=!E(r),o&&o!==t(o)&&(o.addEventListener?o.addEventListener("unload",function(){B()},!1):o.attachEvent&&o.attachEvent("onunload",function(){B()})),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=ge.test(r.getElementsByClassName),x.getById=i(function(e){return L.appendChild(e).id=F,!r.getElementsByName||!r.getElementsByName(F).length}),x.getById?(w.find.ID=function(e,t){if(typeof t.getElementById!==Y&&M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){return e.getAttribute("id")===t}}):(delete w.find.ID,w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),w.find.TAG=x.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Y?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=x.getElementsByClassName&&function(e,t){return M?t.getElementsByClassName(e):void 0},O=[],P=[],(x.qsa=ge.test(r.querySelectorAll))&&(i(function(e){e.innerHTML="<select msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+re+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||P.push("\\["+re+"*(?:value|"+ne+")"),e.querySelectorAll(":checked").length||P.push(":checked")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&P.push("name"+re+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||P.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),P.push(",.*:")})),(x.matchesSelector=ge.test(H=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){x.disconnectedMatch=H.call(e,"div"),H.call(e,"[s!='']:x"),O.push("!=",ae)}),P=P.length&&new RegExp(P.join("|")),O=O.length&&new RegExp(O.join("|")),n=ge.test(L.compareDocumentPosition),I=n||ge.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},j=n?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===z&&I(z,e)?-1:t===r||t.ownerDocument===z&&I(z,t)?1:R?te.call(R,e)-te.call(R,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:R?te.call(R,e)-te.call(R,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===z?-1:c[i]===z?1:0},r):D},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==D&&B(t),n=n.replace(ue,"='$1']"),x.matchesSelector&&M&&(!O||!O.test(n))&&(!P||!P.test(n)))try{var r=H.call(t,n);if(r||x.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,D,null,[t]).length>0},e.contains=function(e,t){return(e.ownerDocument||e)!==D&&B(e),I(e,t)},e.attr=function(e,n){(e.ownerDocument||e)!==D&&B(e);var r=w.attrHandle[n.toLowerCase()],i=r&&K.call(w.attrHandle,n.toLowerCase())?r(e,n,!M):t;return i!==t?i:x.attributes||!M?e.getAttribute(n):(i=e.getAttributeNode(n))&&i.specified?i.value:null},e.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},e.uniqueSort=function(e){var t,n=[],r=0,i=0;if(A=!x.detectDuplicates,R=!x.sortStable&&e.slice(0),e.sort(j),A){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return R=null,e},N=e.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=N(t);return n},w=e.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ce,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(Ce,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=_(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ce,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+re+")"+e+"("+re+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,h,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(u=g[F]||(g[F]={}),c=u[e]||[],h=c[0]===U&&c[1],f=c[0]===U&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(f=h=0)||p.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[U,h,f];break}}else if(y&&(c=(t[F]||(t[F]={}))[e])&&c[0]===U)f=c[1];else for(;(d=++h&&d&&d[m]||(f=h=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[F]||(d[F]={}))[e]=[U,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(t,n){var i,o=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[F]?o(n):o.length>1?(i=[t,t,"",n],w.setFilters.hasOwnProperty(t.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=te.call(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=S(e.replace(se,"$1"));return i[F]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(e){return e=e.replace(Ce,xe),function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(t){return fe.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(Ce,xe).toLowerCase(),function(e){var n;do if(n=M?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}},w.pseudos.nth=w.pseudos.eq;for(C in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})w.pseudos[C]=s(C);for(C in{submit:!0,reset:!0})w.pseudos[C]=l(C);return d.prototype=w.filters=w.pseudos,w.setFilters=new d,_=e.tokenize=function(t,n){var r,i,o,a,s,l,c,u=$[t+" "];if(u)return n?0:u.slice(0);for(s=t,l=[],c=w.preFilter;s;){r&&!(i=le.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=ce.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(se," ")}),s=s.slice(r.length));for(a in w.filter)!(i=he[a].exec(s))||c[a]&&!(i=c[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?e.error(t):$(t,l).slice(0)},S=e.compile=function(e,t){var n,r=[],i=[],o=q[e+" "];if(!o){for(t||(t=_(e)),n=t.length;n--;)o=y(t[n]),o[F]?r.push(o):i.push(o);o=q(e,b(i,r)),o.selector=e}return o},k=e.select=function(e,t,n,r){var i,o,a,s,l,c="function"==typeof e&&e,d=!r&&_(e=c.selector||e);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&x.getById&&9===t.nodeType&&M&&w.relative[o[1].type]){if(t=(w.find.ID(a.matches[0].replace(Ce,xe),t)||[])[0], !t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=he.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((l=w.find[s])&&(r=l(a.matches[0].replace(Ce,xe),ye.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&f(o),!e)return Z.apply(n,r),n;break}}return(c||S(e,d))(r,t,!M,n,ye.test(e)&&u(t.parentNode)||t),n},x.sortStable=F.split("").sort(j).join("")===F,x.detectDuplicates=!!A,B(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(ne,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),e}),r(p,[],function(){function e(e){var t=e,n,r;if(!u(e))for(t=[],n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function n(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function r(e,t){var r=[];return n(e,function(n,i){r.push(t(n,i,e))}),r}function i(e,t){var r=[];return n(e,function(n,i){t&&!t(n,i,e)||r.push(n)}),r}function o(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function a(e,t,n,r){var i=0;for(arguments.length<3&&(n=e[0]);i<e.length;i++)n=t.call(r,n,e[i],i);return n}function s(e,t,n){var r,i;for(r=0,i=e.length;i>r;r++)if(t.call(n,e[r],r,e))return r;return-1}function l(e,n,r){var i=s(e,n,r);return-1!==i?e[i]:t}function c(e){return e[e.length-1]}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{isArray:u,toArray:e,each:n,map:r,filter:i,indexOf:o,reduce:a,findIndex:s,find:l,last:c}}),r(m,[d,p],function(e,n){function r(e){return null===e||e===t?"":(""+e).replace(h,"")}function i(e,r){return r?"array"==r&&n.isArray(e)?!0:typeof e==r:e!==t}function o(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function a(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],c?o[a]=function(){return i[s].apply(this,arguments)}:o[a]=function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function s(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function l(e,t,r,i){i=i||this,e&&(r&&(e=e[r]),n.each(e,function(e,n){return t.call(i,e,n,r)===!1?!1:void l(e,t,r,i)}))}function c(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)r=e[n],t[r]||(t[r]={}),t=t[r];return t}function u(e,t){var n,r;for(t=t||window,e=e.split("."),n=0,r=e.length;r>n&&(t=t[e[n]],t);n++);return t}function d(e,t){return!e||i(e,"array")?e:n.map(e.split(t||","),r)}function f(t){var n=e.cacheSuffix;return n&&(t+=(-1===t.indexOf("?")?"?":"&")+n),t}var h=/^\s*|\s*$/g;return{trim:r,isArray:n.isArray,is:i,toArray:n.toArray,makeMap:o,each:n.each,map:n.map,grep:n.filter,inArray:n.indexOf,extend:s,create:a,walk:l,createNS:c,resolve:u,explode:d,_addCacheSuffix:f}}),r(g,[f,h,m,d],function(e,n,r,i){function o(e){return"undefined"!=typeof e}function a(e){return"string"==typeof e}function s(e){return e&&e==e.window}function l(e,t){var n,r,i;for(t=t||w,i=t.createElement("div"),n=t.createDocumentFragment(),i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return n}function c(e,t,n,r){var i;if(a(t))t=l(t,v(e[0]));else if(t.length&&!t.nodeType){if(t=f.makeArray(t),r)for(i=t.length-1;i>=0;i--)c(e,t[i],n,r);else for(i=0;i<t.length;i++)c(e,t[i],n,r);return e}if(t.nodeType)for(i=e.length;i--;)n.call(e[i],t);return e}function u(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")}function d(e,t,n){var r,i;return t=f(t)[0],e.each(function(){var e=this;n&&r==e.parentNode?i.appendChild(e):(r=e.parentNode,i=t.cloneNode(!1),e.parentNode.insertBefore(i,e),i.appendChild(e))}),e}function f(e,t){return new f.fn.init(e,t)}function h(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1}function p(e){return null===e||e===k?"":(""+e).replace(P,"")}function m(e,t){var n,r,i,o,a;if(e)if(n=e.length,n===o){for(r in e)if(e.hasOwnProperty(r)&&(a=e[r],t.call(a,r,a)===!1))break}else for(i=0;n>i&&(a=e[i],t.call(a,i,a)!==!1);i++);return e}function g(e,t){var n=[];return m(e,function(e,r){t(r,e)&&n.push(r)}),n}function v(e){return e?9==e.nodeType?e:e.ownerDocument:w}function y(e,n,r){var i=[],o=e[n];for("string"!=typeof r&&r instanceof f&&(r=r[0]);o&&9!==o.nodeType;){if(r!==t){if(o===r)break;if("string"==typeof r&&f(o).is(r))break}1===o.nodeType&&i.push(o),o=o[n]}return i}function b(e,n,r,i){var o=[];for(i instanceof f&&(i=i[0]);e;e=e[n])if(!r||e.nodeType===r){if(i!==t){if(e===i)break;if("string"==typeof i&&f(e).is(i))break}o.push(e)}return o}function C(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType==n)return e;return null}function x(e,t,n){m(n,function(n,r){e[n]=e[n]||{},e[n][t]=r})}var w=document,N=Array.prototype.push,E=Array.prototype.slice,_=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,S=e.Event,k,T=r.makeMap("children,contents,next,prev"),R=r.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),A=r.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),B={"for":"htmlFor","class":"className",readonly:"readOnly"},D={"float":"cssFloat"},L={},M={},P=/^\s*|\s*$/g;return f.fn=f.prototype={constructor:f,selector:"",context:null,length:0,init:function(e,t){var n=this,r,i;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(t&&t.nodeType)n.context=t;else{if(t)return f(e).attr(t);n.context=t=document}if(a(e)){if(n.selector=e,r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:_.exec(e),!r)return f(t).find(e);if(r[1])for(i=l(e,v(t)).firstChild;i;)N.call(n,i),i=i.nextSibling;else{if(i=v(t).getElementById(r[2]),!i)return n;if(i.id!==r[2])return n.find(e);n.length=1,n[0]=i}}else this.add(e,!1);return n},toArray:function(){return r.toArray(this)},add:function(e,t){var n=this,r,i;if(a(e))return n.add(f(e));if(t!==!1)for(r=f.unique(n.toArray().concat(f.makeArray(e))),n.length=r.length,i=0;i<r.length;i++)n[i]=r[i];else N.apply(n,f.makeArray(e));return n},attr:function(e,t){var n=this,r;if("object"==typeof e)m(e,function(e,t){n.attr(e,t)});else{if(!o(t)){if(n[0]&&1===n[0].nodeType){if(r=L[e],r&&r.get)return r.get(n[0],e);if(A[e])return n.prop(e)?e:k;t=n[0].getAttribute(e,2),null===t&&(t=k)}return t}this.each(function(){var n;if(1===this.nodeType){if(n=L[e],n&&n.set)return void n.set(this,t);null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2)}})}return n},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if(e=B[e]||e,"object"==typeof e)m(e,function(e,t){n.prop(e,t)});else{if(!o(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1==this.nodeType&&(this[e]=t)})}return n},css:function(e,t){function n(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})}function r(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})}var i=this,a,s;if("object"==typeof e)m(e,function(e,t){i.css(e,t)});else if(o(t))e=n(e),"number"!=typeof t||R[e]||(t+="px"),i.each(function(){var n=this.style;if(s=M[e],s&&s.set)return void s.set(this,t);try{this.style[D[e]||e]=t}catch(i){}null!==t&&""!==t||(n.removeProperty?n.removeProperty(r(e)):n.removeAttribute(e))});else{if(a=i[0],s=M[e],s&&s.get)return s.get(a);if(a.ownerDocument.defaultView)try{return a.ownerDocument.defaultView.getComputedStyle(a,null).getPropertyValue(r(e))}catch(l){return k}else if(a.currentStyle)return a.currentStyle[n(e)]}return i},remove:function(){for(var e=this,t,n=this.length;n--;)t=e[n],S.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var e=this,t,n=this.length;n--;)for(t=e[n];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(e){var t=this,n;if(o(e)){n=t.length;try{for(;n--;)t[n].innerHTML=e}catch(r){f(t[n]).empty().append(e)}return t}return t[0]?t[0].innerHTML:""},text:function(e){var t=this,n;if(o(e)){for(n=t.length;n--;)"innerText"in t[n]?t[n].innerText=e:t[0].textContent=e;return t}return t[0]?t[0].innerText||t[0].textContent:""},append:function(){return c(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return c(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){var e=this;return e[0]&&e[0].parentNode?c(e,arguments,function(e){this.parentNode.insertBefore(e,this)}):e},after:function(){var e=this;return e[0]&&e[0].parentNode?c(e,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):e},appendTo:function(e){return f(e).append(this),this},prependTo:function(e){return f(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return d(this,e)},wrapAll:function(e){return d(this,e,!0)},wrapInner:function(e){return this.each(function(){f(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){f(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),f(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return"string"!=typeof e?n:(-1!==e.indexOf(" ")?m(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(n,r){var i,o;o=u(r,e),o!==t&&(i=r.className,o?r.className=p((" "+i+" ").replace(" "+e+" "," ")):r.className+=i?" "+e:e)}),n)},hasClass:function(e){return u(this[0],e)},each:function(e){return m(this,e)},on:function(e,t){return this.each(function(){S.bind(this,e,t)})},off:function(e,t){return this.each(function(){S.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?S.fire(this,e.type,e):S.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new f(E.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;n>t;t++)f.find(e,this[t],r);return f(r)},filter:function(e){return f("function"==typeof e?g(this.toArray(),function(t,n){return e(n,t)}):f.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof f&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&f(r).is(e)){t.push(r);break}if(r==e){t.push(r);break}r=r.parentNode}}),f(t)},offset:function(e){var t,n,r,i=0,o=0,a;return e?this.css(e):(t=this[0],t&&(n=t.ownerDocument,r=n.documentElement,t.getBoundingClientRect&&(a=t.getBoundingClientRect(),i=a.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,o=a.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:o})},push:N,sort:[].sort,splice:[].splice},r.extend(f,{extend:r.extend,makeArray:function(e){return s(e)||e.nodeType?[e]:r.toArray(e)},inArray:h,isArray:r.isArray,each:m,trim:p,grep:g,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,contains:n.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!=t[r].nodeType&&t.splice(r,1);return t=1===t.length?f.find.matchesSelector(t[0],e)?[t[0]]:[]:f.find.matches(e,t)}}),m({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return y(e,"parentNode")},next:function(e){return C(e,"nextSibling",1)},prev:function(e){return C(e,"previousSibling",1)},children:function(e){return b(e.firstChild,"nextSibling",1)},contents:function(e){return r.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){f.fn[e]=function(n){var r=this,i=[];return r.each(function(){var e=t.call(i,this,n,i);e&&(f.isArray(e)?i.push.apply(i,e):i.push(e))}),this.length>1&&(T[e]||(i=f.unique(i)),0===e.indexOf("parents")&&(i=i.reverse())),i=f(i),n?i.filter(n):i}}),m({parentsUntil:function(e,t){return y(e,"parentNode",t)},nextUntil:function(e,t){return b(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return b(e,"previousSibling",1,t).slice(1)}},function(e,t){f.fn[e]=function(n,r){var i=this,o=[];return i.each(function(){var e=t.call(o,this,n,o);e&&(f.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=f.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse())),o=f(o),r?o.filter(r):o}}),f.fn.is=function(e){return!!e&&this.filter(e).length>0},f.fn.init.prototype=f.fn,f.overrideDefaults=function(e){function t(r,i){return n=n||e(),0===arguments.length&&(r=n.element),i||(i=n.context),new t.fn.init(r,i)}var n;return f.extend(t,this),t},i.ie&&i.ie<8&&(x(L,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?k:t},size:function(e){var t=e.size;return 20===t?k:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?k:t}}),x(L,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),i.ie&&i.ie<9&&(D["float"]="styleFloat",x(M,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),f.attrHooks=L,f.cssHooks=M,f}),r(v,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d,f,h="\ufeff";for(e=e||{},t&&(d=t.getValidStyles(),f=t.getInvalidStyles()),u=("\\\" \\' \\; \\: ; : "+h).split(" "),l=0;l<u.length;l++)c[u[l]]=h+l,c[h+l]=u[l];return{toHex:function(e){return e.replace(r,n)},parse:function(t){function s(e,t,n){var r,i,o,a;if(r=m[e+"-top"+t],r&&(i=m[e+"-right"+t],i&&(o=m[e+"-bottom"+t],o&&(a=m[e+"-left"+t])))){var s=[r,i,o,a];for(l=s.length-1;l--&&s[l]===s[l+1];);l>-1&&n||(m[e+t]=-1==l?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}}function u(e){var t=m[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return m[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}function f(e){return b=!0,c[e]}function h(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function p(t,n,r,i,o,a){if(o=o||a)return o=h(o),"'"+o.replace(/\'/g,"\\'")+"'";if(n=h(n||r||i),!e.allow_script_urls){var s=n.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(s))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"}var m={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),y=y.replace(/\\[0-9a-f]+/g,function(e){return String.fromCharCode(parseInt(e.substr(1),16))}),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(|\/\*|\*\//.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":"color"!==v&&"background-color"!==v||(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,p),m[v]=b?h(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(e,t){function n(t){var n,r,o,a;if(n=d[t])for(r=0,o=n.length;o>r;r++)t=n[r],a=e[t],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+t+": "+a+";")}function r(e,t){var n;return n=f["*"],n&&n[e]?!1:(n=f[t],!n||!n[e])}var i="",o,a;if(t&&d)n("*"),n(t);else for(o in e)a=e[o],a!==s&&a.length>0&&(f&&!r(o,t)||(i+=(i.length>0?" ":"")+o+": "+a+";"));return i}}}}),r(y,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}function r(e,n,r,i){var o,a,s;if(e){if(o=e[r],t&&o===t)return;if(o){if(!i)for(s=o[n];s;s=s[n])if(!s[n])return s;return o}if(a=e.parentNode,a&&a!==t)return a}}var i=e;this.current=function(){return i},this.next=function(e){return i=n(i,"firstChild","nextSibling",e)},this.prev=function(e){return i=n(i,"lastChild","previousSibling",e)},this.prev2=function(e){return i=r(i,"lastChild","previousSibling",e)}}}),r(b,[m],function(e){function t(n){function r(){return P.createDocumentFragment()}function i(e,t){N(F,e,t)}function o(e,t){N(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(M[V]=M[W],M[$]=M[U]):(M[W]=M[V],M[U]=M[$]),M.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function h(e,t){var n=M[W],r=M[U],i=M[V],o=M[$],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function p(){E(I)}function m(){return E(O)}function g(){return E(H)}function v(e){var t=this[W],r=this[U],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=M.extractContents();M.insertNode(e),e.appendChild(t),M.selectNode(e)}function b(){return q(new t(n),{startContainer:M[W],startOffset:M[U],endContainer:M[V],endOffset:M[$],collapsed:M.collapsed,commonAncestorContainer:M.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return M[W]==M[V]&&M[U]==M[$]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function N(e,t,r){var i,o;for(e?(M[W]=t,M[U]=r):(M[V]=t,M[$]=r),i=M[V];i.parentNode;)i=i.parentNode;for(o=M[W];o.parentNode;)o=o.parentNode;o==i?w(M[W],M[U],M[V],M[$])>0&&M.collapse(e):M.collapse(e),M.collapsed=x(),M.commonAncestorContainer=n.findCommonAncestor(M[W],M[V])}function E(e){var t,n=0,r=0,i,o,a,s,l,c;if(M[W]==M[V])return _(e);for(t=M[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[W])return S(t,e);++n}for(t=M[W],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[V])return k(t,e);++r}for(o=r-n,a=M[W];o>0;)a=a.parentNode,o--;for(s=M[V];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function _(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),M[U]==M[$])return t;if(3==M[W].nodeType){if(n=M[W].nodeValue,i=n.substring(M[U],M[$]),e!=H&&(o=M[W],c=M[U],u=M[$]-M[U],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),M.collapse(F)),e==I)return;return i.length>0&&t.appendChild(P.createTextNode(i)),t}for(o=C(M[W],M[U]),a=M[$]-M[U];o&&a>0;)s=o.nextSibling,l=D(o,e),t&&t.appendChild(l),--a,o=s;return e!=H&&M.collapse(F),t}function S(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-M[U],0>=a)return t!=H&&(M.setEndBefore(e),M.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=D(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=H&&(M.setEndBefore(e),M.collapse(z)),n}function k(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=M[$]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=D(o,t),n&&n.appendChild(l),--a,o=s;return t!=H&&(M.setStartAfter(e),M.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=D(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=H&&(M.setStartAfter(e),M.collapse(F)),o}function R(e,t){var n=C(M[V],M[$]-1),r,i,o,a,s,l=n!=M[V];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(M[W],M[U]),r=n!=M[W],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return D(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=M[U],a=o.substring(l),s=o.substring(0,l)):(l=M[$],a=o.substring(0,l),s=o.substring(l)),i!=H&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function D(e,t){return t!=I?t==H?n.clone(e,F):e:void e.parentNode.removeChild(e)}function L(){return n.create("body",null,g()).outerText}var M=this,P=n.doc,O=0,H=1,I=2,F=!0,z=!1,U="startOffset",W="startContainer",V="endContainer",$="endOffset",q=e.extend,j=n.nodeIndex;return q(M,{startContainer:P,startOffset:0,endContainer:P,endOffset:0,collapsed:F,commonAncestorContainer:P,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:h,deleteContents:p,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:L}),M}return t.prototype.toString=function(){return this.toStringIE()},t}),r(C,[m],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),o[r]||(i="&"+e[n+1]+";",a[r]=i,a[i]=r);return a}}var r=e.makeMap,i,o,a,s=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n){return n?(n="x"===n.charAt(0).toLowerCase()?parseInt(n.substr(1),16):parseInt(n,10),n>65535?(n-=65536,String.fromCharCode(55296+(n>>10),56320+(1023&n))):d[n]||String.fromCharCode(n)):a[e]||i[e]||t(e)})}};return f}),r(x,[m,u],function(e,t){return function(n,r){function i(e){n.getElementsByTagName("head")[0].appendChild(e)}function o(r,o,c){function u(){for(var e=b.passed,t=e.length;t--;)e[t]();b.status=2,b.passed=[],b.failed=[]}function d(){for(var e=b.failed,t=e.length;t--;)e[t]();b.status=3,b.passed=[],b.failed=[]}function f(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function h(e,n){e()||((new Date).getTime()-y<l?t.setTimeout(n):d())}function p(){h(function(){for(var e=n.styleSheets,t,r=e.length,i;r--;)if(t=e[r],i=t.ownerNode?t.ownerNode:t.owningElement,i&&i.id===g.id)return u(),!0},p)}function m(){h(function(){try{var e=v.sheet.cssRules;return u(),!!e}catch(t){}},m)}var g,v,y,b;if(r=e._addCacheSuffix(r),s[r]?b=s[r]:(b={passed:[],failed:[]},s[r]=b),o&&b.passed.push(o),c&&b.failed.push(c),1!=b.status){if(2==b.status)return void u();if(3==b.status)return void d();if(b.status=1,g=n.createElement("link"),g.rel="stylesheet",g.type="text/css",g.id="u"+a++,g.async=!1,g.defer=!1,y=(new Date).getTime(),"onload"in g&&!f())g.onload=p,g.onerror=d;else{if(navigator.userAgent.indexOf("Firefox")>0)return v=n.createElement("style"),v.textContent='@import "'+r+'"',m(),void i(v);p()}i(g),g.href=r}}var a=0,s={},l;r=r||{},l=r.maxLoadTime||5e3,this.load=o}}),r(w,[h,g,v,f,y,b,C,d,m,x],function(e,n,r,i,o,a,s,l,c,u){function d(e,t){var n={},r=t.keep_values,i;return i={set:function(n,r,i){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||e,r,i,n[0])),n.attr("data-mce-"+i,r).attr(i,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},n={style:{set:function(e,t){return null!==t&&"object"==typeof t?void e.css(t):(r&&e.attr("data-mce-style",t),void e.attr("style",t))},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serializeStyle(e.parseStyle(n),t[0].nodeName)}}},r&&(n.href=n.src=i),n}function f(e,t){var n=t.attr("style");n=e.serializeStyle(e.parseStyle(n),t[0].nodeName),n||(n=null),t.attr("data-mce-style",n)}function h(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n}function p(e,t){var o=this,a;o.doc=e,o.win=window,o.files={},o.counter=0,o.stdMode=!b||e.documentMode>=8,o.boxModel=!b||"CSS1Compat"==e.compatMode||o.stdMode,o.styleSheetLoader=new u(e),o.boundEvents=[],o.settings=t=t||{},o.schema=t.schema,o.styles=new r({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),o.fixDoc(e),o.events=t.ownEvents?new i(t.proxy):i.Event,o.attrHooks=d(o,t),a=t.schema?t.schema.getBlockElements():{},o.$=n.overrideDefaults(function(){return{context:e,element:o.getRoot()}}),o.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!a[e.nodeName]):!!a[e]}}var m=c.each,g=c.is,v=c.grep,y=c.trim,b=l.ie,C=/^([a-z0-9],?)+$/i,x=/^[ \t\r\n]*$/;return p.prototype={$$:function(e){return"string"==typeof e&&(e=this.get(e)),this.$(e)},root:null,fixDoc:function(e){var t=this.settings,n;if(b&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!b||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.settings.root_element||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),g(n,"string")&&(a=n, n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.settings.root_element||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(C.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=g(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&"undefined"!=typeof t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"</"+e+">":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return e=this.$$(e),t?e.each(function(){for(var e;e=this.firstChild;)3==e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():e.remove(),e.length>1?e.toArray():e[0]},setStyle:function(e,t,n){e=this.$$(e).css(t,n),this.settings.update_styles&&f(this,e)},getStyle:function(e,n,r){return e=this.$$(e),r?e.css(n):(n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=l.ie&&l.ie<12?"styleFloat":"cssFloat"),e[0]&&e[0].style?e[0].style[n]:t)},setStyles:function(e,t){e=this.$$(e).css(t),this.settings.update_styles&&f(this,e)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this,i,o,a=r.settings;""===n&&(n=null),e=r.$$(e),i=e.attr(t),e.length&&(o=r.attrHooks[t],o&&o.set?o.set(e,n,t):e.attr(t,n),i!=n&&a.onSetAttrib&&a.onSetAttrib({attrElm:e,attrName:t,attrValue:n}))},setAttribs:function(e,t){var n=this;n.$$(e).each(function(e,r){m(t,function(e,t){n.setAttrib(r,t,e)})})},getAttrib:function(e,t,n){var r=this,i,o;return e=r.$$(e),e.length&&(i=r.attrHooks[t],o=i&&i.get?i.get(e,t):e.attr(t)),"undefined"==typeof o&&(o=n||""),o},getPos:function(e,t){var r=this,i=0,o=0,a,s=r.doc,l=s.body,c;if(e=r.get(e),t=t||l,e){if(t===l&&e.getBoundingClientRect&&"static"===n(l).css("position"))return c=e.getBoundingClientRect(),t=r.boxModel?s.documentElement:l,i=c.left+(s.documentElement.scrollLeft||l.scrollLeft)-t.clientLeft,o=c.top+(s.documentElement.scrollTop||l.scrollTop)-t.clientTop,{x:i,y:o};for(a=e;a&&a!=t&&a.nodeType;)i+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=e.parentNode;a&&a!=t&&a.nodeType;)i-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode}return{x:i,y:o}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==p.DOM&&n===document){var o=p.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,p.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==p.DOM&&n===document?void p.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void m(e.split(","),function(e){var i;e=c._addCacheSuffix(e),t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),b&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){this.$$(e).addClass(t)},removeClass:function(e,t){this.toggleClass(e,t,!1)},hasClass:function(e,t){return this.$$(e).hasClass(t)},toggleClass:function(e,t,r){this.$$(e).toggleClass(t,r).each(function(){""===this.className&&n(this).attr("class",null)})},show:function(e){this.$$(e).show()},hide:function(e){this.$$(e).hide()},isHidden:function(e){return"none"==this.$$(e).css("display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){e=this.$$(e),b?e.each(function(e,r){if(r.canHaveHTML!==!1){for(;r.firstChild;)r.removeChild(r.firstChild);try{r.innerHTML="<br>"+t,r.removeChild(r.firstChild)}catch(i){n("<div>").html("<br>"+t).contents().slice(1).appendTo(r)}return t}}):e.html(t)},getOuterHTML:function(e){return e=this.get(e),1==e.nodeType&&"outerHTML"in e?e.outerHTML:n("<div>").append(n(e).clone()).html()},setOuterHTML:function(e,t){var r=this;r.$$(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}r.remove(n(this).html(t),!0)})},decode:s.decode,encode:s.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return g(t,"array")&&(e=e.cloneNode(!0)),n&&m(v(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(c.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],m(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(b){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,i,a,s,l,c=0;if(e=e.firstChild){s=new o(e,e.parentNode),t=t||(n.schema?n.schema.getNonEmptyElements():null);do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(i=n.getAttribs(e),r=i.length;r--;)if(l=i[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!x.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new a(this)},nodeIndex:h,split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=y(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.insertBefore(n,e):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(c.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(c.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return e&&1==e.nodeType?(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null):null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&(n=this.getContentEditable(e),null===n);e=e.parentNode);return n},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},p.DOM=new p(document),p.nodeIndex=h,p}),r(N,[w,m],function(e,t){function n(){function e(e,n){function i(){a.remove(l),s&&(s.onreadystatechange=s.onload=s=null),n()}function o(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var a=r,s,l;l=a.uniqueId(),s=document.createElement("script"),s.id=l,s.type="text/javascript",s.src=t._addCacheSuffix(e),"onreadystatechange"in s?s.onreadystatechange=function(){/loaded|complete/.test(s.readyState)&&i()}:s.onload=i,s.onerror=o,(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}var n=0,a=1,s=2,l={},c=[],u={},d=[],f=0,h;this.isDone=function(e){return l[e]==s},this.markDone=function(e){l[e]=s},this.add=this.load=function(e,t,r){var i=l[e];i==h&&(c.push(e),l[e]=n),t&&(u[e]||(u[e]=[]),u[e].push({func:t,scope:r||this}))},this.remove=function(e){delete l[e],delete u[e]},this.loadQueue=function(e,t){this.loadScripts(c,e,t)},this.loadScripts=function(t,n,r){function c(e){i(u[e],function(e){e.func.call(e.scope)}),u[e]=h}var p;d.push({func:n,scope:r||this}),(p=function(){var n=o(t);t.length=0,i(n,function(t){return l[t]==s?void c(t):void(l[t]!=a&&(l[t]=a,f++,e(t,function(){l[t]=s,f--,c(t),p()})))}),f||(i(d,function(e){e.func.call(e.scope)}),d.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(E,[N,m],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){var i=r.language;if(i&&r.languageLoad!==!1){if(n)if(n=","+n+",",-1!=n.indexOf(","+i.substr(0,2)+","))i=i.substr(0,2);else if(-1==n.indexOf(","+i+","))return;e.ScriptLoader.add(this.urls[t]+"/langs/"+i+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},remove:function(e){delete this.urls[e],delete this.lookup[e]},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&(s?a.call(s):a.call(e))}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(_,[],function(){function e(e){return function(t){return!!t&&t.nodeType==e}}function t(e){return e=e.toLowerCase().split(" "),function(t){var n,r;if(t&&t.nodeType)for(r=t.nodeName.toLowerCase(),n=0;n<e.length;n++)if(r===e[n])return!0;return!1}}function n(e,t){return t=t.toLowerCase().split(" "),function(n){var r,i;if(s(n))for(r=0;r<t.length;r++)if(i=getComputedStyle(n,null).getPropertyValue(e),i===t[r])return!0;return!1}}function r(e,t){return function(n){return s(n)&&n[e]===t}}function i(e,t){return function(n){return s(n)&&n.getAttribute(e)===t}}function o(e){return s(e)&&e.hasAttribute("data-mce-bogus")}function a(e){return function(t){if(s(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}}var s=e(1);return{isText:e(3),isElement:s,isComment:e(8),isBr:t("br"),isContentEditableTrue:a("true"),isContentEditableFalse:a("false"),matchNodeNames:t,hasPropValue:r,hasAttributeValue:i,matchStyleValues:n,isBogus:o}}),r(S,[],function(){function e(e){return e==n}function t(e){return e.replace(new RegExp(n,"g"),"")}var n="\ufeff";return{isZwsp:e,ZWSP:n,trim:t}}),r(k,[_,S],function(e,t){function n(e){return p(e)&&(e=e.parentNode),h(e)&&e.hasAttribute("data-mce-caret")}function r(e){return p(e)&&t.isZwsp(e.data)}function i(e){return n(e)||r(e)}function o(e){var t=e.parentNode;t&&t.removeChild(e)}function a(e){try{return e.nodeValue}catch(t){return""}}function s(e,t){0===t.length?o(e):e.nodeValue=t}function l(e,n){var r,o,a,s;if(r=e.ownerDocument,a=r.createTextNode(t.ZWSP),s=e.parentNode,n){if(o=e.previousSibling,p(o)){if(i(o))return o;if(f(o))return o.splitText(o.data.length-1)}s.insertBefore(a,e)}else{if(o=e.nextSibling,p(o)){if(i(o))return o;if(d(o))return o.splitText(1),o}e.nextSibling?s.insertBefore(a,e.nextSibling):s.appendChild(a)}return a}function c(e,t,n){var r,i,o;return r=t.ownerDocument,i=r.createElement(e),i.setAttribute("data-mce-caret",n?"before":"after"),i.setAttribute("data-mce-bogus","all"),i.appendChild(r.createTextNode("\xa0")),o=t.parentNode,n?o.insertBefore(i,t):t.nextSibling?o.insertBefore(i,t.nextSibling):o.appendChild(i),i}function u(e){if(h(e)&&i(e)&&(" "!=e.innerHTML?e.removeAttribute("data-mce-caret"):o(e)),p(e)){var n=t.trim(a(e));s(e,n)}}function d(e){return p(e)&&e.data[0]==t.ZWSP}function f(e){return p(e)&&e.data[e.data.length-1]==t.ZWSP}var h=e.isElement,p=e.isText;return{isCaretContainer:i,isCaretContainerBlock:n,isCaretContainerInline:r,insertInline:l,insertBlock:c,remove:u,startsWithCaretContainer:d,endsWithCaretContainer:f}}),r(T,[m,y,_,b,k],function(e,t,n,r,i){function o(e,t){var n=e.childNodes;return t--,t>n.length-1?t=n.length-1:0>t&&(t=0),n[t]||e}function a(e){this.walk=function(t,n){function r(e){var t;return t=e[0],3===t.nodeType&&t===c&&u>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===f&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function i(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,o){var a=o?"nextSibling":"previousSibling";for(g=e,v=g.parentNode;g&&g!=t;g=v)v=g.parentNode,y=i(g==e?g:g[a],a),y.length&&(o||y.reverse(),n(r(y)))}var c=t.startContainer,u=t.startOffset,d=t.endContainer,f=t.endOffset,h,p,m,g,v,y,b;if(b=e.select("td[data-mce-selected],th[data-mce-selected]"),b.length>0)return void l(b,function(e){n([e])});if(1==c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[u]),1==d.nodeType&&d.hasChildNodes()&&(d=o(d,f)),c==d)return n(r([c]));for(h=e.findCommonAncestor(c,d),g=c;g;g=g.parentNode){if(g===d)return s(c,h,!0);if(g===h)break}for(g=d;g;g=g.parentNode){if(g===c)return s(d,h);if(g===h)break}p=a(c,h)||c,m=a(d,h)||d,s(c,p,!0),y=i(p==c?p:p.nextSibling,"nextSibling",m==d?m.nextSibling:m),y.length&&n(r(y)),s(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&r<n.nodeValue.length&&(i=t(n,r),n=i.previousSibling,o>r?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r<n.nodeValue.length&&(n=t(n,r),r=0),3==i.nodeType&&o>0&&o<i.nodeValue.length&&(i=t(i,o).previousSibling,o=i.nodeValue.length)),{startContainer:n,startOffset:r,endContainer:i,endOffset:o}},this.normalize=function(n){function r(r){function a(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}function s(n,r){for(var i=new t(n,e.getParent(n.parentNode,e.isBlock)||g);n=i[r?"prev":"next"]();)if("BR"===n.nodeName)return!0}function l(e){for(;e&&e!=g;){if(c(e))return!0;e=e.parentNode}return!1}function d(e,t){return e.previousSibling&&e.previousSibling.nodeName==t}function f(n,r){var a,s,l;if(r=r||h,l=e.getParent(r.parentNode,e.isBlock)||g,n&&"BR"==r.nodeName&&C&&e.isEmpty(l))return h=r.parentNode,p=e.nodeIndex(r),void(i=!0);for(a=new t(r,l);v=a[n?"prev":"next"]();){if("false"===e.getContentEditableParent(v)||u(v))return;if(3===v.nodeType&&v.nodeValue.length>0)return h=v,p=n?v.nodeValue.length:0,void(i=!0);if(e.isBlock(v)||y[v.nodeName.toLowerCase()])return;s=v}o&&s&&(h=s,i=!0,p=0)}var h,p,m,g=e.getRoot(),v,y,b,C;if(h=n[(r?"start":"end")+"Container"],p=n[(r?"start":"end")+"Offset"],C=1==h.nodeType&&p===h.childNodes.length,y=e.schema.getNonEmptyElements(),b=r,!u(h)){if(1==h.nodeType&&p>h.childNodes.length-1&&(b=!1),9===h.nodeType&&(h=e.getRoot(),p=0),h===g){if(b&&(v=h.childNodes[p>0?p-1:0])){if(u(v))return;if(y[v.nodeName]||"TABLE"==v.nodeName)return}if(h.hasChildNodes()){if(p=Math.min(!b&&p>0?p-1:p,h.childNodes.length-1),h=h.childNodes[p],p=0,!o&&h===g.lastChild&&"TABLE"===h.nodeName)return;if(l(h)||u(h))return;if(h.hasChildNodes()&&!/TABLE/.test(h.nodeName)){v=h,m=new t(h,g);do{if(c(v)||u(v)){i=!1;break}if(3===v.nodeType&&v.nodeValue.length>0){p=b?0:v.nodeValue.length,h=v,i=!0;break}if(y[v.nodeName.toLowerCase()]&&!a(v)){p=e.nodeIndex(v),h=v.parentNode,"IMG"!=v.nodeName||b||p++,i=!0;break}}while(v=b?m.next():m.prev())}}}o&&(3===h.nodeType&&0===p&&f(!0),1===h.nodeType&&(v=h.childNodes[p],v||(v=h.childNodes[p-1]),!v||"BR"!==v.nodeName||d(v,"A")||s(v)||s(v,!0)||f(!0,v))),b&&!o&&3===h.nodeType&&p===h.nodeValue.length&&f(!1),i&&n["set"+(r?"Start":"End")](h,p)}}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}function s(t,n,r){var i,o,a;if(i=r.elementFromPoint(t,n),o=r.body.createTextRange(),i&&"HTML"!=i.tagName||(i=r.body),o.moveToElementText(i),a=e.toArray(o.getClientRects()),a=a.sort(function(e,t){return e=Math.abs(Math.max(e.top-n,e.bottom-n)),t=Math.abs(Math.max(t.top-n,t.bottom-n)),e-t}),a.length>0){n=(a[0].bottom+a[0].top)/2;try{return o.moveToPoint(t,n),o.collapse(!0),o}catch(s){}}return null}var l=e.each,c=n.isContentEditableFalse,u=i.isCaretContainer;return a.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},a.getCaretRangeFromPoint=function(e,t,n){var r,i;if(n.caretPositionFromPoint)i=n.caretPositionFromPoint(e,t),r=n.createRange(),r.setStart(i.offsetNode,i.offset),r.collapse(!0);else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r=s(e,t,n)}}return r},a.getSelectedNode=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset==n+1?t.childNodes[n]:null},a.getNode=function(e,t){return 1==e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},a}),r(R,[T,d,u],function(e,t,n){return function(r){function i(e){var t,n;if(n=r.$(e).parentsUntil(r.getBody()).add(e),n.length===a.length){for(t=n.length;t>=0&&n[t]===a[t];t--);if(-1===t)return a=n,!0}return a=n,!1}var o,a=[];"onselectionchange"in r.getDoc()||r.on("NodeChange Click MouseUp KeyUp Focus",function(t){var n,i;n=r.selection.getRng(),i={startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset},"nodechange"!=t.type&&e.compareRanges(i,o)||r.fire("SelectionChange"),o=i}),r.on("contextmenu",function(){r.fire("SelectionChange")}),r.on("SelectionChange",function(){var e=r.selection.getStart(!0);!t.range&&r.selection.isCollapsed()||!i(e)&&r.dom.isChildOf(e,r.getBody())&&r.nodeChanged({selectionChange:!0})}),r.on("MouseUp",function(e){e.isDefaultPrevented()||("IMG"==r.selection.getNode().nodeName?n.setEditorTimeout(r,function(){r.nodeChanged()}):r.nodeChanged())}),this.nodeChanged=function(e){var t=r.selection,n,i,o;r.initialized&&t&&!r.settings.disable_nodechange&&!r.readonly&&(o=r.getBody(),n=t.getStart()||o,n.ownerDocument==r.getDoc()&&r.dom.isChildOf(n,o)||(n=o),"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),i=[],r.dom.getParent(n,function(e){return e===o?!0:void i.push(e)}),e=e||{},e.element=n,e.parents=i,r.fire("NodeChange",e))}}}),r(A,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(B,[m],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e,t){var n={},r,i;for(r=0,i=e.length;i>r;r++)n[e[r]]=t||{};return n}var s,c,u,d=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),c=3;c<d.length;c++)"string"==typeof d[c]&&(d[c]=t(d[c])),r.push.apply(r,d[c]);for(e=t(e),s=e.length;s--;)u=[].concat(l,t(n)),a[e[s]]={attributes:i(u),attributesOrder:u,children:i(r,o)}}function r(e,n){var r,i,o,s;for(e=t(e),r=e.length,n=t(n);r--;)for(i=a[e[r]],o=0,s=n.length;s>o;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},l,c,u,d,f,h;return i[e]?i[e]:(l=t("id accesskey class dir lang style tabindex title"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),u=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(l.push.apply(l,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),u.push.apply(u,t("audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(l.push("xml:lang"),h=t("acronym applet basefont big font strike tt"),u.push.apply(u,h),s(h,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),s(f,function(e){n(e,"",d)})),d=d||[].concat(c,u),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),n("address dt dd div caption","",d),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",u),n("blockquote","cite",d),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",d),n("dl","","dt dd"),n("a","href target rel media hreflang type",u),n("q","cite",u),n("ins del","cite datetime",d),n("img","src sizes srcset alt usemap ismap width height"),n("iframe","src name width height",d),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",d,"param"),n("param","name value"),n("map","name",d,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",d),n("th","colspan rowspan headers scope abbr",d),n("form","accept-charset action autocomplete enctype method name novalidate target",d),n("fieldset","disabled form name",d,"legend"),n("label","form for",u),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?d:u),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",d,"li"),n("noscript","",d),"html4"!=e&&(n("wbr"),n("ruby","",u,"rt rp"),n("figcaption","",d),n("mark rt rp summary bdi","",u),n("canvas","width height",d),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",d,"track source"),n("picture","","img source"),n("source","src srcset type media sizes"),n("track","kind src srclang label default"),n("datalist","",u,"option"),n("article section nav aside header footer","",d),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",d,"figcaption"),n("time","datetime",u),n("dialog","open",d),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",u),n("progress","value max",u),n("meter","value min max low high optimum",u),n("details","open",d,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(r("script","language xml:space"),r("style","xml:space"),r("object","declare classid code codebase codetype archive standby align border hspace vspace"),r("embed","align name hspace vspace"),r("param","valuetype type"),r("a","charset name rev shape coords"),r("br","clear"),r("applet","codebase archive code object alt name width height align hspace vspace"),r("img","name longdesc align border hspace vspace"),r("iframe","longdesc frameborder marginwidth marginheight scrolling align"),r("font basefont","size color face"),r("input","usemap align"),r("select","onchange"),r("textarea"),r("h1 h2 h3 h4 h5 h6 div p legend caption","align"),r("ul","type compact"),r("li","type"),r("ol dl menu dir","compact"),r("pre","width xml:space"),r("hr","align noshade size width"),r("isindex","prompt"),r("table","summary width frame rules cellspacing cellpadding align bgcolor"),r("col","width align char charoff valign"),r("colgroup","width align char charoff valign"),r("thead","align char charoff valign"),r("tr","align char charoff valign bgcolor"),r("th","axis align char charoff valign nowrap bgcolor width height"),r("form","accept"),r("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),r("tfoot","align char charoff valign"),r("tbody","align char charoff valign"),r("area","nohref"),r("body","background bgcolor text link vlink alink")),"html4"!=e&&(r("input button select textarea","autofocus"),r("input textarea","placeholder"),r("a","download"),r("link script img","crossorigin"),r("iframe","sandbox seamless allowfullscreen")),s(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,delete a.script,i[e]=a,a)}function r(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),s(e,function(e,r){n[r]=n[r.toUpperCase()]="map"==t?a(e,/[, ]/):c(e,/[, ]/)})),n}var i={},o={},a=e.makeMap,s=e.each,l=e.extend,c=e.explode,u=e.inArray;return function(e){function o(t,n,r){var o=e[t];return o?o=a(o,/[, ]/,a(o.toUpperCase(),/[, ]/)):(o=i[t],o||(o=a(n," ",a(n.toUpperCase()," ")),o=l(o,r),i[t]=o)),o}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function f(e){var n,r,i,o,s,l,c,f,h,p,m,g,v,b,x,w,N,E,_,S=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,k=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),y["@"]&&(w=y["@"].attributes,N=y["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=S.exec(e[n])){if(b=s[1],h=s[2],x=s[3],f=s[5],g={},v=[],l={attributes:g,attributesOrder:v},"#"===b&&(l.paddEmpty=!0),"-"===b&&(l.removeEmpty=!0),"!"===s[4]&&(l.removeEmptyAttrs=!0),w){for(E in w)g[E]=w[E];v.push.apply(v,N)}if(f)for(f=t(f,"|"),i=0,o=f.length;o>i;i++)if(s=k.exec(f[i])){if(c={},m=s[1],p=s[2].replace(/::/g,":"),b=s[3],_=s[4],"!"===m&&(l.attributesRequired=l.attributesRequired||[],l.attributesRequired.push(p),c.required=!0),"-"===m){delete g[p],v.splice(u(v,p),1);continue}b&&("="===b&&(l.attributesDefault=l.attributesDefault||[],l.attributesDefault.push({name:p,value:_}),c.defaultValue=_),":"===b&&(l.attributesForced=l.attributesForced||[],l.attributesForced.push({name:p,value:_}),c.forcedValue=_),"<"===b&&(c.validValues=a(_,"?"))), T.test(p)?(l.attributePatterns=l.attributePatterns||[],c.pattern=d(p),l.attributePatterns.push(c)):(g[p]||v.push(p),g[p]=c)}w||"@"!=h||(w=g,N=v),x&&(l.outputName=h,y[x]=l),T.test(h)?(l.pattern=d(h),C.push(l)):y[h]=l}}function h(e){y={},C=[],f(e),s(N,function(e,t){b[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&(i.text_block_elements=i.block_elements=null,s(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",o=t[2];if(b[o]=b[i],M[o]=i,r||(R[o.toUpperCase()]={},R[o]={}),!y[o]){var a=y[i];a=l({},a),delete a.removeEmptyAttrs,delete a.removeEmpty,y[o]=a}s(b,function(e,t){e[i]&&(b[t]=e=l({},b[t]),e[o]=e[i])})}))}function m(n){var r=/^([+\-]?)(\w+)\[([^\]]+)\]$/;i[e.schema]=null,n&&s(t(n,","),function(e){var n=r.exec(e),i,o;n&&(o=n[1],i=o?b[n[2]]:b[n[2]]={"#comment":{}},i=b[n[2]],s(t(n[3],"|"),function(e){"-"===o?delete i[e]:i[e]={}}))})}function g(e){var t=y[e],n;if(t)return t;for(n=C.length;n--;)if(t=C[n],t.pattern.test(e))return t}var v=this,y={},b={},C=[],x,w,N,E,_,S,k,T,R,A,B,D,L,M={},P={};e=e||{},N=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),x=r(e.valid_styles),w=r(e.invalid_styles,"map"),T=r(e.valid_classes,"map"),E=o("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=o("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),S=o("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),k=o("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),A=o("non_empty_elements","td th iframe video audio object script",S),B=o("move_caret_before_on_enter_elements","table",A),D=o("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),R=o("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption",D),L=o("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),s((e.special||"script noscript style textarea").split(" "),function(e){P[e]=new RegExp("</"+e+"[^>]*>","gi")}),e.valid_elements?h(e.valid_elements):(s(N,function(e,t){y[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},b[t]=e.children}),"html5"!=e.schema&&s(t("strong/b em/i"),function(e){e=t(e,"/"),y[e[1]].outputName=e[0]}),s(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){y[e]&&(y[e].removeEmpty=!0)}),s(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){y[e].paddEmpty=!0}),s(t("span"),function(e){y[e].removeEmptyAttrs=!0})),p(e.custom_elements),m(e.valid_children),f(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&s(c(e.invalid_elements),function(e){y[e]&&delete y[e]}),g("span")||f("span[!data-mce-type|*]"),v.children=b,v.getValidStyles=function(){return x},v.getInvalidStyles=function(){return w},v.getValidClasses=function(){return T},v.getBoolAttrs=function(){return k},v.getBlockElements=function(){return R},v.getTextBlockElements=function(){return D},v.getTextInlineElements=function(){return L},v.getShortEndedElements=function(){return S},v.getSelfClosingElements=function(){return _},v.getNonEmptyElements=function(){return A},v.getMoveCaretBeforeOnEnterElements=function(){return B},v.getWhiteSpaceElements=function(){return E},v.getSpecialElements=function(){return P},v.isValidChild=function(e,t){var n=b[e];return!(!n||!n[t])},v.isValid=function(e,t){var n,r,i=g(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},v.getElementRule=g,v.getCustomElements=function(){return M},v.addValidElements=f,v.setValidElements=h,v.addCustomElements=p,v.addValidChildren=m,v.elements=y}}),r(D,[B,C,m],function(e,t,n){function r(e,t,n){var r=1,i,o,a,s;for(s=e.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g,a.lastIndex=i=n;o=a.exec(t);){if(i=a.lastIndex,"/"===o[1])r--;else if(!o[1]){if(o[2]in s)continue;r++}if(0===r)break}return i}function i(i,a){function s(){}var l=this;i=i||{},l.schema=a=a||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),o("comment cdata text start end pi doctype".split(" "),function(e){e&&(l[e]=i[e]||s)}),l.parse=function(e){function o(e){var t,n;for(t=h.length;t--&&h[t].name!==e;);if(t>=0){for(n=h.length-1;n>=t;n--)e=h[n],e.valid&&l.end(e.name);h.length=t}}function s(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in x?t:z(n||r||o||""),N&&!y&&0!==t.indexOf("data-")){if(a=T[t],!a&&R){for(s=R.length;s--&&(a=R[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(W[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{c=decodeURIComponent(c)}catch(u){c=unescape(c)}if(V.test(c))return;if(!i.allow_html_data_urls&&$.test(c)&&!/^data:image\//i.test(c))return}p.map[t]=n,p.push({name:t,value:n})}var l=this,c,u=0,d,f,h=[],p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F=0,z=t.decode,U,W=n.makeMap("src,href,data,background,formaction,poster"),V=/((java|vb)script|mhtml):/i,$=/^data:/i;for(P=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),O=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,C=a.getShortEndedElements(),M=i.self_closing_elements||a.getSelfClosingElements(),x=a.getBoolAttrs(),N=i.validate,b=i.remove_internals,U=i.fix_self_closing,H=a.getSpecialElements();c=P.exec(e);){if(u<c.index&&l.text(z(e.substr(u,c.index-u))),d=c[6])d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),o(d);else if(d=c[7]){if(d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),w=d in C,U&&M[d]&&h.length>0&&h[h.length-1].name===d&&o(d),!N||(E=a.getElementRule(d))){if(_=!0,N&&(T=E.attributes,R=E.attributePatterns),(k=c[8])?(y=-1!==k.indexOf("data-mce-type"),y&&b&&(_=!1),p=[],p.map={},k.replace(O,s)):(p=[],p.map={}),N&&!y){if(A=E.attributesRequired,B=E.attributesDefault,D=E.attributesForced,L=E.removeEmptyAttrs,L&&!p.length&&(_=!1),D)for(m=D.length;m--;)S=D[m],v=S.name,I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I});if(B)for(m=B.length;m--;)S=B[m],v=S.name,v in p.map||(I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I}));if(A){for(m=A.length;m--&&!(A[m]in p.map););-1===m&&(_=!1)}if(S=p.map["data-mce-bogus"]){if("all"===S){u=r(a,e,P.lastIndex),P.lastIndex=u;continue}_=!1}}_&&l.start(d,p,w)}else _=!1;if(f=H[d]){f.lastIndex=u=c.index+c[0].length,(c=f.exec(e))?(_&&(g=e.substr(u,c.index-u)),u=c.index+c[0].length):(g=e.substr(u),u=e.length),_&&(g.length>0&&l.text(g,!0),l.end(d)),P.lastIndex=u;continue}w||(k&&k.indexOf("/")==k.length-1?_&&l.end(d):h.push({name:d,valid:_}))}else(d=c[1])?(">"===d.charAt(0)&&(d=" "+d),i.allow_conditional_comments||"[if"!==d.substr(0,3)||(d=" "+d),l.comment(d)):(d=c[2])?l.cdata(d):(d=c[3])?l.doctype(d):(d=c[4])&&l.pi(d,c[5]);u=c.index+c[0].length}for(u<e.length&&l.text(z(e.substr(u))),m=h.length-1;m>=0;m--)d=h[m],d.valid&&l.end(d.name)}}var o=n.each;return i.findEndTag=r,i}),r(L,[A,B,D,m],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,h,p,m,g,v,y,b;for(m=i("tr,td,th,tbody,thead,tfoot,table"),p=l.getNonEmptyElements(),g=l.getTextBlockElements(),v=l.getSpecialElements(),n=0;n<t.length;n++)if(r=t[n],r.parent&&!r.fixed)if(g[r.name]&&"li"==r.parent.name){for(y=r.next;y&&g[y.name];)y.name="li",y.fixed=!0,r.parent.insert(y,r.parent),y=y.next;r.unwrap(r)}else{for(a=[r],o=r.parent;o&&!l.isValidChild(o.name,r.name)&&!m[o.name];o=o.parent)a.push(o);if(o&&a.length>1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),h=0;h<a.length-1;h++){for(l.isValidChild(c.name,a[h].name)?(d=u.filterNode(a[h].clone()),c.append(d)):d=c,f=a[h].firstChild;f&&f!=a[h+1];)b=f.next,d.append(f),f=b;c=d}s.isEmpty(p)?o.insert(r,a[0],!0):(o.insert(s,a[0],!0),o.insert(r,s)),o=a[0],(o.isEmpty(p)||o.firstChild===o.lastChild&&"br"===o.firstChild.name)&&o.empty().remove()}else if(r.parent){if("li"===r.name){if(y=r.prev,y&&("ul"===y.name||"ul"===y.name)){y.append(r);continue}if(y=r.next,y&&("ul"===y.name||"ul"===y.name)){y.insert(r,y.firstChild,!0);continue}r.wrap(u.filterNode(new e("ul",1)));continue}l.isValidChild(r.parent.name,"div")&&l.isValidChild("div",r.name)?r.wrap(u.filterNode(new e("div",1))):v[r.name]?r.empty().remove():r.unwrap()}}}var u=this,d={},f=[],h={},p={};r=r||{},r.validate="validate"in r?r.validate:!0,r.root_name=r.root_name||"body",u.schema=l=l||new t,u.filterNode=function(e){var t,n,r;n in d&&(r=h[n],r?r.push(e):h[n]=[e]),t=f.length;for(;t--;)n=f[t].name,n in e.attributes.map&&(r=p[n],r?r.push(e):p[n]=[e]);return e},u.addNodeFilter=function(e,t){o(a(e),function(e){var n=d[e];n||(d[e]=n=[]),n.push(t)})},u.addAttributeFilter=function(e,t){o(a(e),function(e){var n;for(n=0;n<f.length;n++)if(f[n].name===e)return void f[n].callbacks.push(t);f.push({name:e,callbacks:[t]})})},u.parse=function(t,o){function a(){function e(e){e&&(t=e.firstChild,t&&3==t.type&&(t.value=t.value.replace(R,"")),t=e.lastChild,t&&3==t.type&&(t.value=t.value.replace(D,"")))}var t=y.firstChild,n,i;if(l.isValidChild(y.name,I.toLowerCase())){for(;t;)n=t.next,3==t.type||1==t.type&&"p"!==t.name&&!T[t.name]&&!t.attr("data-mce-type")?i?i.append(t):(i=u(I,1),i.attr(r.forced_root_block_attrs),y.insert(i,t),i.append(t)):(e(i),i=null),t=n;e(i)}}function u(t,n){var r=new e(t,n),i;return t in d&&(i=h[t],i?i.push(r):h[t]=[r]),r}function m(e){var t,n,r,i,o=l.getBlockElements();for(t=e.prev;t&&3===t.type;){if(r=t.value.replace(D,""),r.length>0)return void(t.value=r);if(n=t.next){if(3==n.type&&n.value.length){t=t.prev;continue}if(!o[n.name]&&"script"!=n.name&&"style"!=n.name){t=t.prev;continue}}i=t.prev,t.remove(),t=i}}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,N,E,_,S,k,T,R,A=[],B,D,L,M,P,O,H,I;if(o=o||{},h={},p={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),H=l.getNonEmptyElements(),O=l.children,k=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,P=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,L=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,v=new n({validate:k,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(L," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=k?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=O[b.name],s&&O[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(_=p[a],_?_.push(r):p[a]=[r]);T[e]&&m(r),n||(b=r),!B&&P[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=k?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(D,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o}if(B&&P[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(H))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,T[b.name]?b.empty().remove():b.unwrap(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),k&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(S in h){for(_=d[S],C=h[S],N=C.length;N--;)C[N].parent||C.splice(N,1);for(x=0,w=_.length;w>x;x++)_[x](C,S,o)}for(x=0,w=f.length;w>x;x++)if(_=f[x],_.name in p){for(C=p[_.name],N=C.length;N--;)C[N].parent||C.splice(N,1);for(N=0,E=_.callbacks.length;E>N;N++)_.callbacks[N](C,_.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,h,p;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(h=l.getElementRule(c.name),h&&(h.removeEmpty?c.remove():h.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(p=new e("#text",3),p.value="\xa0",i.replace(p))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}}),r.validate&&l.getValidClasses()&&u.addAttributeFilter("class",function(e){for(var t=e.length,n,r,i,o,a,s=l.getValidClasses(),c,u;t--;){for(n=e[t],r=n.attr("class").split(" "),a="",i=0;i<r.length;i++)o=r[i],u=!1,c=s["*"],c&&c[o]&&(u=!0),c=s[n.name],!u&&c&&c[o]&&(u=!0),u&&(a&&(a+=" "),a+=o);a.length||(a=null),n.attr("class",a)}})}}),r(M,[C,m],function(e,t){var n=t.makeMap;return function(t){var r=[],i,o,a,s,l;return t=t||{},i=t.indent,o=n(t.indent_before||""),a=n(t.indent_after||""),s=e.getEncodeFunc(t.entity_encoding||"raw",t.entities),l="html"==t.element_format,{start:function(e,t,n){var c,u,d,f;if(i&&o[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');!n||l?r[r.length]=">":r[r.length]=" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push("</",e,">"),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("<![CDATA[",e,"]]>")},comment:function(e){r.push("<!--",e,"-->")},pi:function(e,t){t?r.push("<?",e," ",s(t),"?>"):r.push("<?",e,"?>"),i&&r.push("\n")},doctype:function(e){r.push("<!DOCTYPE",e,">",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(P,[M,B],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,h,p,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1&&(f=[],f.map={},m=r.getElementRule(e.name))){for(h=0,p=m.attributesOrder.length;p>h;h++)u=m.attributesOrder[h],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(h=0,p=c.length;p>h;h++)u=c[h].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(O,[w,L,D,C,P,A,B,d,m,S],function(e,t,n,r,i,o,a,s,l,c){function u(e){function t(e){return e&&"br"===e.name}var n,r;n=e.lastChild,t(n)&&(r=n.prev,t(r)&&(n.remove(),r.remove()))}var d=l.each,f=l.trim,h=e.DOM,p=["data-mce-selected"];return function(e,o){function m(e){var t=new RegExp(["<span[^>]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","\\s?("+p.join("|")+')="[^"]+"'].join("|"),"gi");return e=c.trim(e.replace(t,""))}function g(){var e=o.getBody().innerHTML,t=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,r,i,a,s,l,c=o.schema;for(e=m(e),l=c.getShortEndedElements();s=t.exec(e);)i=t.lastIndex,a=s[0].length,r=l[s[1]]?i:n.findEndTag(c,e,i),e=e.substring(0,i-a)+e.substring(r),t.lastIndex=i-a;return f(e)}function v(e){-1===l.inArray(p,e)&&(C.addAttributeFilter(e,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),p.push(e))}var y,b,C;return o&&(y=o.dom,b=o.schema),y=y||h,b=b||new a(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,C=new t(e,b),C.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n=e.length,r;n--;)r=e[n],r.attr("tabindex",r.attributes.map["data-mce-tabindex"]),r.attr(t,null)}),C.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,s=e.url_converter,l=e.url_converter_scope,c;r--;)i=t[r],o=i.attributes.map[a],o!==c?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=y.serializeStyle(y.parseStyle(o),i.name):s&&(o=s.call(l,o,n,i.name)),i.attr(n,o.length>0?o:null))}),C.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class"),r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}),C.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),C.addNodeFilter("noscript",function(e){for(var t=e.length,n;t--;)n=e[t].firstChild,n&&(n.value=r.decode(n.value))}),C.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o,a;r--;)i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t?(a=i.attr("type"),a&&i.attr("type","mce-no/type"==a?null:a.replace(/^mce\-/,"")),o.length>0&&(i.firstChild.value="// <![CDATA[\n"+n(o)+"\n// ]]>")):o.length>0&&(i.firstChild.value="<!--\n"+n(o)+"\n-->")}),C.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),C.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&C.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,"ul"!==r.name&&"ol"!==r.name||n.prev&&"li"===n.prev.name&&n.prev.append(n)}),C.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:b,addNodeFilter:C.addNodeFilter,addAttributeFilter:C.addAttributeFilter,serialize:function(t,n){var r=this,o,a,l,h,p,m;return s.ie&&y.select("script,style,select,map").length>0?(p=t.innerHTML,t=t.cloneNode(!1),y.setHTML(t,p)):t=t.cloneNode(!0),o=document.implementation,o.createHTMLDocument&&(a=o.createHTMLDocument(""),d("BODY"==t.nodeName?t.childNodes:[t],function(e){a.body.appendChild(a.importNode(e,!0))}),t="BODY"!=t.nodeName?a.body.firstChild:a.body,l=y.doc,y.doc=a),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,r.onPreProcess(n)),m=C.parse(f(n.getInner?t.innerHTML:y.getOuterHTML(t)),n),u(m),h=new i(e,b),n.content=h.serialize(m),n.cleanup||(n.content=c.trim(n.content),n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||r.onPostProcess(n),l&&(y.doc=l),n.node=null,n.content},addRules:function(e){b.addValidElements(e)},setRules:function(e){b.setValidElements(e)},onPreProcess:function(e){o&&o.fire("PreProcess",e)},onPostProcess:function(e){o&&o.fire("PostProcess",e)},addTempAttr:v,trimHtml:m,getTrimmedContent:g}}}),r(H,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(3==l.nodeType&&(u=l.nodeValue,s+=u.length,s>=i)){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(3==l.nodeType&&(s+=l.nodeValue.length,s>=i)){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,p;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),t!=f&&t!=f.documentElement||(t=h,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(p=t.childNodes,p.length?(n>=p.length?i.insertAfter(a,p[p.length-1]):t.insertBefore(a,p[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="<span></span>",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,h=f.body,p,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=h.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="<span></span><span></span>",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=h.createControlRange(),a.addElement(m),a.select(),p=e.getRng(),p.item&&m===p.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(I,[d],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(t){return e.mac?t.metaKey:t.ctrlKey&&!t.altKey}}}),r(F,[I,m,u,d,_],function(e,t,n,r,i){function o(e,t){for(;t&&t!=e;){if(s(t)||a(t))return t;t=t.parentNode}return null}var a=i.isContentEditableFalse,s=i.isContentEditableTrue;return function(i,s){function l(e){var t=s.settings.object_resizing;return t===!1||r.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:e==s.getBody()?!1:s.dom.is(e,t))}function c(t){var n,r,i,o,a;n=t.screenX-L,r=t.screenY-M,U=n*B[2]+H,W=r*B[3]+I,U=5>U?5:U,W=5>W?5:W,i="IMG"==k.nodeName&&s.settings.resize_img_proportional!==!1?!e.modifierPressed(t):e.modifierPressed(t)||"IMG"==k.nodeName&&B[2]*B[3]!==0,i&&(j(n)>j(r)?(W=Y(U*F),U=Y(W/F)):(U=Y(W/F),W=Y(U*F))),_.setStyles(T,{width:U,height:W}),o=B.startPos.x+n,a=B.startPos.y+r,o=o>0?o:0,a=a>0?a:0,_.setStyles(R,{left:o,top:a,display:"block"}),R.innerHTML=U+" × "+W,B[2]<0&&T.clientWidth<=U&&_.setStyle(T,"left",P+(H-U)),B[3]<0&&T.clientHeight<=W&&_.setStyle(T,"top",O+(I-W)),n=X.scrollWidth-K,r=X.scrollHeight-G,n+r!==0&&_.setStyles(R,{left:o-n,top:a-r}),z||(s.fire("ObjectResizeStart",{target:k,width:H,height:I}),z=!0)}function u(){function e(e,t){t&&(k.style[e]||!s.schema.isValid(k.nodeName.toLowerCase(),e)?_.setStyle(k,e,t):_.setAttrib(k,e,t))}z=!1,e("width",U),e("height",W),_.unbind(V,"mousemove",c),_.unbind(V,"mouseup",u),$!=V&&(_.unbind($,"mousemove",c),_.unbind($,"mouseup",u)),_.remove(T),_.remove(R),q&&"TABLE"!=k.nodeName||d(k),s.fire("ObjectResized",{target:k,width:U,height:W}),_.setAttrib(k,"style",_.getAttrib(k,"style")),s.nodeChanged()}function d(e,t,n){var i,o,a,d,h;f(),x(),i=_.getPos(e,X),P=i.x,O=i.y,h=e.getBoundingClientRect(),o=h.width||h.right-h.left,a=h.height||h.bottom-h.top,k!=e&&(C(),k=e,U=W=0),d=s.fire("ObjectSelected",{target:e}),l(e)&&!d.isDefaultPrevented()?S(A,function(e,i){function s(t){L=t.screenX,M=t.screenY,H=k.clientWidth,I=k.clientHeight,F=I/H,B=e,e.startPos={x:o*e[0]+P,y:a*e[1]+O},K=X.scrollWidth,G=X.scrollHeight,T=k.cloneNode(!0),_.addClass(T,"mce-clonedresizable"),_.setAttrib(T,"data-mce-bogus","all"),T.contentEditable=!1,T.unSelectabe=!0,_.setStyles(T,{left:P,top:O,margin:0}),T.removeAttribute("data-mce-selected"),X.appendChild(T),_.bind(V,"mousemove",c),_.bind(V,"mouseup",u),$!=V&&(_.bind($,"mousemove",c),_.bind($,"mouseup",u)),R=_.add(X,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},H+" × "+I)}var l;return t?void(i==t&&s(n)):(l=_.get("mceResizeHandle"+i),l&&_.remove(l),l=_.add(X,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),r.ie&&(l.contentEditable=!1),_.bind(l,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),s(e)}),e.elm=l,void _.setStyles(l,{left:o*e[0]+P-l.offsetWidth/2,top:a*e[1]+O-l.offsetHeight/2}))}):f(),k.setAttribute("data-mce-selected","1")}function f(){var e,t;x(),k&&k.removeAttribute("data-mce-selected");for(e in A)t=_.get("mceResizeHandle"+e),t&&(_.unbind(t),_.remove(t))}function h(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n,r;if(!z&&!s.removed)return S(_.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),r="mousedown"==e.type?e.target:i.getNode(),r=_.$(r).closest(q?"table":"table,img,hr")[0],t(r,X)&&(w(),n=i.getStart(!0),t(n,r)&&t(i.getEnd(!0),r)&&(!q||r!=n&&"IMG"!==n.nodeName))?void d(r):void f()}function p(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function m(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function g(e){var t=e.srcElement,n,r,i,o,a,l,c;n=t.getBoundingClientRect(),l=D.clientX-n.left,c=D.clientY-n.top;for(r in A)if(i=A[r],o=t.offsetWidth*i[0],a=t.offsetHeight*i[1],j(o-l)<8&&j(a-c)<8){B=i;break}z=!0,s.fire("ObjectResizeStart",{target:k,width:k.clientWidth,height:k.clientHeight}),s.getDoc().selection.empty(),d(t,r,D)}function v(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function y(e){return a(o(s.getBody(),e))}function b(e){var t=e.srcElement;if(y(t))return void v(e);if(t!=k){if(s.fire("ObjectSelected",{target:t}),C(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);"IMG"!=t.nodeName&&"TABLE"!=t.nodeName||(f(),k=t,p(t,"resizestart",g))}}function C(){m(k,"resizestart",g)}function x(){for(var e in A){var t=A[e];t.elm&&(_.unbind(t.elm),delete t.elm)}}function w(){try{s.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function N(e){var t;if(q){t=V.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function E(){k=T=null,q&&(C(),m(X,"controlselect",b))}var _=s.dom,S=t.each,k,T,R,A,B,D,L,M,P,O,H,I,F,z,U,W,V=s.getDoc(),$=document,q=r.ie&&r.ie<11,j=Math.abs,Y=Math.round,X=s.getBody(),K,G;A={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var J=".mce-content-body";return s.contentStyles.push(J+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: box-sizing;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+J+" .mce-resizehandle:hover {background: #000}"+J+" img[data-mce-selected],"+J+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+J+" .mce-clonedresizable {position: absolute;"+(r.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+J+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}"),s.on("init",function(){q?(s.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(f(),N(e.target))}),p(X,"controlselect",b),s.on("mousedown",function(e){D=e})):(w(),r.ie>=11&&(s.on("mousedown click",function(e){var t=e.target,n=t.nodeName;z||!/^(TABLE|IMG|HR)$/.test(n)||y(t)||(s.selection.select(t,"TABLE"==n),"mousedown"==e.type&&s.nodeChanged())}),s.dom.bind(X,"mscontrolselect",function(e){function t(e){n.setEditorTimeout(s,function(){s.selection.select(e)})}return y(e.target)?(e.preventDefault(),void t(e.target)):void(/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&t(e.target)))})));var e=n.throttle(function(e){s.composing||h(e)});s.on("nodechange ResizeEditor ResizeWindow drop",e),s.on("keyup compositionend",function(t){k&&"TABLE"==k.nodeName&&e(t)}),s.on("hide blur",f)}),s.on("remove",x),{isResizable:l,showResizeRect:d,hideResizeRect:f,updateResizeRect:h,controlSelect:N,destroy:E}}}),r(z,[],function(){function e(e){return function(){return e}}function t(e){return function(t){return!e(t)}}function n(e,t){return function(n){return e(t(n))}}function r(){var e=a.call(arguments);return function(t){for(var n=0;n<e.length;n++)if(e[n](t))return!0;return!1}}function i(){var e=a.call(arguments); return function(t){for(var n=0;n<e.length;n++)if(!e[n](t))return!1;return!0}}function o(e){var t=a.call(arguments);return t.length-1>=e.length?e.apply(this,t.slice(1)):function(){var e=t.concat([].slice.call(arguments));return o.apply(this,e)}}var a=[].slice;return{constant:e,negate:t,and:i,or:r,curry:o,compose:n}}),r(U,[_,p,k],function(e,t,n){function r(e){return m(e)?!1:d(e)?!f(e.parentNode):h(e)||u(e)||p(e)||c(e)}function i(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode){if(c(e))return!1;if(l(e))return!0}return!0}function o(e){return c(e)?t.reduce(e.getElementsByTagName("*"),function(e,t){return e||l(t)},!1)!==!0:!1}function a(e){return h(e)||o(e)}function s(e,t){return r(e)&&i(e,t)}var l=e.isContentEditableTrue,c=e.isContentEditableFalse,u=e.isBr,d=e.isText,f=e.matchNodeNames("script style textarea"),h=e.matchNodeNames("img input textarea hr iframe video audio object"),p=e.matchNodeNames("table"),m=n.isCaretContainer;return{isCaretCandidate:r,isInEditable:i,isAtomic:a,isEditableCaretCandidate:s}}),r(W,[],function(){function e(e){return e?{left:u(e.left),top:u(e.top),bottom:u(e.bottom),right:u(e.right),width:u(e.width),height:u(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}}function t(t,n){return t=e(t),n?t.right=t.left:(t.left=t.left+t.width,t.right=t.left),t.width=0,t}function n(e,t){return e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right}function r(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2}function i(e,t){return e.bottom<t.top?!0:e.top>t.bottom?!1:r(t.top-e.bottom,e,t)}function o(e,t){return e.top>t.bottom?!0:e.bottom<t.top?!1:r(t.bottom-e.top,e,t)}function a(e,t){return e.left<t.left}function s(e,t){return e.right>t.right}function l(e,t){return i(e,t)?-1:o(e,t)?1:a(e,t)?-1:s(e,t)?1:0}function c(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom}var u=Math.round;return{clone:e,collapse:t,isEqual:n,isAbove:i,isBelow:o,isLeft:a,isRight:s,compare:l,containsXY:c}}),r(V,[],function(){function e(e){return"string"==typeof e&&e.charCodeAt(0)>=768&&t.test(e)}var t=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]");return{isExtendingChar:e}}),r($,[z,_,w,T,U,W,V],function(e,t,n,r,i,o,a){function s(e){return"createRange"in e?e.createRange():n.DOM.createRng()}function l(e){return e&&/[\r\n\t ]/.test(e)}function c(e){var t=e.startContainer,n=e.startOffset,r;return!!(l(e.toString())&&v(t.parentNode)&&(r=t.data,l(r[n-1])||l(r[n+1])))}function u(e){function t(e){var t=e.ownerDocument,n=s(t),r=t.createTextNode("\xa0"),i=e.parentNode,a;return i.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1),a=o.clone(n.getBoundingClientRect()),i.removeChild(r),a}function n(e){var n,r;return r=e.getClientRects(),n=r.length>0?o.clone(r[0]):o.clone(e.getBoundingClientRect()),b(e)&&0===n.left?t(e):n}function r(e,t){return e=o.collapse(e,t),e.width=1,e.right=e.left+1,e}function i(e){0!==e.height&&(u.length>0&&o.isEqual(e,u[u.length-1])||u.push(e))}function l(e,t){var o=s(e.ownerDocument);if(t<e.data.length){if(a.isExtendingChar(e.data[t]))return u;if(a.isExtendingChar(e.data[t-1])&&(o.setStart(e,t),o.setEnd(e,t+1),!c(o)))return i(r(n(o),!1)),u}t>0&&(o.setStart(e,t-1),o.setEnd(e,t),c(o)||i(r(n(o),!1))),t<e.data.length&&(o.setStart(e,t),o.setEnd(e,t+1),c(o)||i(r(n(o),!0)))}var u=[],d,h;if(y(e.container()))return l(e.container(),e.offset()),u;if(f(e.container()))if(e.isAtEnd())h=x(e.container(),e.offset()),y(h)&&l(h,h.data.length),g(h)&&!b(h)&&i(r(n(h),!1));else{if(h=x(e.container(),e.offset()),y(h)&&l(h,0),g(h)&&e.isAtEnd())return i(r(n(h),!1)),u;d=x(e.container(),e.offset()-1),g(d)&&!b(d)&&(p(d)||p(h)||!g(h))&&i(r(n(d),!1)),g(h)&&i(r(n(h),!0))}return u}function d(t,n,r){function i(){return y(t)?0===n:0===n}function o(){return y(t)?n>=t.data.length:n>=t.childNodes.length}function a(){var e;return e=s(t.ownerDocument),e.setStart(t,n),e.setEnd(t,n),e}function l(){return r||(r=u(new d(t,n))),r}function c(){return l().length>0}function f(e){return e&&t===e.container()&&n===e.offset()}function h(e){return x(t,e?n-1:n)}return{container:e.constant(t),offset:e.constant(n),toRange:a,getClientRects:l,isVisible:c,isAtStart:i,isAtEnd:o,isEqual:f,getNode:h}}var f=t.isElement,h=i.isCaretCandidate,p=t.matchStyleValues("display","block table"),m=t.matchStyleValues("float","left right"),g=e.and(f,h,e.negate(m)),v=e.negate(t.matchStyleValues("white-space","pre pre-line pre-wrap")),y=t.isText,b=t.isBr,C=n.nodeIndex,x=r.getNode;return d.fromRangeStart=function(e){return new d(e.startContainer,e.startOffset)},d.fromRangeEnd=function(e){return new d(e.endContainer,e.endOffset)},d.after=function(e){return new d(e.parentNode,C(e)+1)},d.before=function(e){return new d(e.parentNode,C(e))},d}),r(q,[_,w,z,p,$],function(e,t,n,r,i){function o(e){var t=e.parentNode;return v(t)?o(t):t}function a(e){return e?r.reduce(e.childNodes,function(e,t){return v(t)&&"BR"!=t.nodeName?e=e.concat(a(t)):e.push(t),e},[]):[]}function s(e,t){for(;(e=e.previousSibling)&&g(e);)t+=e.data.length;return t}function l(e){return function(t){return e===t}}function c(t){var n,i,s;return n=a(o(t)),i=r.findIndex(n,l(t),t),n=n.slice(0,i+1),s=r.reduce(n,function(e,t,r){return g(t)&&g(n[r-1])&&e++,e},0),n=r.filter(n,e.matchNodeNames(t.nodeName)),i=r.findIndex(n,l(t),t),i-s}function u(e){var t;return t=g(e)?"text()":e.nodeName.toLowerCase(),t+"["+c(e)+"]"}function d(e,t,n){var r=[];for(t=t.parentNode;t!=e&&(!n||!n(t));t=t.parentNode)r.push(t);return r}function f(t,i){var o,a,l=[],c,f,h;return o=i.container(),a=i.offset(),g(o)?c=s(o,a):(f=o.childNodes,a>=f.length?(c="after",a=f.length-1):c="before",o=f[a]),l.push(u(o)),h=d(t,o),h=r.filter(h,n.negate(e.isBogus)),l=l.concat(r.map(h,function(e){return u(e)})),l.reverse().join("/")+","+c}function h(t,n,i){var o=a(t);return o=r.filter(o,function(e,t){return!g(e)||!g(o[t-1])}),o=r.filter(o,e.matchNodeNames(n)),o[i]}function p(e,t){for(var n=e,r=0,o;g(n);){if(o=n.data.length,t>=r&&r+o>=t){e=n,t-=r;break}if(!g(n.nextSibling)){e=n,t=o;break}r+=o,n=n.nextSibling}return t>e.data.length&&(t=e.data.length),new i(e,t)}function m(e,t){var n,o,a;return t?(n=t.split(","),t=n[0].split("/"),a=n.length>1?n[1]:"before",o=r.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),h(e,t[1],parseInt(t[2],10))):null},e),o?g(o)?p(o,parseInt(a,10)):(a="after"===a?y(o)+1:y(o),new i(o.parentNode,a)):null):null}var g=e.isText,v=e.isBogus,y=t.nodeIndex;return{create:f,resolve:m}}),r(j,[d,m,k,q,$,_],function(e,t,n,r,i,o){function a(a){var l=a.dom;this.getBookmark=function(e,c){function u(e,n){var r=0;return t.each(l.select(e),function(e){return"all"!==e.getAttribute("data-mce-bogus")?e==n?!1:void r++:void 0}),r}function d(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function f(e){function t(e,t){var r=e[t?"startContainer":"endContainer"],i=e[t?"startOffset":"endOffset"],o=[],a,s,u=0;if(3==r.nodeType){if(c)for(a=r.previousSibling;a&&3==a.nodeType;a=a.previousSibling)i+=a.nodeValue.length;o.push(i)}else s=r.childNodes,i>=s.length&&s.length&&(u=1,i=Math.max(0,s.length-1)),o.push(l.nodeIndex(s[i],c)+u);for(;r&&r!=n;r=r.parentNode)o.push(l.nodeIndex(r,c));return o}var n=l.getRoot(),r={};return r.start=t(e,!0),a.isCollapsed()||(r.end=t(e)),r}function h(e){function t(e){var t;if(n.isCaretContainer(e)){if(o.isText(e)&&n.isCaretContainerBlock(e)&&(e=e.parentNode),t=e.previousSibling,s(t))return t;if(t=e.nextSibling,s(t))return t}}return t(e.startContainer)||t(e.endContainer)}var p,m,g,v,y,b,C="",x;if(2==e)return b=a.getNode(),y=b?b.nodeName:null,p=a.getRng(),s(b)||"IMG"==y?{name:y,index:u(y,b)}:a.tridentSel?a.tridentSel.getBookmark(e):(b=h(p),b?(y=b.tagName,{name:y,index:u(y,b)}):f(p));if(3==e)return p=a.getRng(),{start:r.create(l.getRoot(),i.fromRangeStart(p)),end:r.create(l.getRoot(),i.fromRangeEnd(p))};if(e)return{rng:a.getRng()};if(p=a.getRng(),g=l.uniqueId(),v=a.isCollapsed(),x="overflow:hidden;line-height:0px",p.duplicate||p.item){if(p.item)return b=p.item(0),y=b.nodeName,{name:y,index:u(y,b)};m=p.duplicate();try{p.collapse(),p.pasteHTML('<span data-mce-type="bookmark" id="'+g+'_start" style="'+x+'">'+C+"</span>"),v||(m.collapse(!1),p.moveToElementText(m.parentElement()),0===p.compareEndPoints("StartToEnd",m)&&m.move("character",-1),m.pasteHTML('<span data-mce-type="bookmark" id="'+g+'_end" style="'+x+'">'+C+"</span>"))}catch(w){return null}}else{if(b=a.getNode(),y=b.nodeName,"IMG"==y)return{name:y,index:u(y,b)};m=d(p.cloneRange()),v||(m.collapse(!1),m.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_end",style:x},C))),p=d(p),p.collapse(!0),p.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_start",style:x},C))}return a.moveToBookmark({id:g,keep:1}),{id:g}},this.moveToBookmark=function(n){function i(e){var t=n[e?"start":"end"],r,i,o,a;if(t){for(o=t[0],i=d,r=t.length-1;r>=1;r--){if(a=i.childNodes,t[r]>a.length-1)return;i=a[t[r]]}3===i.nodeType&&(o=Math.min(t[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(t[0],i.childNodes.length)),e?u.setStart(i,o):u.setEnd(i,o)}return!0}function o(r){var i=l.get(n.id+"_"+r),o,a,s,c,u=n.keep;if(i&&(o=i.parentNode,"start"==r?(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),f=h=o,p=m=a):(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),h=o,m=a),!u)){for(c=i.previousSibling,s=i.nextSibling,t.each(t.grep(i.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});i=l.get(n.id+"_"+r);)l.remove(i,1);c&&s&&c.nodeType==s.nodeType&&3==c.nodeType&&!e.opera&&(a=c.nodeValue.length,c.appendData(s.nodeValue),l.remove(s),"start"==r?(f=h=c,p=m=a):(h=c,m=a))}}function s(t){return!l.isBlock(t)||t.innerHTML||e.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t}function c(){var e,t;return e=l.createRng(),t=r.resolve(l.getRoot(),n.start),e.setStart(t.container(),t.offset()),t=r.resolve(l.getRoot(),n.end),e.setEnd(t.container(),t.offset()),e}var u,d,f,h,p,m;if(n)if(t.isArray(n.start)){if(u=l.createRng(),d=l.getRoot(),a.tridentSel)return a.tridentSel.moveToBookmark(n);i(!0)&&i()&&a.setRng(u)}else"string"==typeof n.start?a.setRng(c(n)):n.id?(o("start"),o("end"),f&&(u=l.createRng(),u.setStart(s(f),p),u.setEnd(s(h),m),a.setRng(u))):n.name?a.select(l.select(n.name)[n.index]):n.rng&&a.setRng(n.rng)}}var s=o.isContentEditableFalse;return a.isBookmarkNode=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},a}),r(Y,[y,H,F,T,j,_,d,m,$],function(e,n,r,i,o,a,s,l,c){function u(e,t,i,a){var s=this;s.dom=e,s.win=t,s.serializer=i,s.editor=a,s.bookmarkManager=new o(s),s.controlSelection=new r(s,a),s.win.getSelection||(s.tridentSel=new n(s))}var d=l.each,f=l.trim,h=s.ie;return u.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='<span id="__caret">_</span>',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('<span id="__mce_tmp">_</span>'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(e){var t=this,n=t.getRng(),r,i,o,a;if(n.duplicate||n.item){if(n.item)return n.item(0);for(o=n.duplicate(),o.collapse(1),r=o.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),i=a=n.parentElement();a=a.parentNode;)if(a==r){r=i;break}return r}return r=n.startContainer,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[Math.min(r.childNodes.length-1,n.startOffset)])),r&&3==r.nodeType?r.parentNode:r},getEnd:function(e){var t=this,n=t.getRng(),r,i;return n.duplicate||n.item?n.item?n.item(0):(n=n.duplicate(),n.collapse(0),r=n.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),r&&"BODY"==r.nodeName?r.lastChild||r:r):(r=n.endContainer,i=n.endOffset,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[i>0?i-1:i])),r&&3==r.nodeType?r.parentNode:r)},getBookmark:function(e,t){return this.bookmarkManager.getBookmark(e,t)},moveToBookmark:function(e){return this.bookmarkManager.moveToBookmark(e)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a,s,l;if(!n.win)return null;if(a=n.win.document,!e&&n.lastFocusBookmark){var c=n.lastFocusBookmark;return c.startContainer?(i=a.createRange(),i.setStart(c.startContainer,c.startOffset),i.setEnd(c.endContainer,c.endOffset)):i=c,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(u){}if(l=n.editor.fire("GetSelectionRange",{range:i}),l.range!==i)return l.range;if(h&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(u){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r,i,o;if(e)if(e.select){n.explicitRange=null;try{e.select()}catch(a){}}else if(n.tridentSel){if(e.cloneRange)try{n.tridentSel.addRange(e)}catch(a){}}else{if(r=n.getSel(),o=n.editor.fire("SetSelectionRange",{range:e}),e=o.range,r){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(a){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}e.collapsed||e.startContainer!=e.endContainer||!r.setBaseAndExtent||s.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(i=e.startContainer.childNodes[e.startOffset],i&&"IMG"==i.tagName&&n.getSel().setBaseAndExtent(i,0,i,1))}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i,o,a,s,l=t.dom.getRoot();return n?(i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r)):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return s.range&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};d(n.selectorChangedData,function(e,t){d(o,function(n){return i.is(n,t)?(r[t]||(d(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),d(r,function(e,n){a[n]||(delete r[n],d(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){function n(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var r,i,o=this,s=o.dom,l=s.getRoot(),c,u,d=0;if(a.isElement(e)){if(t===!1&&(d=e.offsetHeight),"BODY"!=l.nodeName){var f=o.getScrollContainer();if(f)return r=n(e).y-n(f).y+d,u=f.clientHeight,c=f.scrollTop,void((c>r||r+25>c+u)&&(f.scrollTop=c>r?r:r-u+25))}i=s.getViewPort(o.editor.getWin()),r=s.getPos(e).y+d,c=i.y,u=i.h,(r<i.y||r+25>c+u)&&o.editor.getWin().scrollTo(0,c>r?r:r-u+25)}},placeCaretAt:function(e,t){this.setRng(i.getCaretRangeFromPoint(e,t,this.editor.getDoc()))},_moveEndPoint:function(t,n,r){var i=n,o=new e(n,i),a=this.dom.schema.getNonEmptyElements();do{if(3==n.nodeType&&0!==f(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"==n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(s.ie&&s.ie<11&&this.dom.isBlock(n)&&this.dom.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?o.next():o.prev());"BODY"==i.nodeName&&(r?t.setStart(i,0):t.setEnd(i,i.childNodes.length))},getBoundingClientRect:function(){var e=this.getRng();return e.collapsed?c.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){this.win=null,this.controlSelection.destroy()}},u}),r(X,[j,m],function(e,t){function n(t){this.compare=function(n,i){function o(e){var n={};return r(t.getAttribs(e),function(r){var i=r.nodeName.toLowerCase();0!==i.indexOf("_")&&"style"!==i&&0!==i.indexOf("data-")&&(n[i]=t.getAttrib(e,i))}),n}function a(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(n=t[r],"undefined"==typeof n)return!1;if(e[r]!=n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0}return n.nodeName!=i.nodeName?!1:a(o(n),o(i))&&a(t.parseStyle(t.getAttrib(n,"style")),t.parseStyle(t.getAttrib(i,"style")))?!e.isBookmarkNode(n)&&!e.isBookmarkNode(i):!1}}var r=t.each;return n}),r(K,[m],function(e){function t(e,t){function r(e){return e.replace(/%(\w+)/g,"")}var i,o,a=e.dom,s="",l,c;if(c=e.settings.preview_styles,c===!1)return"";if(c||(c="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),"string"==typeof t){if(t=e.formatter.get(t),!t)return;t=t[0]}return i=t.block||t.inline||"span",o=a.create(i),n(t.styles,function(e,t){e=r(e),e&&a.setStyle(o,t,e)}),n(t.attributes,function(e,t){e=r(e),e&&a.setAttrib(o,t,e)}),n(t.classes,function(e){e=r(e),a.hasClass(o,e)||a.addClass(o,e)}),e.fire("PreviewFormats"),a.setStyles(o,{position:"absolute",left:-65535}),e.getBody().appendChild(o),l=a.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,n(c.split(" "),function(t){var n=a.getStyle(o,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=a.getStyle(e.getBody(),t,!0),"#ffffff"==a.toHex(n).toLowerCase())||"color"==t&&"#000000"==a.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(s+="padding:0 2px;"),s+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),a.remove(o),s}var n=e.each;return{getCssText:t}}),r(G,[p,_,g],function(e,t,n){function r(e,t){var n=o[e];n||(o[e]=n=[]),o[e].push(t)}function i(e,t){s(o[e],function(e){e(t)})}var o=[],a=e.filter,s=e.each;return r("pre",function(r){function i(t){return c(t.previousSibling)&&-1!=e.indexOf(u,t.previousSibling)}function o(e,t){n(t).remove(),n(e).append("<br><br>").append(t.childNodes)}var l=r.selection.getRng(),c,u;c=t.matchNodeNames("pre"),l.collapsed||(u=r.selection.getSelectedBlocks(),s(a(a(u,c),i),function(e){o(e.previousSibling,e)}))}),{postProcess:i}}),r(J,[y,T,j,X,m,K,G],function(e,t,n,r,i,o,a){return function(s){function l(e){return e.nodeType&&(e=e.nodeName),!!s.schema.getTextBlockElements()[e.toLowerCase()]}function c(e){return/^(TH|TD)$/.test(e.nodeName)}function u(e){return e&&/^(IMG)$/.test(e.nodeName)}function d(e,t){return Y.getParents(e,t,Y.getRoot())}function f(e){return 1===e.nodeType&&"_mce_caret"===e.id}function h(){g({valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,t,n){ue(n,function(t,n){Y.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),ue("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){g(e,{block:e,remove:"all"})}),g(s.settings.formats)}function p(){s.addShortcut("meta+b","bold_desc","Bold"),s.addShortcut("meta+i","italic_desc","Italic"),s.addShortcut("meta+u","underline_desc","Underline");for(var e=1;6>=e;e++)s.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);s.addShortcut("access+7","",["FormatBlock",!1,"p"]),s.addShortcut("access+8","",["FormatBlock",!1,"div"]),s.addShortcut("access+9","",["FormatBlock",!1,"address"])}function m(e){return e?j[e]:j}function g(e,t){e&&("string"!=typeof e?ue(e,function(e,t){g(t,e)}):(t=t.length?t:[t],ue(t,function(e){e.deep===oe&&(e.deep=!e.selector),e.split===oe&&(e.split=!e.selector||e.inline),e.remove===oe&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),j[e]=t))}function v(e){return e&&j[e]&&delete j[e],j}function y(e,t){var n=m(t);if(n)for(var r=0;r<n.length;r++)if(n[r].inherit===!1&&Y.is(e,n[r].selector))return!0;return!1}function b(e){var t;return s.dom.getParent(e,function(e){return t=s.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function C(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=b(e.parentNode),s.dom.getStyle(e,"color")&&t?s.dom.setStyle(e,"text-decoration",t):s.dom.getStyle(e,"text-decoration")===t&&s.dom.setStyle(e,"text-decoration",null))}function x(t,n,r){function i(e,t){if(t=t||d,e){if(t.onformat&&t.onformat(e,t,n,r),ue(t.styles,function(t,r){Y.setStyle(e,r,M(t,n))}),t.styles){var i=Y.getAttrib(e,"style");i&&e.setAttribute("data-mce-style",i)}ue(t.attributes,function(t,r){Y.setAttrib(e,r,M(t,n))}),ue(t.classes,function(t){t=M(t,n),Y.hasClass(e,t)||Y.addClass(e,t)})}}function o(){function t(t,n){var i=new e(n);for(r=i.prev2();r;r=i.prev2()){if(3==r.nodeType&&r.data.length>0)return r;if(r.childNodes.length>1||r==t||"BR"==r.tagName)return r}}var n=s.selection.getRng(),i=n.startContainer,o=n.endContainer;if(i!=o&&0===n.endOffset){var a=t(i,o),l=3==a.nodeType?a.data.length:a.childNodes.length;n.setEnd(a,l)}return n}function c(e,r,o){var a=[],s,c,h=!0;s=d.inline||d.block,c=Y.create(s),i(c),K.walk(e,function(e){function r(e){var m,v,y,b,C;return C=h,m=e.nodeName.toLowerCase(),v=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&ae(e)&&(C=h,h="true"===ae(e),b=!0),B(m,"br")?(p=0,void(d.block&&Y.remove(e))):d.wrapper&&E(e,t,n)?void(p=0):h&&!b&&d.block&&!d.wrapper&&l(m)&&G(v,s)?(e=Y.rename(e,s),i(e),a.push(e),void(p=0)):d.selector&&(ue(u,function(t){return"collapsed"in t&&t.collapsed!==g?void 0:Y.is(e,t.selector)&&!f(e)?(i(e,t),y=!0,!1):void 0}),!d.inline||y)?void(p=0):void(!h||b||!G(s,m)||!G(v,s)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||f(e)||d.inline&&J(e)?(p=0,ue(de(e.childNodes),r),b&&(h=C),p=0):(p||(p=Y.clone(c,ne),e.parentNode.insertBefore(p,e),a.push(p)),p.appendChild(e)))}var p;ue(e,r)}),d.links===!0&&ue(a,function(e){function t(e){"A"===e.nodeName&&i(e,d),ue(de(e.childNodes),t)}t(e)}),ue(a,function(e){function r(e){var t=0;return ue(e.childNodes,function(e){P(e)||ce(e)||t++}),t}function o(e){var t,n;return ue(e.childNodes,function(e){return 1!=e.nodeType||ce(e)||f(e)?void 0:(t=e,ne)}),t&&!ce(t)&&A(t,d)&&(n=Y.clone(t,ne),i(n),Y.replace(n,e,re),Y.remove(t,1)),n||e}var s;if(s=r(e),(a.length>1||!J(e))&&0===s)return void Y.remove(e,1);if(d.inline||d.wrapper){if(d.exact||1!==s||(e=o(e)),ue(u,function(t){ue(Y.select(t.inline,e),function(e){ce(e)||F(t,n,e,t.exact?e:null)})}),E(e.parentNode,t,n))return Y.remove(e,1),e=0,re;d.merge_with_parents&&Y.getParent(e.parentNode,function(r){return E(r,t,n)?(Y.remove(e,1),e=0,re):void 0}),e&&d.merge_siblings!==!1&&(e=W(U(e),e),e=W(e,U(e,re)))}})}var u=m(t),d=u[0],h,p,g=!r&&X.isCollapsed();if("false"!==ae(X.getNode())){if(d){if(r)r.nodeType?(p=Y.createRng(),p.setStartBefore(r),p.setEndAfter(r),c(H(p,u),null,!0)):c(r,null,!0);else if(g&&d.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length)$("apply",t,n);else{var v=s.selection.getNode();Q||!u[0].defaultBlock||Y.getParent(v,Y.isBlock)||x(u[0].defaultBlock),s.selection.setRng(o()),h=X.getBookmark(),c(H(X.getRng(re),u),h),d.styles&&(d.styles.color||d.styles.textDecoration)&&(fe(v,C,"childNodes"),C(v)),X.moveToBookmark(h),q(X.getRng(re)),s.nodeChanged()}a.postProcess(t,s)}}else{r=X.getNode();for(var y=0,b=u.length;b>y;y++)if(u[y].ceFalseOverride&&Y.is(r,u[y].selector))return void i(r,u[y])}}function w(e,t,n,r){function i(e){var n,r,o,a,s;if(1===e.nodeType&&ae(e)&&(a=y,y="true"===ae(e),s=!0),n=de(e.childNodes),y&&!s)for(r=0,o=h.length;o>r&&!F(h[r],t,e,e);r++);if(p.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(y=a)}}function o(n){var i;return ue(d(n.parentNode).reverse(),function(n){var o;i||"_start"==n.id||"_end"==n.id||(o=E(n,e,t,r),o&&o.split!==!1&&(i=n))}),i}function a(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode, o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=Y.clone(o,ne),c=0;c<h.length;c++)if(F(h[c],t,a,a)){a=0;break}a&&(s&&a.appendChild(s),l||(l=a),s=a)}!i||p.mixed&&J(e)||(n=Y.split(e,n)),s&&(r.parentNode.insertBefore(s,r),l.appendChild(r))}return n}function l(e){return a(o(e),e,e,!0)}function u(e){var t=Y.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return ce(n)&&(n=n[e?"firstChild":"lastChild"]),3==n.nodeType&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),Y.remove(t,!0),n}function f(e){var t,n,r=e.commonAncestorContainer;if(e=H(e,h,re),p.split){if(t=V(e,re),n=V(e),t!=n){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"==t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&c(n)&&n.firstChild&&(n=n.firstChild||n),Y.isChildOf(t,n)&&!J(n)&&!c(t)&&!c(n))return t=O(t,"span",{id:"_start","data-mce-type":"bookmark"}),l(t),void(t=u(re));t=O(t,"span",{id:"_start","data-mce-type":"bookmark"}),n=O(n,"span",{id:"_end","data-mce-type":"bookmark"}),l(t),l(n),t=u(re),n=u()}else t=n=l(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=Z(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=Z(n)+1}K.walk(e,function(e){ue(e,function(e){i(e),1===e.nodeType&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===b(e.parentNode)&&F({deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})}var h=m(e),p=h[0],g,v,y=!0;if(n)return void(n.nodeType?(v=Y.createRng(),v.setStartBefore(n),v.setEndAfter(n),f(v)):f(n));if("false"!==ae(X.getNode()))X.isCollapsed()&&p.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length?$("remove",e,t,r):(g=X.getBookmark(),f(X.getRng(re)),X.moveToBookmark(g),p.inline&&_(e,t,X.getStart())&&q(X.getRng(!0)),s.nodeChanged());else{n=X.getNode();for(var C=0,x=h.length;x>C&&(!h[C].ceFalseOverride||!F(h[C],t,n,n));C++);}}function N(e,t,n){var r=m(e);!_(e,t,n)||"toggle"in r[0]&&!r[0].toggle?x(e,t,n):w(e,t,n)}function E(e,t,n,r){function i(e,t,i){var o,a,s=t[i],l;if(t.onmatch)return t.onmatch(e,t,i);if(s)if(s.length===oe){for(o in s)if(s.hasOwnProperty(o)){if(a="attributes"===i?Y.getAttrib(e,o):D(e,o),r&&!a&&!t.exact)return;if((!r||t.exact)&&!B(a,L(M(s[o],n),o)))return}}else for(l=0;l<s.length;l++)if("attributes"===i?Y.getAttrib(e,s[l]):D(e,s[l]))return t;return t}var o=m(t),a,s,l;if(o&&e)for(s=0;s<o.length;s++)if(a=o[s],A(e,a)&&i(e,a,"attributes")&&i(e,a,"styles")){if(l=a.classes)for(s=0;s<l.length;s++)if(!Y.hasClass(e,l[s]))return;return a}}function _(e,t,n){function r(n){var r=Y.getRoot();return n===r?!1:(n=Y.getParent(n,function(n){return y(n,e)?!0:n.parentNode===r||!!E(n,e,t,!0)}),E(n,e,t))}var i;return n?r(n):(n=X.getNode(),r(n)?re:(i=X.getStart(),i!=n&&r(i)?re:ne))}function S(e,t){var n,r=[],i={};return n=X.getStart(),Y.getParent(n,function(n){var o,a;for(o=0;o<e.length;o++)a=e[o],!i[a]&&E(n,a,t)&&(i[a]=!0,r.push(a))},Y.getRoot()),r}function k(e){var t=m(e),n,r,i,o,a;if(t)for(n=X.getStart(),r=d(n),o=t.length-1;o>=0;o--){if(a=t[o].selector,!a||t[o].defaultBlock)return re;for(i=r.length-1;i>=0;i--)if(Y.is(r[i],a))return re}return ne}function T(e,t,n){var r;return ie||(ie={},r={},s.on("NodeChange",function(e){var t=d(e.element),n={};t=i.grep(t,function(e){return 1==e.nodeType&&!e.getAttribute("data-mce-bogus")}),ue(ie,function(e,i){ue(t,function(o){return E(o,i,{},e.similar)?(r[i]||(ue(e,function(e){e(!0,{node:o,format:i,parents:t})}),r[i]=e),n[i]=e,!1):y(o,i)?!1:void 0})}),ue(r,function(i,o){n[o]||(delete r[o],ue(i,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),ue(e.split(","),function(e){ie[e]||(ie[e]=[],ie[e].similar=n),ie[e].push(t)}),this}function R(e){return o.getCssText(s,e)}function A(e,t){return B(e,t.inline)?re:B(e,t.block)?re:t.selector?1==e.nodeType&&Y.is(e,t.selector):void 0}function B(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function D(e,t){return L(Y.getStyle(e,t),t)}function L(e,t){return"color"!=t&&"backgroundColor"!=t||(e=Y.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function M(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function P(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function O(e,t,n){var r=Y.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function H(t,n,r){function i(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=Y.getRoot(),3==r.nodeType&&!P(r)&&(e?v>0:b<r.nodeValue.length))return r;for(;;){if(!n[0].block_expand&&J(i))return i;for(o=i[a];o;o=o[a])if(!ce(o)&&!P(o)&&!t(o))return i;if(i==s||i.parentNode==s){r=i;break}i=i.parentNode}return r}function o(e,t){for(t===oe&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)e=e.childNodes[t],e&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}}function a(e){for(var t=e;t;){if(1===t.nodeType&&ae(t))return"false"===ae(t)?t:e;t=t.parentNode}return e}function c(t,n,i){function o(e,t){var n,o,a=e.nodeValue;return"undefined"==typeof t&&(t=i?a.length:0),i?(n=a.lastIndexOf(" ",t),o=a.lastIndexOf("\xa0",t),n=n>o?n:o,-1===n||r||n++):(n=a.indexOf(" ",t),o=a.indexOf("\xa0",t),n=-1!==n&&(-1===o||o>n)?n:o),n}var a,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(a=new e(t,Y.getParent(t,J)||s.getBody());l=a[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(J(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function u(e,r){var i,o,a,s;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=d(e),o=0;o<i.length;o++)for(a=0;a<n.length;a++)if(s=n[a],!("collapsed"in s&&s.collapsed!==t.collapsed)&&Y.is(i[o],s.selector))return i[o];return e}function f(e,t){var r,i=Y.getRoot();if(n[0].wrapper||(r=Y.getParent(e,n[0].block,i)),r||(r=Y.getParent(3==e.nodeType?e.parentNode:e,function(e){return e!=i&&l(e)})),r&&n[0].wrapper&&(r=d(r,"ul,ol").reverse()[0]||r),!r)for(r=e;r[t]&&!J(r[t])&&(r=r[t],!B(r,"br")););return r||e}var h,p,m,g=t.startContainer,v=t.startOffset,y=t.endContainer,b=t.endOffset;if(1==g.nodeType&&g.hasChildNodes()&&(h=g.childNodes.length-1,g=g.childNodes[v>h?h:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(h=y.childNodes.length-1,y=y.childNodes[b>h?h:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=a(g),y=a(y),(ce(g.parentNode)||ce(g))&&(g=ce(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(ce(y.parentNode)||ce(y))&&(y=ce(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=c(g,v,!0),m&&(g=m.container,v=m.offset),m=c(y,b),m&&(y=m.container,b=m.offset)),p=o(y,b),p.node)){for(;p.node&&0===p.offset&&p.node.previousSibling;)p=o(p.node.previousSibling);p.node&&p.offset>0&&3===p.node.nodeType&&" "===p.node.nodeValue.charAt(p.offset-1)&&p.offset>1&&(y=p.node,y.splitText(p.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=i(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=i())),n[0].selector&&n[0].expand!==ne&&!n[0].inline&&(g=u(g,"previousSibling"),y=u(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(J(g)||(g=i(!0)),J(y)||(y=i()))),1==g.nodeType&&(v=Z(g),g=g.parentNode),1==y.nodeType&&(b=Z(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function I(e,t){return t.links&&"A"==e.tagName}function F(e,t,n,r){var i,o,a;if(!A(n,e)&&!I(n,e))return ne;if("all"!=e.remove)for(ue(e.styles,function(i,o){i=L(M(i,t),o),"number"==typeof o&&(o=i,r=0),(e.remove_similar||!r||B(D(r,o),i))&&Y.setStyle(n,o,""),a=1}),a&&""===Y.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),ue(e.attributes,function(e,i){var o;if(e=M(e,t),"number"==typeof i&&(i=e,r=0),!r||B(Y.getAttrib(r,i),e)){if("class"==i&&(e=Y.getAttrib(n,i),e&&(o="",ue(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void Y.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),te.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),ue(e.classes,function(e){e=M(e,t),r&&!Y.hasClass(r,e)||Y.removeClass(n,e)}),o=Y.getAttribs(n),i=0;i<o.length;i++){var s=o[i].nodeName;if(0!==s.indexOf("_")&&0!==s.indexOf("data-"))return ne}return"none"!=e.remove?(z(n,e),re):void 0}function z(e,t){function n(e,t,n){return e=U(e,t,n),!e||"BR"==e.nodeName||J(e)}var r=e.parentNode,i;t.block&&(Q?r==Y.getRoot()&&(t.list_block&&B(e,t.list_block)||ue(de(e.childNodes),function(e){G(Q,e.nodeName.toLowerCase())?i?i.appendChild(e):(i=O(e,Q),Y.setAttribs(i,s.settings.forced_root_block_attrs)):i=0})):J(e)&&!J(r)&&(n(e,ne)||n(e.firstChild,re,1)||e.insertBefore(Y.create("br"),e.firstChild),n(e,re)||n(e.lastChild,ne,1)||e.appendChild(Y.create("br")))),t.selector&&t.inline&&!B(t.inline,e)||Y.remove(e,1)}function U(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1==e.nodeType||!P(e))return e}function W(e,t){function n(e,t){for(i=e;i;i=i[t]){if(3==i.nodeType&&0!==i.nodeValue.length)return e;if(1==i.nodeType&&!ce(i))return i}return e}var i,o,a=new r(Y);if(e&&t&&(e=n(e,"previousSibling"),t=n(t,"nextSibling"),a.compare(e,t))){for(i=e.nextSibling;i&&i!=t;)o=i,i=i.nextSibling,e.appendChild(o);return Y.remove(t),ue(de(t.childNodes),function(t){e.appendChild(t)}),e}return t}function V(t,n){var r,i,o;return r=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1==r.nodeType&&(o=r.childNodes.length-1,!n&&i&&i--,r=r.childNodes[i>o?o:i]),3===r.nodeType&&n&&i>=r.nodeValue.length&&(r=new e(r,s.getBody()).next()||r),3!==r.nodeType||n||0!==i||(r=new e(r,s.getBody()).prev()||r),r}function $(t,n,r,i){function o(e){var t=Y.create("span",{id:g,"data-mce-bogus":!0,style:v?"color:red":""});return e&&t.appendChild(s.getDoc().createTextNode(ee)),t}function a(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==ee||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function c(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=X.getRng(!0),a(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),Y.remove(e)):(n=u(e),n.nodeValue.charAt(0)===ee&&(n.deleteData(0,1),r.startContainer==n&&r.startOffset>0&&r.setStart(n,r.startOffset-1),r.endContainer==n&&r.endOffset>0&&r.setEnd(n,r.endOffset-1)),Y.remove(e,1)),X.setRng(r);else if(e=c(X.getStart()),!e)for(;e=Y.get(g);)d(e,!1)}function f(){var e,t,i,a,s,l,d;e=X.getRng(!0),a=e.startOffset,l=e.startContainer,d=l.nodeValue,t=c(X.getStart()),t&&(i=u(t)),d&&a>0&&a<d.length&&/\w/.test(d.charAt(a))&&/\w/.test(d.charAt(a-1))?(s=X.getBookmark(),e.collapse(!0),e=H(e,m(n)),e=K.split(e),x(n,r,e),X.moveToBookmark(s)):(t&&i.nodeValue===ee?x(n,r,t):(t=o(!0),i=t.firstChild,e.insertNode(t),a=1,x(n,r,t)),X.setCursorLocation(i,a))}function h(){var e=X.getRng(!0),t,a,s,c,u,d,f=[],h,p;for(t=e.startContainer,a=e.startOffset,u=t,3==t.nodeType&&(a!=t.nodeValue.length&&(c=!0),u=u.parentNode);u;){if(E(u,n,r,i)){d=u;break}u.nextSibling&&(c=!0),f.push(u),u=u.parentNode}if(d)if(c)s=X.getBookmark(),e.collapse(!0),e=H(e,m(n),!0),e=K.split(e),w(n,r,e),X.moveToBookmark(s);else{for(p=o(),u=p,h=f.length-1;h>=0;h--)u.appendChild(Y.clone(f[h],!1)),u=u.firstChild;u.appendChild(Y.doc.createTextNode(ee)),u=u.firstChild;var g=Y.getParent(d,l);g&&Y.isEmpty(g)?d.parentNode.replaceChild(p,d):Y.insertAfter(p,d),X.setCursorLocation(u,1),Y.isEmpty(d)&&Y.remove(d)}}function p(){var e;e=c(X.getStart()),e&&!Y.isEmpty(e)&&fe(e,function(e){1!=e.nodeType||e.id===g||Y.isEmpty(e)||Y.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var g="_mce_caret",v=s.settings.caret_debug;s._hasCaretEvents||(le=function(){var e=[],t;if(a(c(X.getStart()),e))for(t=e.length;t--;)Y.setAttrib(e[t],"data-mce-bogus","1")},se=function(e){var t=e.keyCode;d(),8==t&&X.isCollapsed()&&X.getStart().innerHTML==ee&&d(c(X.getStart())),37!=t&&39!=t||d(c(X.getStart())),p()},s.on("SetContent",function(e){e.selection&&p()}),s._hasCaretEvents=!0),"apply"==t?f():h()}function q(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if((t.startContainer!=t.endContainer||!u(t.startContainer.childNodes[t.startOffset]))&&(3==n.nodeType&&r>=n.nodeValue.length&&(r=Z(n),n=n.parentNode,i=!0),1==n.nodeType))for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,Y.getParent(n,Y.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!P(a))return l=Y.create("a",{"data-mce-bogus":"all"},ee),a.parentNode.insertBefore(l,a),t.setStart(a,0),X.setRng(t),void Y.remove(l)}var j={},Y=s.dom,X=s.selection,K=new t(Y),G=s.schema.isValidChild,J=Y.isBlock,Q=s.settings.forced_root_block,Z=Y.nodeIndex,ee="\ufeff",te=/^(src|href|style)$/,ne=!1,re=!0,ie,oe,ae=Y.getContentEditable,se,le,ce=n.isBookmarkNode,ue=i.each,de=i.grep,fe=i.walk,he=i.extend;he(this,{get:m,register:g,unregister:v,apply:x,remove:w,toggle:N,match:_,matchAll:S,matchNode:E,canApply:k,formatChanged:T,getCssText:R}),h(),p(),s.on("BeforeGetContent",function(e){le&&"raw"!=e.format&&le()}),s.on("mouseup keydown",function(e){se&&se(e)})}}),r(Q,[I,d],function(e,t){return function(e){function n(){return e.serializer.getTrimmedContent()}function r(t){e.setDirty(t)}function i(e){o.typing=!1,o.add({},e)}var o=this,a=0,s=[],l,c,u=0;return e.on("init",function(){o.add()}),e.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&o.beforeChange()}),e.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&i(e)}),e.on("ObjectResizeStart Cut",function(){o.beforeChange()}),e.on("SaveContent ObjectResized blur",i),e.on("DragEnd",i),e.on("KeyUp",function(a){var l=a.keyCode;a.isDefaultPrevented()||((l>=33&&36>=l||l>=37&&40>=l||45==l||13==l||a.ctrlKey)&&(i(),e.nodeChanged()),(46==l||8==l||t.mac&&(91==l||93==l))&&e.nodeChanged(),c&&o.typing&&(e.isDirty()||(r(s[0]&&n()!=s[0].content),e.isDirty()&&e.fire("change",{level:s[0],lastLevel:null})),e.fire("TypingUndo"),c=!1,e.nodeChanged()))}),e.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented()){if(t>=33&&36>=t||t>=37&&40>=t||45==t)return void(o.typing&&i(e));var n=e.ctrlKey&&!e.altKey||e.metaKey;!(16>t||t>20)||224==t||91==t||o.typing||n||(o.beforeChange(),o.typing=!0,o.add({},e),c=!0)}}),e.on("MouseDown",function(e){o.typing&&i(e)}),e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),e.on("AddUndo Undo Redo ClearUndos",function(t){t.isDefaultPrevented()||e.nodeChanged()}),o={data:s,typing:!1,beforeChange:function(){u||(l=e.selection.getBookmark(2,!0))},add:function(t,i){var o,c=e.settings,d;if(t=t||{},t.content=n(),u||e.removed)return null;if(d=s[a],e.fire("BeforeAddUndo",{level:t,lastLevel:d,originalEvent:i}).isDefaultPrevented())return null;if(d&&d.content==t.content)return null;if(s[a]&&(s[a].beforeBookmark=l),c.custom_undo_redo_levels&&s.length>c.custom_undo_redo_levels){for(o=0;o<s.length-1;o++)s[o]=s[o+1];s.length--,a=s.length}t.bookmark=e.selection.getBookmark(2,!0),a<s.length-1&&(s.length=a+1),s.push(t),a=s.length-1;var f={level:t,lastLevel:d,originalEvent:i};return e.fire("AddUndo",f),a>0&&(r(!0),e.fire("change",f)),t},undo:function(){var t;return o.typing&&(o.add(),o.typing=!1),a>0&&(t=s[--a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.beforeBookmark),r(!0),e.fire("undo",{level:t})),t},redo:function(){var t;return a<s.length-1&&(t=s[++a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.bookmark),r(!0),e.fire("redo",{level:t})),t},clear:function(){s=[],a=0,o.typing=!1,o.data=s,e.fire("ClearUndos")},hasUndo:function(){return a>0||o.typing&&s[0]&&n()!=s[0].content},hasRedo:function(){return a<s.length-1&&!this.typing},transact:function(e){o.beforeChange();try{u++,e()}finally{u--}return o.add()},extra:function(t,n){var r,i;o.transact(t)&&(i=s[a].bookmark,r=s[a-1],e.setContent(r.content,{format:"raw"}),e.selection.moveToBookmark(r.beforeBookmark),o.transact(n)&&(s[a-1].beforeBookmark=i))}}}}),r(Z,[y,T,d],function(e,t,n){var r=n.ie&&n.ie<11;return function(i){function o(o){function h(e){return e&&a.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==a.getContentEditable(e)}function p(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}function m(e){var t;a.isBlock(e)&&(t=s.getRng(),e.appendChild(a.create("span",null,"\xa0")),s.select(e),e.lastChild.outerHTML="",s.setRng(t))}function g(e){var t=e,n=[],r;if(t){for(;t=t.firstChild;){if(a.isBlock(t))return;1!=t.nodeType||d[t.nodeName.toLowerCase()]||n.push(t)}for(r=n.length;r--;)t=n[r],!t.hasChildNodes()||t.firstChild==t.lastChild&&""===t.firstChild.nodeValue?a.remove(t):"A"==t.nodeName&&" "===(t.innerText||t.textContent)&&a.remove(t)}}function v(t){function r(e){for(;e;){if(1==e.nodeType||3==e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}var i,o,l,c=t,u;if(t){if(n.ie&&n.ie<9&&M&&M.firstChild&&M.firstChild==M.lastChild&&"BR"==M.firstChild.tagName&&a.remove(M.firstChild),/^(LI|DT|DD)$/.test(t.nodeName)){var d=r(t.firstChild);d&&/^(UL|OL|DL)$/.test(d.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(l=a.createRng(),n.ie||t.normalize(),t.hasChildNodes()){for(i=new e(t,t);o=i.current();){if(3==o.nodeType){l.setStart(o,0),l.setEnd(o,0);break}if(f[o.nodeName.toLowerCase()]){l.setStartBefore(o),l.setEndBefore(o);break}c=o,o=i.next()}o||(l.setStart(c,0),l.setEnd(c,0))}else"BR"==t.nodeName?t.nextSibling&&a.isBlock(t.nextSibling)?((!P||9>P)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}}function y(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function b(e){e.innerHTML=r?"":'<br data-mce-bogus="1">'}function C(e){var t=D,n,i,o,s=u.getTextInlineElements();if(e||"TABLE"==z?(n=a.create(e||W),y(n)):n=M.cloneNode(!1),o=n,l.keep_styles!==!1)do if(s[t.nodeName]){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while((t=t.parentNode)&&t!=B);return r||(o.innerHTML='<br data-mce-bogus="1">'),n}function x(t){var n,r,i;if(3==D.nodeType&&(t?L>0:L<D.nodeValue.length))return!1;if(D.parentNode==M&&V&&!t)return!0;if(t&&1==D.nodeType&&D==M.firstChild)return!0;if("TABLE"===D.nodeName||D.previousSibling&&"TABLE"==D.previousSibling.nodeName)return V&&!t||!V&&t;for(n=new e(D,M),3==D.nodeType&&(t&&0===L?n.prev():t||L!=D.nodeValue.length||n.next());r=n.current();){if(1===r.nodeType){if(!r.getAttribute("data-mce-bogus")&&(i=r.nodeName.toLowerCase(),d[i]&&"br"!==i))return!1}else if(3===r.nodeType&&!/^[ \t\r\n]*$/.test(r.nodeValue))return!1;t?n.prev():n.next()}return!0}function w(e,t){var n,r,o,s,l,c,d=W||"P";if(r=a.getParent(e,a.isBlock),!r||!h(r)){if(r=r||B,c=r==i.getBody()||p(r)?r.nodeName.toLowerCase():r.parentNode.nodeName.toLowerCase(),!r.hasChildNodes())return n=a.create(d),y(n),r.appendChild(n),R.setStart(n,0),R.setEnd(n,0),n;for(s=e;s.parentNode!=r;)s=s.parentNode;for(;s&&!a.isBlock(s);)o=s,s=s.previousSibling;if(o&&u.isValidChild(c,d.toLowerCase())){for(n=a.create(d),y(n),o.parentNode.insertBefore(n,o),s=o;s&&!a.isBlock(s);)l=s.nextSibling,n.appendChild(s),s=l;R.setStart(e,t),R.setEnd(e,t)}}return e}function N(){function e(e){for(var t=F[e?"firstChild":"lastChild"];t&&1!=t.nodeType;)t=t[e?"nextSibling":"previousSibling"];return t===M}function t(){var e=F.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:F}if(F!=i.getBody()){var n=F.parentNode.nodeName;/^(OL|UL|LI)$/.test(n)&&(W="LI"),H=W?C(W):a.create("BR"),e(!0)&&e()?"LI"==n?a.insertAfter(H,t()):a.replace(H,F):e(!0)?"LI"==n?(a.insertAfter(H,t()),H.appendChild(a.doc.createTextNode(" ")),H.appendChild(F)):F.parentNode.insertBefore(H,F):e()?(a.insertAfter(H,t()),m(H)):(F=t(),A=R.cloneRange(),A.setStartAfter(M),A.setEndAfter(F),I=A.extractContents(),"LI"==W&&"LI"==I.firstChild.nodeName?(H=I.firstChild,a.insertAfter(I,F)):(a.insertAfter(I,F),a.insertAfter(H,F))),a.remove(M),v(H),c.add()}}function E(){i.execCommand("InsertLineBreak",!1,o)}function _(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function S(e){var t=a.getRoot(),n,r;for(n=e;n!==t&&"false"!==a.getContentEditable(n);)"true"===a.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function k(e){var t;r||(e.normalize(),t=e.lastChild,t&&!/^(left|right)$/gi.test(a.getStyle(t,"float",!0))||a.add(e,"br"))}function T(){H=/^(H[1-6]|PRE|FIGURE)$/.test(z)&&"HGROUP"!=U?C(W):C(),l.end_container_on_empty_block&&h(F)&&a.isEmpty(M)?H=a.split(F,M):a.insertAfter(H,M),v(H)}var R,A,B,D,L,M,P,O,H,I,F,z,U,W,V;if(R=s.getRng(!0),!o.isDefaultPrevented()){if(!R.collapsed)return void i.execCommand("Delete");if(new t(a).normalize(R),D=R.startContainer,L=R.startOffset,W=(l.force_p_newlines?"p":"")||l.forced_root_block,W=W?W.toUpperCase():"",P=a.doc.documentMode,O=o.shiftKey,1==D.nodeType&&D.hasChildNodes()&&(V=L>D.childNodes.length-1,D=D.childNodes[Math.min(L,D.childNodes.length-1)]||D,L=V&&3==D.nodeType?D.nodeValue.length:0),B=S(D)){if(c.beforeChange(),!a.isBlock(B)&&B!=a.getRoot())return void(W&&!O||E());if((W&&!O||!W&&O)&&(D=w(D,L)),M=a.getParent(D,a.isBlock),F=M?a.getParent(M.parentNode,a.isBlock):null,z=M?M.nodeName.toUpperCase():"",U=F?F.nodeName.toUpperCase():"","LI"!=U||o.ctrlKey||(M=F,z=U),/^(LI|DT|DD)$/.test(z)){if(!W&&O)return void E();if(a.isEmpty(M))return void N()}if("PRE"==z&&l.br_in_pre!==!1){if(!O)return void E()}else if(!W&&!O&&"LI"!=z||W&&O)return void E();W&&M===i.getBody()||(W=W||"P",x()?T():x(!0)?(H=M.parentNode.insertBefore(C(),M),m(H),v(M)):(A=R.cloneRange(),A.setEndAfter(M),I=A.extractContents(),_(I),H=I.firstChild,a.insertAfter(I,M),g(H),k(M),a.isEmpty(M)&&b(M),H.normalize(),a.isEmpty(H)?(a.remove(H),T()):v(H)),a.setAttrib(H,"id",""),i.fire("NewBlock",{newBlock:H}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements(),f=u.getMoveCaretBeforeOnEnterElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(ee,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,h,p,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){p=t,t=t.nextSibling,r.remove(p);continue}h||(h=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(h,t),g=!0),p=t,t=t.nextSibling,h.appendChild(p)}else h=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(te,[z,y,_,$,k,U],function(e,t,n,r,i,o){function a(e){return e>0}function s(e){return 0>e}function l(e,n,r,i,o){var l=new t(e,i);if(s(n)){if(C(e)&&(e=l.prev(!0),r(e)))return e;for(;e=l.prev(o);)if(r(e))return e}if(a(n)){if(C(e)&&(e=l.next(!0),r(e)))return e;for(;e=l.next(o);)if(r(e))return e}return null}function c(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode)if(b(e))return e;return t}function u(e,t){for(;e&&e!=t;){if(x(e))return e;e=e.parentNode}return null}function d(e,t,n){return u(e.container(),n)==u(t.container(),n)}function f(e,t,n){return c(e.container(),n)==c(t.container(),n)}function h(e,t){var n,r;return t?(n=t.container(),r=t.offset(),E(n)?n.childNodes[r+e]:null):null}function p(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n}function m(e,t,n){return u(t,e)==u(n,e)}function g(e,t,n){var r,i;for(i=e?"previousSibling":"nextSibling";n&&n!=t;){if(r=n[i],w(r)&&(r=r[i]),C(r)){if(m(t,r,n))return r;break}if(_(r))break;n=n.parentNode}return null}function v(e,t,r){var o,a,s,l,c=N(g,!0,t),u=N(g,!1,t);if(a=r.startContainer,s=r.startOffset,i.isCaretContainerBlock(a)){if(E(a)||(a=a.parentNode),l=a.getAttribute("data-mce-caret"),"before"==l&&(o=a.nextSibling,C(o)))return S(o);if("after"==l&&(o=a.previousSibling,C(o)))return k(o)}if(!r.collapsed)return r;if(n.isText(a)){if(w(a)){if(1===e){if(o=u(a))return S(o);if(o=c(a))return k(o)}if(-1===e){if(o=c(a))return k(o);if(o=u(a))return S(o)}return r}if(i.endsWithCaretContainer(a)&&s>=a.data.length-1)return 1===e&&(o=u(a))?S(o):r;if(i.startsWithCaretContainer(a)&&1>=s)return-1===e&&(o=c(a))?k(o):r;if(s===a.data.length)return o=u(a),o?S(o):r;if(0===s)return o=c(a),o?k(o):r}return r}function y(e,t){return C(h(e,t))}var b=n.isContentEditableTrue,C=n.isContentEditableFalse,x=n.matchStyleValues("display","block table table-cell table-caption"),w=i.isCaretContainer,N=e.curry,E=n.isElement,_=o.isCaretCandidate,S=N(p,!0),k=N(p,!1);return{isForwards:a,isBackwards:s,findNode:l,getEditingHost:c,getParentBlock:u,isInSameBlock:d,isInSameEditingHost:f,isBeforeContentEditableFalse:N(y,0),isAfterContentEditableFalse:N(y,-1),normalizeRange:v}}),r(ne,[_,U,$,te,p,z],function(e,t,n,r,i,o){function a(e,t){for(var n=[];e&&e!=t;)n.push(e),e=e.parentNode;return n}function s(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null}function l(e,t){if(m(e)){if(v(t.previousSibling)&&!f(t.previousSibling))return n.before(t);if(f(t))return n(t,0)}if(g(e)){if(v(t.nextSibling)&&!f(t.nextSibling))return n.after(t);if(f(t))return n(t,t.data.length)}return g(e)?p(t)?n.before(t):n.after(t):n.before(t)}function c(t,i){var o;return e.isBr(t)?(o=u(1,n.after(t),i),o?!r.isInSameBlock(n.before(t),n.before(o),i):!1):!1}function u(e,t,p){var C,x,w,N,E,_,S;if(!h(p)||!t)return null;if(S=t,C=S.container(),x=S.offset(),f(C)){if(g(e)&&x>0)return n(C,--x);if(m(e)&&x<C.length)return n(C,++x);w=C}else{if(g(e)&&x>0&&(N=s(C,x-1),v(N)))return!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,E.data.length):n.after(E):f(N)?n(N,N.data.length):n.before(N);if(m(e)&&x<C.childNodes.length&&(N=s(C,x),v(N)))return c(N,p)?u(e,n.after(N),p):!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,0):n.before(E):f(N)?n(N,0):n.after(N);w=S.getNode()}return(m(e)&&S.isAtEnd()||g(e)&&S.isAtStart())&&(w=r.findNode(w,e,o.constant(!0),p,!0),b(w))?l(e,w):(N=r.findNode(w,e,b,p),_=i.last(i.filter(a(C,p),d)),!_||N&&_.contains(N)?N?l(e,N):null:S=m(e)?n.after(_):n.before(_))}var d=e.isContentEditableFalse,f=e.isText,h=e.isElement,p=e.isBr,m=r.isForwards,g=r.isBackwards,v=t.isCaretCandidate,y=t.isAtomic,b=t.isEditableCaretCandidate;return function(e){return{next:function(t){return u(1,t,e)},prev:function(t){return u(-1,t,e)}}}}),r(re,[m,ne,$],function(e,t,n){var r=function(e){var t=e.firstChild,n=e.lastChild;return t&&"meta"===t.name&&(t=t.next),n&&"mce_marker"===n.attr("id")&&(n=n.prev),t&&t===n?"ul"===t.name||"ol"===t.name:!1},i=function(e){var t=e.firstChild,n=e.lastChild;return t&&"META"===t.nodeName&&t.parentNode.removeChild(t),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),e},o=function(e,t,n){var r=t.serialize(n),o=e.createFragment(r);return i(o)},a=function(t){return e.grep(t.childNodes,function(e){return"LI"===e.nodeName})},s=function(e){return!e.firstChild},l=function(e){return e.length>0&&s(e[e.length-1])?e.slice(0,-1):e},c=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},u=function(e,t){return!!c(e,t)},d=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]},f=function(e,r){var i=n.before(e),o=new t(r),a=o.next(i);return a?a.toRange():null},h=function(e,r){var i=n.after(e),o=new t(r),a=o.prev(i);return a?a.toRange():null},p=function(t,n,r,i){var o=d(t,i),a=t.parentNode;return a.insertBefore(o[0],t),e.each(n,function(e){a.insertBefore(e,t)}),a.insertBefore(o[1],t),a.removeChild(t),h(n[n.length-1],r)},m=function(t,n,r){var i=t.parentNode;return e.each(n,function(e){i.insertBefore(e,t)}),f(t,r)},g=function(e,t,n,r){return r.insertAfter(t.reverse(),e),h(t[0],n)},v=function(e,r,i,s){var u=o(r,e,s),d=c(r,i.startContainer),f=l(a(u.firstChild)),h=1,v=2,y=r.getRoot(),b=function(e){var o=n.fromRangeStart(i),a=new t(r.getRoot()),s=e===h?a.prev(o):a.next(o);return s?c(r,s.getNode())!==d:!0};return b(h)?m(d,f,y):b(v)?g(d,f,y,r):p(d,f,y,i)};return{isListFragment:r,insertAtCaret:v,isParentBlockLi:u,trimListItems:l,listItems:a}}),r(ie,[d,m,P,ne,$,X,_,re],function(e,t,n,r,i,o,a,s){var l=a.matchNodeNames("td th"),c=function(a,c,u){function d(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=D.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i<r.length?e=e.replace(/ (<br>|)$/," "):t("nextSibling")||(e=e.replace(/( | )(<br>|)$/," "))),e}function f(){var e,t,n;e=D.getRng(!0),t=e.startContainer,n=e.startOffset,3==t.nodeType&&e.collapsed&&("\xa0"===t.data[n]?(t.deleteData(n,1),/[\u00a0| ]$/.test(c)||(c+=" ")):"\xa0"===t.data[n-1]&&(t.deleteData(n-1,1),/[\u00a0| ]$/.test(c)||(c=" "+c)))}function h(){if(A){var e=a.getBody(),n=new o(L);t.each(L.select("*[data-mce-fragment]"),function(t){for(var r=t.parentNode;r&&r!=e;r=r.parentNode)B[t.nodeName.toLowerCase()]&&n.compare(r,t)&&L.remove(t,!0)})}}function p(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}function m(e){t.each(e.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")})}function g(e){return!!e.getAttribute("data-mce-fragment")}function v(e){return e&&!a.schema.getShortEndedElements()[e.nodeName]}function y(t){function n(e){for(var t=a.getBody();e&&e!==t;e=e.parentNode)if("false"===a.dom.getContentEditable(e))return e;return null}function o(e){var t=i.fromRangeStart(e),n=new r(a.getBody());return t=n.next(t),t?t.toRange():void 0}var s,c,u;if(t){if(D.scrollIntoView(t),s=n(t))return L.remove(t),void D.select(s);S=L.createRng(),k=t.previousSibling,k&&3==k.nodeType?(S.setStart(k,k.nodeValue.length),e.ie||(T=t.nextSibling,T&&3==T.nodeType&&(k.appendData(T.data),T.parentNode.removeChild(T)))):(S.setStartBefore(t),S.setEndBefore(t)),c=L.getParent(t,L.isBlock),L.remove(t),c&&L.isEmpty(c)&&(a.$(c).empty(),S.setStart(c,0),S.setEnd(c,0),l(c)||g(c)||!(u=o(S))?L.add(c,L.create("br",{"data-mce-bogus":"1"})):(S=u,L.remove(c))),D.setRng(S)}}var b,C,x,w,N,E,_,S,k,T,R,A,B=a.schema.getTextInlineElements(),D=a.selection,L=a.dom;/^ | $/.test(c)&&(c=d(c)),b=a.parser,A=u.merge,C=new n({validate:a.settings.validate},a.schema),R='<span id="mce_marker" data-mce-type="bookmark">​</span>',E={content:c,format:"html",selection:!0},a.fire("BeforeSetContent",E),c=E.content,-1==c.indexOf("{$caret}")&&(c+="{$caret}"),c=c.replace(/\{\$caret\}/,R),S=D.getRng();var M=S.startContainer||(S.parentElement?S.parentElement():null),P=a.getBody();M===P&&D.isCollapsed()&&L.isBlock(P.firstChild)&&v(P.firstChild)&&L.isEmpty(P.firstChild)&&(S=L.createRng(),S.setStart(P.firstChild,0),S.setEnd(P.firstChild,0),D.setRng(S)),D.isCollapsed()||(a.selection.setRng(a.selection.getRng()),a.getDoc().execCommand("Delete",!1,null), f()),x=D.getNode();var O={context:x.nodeName.toLowerCase(),data:u.data};if(N=b.parse(c,O),u.paste===!0&&s.isListFragment(N)&&s.isParentBlockLi(L,x))return S=s.insertAtCaret(C,L,a.selection.getRng(!0),N),a.selection.setRng(S),void a.fire("SetContent",E);if(p(N),k=N.lastChild,"mce_marker"==k.attr("id"))for(_=k,k=k.prev;k;k=k.walk(!0))if(3==k.type||!L.isBlock(k.name)){a.schema.isValidChild(k.parent.name,"span")&&k.parent.insert(_,k,"br"===k.name);break}if(a._selectionOverrides.showBlockCaretContainer(x),O.invalid){for(D.setContent(R),x=D.getNode(),w=a.getBody(),9==x.nodeType?x=k=w:k=x;k!==w;)x=k,k=k.parentNode;c=x==w?w.innerHTML:L.getOuterHTML(x),c=C.serialize(b.parse(c.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return C.serialize(N)}))),x==w?L.setHTML(w,c):L.setOuterHTML(x,c)}else c=C.serialize(N),k=x.firstChild,T=x.lastChild,!k||k===T&&"BR"===k.nodeName?L.setHTML(x,c):D.setContent(c);h(),y(L.get("mce_marker")),m(a.getBody()),a.fire("SetContent",E),a.addVisual()},u=function(e){var n;return"string"!=typeof e?(n=t.extend({paste:e.paste,data:{paste:e.paste}},e),{content:e.content,details:n}):{content:e,details:{}}},d=function(e,t){var n=u(t);c(e,n.content,n.details)};return{insertAtCaret:d}}),r(oe,[d,m,T,y,ie],function(e,n,r,i,o){var a=n.each,s=n.extend,l=n.map,c=n.inArray,u=n.explode,d=e.ie&&e.ie<11,f=!0,h=!1;return function(n){function p(e,t,r,i){var o,s,l=0;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||i&&i.skip_focus||n.focus(),i=n.fire("BeforeExecCommand",{command:e,ui:t,value:r}),i.isDefaultPrevented())return!1;if(s=e.toLowerCase(),o=B.exec[s])return o(s,t,r),n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;if(a(n.plugins,function(i){return i.execCommand&&i.execCommand(e,t,r)?(n.fire("ExecCommand",{command:e,ui:t,value:r}),l=!0,!1):void 0}),l)return l;if(n.theme&&n.theme.execCommand&&n.theme.execCommand(e,t,r))return n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;try{l=n.getDoc().execCommand(e,t,r)}catch(c){}return l?(n.fire("ExecCommand",{command:e,ui:t,value:r}),!0):!1}function m(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.state[e])return t(e);try{return n.getDoc().queryCommandState(e)}catch(r){}return!1}}function g(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.value[e])return t(e);try{return n.getDoc().queryCommandValue(e)}catch(r){}}}function v(e,t){t=t||"exec",a(e,function(e,n){a(n.toLowerCase().split(","),function(n){B[t][n]=e})})}function y(e,t,r){e=e.toLowerCase(),B.exec[e]=function(e,i,o,a){return t.call(r||n,i,o,a)}}function b(e){if(e=e.toLowerCase(),B.exec[e])return!0;try{return n.getDoc().queryCommandSupported(e)}catch(t){}return!1}function C(e,t,r){e=e.toLowerCase(),B.state[e]=function(){return t.call(r||n)}}function x(e,t,r){e=e.toLowerCase(),B.value[e]=function(){return t.call(r||n)}}function w(e){return e=e.toLowerCase(),!!B.exec[e]}function N(e,r,i){return r===t&&(r=h),i===t&&(i=null),n.getDoc().execCommand(e,r,i)}function E(e){return A.match(e)}function _(e,r){A.toggle(e,r?{value:r}:t),n.nodeChanged()}function S(e){L=R.getBookmark(e)}function k(){R.moveToBookmark(L)}var T,R,A,B={state:{},exec:{},value:{}},D=n.settings,L;n.on("PreInit",function(){T=n.dom,R=n.selection,D=n.settings,A=n.formatter}),s(this,{execCommand:p,queryCommandState:m,queryCommandValue:g,queryCommandSupported:b,addCommands:v,addCommand:y,addQueryStateHandler:C,addQueryValueHandler:x,hasCustomCommand:w}),v({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(t){var r=n.getDoc(),i;try{N(t)}catch(o){i=f}if("paste"!==t||r.queryCommandEnabled(t)||(i=!0),i||!r.queryCommandSupported(t)){var a=n.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");e.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),n.notificationManager.open({text:a,type:"error"})}},unlink:function(){if(R.isCollapsed()){var e=R.getNode();return void("A"==e.tagName&&n.dom.remove(e,!0))}A.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"==t&&(t="justify"),a("left,center,right,justify".split(","),function(e){t!=e&&A.remove("align"+e)}),"none"!=t&&_("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;N(e),t=T.getParent(R.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(S(),T.split(n,t),k()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){_(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){_(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=u(D.font_size_style_values),r=u(D.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),_(e,n)},RemoveFormat:function(e){A.remove(e)},mceBlockQuote:function(){_("blockquote")},FormatBlock:function(e,t,n){return _(n||"p")},mceCleanup:function(){var e=R.getBookmark();n.setContent(n.getContent({cleanup:f}),{cleanup:f}),R.moveToBookmark(e)},mceRemoveNode:function(e,t,r){var i=r||R.getNode();i!=n.getBody()&&(S(),n.dom.remove(i,f),k())},mceSelectNodeDepth:function(e,t,r){var i=0;T.getParent(R.getNode(),function(e){return 1==e.nodeType&&i++==r?(R.select(e),h):void 0},n.getBody())},mceSelectNode:function(e,t,n){R.select(n)},mceInsertContent:function(e,t,r){o.insertAtCaret(n,r)},mceInsertRawHTML:function(e,t,r){R.setContent("tiny_mce_marker"),n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return r}))},mceToggleFormat:function(e,t,n){_(n)},mceSetContent:function(e,t,r){n.setContent(r)},"Indent,Outdent":function(e){var t,r,i;t=D.indentation,r=/[a-z%]+$/i.exec(t),t=parseInt(t,10),m("InsertUnorderedList")||m("InsertOrderedList")?N(e):(D.forced_root_block||T.getParent(R.getNode(),T.isBlock)||A.apply("div"),a(R.getSelectedBlocks(),function(o){if("false"!==T.getContentEditable(o)&&"LI"!=o.nodeName){var a=n.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==T.getStyle(o,"direction",!0)?"Right":"Left","outdent"==e?(i=Math.max(0,parseInt(o.style[a]||0,10)-t),T.setStyle(o,a,i?i+r:"")):(i=parseInt(o.style[a]||0,10)+t+r,T.setStyle(o,a,i))}}))},mceRepaint:function(){},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual,n.addVisual()},mceReplaceContent:function(e,t,r){n.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,R.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=T.getParent(R.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||A.remove("link"),n.href&&A.apply("link",n,r)},selectAll:function(){var e=T.getRoot(),t;R.getRng().setStart?(t=T.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),R.setRng(t)):(t=R.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){N("Delete");var e=n.getBody();T.isEmpty(e)&&(n.setContent(""),e.firstChild&&T.isBlock(e.firstChild)?n.selection.setCursorLocation(e.firstChild,0):n.selection.setCursorLocation(e,0))},mceNewDocument:function(){n.setContent("")},InsertLineBreak:function(e,t,o){function a(){for(var e=new i(m,v),t,r=n.schema.getNonEmptyElements();t=e.next();)if(r[t.nodeName.toLowerCase()]||t.length>0)return!0}var s=o,l,c,u,h=R.getRng(!0);new r(T).normalize(h);var p=h.startOffset,m=h.startContainer;if(1==m.nodeType&&m.hasChildNodes()){var g=p>m.childNodes.length-1;m=m.childNodes[Math.min(p,m.childNodes.length-1)]||m,p=g&&3==m.nodeType?m.nodeValue.length:0}var v=T.getParent(m,T.isBlock),y=v?v.nodeName.toUpperCase():"",b=v?T.getParent(v.parentNode,T.isBlock):null,C=b?b.nodeName.toUpperCase():"",x=s&&s.ctrlKey;"LI"!=C||x||(v=b,y=C),m&&3==m.nodeType&&p>=m.nodeValue.length&&(d||a()||(l=T.create("br"),h.insertNode(l),h.setStartAfter(l),h.setEndAfter(l),c=!0)),l=T.create("br"),h.insertNode(l);var w=T.doc.documentMode;return d&&"PRE"==y&&(!w||8>w)&&l.parentNode.insertBefore(T.doc.createTextNode("\r"),l),u=T.create("span",{}," "),l.parentNode.insertBefore(u,l),R.scrollIntoView(u),T.remove(u),c?(h.setStartBefore(l),h.setEndBefore(l)):(h.setStartAfter(l),h.setEndAfter(l)),R.setRng(h),n.undoManager.add(),f}}),v({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=R.isCollapsed()?[T.getParent(R.getNode(),T.isBlock)]:R.getSelectedBlocks(),r=l(n,function(e){return!!A.matchNode(e,t)});return-1!==c(r,f)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return E(e)},mceBlockQuote:function(){return E("blockquote")},Outdent:function(){var e;if(D.inline_styles){if((e=T.getParent(R.getStart(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f;if((e=T.getParent(R.getEnd(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f}return m("InsertUnorderedList")||m("InsertOrderedList")||!D.inline_styles&&!!T.getParent(R.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=T.getParent(R.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),v({"FontSize,FontName":function(e){var t=0,n;return(n=T.getParent(R.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),v({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}),r(ae,[m],function(e){function t(e,o){var a=this,s,l;if(e=r(e),o=a.settings=o||{},s=o.base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(a.source=e);var c=0===e.indexOf("//");0!==e.indexOf("/")||c||(e=(s?s.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(l=o.base_uri?o.base_uri.path:new t(location.href).directory,""===o.base_uri.protocol?e="//mce_host"+a.toAbsPath(l,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(s&&s.protocol||"http")+"://mce_host"+a.toAbsPath(l,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(i,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),a[t]=r}),s&&(a.protocol||(a.protocol=s.protocol),a.userInfo||(a.userInfo=s.userInfo),a.port||"mce_host"!==a.host||(a.port=s.port),a.host&&"mce_host"!==a.host||(a.host=s.host),a.source=""),c&&(a.protocol="")}var n=e.each,r=e.trim,i="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),o={ftp:21,http:80,https:443,mailto:25};return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(n&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=o[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.length<n.length)for(o=0,a=n.length;a>o;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}},t.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},t}),r(se,[m],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r=this;if(!o&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],"function"==typeof f&&c[d]?u[d]=s(d,f):u[d]=f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(le,[m],function(e){function t(t){function n(){return!1}function r(){return!0}function i(e,i){var o,s,l,c;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=u),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=r},i.stopPropagation=function(){i.isPropagationStopped=r},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=r},i.isDefaultPrevented=n,i.isPropagationStopped=n,i.isImmediatePropagationStopped=n),t.beforeFire&&t.beforeFire(i),o=d[e])for(s=0,l=o.length;l>s;s++){if(c=o[s],c.once&&a(e,c.func),i.isImmediatePropagationStopped())return i.stopPropagation(),i;if(c.func.call(u,i)===!1)return i.preventDefault(),i}return i}function o(t,r,i,o){var a,s,l;if(r===!1&&(r=n),r)for(r={func:r},o&&e.extend(r,o),s=t.toLowerCase().split(" "),l=s.length;l--;)t=s[l],a=d[t],a||(a=d[t]=[],f(t,!0)),i?a.unshift(r):a.push(r);return c}function a(e,t){var n,r,i,o,a;if(e)for(o=e.toLowerCase().split(" "),n=o.length;n--;){if(e=o[n],r=d[e],!e){for(i in d)f(i,!1),delete d[i];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),d[e]=r);else r.length=0;r.length||(f(e,!1),delete d[e])}}else{for(e in d)f(e,!1);d={}}return c}function s(e,t,n){return o(e,t,n,{once:!0})}function l(e){return e=e.toLowerCase(),!(!d[e]||0===d[e].length)}var c=this,u,d={},f;t=t||{},u=t.scope||c,f=t.toggleEvent||n,c.fire=i,c.on=o,c.off=a,c.once=s,c.has=l}var n=e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," ");return t.isNative=function(e){return!!n[e.toLowerCase()]},t}),r(ce,[],function(){function e(e){this.create=e.create}return e.create=function(t,n){return new e({create:function(e,r){function i(t){e.set(r,t.value)}function o(e){t.set(n,e.value)}var a;return e.on("change:"+r,o),t.on("change:"+n,i),a=e._bindings,a||(a=e._bindings=[],e.on("destroy",function(){for(var e=a.length;e--;)a[e]()})),a.push(function(){t.off("change:"+n,i)}),t.get(n)}})},e}),r(ue,[le],function(e){function t(t){return t._eventDispatcher||(t._eventDispatcher=new e({scope:t,toggleEvent:function(n,r){e.isNative(n)&&t.toggleNativeEvent&&t.toggleNativeEvent(n,r)}})),t._eventDispatcher}return{fire:function(e,n,r){var i=this;if(i.removed&&"remove"!==e)return n;if(n=t(i).fire(e,n,r),r!==!1&&i.parent)for(var o=i.parent();o&&!n.isPropagationStopped();)o.fire(e,n,!1),o=o.parent();return n},on:function(e,n,r){return t(this).on(e,n,r)},off:function(e,n){return t(this).off(e,n)},once:function(e,n){return t(this).once(e,n)},hasEventListeners:function(e){return t(this).has(e)}}}),r(de,[ce,ue,se,m],function(e,t,n,r){function i(e){return e.nodeType>0}function o(e,t){var n,a;if(e===t)return!0;if(null===e||null===t)return e===t;if("object"!=typeof e||"object"!=typeof t)return e===t;if(r.isArray(t)){if(e.length!==t.length)return!1;for(n=e.length;n--;)if(!o(e[n],t[n]))return!1}if(i(e)||i(t))return e===t;a={};for(n in t){if(!o(e[n],t[n]))return!1;a[n]=!0}for(n in e)if(!a[n]&&!o(e[n],t[n]))return!1;return!0}return n.extend({Mixins:[t],init:function(t){var n,r;t=t||{};for(n in t)r=t[n],r instanceof e&&(t[n]=r.create(this,n));this.data=t},set:function(t,n){var r,i,a=this.data[t];if(n instanceof e&&(n=n.create(this,t)),"object"==typeof t){for(r in t)this.set(r,t[r]);return this}return o(a,n)||(this.data[t]=n,i={target:this,name:t,value:n,oldValue:a},this.fire("change:"+t,i),this.fire("change",i)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(t){return e.create(this,t)},destroy:function(){this.fire("destroy")}})}),r(fe,[se],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.classes.contains(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.pseudo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a<n.length;a++)">"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,h,p;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,p=e,h=0,i=o-1;i>=0;i--)for(c=a[i];p;){if(c.pseudo)for(f=p.parent().items(),u=d=f.length;u--&&f[u]!==p;);for(s=0,l=c.length;l>s;s++)if(!c[s](p,u,d)){s=l+1;break}if(s===l){h++;break}if(i===o-1)break;p=p.parent()}if(h===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(he,[m,fe,se],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].classes.contains(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(e){return this.each(function(t){t.classes.add(e)})},removeClass:function(e){return this.each(function(t){t.classes.remove(e)})}},e.each("fire on off show hide append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(pe,[d,m,w],function(e,t,n){var r=0,i={id:function(){return"mceu_"+r++},create:function(e,r,i){var o=document.createElement(e);return n.DOM.setAttribs(o,r),"string"==typeof i?o.innerHTML=i:t.each(i,function(e){e.nodeType&&o.appendChild(e)}),o},createFragment:function(e){return n.DOM.createFragment(e)},getWindowSize:function(){return n.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return n.DOM.getPos(e,t||i.getContainer())},getContainer:function(){return e.container?e.container:document.body},getViewPort:function(e){return n.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return n.DOM.addClass(e,t)},removeClass:function(e,t){return n.DOM.removeClass(e,t)},hasClass:function(e,t){return n.DOM.hasClass(e,t)},toggleClass:function(e,t,r){return n.DOM.toggleClass(e,t,r)},css:function(e,t,r){return n.DOM.setStyle(e,t,r)},getRuntimeStyle:function(e,t){return n.DOM.getStyle(e,t,!0)},on:function(e,t,r,i){return n.DOM.bind(e,t,r,i)},off:function(e,t,r){return n.DOM.unbind(e,t,r)},fire:function(e,t,r){return n.DOM.fire(e,t,r)},innerHtml:function(e,t){n.DOM.setHTML(e,t)}};return i}),r(me,[],function(){return{parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}}}}),r(ge,[m],function(e){function t(){}function n(e){this.cls=[],this.cls._map={},this.onchange=e||t,this.prefix=""}return e.extend(n.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){for(var t=0;t<this.cls.length&&this.cls[t]!==e;t++);this.cls.splice(t,1),delete this.cls._map[e],this._change()}return this},toggle:function(e,t){var n=this.contains(e);return n!==t&&(n?this.remove(e):this.add(e),this._change()),this},contains:function(e){return!!this.cls._map[e]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),n.prototype.toString=function(){var e;if(this.clsValue)return this.clsValue;e="";for(var t=0;t<this.cls.length;t++)t>0&&(e+=" "),e+=this.prefix+this.cls[t];return e},n}),r(ve,[u],function(e){var t={},n;return{add:function(r){var i=r.parent();if(i){if(!i._layout||i._layout.isNative())return;t[i._id]||(t[i._id]=i),n||(n=!0,e.requestAnimationFrame(function(){var e,r;n=!1;for(e in t)r=t[e],r.state.get("rendered")&&r.reflow();t={}},document.body))}},remove:function(e){t[e._id]&&delete t[e._id]}}}),r(ye,[se,m,le,de,he,pe,g,me,ge,ve],function(e,t,n,r,i,o,a,s,l,c){function u(e){return e._eventDispatcher||(e._eventDispatcher=new n({scope:e,toggleEvent:function(t,r){r&&n.isNative(t)&&(e._nativeEvents||(e._nativeEvents={}),e._nativeEvents[t]=!0,e.state.get("rendered")&&d(e))}})),e._eventDispatcher}function d(e){function t(t){var n=e.getParentCtrl(t.target);n&&n.fire(t.type,t)}function n(){var e=c._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),c._lastHoverCtrl=null)}function r(t){var n=e.getParentCtrl(t.target),r=c._lastHoverCtrl,i=0,o,a,s;if(n!==r){if(c._lastHoverCtrl=n,a=n.parents().toArray().reverse(),a.push(n),r){for(s=r.parents().toArray().reverse(),s.push(r),i=0;i<s.length&&a[i]===s[i];i++);for(o=s.length-1;o>=i;o--)r=s[o],r.fire("mouseleave",{target:r.getEl()})}for(o=i;o<a.length;o++)n=a[o],n.fire("mouseenter",{target:n.getEl()})}}function i(t){t.preventDefault(),"mousewheel"==t.type?(t.deltaY=-1/40*t.wheelDelta,t.wheelDeltaX&&(t.deltaX=-1/40*t.wheelDeltaX)):(t.deltaX=0,t.deltaY=t.detail),t=e.fire("wheel",t)}var o,s,l,c,u,d;if(u=e._nativeEvents){for(l=e.parents().toArray(),l.unshift(e),o=0,s=l.length;!c&&s>o;o++)c=l[o]._eventsRoot;for(c||(c=l[l.length-1]||e),e._eventsRoot=c,s=o,o=0;s>o;o++)l[o]._eventsRoot=c;var p=c._delegates;p||(p=c._delegates={});for(d in u){if(!u)return!1;"wheel"!==d||h?("mouseenter"===d||"mouseleave"===d?c._hasMouseEnter||(a(c.getEl()).on("mouseleave",n).on("mouseover",r),c._hasMouseEnter=1):p[d]||(a(c.getEl()).on(d,t),p[d]=!0),u[d]=!1):f?a(e.getEl()).on("mousewheel",i):a(e.getEl()).on("DOMMouseScroll",i)}}}var f="onmousewheel"in document,h=!1,p="mce-",m,g=0,v={Statics:{classPrefix:p},isRtl:function(){return m.rtl},classPrefix:p,init:function(e){function n(e){var t;for(e=e.split(" "),t=0;t<e.length;t++)i.classes.add(e[t])}var i=this,o,c;i.settings=e=t.extend({},i.Defaults,e),i._id=e.id||"mceu_"+g++,i._aria={role:e.role},i._elmCache={},i.$=a,i.state=new r({visible:!0,active:!1,disabled:!1,value:""}),i.data=new r(e.data),i.classes=new l(function(){i.state.get("rendered")&&(i.getEl().className=this.toString())}),i.classes.prefix=i.classPrefix,o=e.classes,o&&(i.Defaults&&(c=i.Defaults.classes,c&&o!=c&&n(c)),n(o)),t.each("title text name visible disabled active value".split(" "),function(t){t in e&&i[t](e[t])}),i.on("click",function(){return i.disabled()?!1:void 0}),i.settings=e,i.borderBox=s.parseBox(e.border),i.paddingBox=s.parseBox(e.padding),i.marginBox=s.parseBox(e.margin),e.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){return o.getContainer()},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},initLayoutRect:function(){var e=this,t=e.settings,n,r,i=e.getEl(),a,l,c,u,d,f,h,p;n=e.borderBox=e.borderBox||s.measureBox(i,"border"),e.paddingBox=e.paddingBox||s.measureBox(i,"padding"),e.marginBox=e.marginBox||s.measureBox(i,"margin"),p=o.getSize(i),f=t.minWidth,h=t.minHeight,c=f||p.width,u=h||p.height,a=t.width,l=t.height,d=t.autoResize,d="undefined"!=typeof d?d:!a&&!l,a=a||c,l=l||u;var m=n.left+n.right,g=n.top+n.bottom,v=t.maxWidth||65535,y=t.maxHeight||65535;return e._layoutRect=r={x:t.x||0,y:t.y||0,w:a,h:l,deltaW:m,deltaH:g,contentW:a-m,contentH:l-g,innerW:a-m,innerH:l-g,startMinWidth:f||0,startMinHeight:h||0,minW:Math.min(c,v),minH:Math.min(u,y),maxW:v,maxH:y,autoResize:d,scrollW:0},e._lastLayoutRect={},r},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,l;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=i<n.minW?n.minW:i,i=i>n.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=i<n.minH?n.minH:i,i=i>n.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=i<n.minW-o?n.minW-o:i,i=i>n.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=i<n.minH-a?n.minH-a:i,i=i>n.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,r.x===n.x&&r.y===n.y&&r.w===n.w&&r.h===n.h||(l=m.repaintControls,l&&l.map&&!l.map[t._id]&&(l.push(t),l.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o,a,s,l,c,u;c=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,i=e._layoutRect,l=e._lastRepaintRect||{},o=e.borderBox,a=o.left+o.right,s=o.top+o.bottom,i.x!==l.x&&(t.left=c(i.x)+"px",l.x=i.x),i.y!==l.y&&(t.top=c(i.y)+"px",l.y=i.y),i.w!==l.w&&(u=c(i.w-a),t.width=(u>=0?u:0)+"px",l.w=i.w),i.h!==l.h&&(u=c(i.h-s),t.height=(u>=0?u:0)+"px",l.h=i.h),e._hasBody&&i.innerW!==l.innerW&&(u=c(i.innerW),r=e.getEl("body"),r&&(n=r.style,n.width=(u>=0?u:0)+"px"),l.innerW=i.innerW),e._hasBody&&i.innerH!==l.innerH&&(u=c(i.innerH),r=r||e.getEl("body"),r&&(n=n||r.style,n.height=(u>=0?u:0)+"px"),l.innerH=i.innerH),e._lastRepaintRect=l,e.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,o.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){function n(e){var t,n;return"string"!=typeof e?e:function(i){return t||r.parentsAndSelf().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t?t.call(n,i):(i.action=e,void this.fire("execute",i))}}var r=this;return u(r).on(e,n(t)),r},off:function(e,t){return u(this).off(e,t),this},fire:function(e,t,n){var r=this;if(t=t||{},t.control||(t.control=r),t=u(r).fire(e,t),n!==!1&&r.parent)for(var i=r.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return u(this).has(e)},parents:function(e){var t=this,n,r=new i;for(n=t.parent();n;n=n.parent())r.add(n);return e&&(r=r.filter(e)),r},parentsAndSelf:function(e){return new i(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=a("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return m.translate?m.translate(e):e},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),r,i; if(e.items){var o=e.items().toArray();for(i=o.length;i--;)o[i].remove()}n&&n.items&&(r=[],n.items().each(function(t){t!==e&&r.push(t)}),n.items().set(r),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&a(t).off();var s=e.getRoot().controlIdLookup;return s&&delete s[e._id],t&&t.parentNode&&t.parentNode.removeChild(t),e.state.set("rendered",!1),e.state.destroy(),e.fire("remove"),e},renderBefore:function(e){return a(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return a(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var e=this,t=e.settings,n,r,i,o,s;e.$el=a(e.getEl()),e.state.set("rendered",!0);for(o in t)0===o.indexOf("on")&&e.on(o.substr(2),t[o]);if(e._eventsRoot){for(i=e.parent();!s&&i;i=i.parent())s=i._eventsRoot;if(s)for(o in s._nativeEvents)e._nativeEvents[o]=!0}d(e),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e.settings.border&&(r=e.borderBox,e.$el.css({"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var u in e._aria)e.aria(u,e._aria[u]);e.state.get("visible")===!1&&(e.getEl().style.display="none"),e.bindStates(),e.state.on("change:visible",function(t){var n=t.value,r;e.state.get("rendered")&&(e.getEl().style.display=n===!1?"none":"",e.getEl().getBoundingClientRect()),r=e.parent(),r&&(r._lastRect=null),e.fire(n?"show":"hide"),c.add(e)}),e.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){c.remove(this);var e=this.parent();return e._layout&&!e._layout.isNative()&&e.reflow(),this}};return t.each("text title visible disabled active value".split(" "),function(e){v[e]=function(t){return 0===arguments.length?this.state.get(e):("undefined"!=typeof t&&this.state.set(e,t),this)}}),m=e.extend(v)}),r(be,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(Ce,[],function(){return function(e){function t(e){return e&&1===e.nodeType}function n(e){return e=e||C,t(e)?e.getAttribute("role"):null}function r(e){for(var t,r=e||C;r=r.parentNode;)if(t=n(r))return t}function i(e){var n=C;return t(n)?n.getAttribute("aria-"+e):void 0}function o(e){var t=e.tagName.toUpperCase();return"INPUT"==t||"TEXTAREA"==t||"SELECT"==t}function a(e){return o(e)&&!e.hidden?!0:!!/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(n(e))}function s(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){a(e)&&n.push(e);for(var r=0;r<e.childNodes.length;r++)t(e.childNodes[r])}}var n=[];return t(e||b.getEl()),n}function l(e){var t,n;e=e||x,n=e.parents().toArray(),n.unshift(e);for(var r=0;r<n.length&&(t=n[r],!t.settings.ariaRoot);r++);return t}function c(e){var t=l(e),n=s(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?u(t.lastAriaIndex,n):u(0,n)}function u(e,t){return 0>e?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function d(e,t){var n=-1,r=l();t=t||s(r.getEl());for(var i=0;i<t.length;i++)t[i]===C&&(n=i);n+=e,r.lastAriaIndex=u(n,t)}function f(){var e=r();"tablist"==e?d(-1,s(C.parentNode)):x.parent().submenu?v():d(-1)}function h(){var e=n(),t=r();"tablist"==t?d(1,s(C.parentNode)):"menuitem"==e&&"menu"==t&&i("haspopup")?y():d(1)}function p(){d(-1)}function m(){var e=n(),t=r();"menuitem"==e&&"menubar"==t?y():"button"==e&&i("haspopup")?y({key:"down"}):d(1)}function g(e){var t=r();if("tablist"==t){var n=s(x.getEl("body"))[0];n&&n.focus()}else d(e.shiftKey?-1:1)}function v(){x.fire("cancel")}function y(e){e=e||{},x.fire("click",{target:C,aria:e})}var b=e.root,C,x;try{C=document.activeElement}catch(w){C=document.body}return x=b.getParentCtrl(C),b.on("keydown",function(e){function t(e,t){o(C)||"slider"!==n(C)&&t(e)!==!1&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,f);break;case 39:t(e,h);break;case 38:t(e,p);break;case 40:t(e,m);break;case 27:v();break;case 14:case 13:case 32:t(e,y);break;case 9:g(e)!==!1&&e.preventDefault()}}),b.on("focusin",function(e){C=e.target,x=e.control}),{focusFirst:c}}}),r(xe,[ye,he,fe,be,Ce,m,g,ge,ve],function(e,t,n,r,i,o,a,s,l){var c={};return e.extend({init:function(e){var n=this;n._super(e),e=n.settings,e.fixed&&n.state.set("fixed",!0),n._items=new t,n.isRtl()&&n.classes.add("rtl"),n.bodyClasses=new s(function(){n.state.get("rendered")&&(n.getEl("body").className=this.toString())}),n.bodyClasses.prefix=n.classPrefix,n.classes.add("container"),n.bodyClasses.add("container-body"),e.containerCls&&n.classes.add(e.containerCls),n._layout=r.create((e.layout||"")+"layout"),n.settings.items?n.add(n.settings.items):n.add(n.render()),n._hasBody=!0},items:function(){return this._items},find:function(e){return e=c[e]=c[e]||new n(e),e.find(this)},add:function(e){var t=this;return t.items().add(t.create(e)).parent(t),t},focus:function(e){var t=this,n,r,i;return e&&(r=t.keyboardNav||t.parents().eq(-1)[0].keyboardNav)?void r.focusFirst(t):(i=t.find("*"),t.statusbar&&i.add(t.statusbar.items()),i.each(function(e){return e.settings.autofocus?(n=null,!1):void(e.canFocus&&(n=n||e))}),n&&n.focus(),t)},replace:function(e,t){for(var n,r=this.items(),i=r.length;i--;)if(r[i]===e){r[i]=t;break}i>=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,i,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r;t.parent(e),t.state.get("rendered")||(r=e.getEl("body"),r.hasChildNodes()&&n<=r.childNodes.length-1?a(r.childNodes[n]).before(t.renderHtml()):a(r).append(t.renderHtml()),t.postRender(),l.add(t))}),e._layout.applyClasses(e.items().filter(":visible")),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t<i.length-1&&(t+=1),t>=0&&t<i.length&&(o=i.slice(0,t).toArray(),a=i.slice(t).toArray(),i.set(o.concat(e,a))),r.renderNew()},fromJSON:function(e){var t=this;for(var n in e)t.find("#"+n).value(e[n]);return t},toJSON:function(){var e=this,t={};return e.find("*").each(function(e){var n=e.name(),r=e.value();n&&"undefined"!=typeof r&&(t[n]=r)}),t},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e.state.set("rendered",!0),e.settings.style&&e.$el.css(e.settings.style),e.settings.border&&(t=e.borderBox,e.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(l.remove(this),this.visible()){for(e.repaintControls=[],e.repaintControls.map={},this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(we,[g],function(e){function t(e){var t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}function n(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}return function(r,i){function o(){return s.getElementById(i.handle||r)}var a,s=i.document||document,l,c,u,d,f,h;i=i||{},c=function(r){var c=t(s),p,m;n(r),r.preventDefault(),l=r.button,p=o(),f=r.screenX,h=r.screenY,m=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,a=e("<div>").css({position:"absolute",top:0,left:0,width:c.width,height:c.height,zIndex:2147483647,opacity:1e-4,cursor:m}).appendTo(s.body),e(s).on("mousemove touchmove",d).on("mouseup touchend",u),i.start(r)},d=function(e){return n(e),e.button!==l?u(e):(e.deltaX=e.screenX-f,e.deltaY=e.screenY-h,e.preventDefault(),void i.drag(e))},u=function(t){n(t),e(s).off("mousemove touchmove",d).off("mouseup touchend",u),a.remove(),i.stop&&i.stop(t)},this.destroy=function(){e(o()).off()},e(o()).on("mousedown touchstart",c)}}),r(Ne,[g,we],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,h,p,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),e(i.getEl("absend")).css(y,i.layoutRect()[l]-1),!c)return void e(f).css("display","none");e(f).css("display","block"),d=i.getEl("body"),h=i.getEl("scroll"+t+"t"),p=d["client"+s]-2*o,p-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=p/m,v={},v[y]=d["offset"+a]+o,v[b]=p,e(f).css(v),v={},v[y]=d["scroll"+a]*g,v[b]=p*g,e(h).css(v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;e(i.getEl()).append('<div id="'+u+'" class="'+d+"scrollbar "+d+"scrollbar-"+n+'"><div id="'+u+'t" class="'+d+'scrollbar-thumb"></div></div>'),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e("#"+u).addClass(d+"active")},drag:function(e){var t,u,d,f,h=i.layoutRect();u=h.contentW>h.innerW,d=h.contentH>h.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e("#"+u).removeClass(d+"active")}})}i.classes.add("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e(i.getEl("body")).on("scroll",n)),n())}}}),r(Ee,[xe,Ne],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}})}),r(_e,[pe],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,h;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t.state.get("fixed")&&"static"==e.getRuntimeStyle(document.body,"position")&&(a-=f.x,s-=f.y),i=t.getEl(),h=e.getSize(i),l=h.width,c=h.height,h=e.getSize(n),u=h.width,d=h.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o<r.length;o++){var a=t(this,n,r[o]);if(this.state.get("fixed")){if(a.x>0&&a.x+a.w<i.w&&a.y>0&&a.y+a.h<i.h)return r[o]}else if(a.x>i.x&&a.x+a.w<i.w+i.x&&a.y>i.y&&a.y+a.h<i.h+i.y)return r[o]}return r[0]},moveRel:function(e,n){"string"!=typeof n&&(n=this.testMoveRel(e,n));var r=t(this,e,n);return this.moveTo(r.x,r.y)},moveBy:function(e,t){var n=this,r=n.layoutRect();return n.moveTo(r.x+e,r.y+t),n},moveTo:function(t,n){function r(e,t,n){return 0>e?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i.state.get("rendered")?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(Se,[pe],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(ke,[Ee,_e,Se,pe,g,u],function(e,t,n,r,i,o){function a(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}function s(e){for(var t=v.length;t--;){var n=v[t],r=n.getParentCtrl(e.target);if(n.settings.autohide){if(r&&(a(r,n)||n.parent()===r))continue;e=n.fire("autohide",{target:e.target}),e.isDefaultPrevented()||n.hide()}}}function l(){p||(p=function(e){2!=e.button&&s(e)},i(document).on("click touchstart",p))}function c(){m||(m=function(){var e;for(e=v.length;e--;)d(v[e])},i(window).on("scroll",m))}function u(){if(!g){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;g=function(){document.all&&t==e.clientWidth&&n==e.clientHeight||(t=e.clientWidth,n=e.clientHeight,C.hideAll())},i(window).on("resize",g)}}function d(e){function t(t,n){for(var r,i=0;i<v.length;i++)if(v[i]!=e)for(r=v[i].parent();r&&(r=r.parent());)r==e&&v[i].fixed(t).moveBy(0,n).repaint()}var n=r.getViewPort().y;e.settings.autofix&&(e.state.get("fixed")?e._autoFixY>n&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY<n&&(e.fixed(!0).layoutRect({y:0}).repaint(),t(!0,n-e._autoFixY))))}function f(e,t){var n,r=C.zIndex||65535,o;if(e)y.push(t);else for(n=y.length;n--;)y[n]===t&&y.splice(n,1);if(y.length)for(n=0;n<y.length;n++)y[n].modal&&(r++,o=y[n]),y[n].getEl().style.zIndex=r,y[n].zIndex=r,r++;var a=i("#"+t.classPrefix+"modal-block",t.getContainerElm())[0];o?i(a).css("z-index",o.zIndex-1):a&&(a.parentNode.removeChild(a),b=!1),C.currentZIndex=r}function h(e){var t;for(t=v.length;t--;)v[t]===e&&v.splice(t,1);for(t=y.length;t--;)y[t]===e&&y.splice(t,1)}var p,m,g,v=[],y=[],b,C=e.extend({Mixins:[t,n],init:function(e){var t=this;t._super(e),t._eventsRoot=t,t.classes.add("floatpanel"),e.autohide&&(l(),u(),v.push(t)),e.autofix&&(c(),t.on("move",function(){d(this)})),t.on("postrender show",function(e){if(e.control==t){var n,r=t.classPrefix;t.modal&&!b&&(n=i("#"+r+"modal-block",t.getContainerElm()),n[0]||(n=i('<div id="'+r+'modal-block" class="'+r+"reset "+r+'fade"></div>').appendTo(t.getContainerElm())),o.setTimeout(function(){n.addClass(r+"in"),i(t.getEl()).addClass(r+"in")}),b=!0),f(!0,t)}}),t.on("show",function(){t.parents().each(function(e){return e.state.get("fixed")?(t.fixed(!0),!1):void 0})}),e.popover&&(t._preBodyHtml='<div class="'+t.classPrefix+'arrow"></div>',t.classes.add("popover").add("bottom").add(t.isRtl()?"end":"start")),t.aria("label",e.ariaLabel),t.aria("labelledby",t._id),t.aria("describedby",t.describedBy||t._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!=e){if(t.state.get("rendered")){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e=this,t,n=e._super();for(t=v.length;t--&&v[t]!==e;);return-1===t&&v.push(e),n},hide:function(){return h(this),f(!1,this),this._super()},hideAll:function(){C.hideAll()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||(e.remove(),f(!1,e)),e},remove:function(){h(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return C.hideAll=function(){for(var e=v.length;e--;){var t=v[e];t&&t.settings.autohide&&(t.hide(),v.splice(e,1))}},C}),r(Te,[ke,Ee,pe,g,we,me,d,u],function(e,t,n,r,i,o,a,s){function l(e){var t="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0",n=r("meta[name=viewport]")[0],i;a.overrideViewPort!==!1&&(n||(n=document.createElement("meta"),n.setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),i=n.getAttribute("content"),i&&"undefined"!=typeof f&&(f=i),n.setAttribute("content",e?t:f))}function c(e){for(var t=0;t<d.length;t++)if(d[t]._fullscreen)return;r([document.documentElement,document.body]).removeClass(e+"fullscreen")}function u(){function e(){var e,t=n.getWindowSize(),r;for(e=0;e<d.length;e++)r=d[e].layoutRect(),d[e].moveTo(d[e].settings.x||Math.max(0,t.w/2-r.w/2),d[e].settings.y||Math.max(0,t.h/2-r.h/2))}if(!a.desktop){var t={w:window.innerWidth,h:window.innerHeight};s.setInterval(function(){var e=window.innerWidth,n=window.innerHeight;t.w==e&&t.h==n||(t={w:e,h:n},r(window).trigger("resize"))},100)}r(window).on("resize",e)}var d=[],f="",h=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var r=this;r._super(e),r.isRtl()&&r.classes.add("rtl"),r.classes.add("window"),r.bodyClasses.add("window-body"),r.state.set("fixed",!0),e.buttons&&(r.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:r.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),r.statusbar.classes.add("foot"),r.statusbar.parent(r)),r.on("click",function(e){var t=r.classPrefix+"close";(n.hasClass(e.target,t)||n.hasClass(e.target.parentNode,t))&&r.close()}),r.on("cancel",function(){r.close()}),r.aria("describedby",r.describedBy||r._id+"-none"),r.aria("label",e.title),r._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=e.settings.x||Math.max(0,a.w/2-t.w/2),t.y=e.settings.y||Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='<div id="'+n+'-head" class="'+r+'window-head"><div id="'+n+'-title" class="'+r+'title">'+e.encode(i.title)+'</div><div id="'+n+'-dragh" class="'+r+'dragh"></div><button type="button" class="'+r+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),i.url&&(s='<iframe src="'+i.url+'" tabindex="-1"></iframe>'),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.bodyClasses+'">'+s+"</div>"+a+"</div></div>"},fullscreen:function(e){var t=this,i=document.documentElement,a,l=t.classPrefix,c;if(e!=t._fullscreen)if(r(window).on("resize",function(){var e;if(t._fullscreen)if(a)t._timer||(t._timer=s.setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(a=!0)}}),c=t.layoutRect(),t._fullscreen=e,e){t._initial={x:c.x,y:c.y,w:c.w,h:c.h},t.borderBox=o.parseBox("0"),t.getEl("head").style.display="none",c.deltaH-=c.headerH+2,r([i,document.body]).addClass(l+"fullscreen"),t.classes.add("fullscreen");var u=n.getWindowSize();t.moveTo(0,0).resizeTo(u.w,u.h)}else t.borderBox=o.parseBox(t.settings.border),t.getEl("head").style.display="",c.deltaH+=c.headerH,r([i,document.body]).removeClass(l+"fullscreen"),t.classes.remove("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.classes.add("in"),e.fire("open")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()}),d.push(e),l(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t;for(e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),t=d.length;t--;)d[t]===e&&d.splice(t,1);l(d.length>0),c(e.classPrefix)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});return u(),h}),r(Re,[Te],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){function r(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),o(t)}}}var i,o=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:i=[r("Ok",!0,!0),r("Cancel",!1)];break;case t.YES_NO:case t.YES_NO_CANCEL:i=[r("Yes",1,!0),r("No",0)],n.buttons==t.YES_NO_CANCEL&&i.push(r("Cancel",-1));break;default:i=[r("Ok",!0,!0)]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:i,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){o(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(Ae,[Te,Re],function(e,t){return function(n){function r(){return s.length?s[s.length-1]:void 0}function i(e){n.fire("OpenWindow",{win:e})}function o(e){n.fire("CloseWindow",{win:e})}var a=this,s=[];a.windows=s,n.on("remove",function(){for(var e=s.length;e--;)s[e].close()}),a.open=function(t,r){var a;return n.editorManager.setActive(n),t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body,data:t.data,callbacks:t.commands}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){a.find("form")[0].submit()}},{text:"Cancel",onclick:function(){a.close()}}]),a=new e(t),s.push(a),a.on("close",function(){for(var e=s.length;e--;)s[e]===a&&s.splice(e,1);s.length||n.focus(),o(a)}),t.data&&a.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),a.features=t||{},a.params=r||{},1===s.length&&n.nodeChanged(),a=a.renderTo().reflow(),i(a),a},a.alert=function(e,r,a){var s;s=t.alert(e,function(){r?r.call(a||this):n.focus()}),s.on("close",function(){o(s)}),i(s)},a.confirm=function(e,n,r){var a;a=t.confirm(e,function(e){n.call(r||this,e)}),a.on("close",function(){o(a)}),i(a)},a.close=function(){r()&&r().close()},a.getParams=function(){return r()?r().params:null},a.setParams=function(e){r()&&(r().params=e)},a.getWindows=function(){return s}}}),r(Be,[ye,_e],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'" role="presentation"><div class="'+t+'tooltip-arrow"></div><div class="'+t+'tooltip-inner">'+e.encode(e.state.get("text"))+"</div></div>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)}),e._super()},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(De,[ye,Be],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.classes.toggle("tooltip-n","bc-tc"==i),r.classes.toggle("tooltip-nw","bc-tl"==i),r.classes.toggle("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){function e(e){n.aria("disabled",e),n.classes.toggle("disabled",e)}function t(e){n.aria("pressed",e),n.classes.toggle("active",e)}var n=this;return n.state.on("change:disabled",function(t){e(t.value)}),n.state.on("change:active",function(e){t(e.value)}),n.state.get("disabled")&&e(!0),n.state.get("active")&&t(!0),n._super()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(Le,[De],function(e){return e.extend({Defaults:{value:0},init:function(e){var t=this;t._super(e),t.classes.add("progress"),t.settings.filter||(t.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this,t=e._id,n=this.classPrefix;return'<div id="'+t+'" class="'+e.classes+'"><div class="'+n+'bar-container"><div class="'+n+'bar"></div></div><div class="'+n+'text">0%</div></div>'},postRender:function(){var e=this;return e._super(),e.value(e.settings.value),e},bindStates:function(){function e(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}var t=this;return t.state.on("change:value",function(t){e(t.value)}),e(t.state.get("value")),t._super()}})}),r(Me,[ye,_e,Le,u],function(e,t,n,r){return e.extend({Mixins:[t],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||e.timeout>0)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new n),t.on("click",function(e){-1!=e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e=this,t=e.classPrefix,n="",r="",i="",o="";return e.icon&&(n='<i class="'+t+"ico "+t+"i-"+e.icon+'"></i>'),e.color&&(o=' style="background-color: '+e.color+'"'),e.closeButton&&(r='<button type="button" class="'+t+'close" aria-hidden="true">\xd7</button>'),e.progressBar&&(i=e.progressBar.renderHtml()),'<div id="'+e._id+'" class="'+e.classes+'"'+o+' role="presentation">'+n+'<div class="'+t+'notification-inner">'+e.state.get("text")+"</div>"+i+r+"</div>"},postRender:function(){var e=this;return r.setTimeout(function(){e.$el.addClass(e.classPrefix+"in")}),e._super()},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().childNodes[1].innerHTML=t.value}),e.progressBar&&e.progressBar.bindStates(),e._super()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||e.remove(),e},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(Pe,[Me,u],function(e,t){return function(n){function r(){return l.length?l[l.length-1]:void 0}function i(){t.requestAnimationFrame(function(){o(),a()})}function o(){for(var e=0;e<l.length;e++)l[e].moveTo(0,0)}function a(){if(l.length>0){var e=l.slice(0,1)[0],t=n.inline?n.getElement():n.getContentAreaContainer();if(e.moveRel(t,"tc-tc"),l.length>1)for(var r=1;r<l.length;r++)l[r].moveRel(l[r-1].getEl(),"bc-tc")}}var s=this,l=[];s.notifications=l,n.on("remove",function(){for(var e=l.length;e--;)l[e].close()}),n.on("ResizeEditor",a),n.on("ResizeWindow",i),s.open=function(t){var r;return n.editorManager.setActive(n),r=new e(t),l.push(r),t.timeout>0&&(r.timer=setTimeout(function(){r.close()},t.timeout)),r.on("close",function(){var e=l.length;for(r.timer&&n.getWin().clearTimeout(r.timer);e--;)l[e]===r&&l.splice(e,1);a()}),r.renderTo(),a(),r},s.close=function(){r()&&r().close()},s.getNotifications=function(){return l},n.on("SkinLoaded",function(){var e=n.settings.service_message;e&&n.notificationManager.open({text:e,type:"warning",timeout:0,icon:""})})}}),r(Oe,[w],function(e){function t(t,n,r){for(var i=[];n&&n!=t;n=n.parentNode)i.push(e.nodeIndex(n,r));return i}function n(e,t){var n,r,i;for(r=e,n=t.length-1;n>=0;n--){if(i=r.childNodes,t[n]>i.length-1)return null;r=i[t[n]]}return r}return{create:t,resolve:n}}),r(He,[I,T,y,Oe,A,C,d,m,u,k,$,ne],function(e,t,n,r,i,o,a,s,l,c,u,d){return function(f){function h(e,t){try{f.getDoc().execCommand(e,!1,t)}catch(n){}}function p(){var e=f.getDoc().documentMode;return e?e:6}function m(e){return e.isDefaultPrevented()}function g(e){var t,n;e.dataTransfer&&(f.selection.isCollapsed()&&"IMG"==e.target.tagName&&re.select(e.target),t=f.selection.getContent(),t.length>0&&(n=ue+escape(f.id)+","+escape(t),e.dataTransfer.setData(de,n)))}function v(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(de),t&&t.indexOf(ue)>=0)?(t=t.substr(ue.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}function y(e){f.queryCommandSupported("mceInsertClipboardContent")?f.execCommand("mceInsertClipboardContent",!1,{content:e}):f.execCommand("mceInsertContent",!1,e)}function b(){function i(e){var t=C.schema.getBlockElements(),n=f.getBody();if("BR"!=e.nodeName)return!1;for(;e!=n&&!t[e.nodeName];e=e.parentNode)if(e.nextSibling)return!1;return!0}function o(e,t){var n;for(n=e.nextSibling;n&&n!=t;n=n.nextSibling)if((3!=n.nodeType||0!==Z.trim(n.data).length)&&n!==t)return!1;return n===t}function a(e,t,r){var o,a,s;for(s=C.schema.getNonEmptyElements(),o=new n(r||e,e);a=o[t?"next":"prev"]();){if(s[a.nodeName]&&!i(a))return a;if(3==a.nodeType&&a.data.length>0)return a}}function c(e){var n,r,i,o,s;if(!e.collapsed&&(n=C.getParent(t.getNode(e.startContainer,e.startOffset),C.isBlock), r=C.getParent(t.getNode(e.endContainer,e.endOffset),C.isBlock),s=f.schema.getTextBlockElements(),n!=r&&s[n.nodeName]&&s[r.nodeName]&&"false"!==C.getContentEditable(n)&&"false"!==C.getContentEditable(r)))return e.deleteContents(),i=a(n,!1),o=a(r,!0),C.isEmpty(r)||Z(n).append(r.childNodes),Z(r).remove(),i?1==i.nodeType?"BR"==i.nodeName?(e.setStartBefore(i),e.setEndBefore(i)):(e.setStartAfter(i),e.setEndAfter(i)):(e.setStart(i,i.data.length),e.setEnd(i,i.data.length)):o&&(1==o.nodeType?(e.setStartBefore(o),e.setEndBefore(o)):(e.setStart(o,0),e.setEnd(o,0))),x.setRng(e),!0}function u(e,n){var r,i,s,l,c,u;if(!e.collapsed)return e;if(c=e.startContainer,u=e.startOffset,3==c.nodeType)if(n){if(u<c.data.length)return e}else if(u>0)return e;if(r=t.getNode(e.startContainer,e.startOffset),s=C.getParent(r,C.isBlock),i=a(f.getBody(),n,r),l=C.getParent(i,C.isBlock),!r||!i)return e;if(l&&s!=l)if(n){if(!o(s,l))return e;1==r.nodeType?"BR"==r.nodeName?e.setStartBefore(r):e.setStartAfter(r):e.setStart(r,r.data.length),1==i.nodeType?e.setEnd(i,0):e.setEndBefore(i)}else{if(!o(l,s))return e;1==i.nodeType?"BR"==i.nodeName?e.setStartBefore(i):e.setStartAfter(i):e.setStart(i,i.data.length),1==r.nodeType?e.setEnd(r,0):e.setEndBefore(r)}return e}function d(e){var t=x.getRng();return t=u(t,e),c(t)?!0:void 0}function h(e,t){function n(e,n){return m=Z(n).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),l=e.cloneNode(!1),m=s.map(m,function(e){return e=e.cloneNode(!1),l.hasChildNodes()?(e.appendChild(l.firstChild),l.appendChild(e)):l.appendChild(e),l.appendChild(e),e}),m.length?(p=C.create("br"),m[0].appendChild(p),C.replace(l,e),t.setStartBefore(p),t.setEndBefore(p),f.selection.setRng(t),p):null}function i(e){return e&&f.schema.getTextBlockElements()[e.tagName]}var o,a,l,c,u,d,h,p,m;if(t.collapsed&&(d=t.startContainer,h=t.startOffset,a=C.getParent(d,C.isBlock),i(a)))if(1==d.nodeType){if(d=d.childNodes[h],d&&"BR"!=d.tagName)return;if(u=e?a.nextSibling:a.previousSibling,C.isEmpty(a)&&i(u)&&C.isEmpty(u)&&n(a,d))return C.remove(u),!0}else if(3==d.nodeType){if(o=r.create(a,d),c=a.cloneNode(!0),d=r.resolve(c,o),e){if(h>=d.data.length)return;d.deleteData(h,1)}else{if(0>=h)return;d.deleteData(h-1,1)}if(C.isEmpty(c))return n(a,d)}}function p(e){var t,n,r;d(e)||(s.each(f.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&f.dom.setAttrib(e,"style",f.dom.getAttrib(e,"style"))}),t=new w(function(){}),t.observe(f.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),f.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),n=f.selection.getRng(),r=n.startContainer.parentNode,s.each(t.takeRecords(),function(e){if(C.isChildOf(e.target,f.getBody())){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}s.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),C.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),f.selection.setRng(n))}})}}),t.disconnect(),s.each(f.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")}))}var b=f.getDoc(),C=f.dom,x=f.selection,w=window.MutationObserver,N,E;w||(N=!0,w=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMSubtreeModified",e,!1),r.removeEventListener("DOMNodeInsertedIntoDocument",e,!1),r.removeEventListener("DOMNodeInserted",e,!1),r.removeEventListener("DOMAttrModified",t,!1)},this.takeRecords=function(){return n}}),f.on("keydown",function(e){var t=e.keyCode==te,n=e.ctrlKey||e.metaKey;if(!m(e)&&(t||e.keyCode==ee)){var r=f.selection.getRng(),i=r.startContainer,o=r.startOffset;if(t&&e.shiftKey)return;if(h(t,r))return void e.preventDefault();if(!n&&r.collapsed&&3==i.nodeType&&(t?o<i.data.length:o>0))return;e.preventDefault(),n&&f.selection.getSel().modify("extend",t?"forward":"backward",e.metaKey?"lineboundary":"word"),p(t)}}),f.on("keypress",function(t){if(!m(t)&&!x.isCollapsed()&&t.charCode>31&&!e.metaKeyPressed(t)){var n,r,i,o,a,s;n=f.selection.getRng(),s=String.fromCharCode(t.charCode),t.preventDefault(),r=Z(n.startContainer).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),p(!0),r=r.filter(function(e,t){return!Z.contains(f.getBody(),t)}),r.length?(i=C.createFragment(),r.each(function(e,t){t=t.cloneNode(!1),i.hasChildNodes()?(t.appendChild(i.firstChild),i.appendChild(t)):(a=t,i.appendChild(t)),i.appendChild(t)}),a.appendChild(f.getDoc().createTextNode(s)),o=C.getParent(n.startContainer,C.isBlock),C.isEmpty(o)?Z(o).empty().append(i):n.insertNode(i),n.setStart(a.firstChild,1),n.setEnd(a.firstChild,1),f.selection.setRng(n)):f.selection.setContent(s)}}),f.addCommand("Delete",function(){p()}),f.addCommand("ForwardDelete",function(){p(!0)}),N||(f.on("dragstart",function(e){E=x.getRng(),g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);n&&(e.preventDefault(),l.setEditorTimeout(f,function(){var r=t.getCaretRangeFromPoint(e.x,e.y,b);E&&(x.setRng(E),E=null),p(),x.setRng(r),y(n.html)}))}}),f.on("cut",function(e){m(e)||!e.clipboardData||f.selection.isCollapsed()||(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",f.selection.getContent()),e.clipboardData.setData("text/plain",f.selection.getContent({format:"text"})),l.setEditorTimeout(f,function(){p(!0)}))}))}function C(){function e(e){var t=ne.create("body"),n=e.cloneContents();return t.appendChild(n),re.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(f.getBody()),t.compareRanges(n,r)}var i=e(n),o=ne.createRng();o.selectNode(f.getBody());var a=e(o);return i===a}f.on("keydown",function(e){var t=e.keyCode,r,i;if(!m(e)&&(t==te||t==ee)){if(r=f.selection.isCollapsed(),i=f.getBody(),r&&!ne.isEmpty(i))return;if(!r&&!n(f.selection.getRng()))return;e.preventDefault(),f.setContent(""),i.firstChild&&ne.isBlock(i.firstChild)?f.selection.setCursorLocation(i.firstChild,0):f.selection.setCursorLocation(i,0),f.nodeChanged()}})}function x(){f.shortcuts.add("meta+a",null,"SelectAll")}function w(){f.settings.content_editable||ne.bind(f.getDoc(),"mousedown mouseup",function(e){var t;if(e.target==f.getDoc().documentElement)if(t=re.getRng(),f.getBody().focus(),"mousedown"==e.type){if(c.isCaretContainer(t.startContainer))return;re.placeCaretAt(e.clientX,e.clientY)}else re.setRng(t)})}function N(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee){if(!f.getBody().getElementsByTagName("hr").length)return;if(re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return ne.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(ne.remove(n),e.preventDefault())}}})}function E(){window.Range.prototype.getClientRects||f.on("mousedown",function(e){if(!m(e)&&"HTML"===e.target.nodeName){var t=f.getBody();t.blur(),l.setEditorTimeout(f,function(){t.focus()})}})}function _(){f.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==ne.getContentEditableParent(t)&&(e.preventDefault(),re.getSel().setBaseAndExtent(t,0,t,1),f.nodeChanged()),"A"==t.nodeName&&ne.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),re.select(t))})}function S(){function e(){var e=ne.getAttribs(re.getStart().cloneNode(!1));return function(){var t=re.getStart();t!==f.getBody()&&(ne.setAttrib(t,"style",null),Q(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!re.isCollapsed()&&ne.getParent(re.getStart(),ne.isBlock)!=ne.getParent(re.getEnd(),ne.isBlock)}f.on("keypress",function(n){var r;return m(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),f.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),ne.bind(f.getDoc(),"cut",function(n){var r;!m(n)&&t()&&(r=e(),l.setEditorTimeout(f,function(){r()}))})}function k(){document.body.setAttribute("role","application")}function T(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee&&re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function R(){p()>7||(h("RespectVisibilityInDesign",!0),f.contentStyles.push(".mceHideBrInPre pre br {display: none}"),ne.addClass(f.getBody(),"mceHideBrInPre"),oe.addNodeFilter("pre",function(e){for(var t=e.length,n,r,o,a;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)o=n[r],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new i("#text",3),o,!0).value="\n"}),ae.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function A(){ne.bind(f.getBody(),"mouseup",function(){var e,t=re.getNode();"IMG"==t.nodeName&&((e=ne.getStyle(t,"width"))&&(ne.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"width","")),(e=ne.getStyle(t,"height"))&&(ne.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"height","")))})}function B(){f.on("keydown",function(t){var n,r,i,o,a;if(!m(t)&&t.keyCode==e.BACKSPACE&&(n=re.getRng(),r=n.startContainer,i=n.startOffset,o=ne.getRoot(),a=r,n.collapsed&&0===i)){for(;a&&a.parentNode&&a.parentNode.firstChild==a&&a.parentNode!=o;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(f.formatter.toggle("blockquote",null,a),n=ne.createRng(),n.setStart(r,0),n.setEnd(r,0),re.setRng(n))}})}function D(){function e(){K(),h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),ie.object_resizing||h("enableObjectResizing",!1)}ie.readonly||f.on("BeforeExecCommand MouseDown",e)}function L(){function e(){Q(ne.select("a"),function(e){var t=e.parentNode,n=ne.getRoot();if(t.lastChild===e){for(;t&&!ne.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}ne.add(t,"br",{"data-mce-bogus":1})}})}f.on("SetContent ExecCommand",function(t){"setcontent"!=t.type&&"mceInsertLink"!==t.command||e()})}function M(){ie.forced_root_block&&f.on("init",function(){h("DefaultParagraphSeparator",ie.forced_root_block)})}function P(){f.on("keydown",function(e){var t;m(e)||e.keyCode!=ee||(t=f.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),f.undoManager.beforeChange(),ne.remove(t.item(0)),f.undoManager.add()))})}function O(){var e;p()>=10&&(e="",Q("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),f.contentStyles.push(e+"{padding-right: 1px !important}"))}function H(){p()<9&&(oe.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),ae.addNodeFilter("noscript",function(e){for(var t=e.length,n,r,a;t--;)n=e[t],r=e[t].firstChild,r?r.value=o.decode(r.value):(a=n.attributes.map["data-mce-innertext"],a&&(n.attr("data-mce-innertext",null),r=new i("#text",3),r.value=a,r.raw=!0,n.append(r)))}))}function I(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),ne.unbind(r,"mouseup",n),ne.unbind(r,"mousemove",t),a=o=0}var r=ne.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,ne.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(ne.bind(r,"mouseup",n),ne.bind(r,"mousemove",t),ne.getRoot().focus(),a.select())}})}function F(){f.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||re.normalize()},!0)}function z(){f.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function U(){f.inline||f.on("keydown",function(){document.activeElement==document.body&&f.getWin().focus()})}function W(){f.inline||(f.contentStyles.push("body {min-height: 150px}"),f.on("click",function(e){var t;if("HTML"==e.target.nodeName){if(a.ie>11)return void f.getBody().focus();t=f.selection.getRng(),f.getBody().focus(),f.selection.setRng(t),f.selection.normalize(),f.nodeChanged()}}))}function V(){a.mac&&f.on("keydown",function(t){!e.metaKeyPressed(t)||t.shiftKey||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),f.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","lineboundary"))})}function $(){h("AutoUrlDetect",!1)}function q(){f.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),f.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function j(){f.on("init",function(){f.dom.bind(f.getBody(),"submit",function(e){e.preventDefault()})})}function Y(){oe.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}function X(){f.on("dragstart",function(e){g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);if(n&&n.id!=f.id){e.preventDefault();var r=t.getCaretRangeFromPoint(e.x,e.y,f.getDoc());re.setRng(r),y(n.html)}}})}function K(){var e,t;G()&&(e=f.getBody(),t=e.parentNode,t.removeChild(e),t.appendChild(e),e.focus())}function G(){var e;return se?(e=f.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}function J(){function t(e){var t=new d(e.getBody()),n=e.selection.getRng(),r=u.fromRangeStart(n),i=u.fromRangeEnd(n);return!e.selection.isCollapsed()&&!t.prev(r)&&!t.next(i)}f.on("keypress",function(n){!m(n)&&!re.isCollapsed()&&n.charCode>31&&!e.metaKeyPressed(n)&&t(f)&&(n.preventDefault(),f.setContent(String.fromCharCode(n.charCode)),f.selection.select(f.getBody(),!0),f.selection.collapse(!1),f.nodeChanged())}),f.on("keydown",function(e){var n=e.keyCode;m(e)||n!=te&&n!=ee||t(f)&&(e.preventDefault(),f.setContent(""),f.nodeChanged())})}var Q=s.each,Z=f.$,ee=e.BACKSPACE,te=e.DELETE,ne=f.dom,re=f.selection,ie=f.settings,oe=f.parser,ae=f.serializer,se=a.gecko,le=a.ie,ce=a.webkit,ue="data:text/mce-internal,",de=le?"Text":"URL";return B(),C(),a.windowsPhone||F(),ce&&(J(),b(),w(),_(),M(),j(),T(),Y(),a.iOS?(U(),W(),q()):x()),le&&a.ie<11&&(N(),k(),R(),A(),P(),O(),H(),I()),a.ie>=11&&(W(),T()),a.ie&&(x(),$(),X()),se&&(J(),N(),E(),S(),D(),L(),z(),V(),T()),{refreshContentEditable:K,isHidden:G}}}),r(Ie,[ue,w,m],function(e,t,n){function r(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=o.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()}function i(e,t){function n(e){return!e.hidden&&!e.readonly}var i=r(e,t),s;if(e.delegates||(e.delegates={}),!e.delegates[t])if(e.settings.event_root){if(a||(a={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&a){for(t in a)e.dom.unbind(r(e,t));a=null}})),a[t])return;s=function(r){for(var i=r.target,a=e.editorManager.editors,s=a.length;s--;){var l=a[s].getBody();(l===i||o.isChildOf(i,l))&&n(a[s])&&a[s].fire(t,r)}},a[t]=s,o.bind(i,t,s)}else s=function(r){n(e)&&e.fire(t,r)},o.bind(i,t,s),e.delegates[t]=s}var o=t.DOM,a,s={bindPendingEventDelegates:function(){var e=this;n.each(e._pendingNativeEvents,function(t){i(e,t)})},toggleNativeEvent:function(e,t){var n=this;"focus"!=e&&"blur"!=e&&(t?n.initialized?i(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(r(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e=this,t;if(e.delegates){for(t in e.delegates)e.dom.unbind(r(e,t),t,e.delegates[t]);delete e.delegates}e.inline||(e.getBody().onload=null,e.dom.unbind(e.getWin()),e.dom.unbind(e.getDoc())),e.dom.unbind(e.getBody()),e.dom.unbind(e.getContainer())}};return s=n.extend({},e,s)}),r(Fe,[],function(){function e(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}}function t(e){var t,n;return t=e.getBody(),n=function(t){e.dom.getParents(t.target,"a").length>0&&t.preventDefault()},e.dom.bind(t,"click",n),{unbind:function(){e.dom.unbind(t,"click",n)}}}function n(n,r){n._clickBlocker&&(n._clickBlocker.unbind(),n._clickBlocker=null),r?(n._clickBlocker=t(n),n.selection.controlSelection.hideResizeRect(),n.readonly=!0,n.getBody().contentEditable=!1):(n.readonly=!1,n.getBody().contentEditable=!0,e(n,"StyleWithCSS",!1),e(n,"enableInlineTableEditing",!1),e(n,"enableObjectResizing",!1),n.focus(),n.nodeChanged())}function r(e,t){var r=e.readonly?"readonly":"design";t!=r&&(e.initialized?n(e,"readonly"==t):e.on("init",function(){n(e,"readonly"==t)}),e.fire("SwitchMode",{mode:t}))}return{setMode:r}}),r(ze,[m,d],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122},o=e.makeMap("alt,ctrl,shift,meta,access");return function(a){function s(e){var a,s,l={};n(r(e,"+"),function(e){e in o?l[e]=!0:/^[0-9]{2,}$/.test(e)?l.keyCode=parseInt(e,10):(l.charCode=e.charCodeAt(0),l.keyCode=i[e]||e.toUpperCase().charCodeAt(0))}),a=[l.keyCode];for(s in o)l[s]?a.push(s):l[s]=!1;return l.id=a.join(","),l.access&&(l.alt=!0,t.mac?l.ctrl=!0:l.shift=!0),l.meta&&(t.mac?l.meta=!0:(l.ctrl=!0,l.meta=!1)),l}function l(t,n,i,o){var l;return l=e.map(r(t,">"),s),l[l.length-1]=e.extend(l[l.length-1],{func:i,scope:o||a}),e.extend(l[0],{desc:a.translate(n),subpatterns:l.slice(1)})}function c(e){return e.altKey||e.ctrlKey||e.metaKey}function u(e){return e.keyCode>=112&&e.keyCode<=123}function d(e,t){return t?t.ctrl!=e.ctrlKey||t.meta!=e.metaKey?!1:t.alt!=e.altKey||t.shift!=e.shiftKey?!1:e.keyCode==t.keyCode||e.charCode&&e.charCode==t.charCode?(e.preventDefault(),!0):!1:!1}function f(e){return e.func?e.func.call(e.scope):null}var h=this,p={},m=[];a.on("keyup keypress keydown",function(e){!c(e)&&!u(e)||e.isDefaultPrevented()||(n(p,function(t){return d(e,t)?(m=t.subpatterns.slice(0),"keydown"==e.type&&f(t),!0):void 0}),d(e,m[0])&&(1===m.length&&"keydown"==e.type&&f(m[0]),m.shift()))}),h.add=function(t,i,o,s){var c;return c=o,"string"==typeof o?o=function(){a.execCommand(c,!1,null)}:e.isArray(c)&&(o=function(){a.execCommand(c[0],c[1],c[2])}),n(r(e.trim(t.toLowerCase())),function(e){var t=l(e,i,o,s);p[t.id]=t}),!0},h.remove=function(e){var t=l(e);return p[t.id]?(delete p[t.id],!0):!1}}}),r(Ue,[c,m,z],function(e,t,n){return function(r,i){function o(e){var t,n;return n={"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"},t=n[e.blob().type.toLowerCase()]||"dat",e.id()+"."+t}function a(e,t){return e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t}function s(e){return{id:e.id,blob:e.blob,base64:e.base64,filename:n.constant(o(e))}}function l(e,t,n,r){var s,l;s=new XMLHttpRequest,s.open("POST",i.url),s.withCredentials=i.credentials,s.upload.onprogress=function(e){r(e.loaded/e.total*100)},s.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+s.status)},s.onload=function(){var e;return 200!=s.status?void n("HTTP Error: "+s.status):(e=JSON.parse(s.responseText),e&&"string"==typeof e.location?void t(a(i.basePath,e.location)):void n("Invalid JSON: "+s.responseText))},l=new FormData,l.append("file",e.blob(),o(e)),s.send(l)}function c(){return new e(function(e){e([])})}function u(e,t){return{url:t,blobInfo:e,status:!0}}function d(e,t){return{url:"",blobInfo:e,status:!1,error:t}}function f(e,n){t.each(y[e],function(e){e(n)}),delete y[e]}function h(t,n,i){return r.markPending(t.blobUri()),new e(function(e){var o,a,l=function(){};try{var c=function(){o&&(o.close(),a=l)},h=function(n){c(),r.markUploaded(t.blobUri(),n),f(t.blobUri(),u(t,n)),e(u(t,n))},p=function(){c(),r.removeFailed(t.blobUri()),f(t.blobUri(),d(t,p)),e(d(t,p))};a=function(e){0>e||e>100||(o||(o=i()),o.progressBar.value(e))},n(s(t),h,p,a)}catch(m){e(d(t,m.message))}})}function p(e){return e===l}function m(t){var n=t.blobUri();return new e(function(e){y[n]=y[n]||[],y[n].push(e)})}function g(n,o){return n=t.grep(n,function(e){return!r.isUploaded(e.blobUri())}),e.all(t.map(n,function(e){return r.isPending(e.blobUri())?m(e):h(e,i.handler,o)}))}function v(e,t){return!i.url&&p(i.handler)?c():g(e,t)}var y={};return i=t.extend({credentials:!1,handler:l},i),{upload:v}}}),r(We,[c],function(e){function t(t){return new e(function(e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="blob",n.onload=function(){200==this.status&&e(this.response)},n.send()})}function n(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}}function r(t){return new e(function(e){var r,i,o;t=n(t);try{r=atob(t.data)}catch(a){return void e(new Blob([]))}for(i=new Uint8Array(r.length),o=0;o<i.length;o++)i[o]=r.charCodeAt(o);e(new Blob([i],{type:t.type}))})}function i(e){return 0===e.indexOf("blob:")?t(e):0===e.indexOf("data:")?r(e):null}function o(t){return new e(function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)})}return{uriToBlob:i,blobToDataUri:o,parseDataUri:n}}),r(Ve,[c,p,z,We,d],function(e,t,n,r,i){var o=0;return function(a,s){function l(l,u){function d(e,t){var n,i;return 0===e.src.indexOf("blob:")?(i=s.getByUri(e.src),void(i&&t({image:e,blobInfo:i}))):(n=r.parseDataUri(e.src).data,i=s.findFirst(function(e){return e.base64()===n}),void(i?t({image:e,blobInfo:i}):r.uriToBlob(e.src).then(function(r){var i="blobid"+o++,a=s.create(i,r,n);s.add(a),t({image:e,blobInfo:a})})))}var f,h;return u||(u=n.constant(!0)),f=t.filter(l.getElementsByTagName("img"),function(e){var t=e.src;return i.fileApi?e.hasAttribute("data-mce-bogus")?!1:e.hasAttribute("data-mce-placeholder")?!1:t&&t!=i.transparentSrc?0===t.indexOf("blob:")?!a.isUploaded(t):0===t.indexOf("data:")?u(e):!1:!1:!1}),h=t.map(f,function(t){var n;return c[t.src]?new e(function(e){c[t.src].then(function(n){e({image:t,blobInfo:n.blobInfo})})}):(n=new e(function(e){d(t,e)}).then(function(e){return delete c[e.image.src],e})["catch"](function(e){return delete c[t.src],e}),c[t.src]=n,n)}),e.all(h)}var c={};return{findAll:l}}}),r($e,[p,z],function(e,t){return function(){function n(e,t,n){return{id:u(e),blob:u(t),base64:u(n),blobUri:u(URL.createObjectURL(t))}}function r(e){i(e.id())||c.push(e)}function i(e){return o(function(t){return t.id()===e})}function o(t){return e.filter(c,t)[0]}function a(e){return o(function(t){return t.blobUri()==e})}function s(t){c=e.filter(c,function(e){return e.blobUri()===t?(URL.revokeObjectURL(e.blobUri()),!1):!0})}function l(){e.each(c,function(e){URL.revokeObjectURL(e.blobUri())}),c=[]}var c=[],u=t.constant;return{create:n,add:r,get:i,getByUri:a,findFirst:o,removeByUri:s,destroy:l}}}),r(qe,[],function(){return function(){function e(e,t){return{status:e,resultUri:t}}function t(e){return e in d}function n(e){var t=d[e];return t?t.resultUri:null}function r(e){return t(e)?d[e].status===c:!1}function i(e){return t(e)?d[e].status===u:!1}function o(t){d[t]=e(c,null)}function a(t,n){d[t]=e(u,n)}function s(e){delete d[e]}function l(){d={}}var c=1,u=2,d={};return{hasBlobUri:t,getResultUri:n,isPending:r,isUploaded:i,markPending:o,markUploaded:a,removeFailed:s,destroy:l}}}),r(je,[p,Ue,Ve,$e,qe],function(e,t,n,r,i){return function(o){function a(e){return function(t){return o.selection?e(t):[]}}function s(e,t,n){var r=0;do r=e.indexOf(t,r),-1!==r&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1);while(-1!==r);return e}function l(e,t,n){return e=s(e,'src="'+t+'"','src="'+n+'"'),e=s(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')}function c(t,n){e.each(o.undoManager.data,function(e){e.content=l(e.content,t,n)})}function u(){return o.notificationManager.open({text:o.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}function d(e,t){y.removeByUri(e.src),c(e.src,t),o.$(e).attr({src:t,"data-mce-src":o.convertURL(t,"src")})}function f(n){return b||(b=new t(w,{url:x.images_upload_url,basePath:x.images_upload_base_path,credentials:x.images_upload_credentials,handler:x.images_upload_handler})),m().then(a(function(t){var r;return r=e.map(t,function(e){return e.blobInfo}),b.upload(r,u).then(a(function(r){return r=e.map(r,function(e,n){var r=t[n].image;return e.status&&o.settings.images_replace_blob_uris!==!1&&d(r,e.url),{element:r,status:e.status}}),n&&n(r),r}))}))}function h(e){return x.automatic_uploads!==!1?f(e):void 0}function p(e){return x.images_dataimg_filter?x.images_dataimg_filter(e):!0}function m(){return C||(C=new n(w,y)),C.findAll(o.getBody(),p).then(a(function(t){return e.each(t,function(e){c(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),t}))}function g(){y.destroy(),w.destroy(),C=b=null}function v(t){return t.replace(/src="(blob:[^"]+)"/g,function(t,n){var r=w.getResultUri(n);if(r)return'src="'+r+'"';var i=y.getByUri(n);return i||(i=e.reduce(o.editorManager.editors,function(e,t){return e||t.editorUpload.blobCache.getByUri(n)},null)),i?'src="data:'+i.blob().type+";base64,"+i.base64()+'"':t})}var y=new r,b,C,x=o.settings,w=new i;return o.on("setContent",function(){o.settings.automatic_uploads!==!1?h():m()}),o.on("RawSaveContent",function(e){e.content=v(e.content)}),o.on("getContent",function(e){e.source_view||"raw"==e.format||(e.content=v(e.content))}),o.on("PostRender",function(){o.parser.addNodeFilter("img",function(t){e.each(t,function(e){var t=e.attr("src");if(!y.getByUri(t)){var n=w.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:y,uploadImages:f,uploadImagesAuto:h,scanForImages:m,destroy:g}}}),r(Ye,[k,$,_,T,g,W,u],function(e,t,n,r,i,o,a){var s=n.isContentEditableFalse;return function(t,n){function r(e,n){var r=o.collapse(e.getBoundingClientRect(),n),i,a,s,l,c;return"BODY"==t.tagName?(i=t.ownerDocument.documentElement,a=t.scrollLeft||i.scrollLeft,s=t.scrollTop||i.scrollTop):(c=t.getBoundingClientRect(),a=t.scrollLeft-c.left,s=t.scrollTop-c.top),r.left+=a,r.right+=a,r.top+=s,r.bottom+=s,r.width=1,l=e.offsetWidth-e.clientWidth,l>0&&(n&&(l*=-1),r.left+=l,r.right+=l),r}function l(){var n,r,o,a,s;for(n=i("*[contentEditable=false]",t),a=0;a<n.length;a++)r=n[a],o=r.previousSibling,e.endsWithCaretContainer(o)&&(s=o.data,1==s.length?o.parentNode.removeChild(o):o.deleteData(s.length-1,1)),o=r.nextSibling,e.startsWithCaretContainer(o)&&(s=o.data,1==s.length?o.parentNode.removeChild(o):o.deleteData(0,1));return null}function c(o,a){var l,c,f;return u(),n(a)?(g=e.insertBlock("p",a,o),l=r(a,o),i(g).css("top",l.top),m=i('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(l).appendTo(t),o&&m.addClass("mce-visual-caret-before"),d(),c=a.ownerDocument.createRange(),f=g.firstChild,c.setStart(f,0),c.setEnd(f,1),c):(g=e.insertInline(a,o),c=a.ownerDocument.createRange(),s(g.nextSibling)?(c.setStart(g,0),c.setEnd(g,0)):(c.setStart(g,1),c.setEnd(g,1)),c)}function u(){l(),g&&(e.remove(g),g=null),m&&(m.remove(),m=null),clearInterval(p)}function d(){p=a.setInterval(function(){i("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden")},500)}function f(){a.clearInterval(p)}function h(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"}var p,m,g;return{show:c,hide:u,getCss:h,destroy:f}}}),r(Xe,[p,_,W],function(e,t,n){function r(i){function o(t){return e.map(t,function(e){return e=n.clone(e),e.node=i,e})}if(e.isArray(i))return e.reduce(i,function(e,t){return e.concat(r(t))},[]);if(t.isElement(i))return o(i.getClientRects());if(t.isText(i)){var a=i.ownerDocument.createRange();return a.setStart(i,0),a.setEnd(i,i.data.length),o(a.getClientRects())}}return{getClientRects:r}}),r(Ke,[z,p,Xe,U,te,ne,$,W],function(e,t,n,r,i,o,a,s){function l(e,t,n,o){for(;o=i.findNode(o,e,r.isEditableCaretCandidate,t);)if(n(o))return}function c(e,r,i,o,a,s){function c(o){var s,l,c;for(c=n.getClientRects(o),-1==e&&(c=c.reverse()),s=0;s<c.length;s++)if(l=c[s],!i(l,h)){if(f.length>0&&r(l,t.last(f))&&u++,l.line=u,a(l))return!0;f.push(l)}}var u=0,d,f=[],h;return(h=t.last(s.getClientRects()))?(d=s.getNode(),c(d),l(e,o,c,d),f):f}function u(e,t){return t.line>e}function d(e,t){return t.line===e}function f(e,n,r,i){function l(n){return 1==e?t.last(n.getClientRects()):t.last(n.getClientRects())}var c=new o(n),u,d,f,h,p=[],m=0,g,v;1==e?(u=c.next,d=s.isBelow,f=s.isAbove,h=a.after(i)):(u=c.prev,d=s.isAbove,f=s.isBelow,h=a.before(i)),v=l(h);do if(h.isVisible()&&(g=l(h),!f(g,v))){if(p.length>0&&d(g,t.last(p))&&m++,g=s.clone(g),g.position=h,g.line=m,r(g))return p;p.push(g)}while(h=u(h));return p}var h=e.curry,p=h(c,-1,s.isAbove,s.isBelow),m=h(c,1,s.isBelow,s.isAbove);return{upUntil:p,downUntil:m,positionsUntil:f,isAboveLine:h(u),isLine:h(d)}}),r(Ge,[z,p,_,Xe,W,te,U],function(e,t,n,r,i,o,a){function s(e,t){return Math.abs(e.left-t)}function l(e,t){return Math.abs(e.right-t)}function c(e,n){function r(e,t){return e>=t.left&&e<=t.right}return t.reduce(e,function(e,t){var i,o;return i=Math.min(s(e,n),l(e,n)),o=Math.min(s(t,n),l(t,n)),r(n,t)?t:r(n,e)?e:o==i&&m(t.node)?t:i>o?t:e})}function u(e,t,n,r){for(;r=g(r,e,a.isEditableCaretCandidate,t);)if(n(r))return}function d(e,n){function o(e,i){var o;return o=t.filter(r.getClientRects(i),function(t){return!e(t,n)}),a=a.concat(o),0===o.length}var a=[];return a.push(n),u(-1,e,v(o,i.isAbove),n.node),u(1,e,v(o,i.isBelow),n.node),a}function f(e){return t.filter(t.toArray(e.getElementsByTagName("*")),m)}function h(e,t){return{node:e.node,before:s(e,t)<l(e,t)}}function p(e,n,i){var o,a;return o=r.getClientRects(f(e)),o=t.filter(o,function(e){return i>=e.top&&i<=e.bottom}),a=c(o,n),a&&(a=c(d(e,a),n),a&&m(a.node))?h(a,n):null}var m=n.isContentEditableFalse,g=o.findNode,v=e.curry;return{findClosestClientRect:c,findLineNodeRects:d,closestCaret:p}}),r(Je,[],function(){var e=function(e){var t,n,r,i;return i=e.getBoundingClientRect(),t=e.ownerDocument,n=t.documentElement,r=t.defaultView,{top:i.top+r.pageYOffset-n.clientTop,left:i.left+r.pageXOffset-n.clientLeft}},t=function(t){return t.inline?e(t.getBody()):{left:0,top:0}},n=function(e){var t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}},r=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},i={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:i},i=function(t,n){if(n.target.ownerDocument!==t.getDoc()){var i=e(t.getContentAreaContainer()),o=r(t);return{left:n.pageX-i.left+o.left,top:n.pageY-i.top+o.top}}return{left:n.pageX,top:n.pageY}},o=function(e,t,n){return{pageX:n.left-e.left+t.left,pageY:n.top-e.top+t.top}},a=function(e,r){return o(t(e),n(e),i(e,r))};return{calc:a}}),r(Qe,[_,p,z,u,w,Je],function(e,t,n,r,i,o){var a=e.isContentEditableFalse,s=e.isContentEditableTrue,l=function(e){return a(e)},c=function(e,t,n){return t===n||e.dom.isChildOf(t,n)?!1:!a(t)},u=function(e){var t=e.cloneNode(!0);return t.removeAttribute("data-mce-selected"),t},d=function(e,t,n,r){var i=t.cloneNode(!0);e.dom.setStyles(i,{width:n,height:r}),e.dom.setAttrib(i,"data-mce-selected",null);var o=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(o,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(i,{margin:0,boxSizing:"border-box"}),o.appendChild(i),o},f=function(e,t){e.parentNode!==t&&t.appendChild(e)},h=function(e,t,n,r,i,o){var a=0,s=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>i&&(a=t.pageX+n-i), t.pageY+r>o&&(s=t.pageY+r-o),e.style.width=n-a+"px",e.style.height=r-s+"px"},p=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},m=function(e){return 0===e.button},g=function(e){return e.element},v=function(e,t){return{pageX:t.pageX-e.relX,pageY:t.pageY+5}},y=function(e,r){return function(i){if(m(i)){var o=t.find(r.dom.getParents(i.target),n.or(a,s));if(l(o)){var c=r.dom.getPos(o),u=r.getBody(),f=r.getDoc().documentElement;e.element=o,e.screenX=i.screenX,e.screenY=i.screenY,e.maxX=(r.inline?u.scrollWidth:f.offsetWidth)-2,e.maxY=(r.inline?u.scrollHeight:f.offsetHeight)-2,e.relX=i.pageX-c.x,e.relY=i.pageY-c.y,e.width=o.offsetWidth,e.height=o.offsetHeight,e.ghost=d(r,o,e.width,e.height)}}}},b=function(e,t){var n=r.throttle(function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n)},0);return function(r){var i=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(g(e)&&!e.dragging&&i>10){var a=t.fire("dragstart",{target:e.element});if(a.isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){var s=v(e,o.calc(t,r));f(e.ghost,t.getBody()),h(e.ghost,s,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY)}}},C=function(e,t){return function(n){if(e.dragging&&c(t,t.selection.getNode(),e.element)){var r=u(e.element),i=t.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});i.isDefaultPrevented()||(r=i.targetClone,t.undoManager.transact(function(){p(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret()}))}w(e)}},x=function(e,t){return function(){w(e),e.dragging&&t.fire("dragend")}},w=function(e){e.dragging=!1,e.element=null,p(e.ghost)},N=function(e){var t={},n,r,o,a,s,l;n=i.DOM,l=document,r=y(t,e),o=b(t,e),a=C(t,e),s=x(t,e),e.on("mousedown",r),e.on("mousemove",o),e.on("mouseup",a),n.bind(l,"mousemove",o),n.bind(l,"mouseup",s),e.on("remove",function(){n.unbind(l,"mousemove",o),n.unbind(l,"mouseup",s)})},E=function(e){e.on("drop",function(t){var n="undefined"!=typeof t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(a(n)||a(e.dom.getContentEditableParent(n)))&&t.preventDefault()})},_=function(e){N(e),E(e)};return{init:_}}),r(Ze,[d,ne,$,k,te,Ye,Ke,Ge,_,T,W,I,z,p,u,Qe,S],function(e,t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g){function v(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function y(c){function y(){var e=c.dom.get(le);return e?e.getElementsByTagName("*")[0]:e}function S(e){return c.dom.isBlock(e)}function k(e){e&&c.selection.setRng(e)}function T(){return c.selection.getRng()}function R(e,t){c.selection.scrollIntoView(e,t)}function A(e,t,n){var r;return r=c.fire("ShowCaret",{target:t,direction:e,before:n}),r.isDefaultPrevented()?null:(R(t,-1===e),se.show(n,t))}function B(e){var t;return se.hide(),t=c.fire("BeforeObjectSelected",{target:e}),t.isDefaultPrevented()?null:D(e)}function D(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}function L(e,t){var n=i.isInSameBlock(e,t);return!n&&l.isBr(e.getNode())?!0:n}function M(e,t){return t=i.normalizeRange(e,re,t),-1==e?n.fromRangeStart(t):n.fromRangeEnd(t)}function P(e){return r.isCaretContainerBlock(e.startContainer)}function O(e,t,n,r){var i,o,a,s;return!r.collapsed&&(i=_(r),x(i))?A(e,i,-1==e):(s=P(r),o=M(e,r),n(o)?B(o.getNode(-1==e)):(o=t(o))?n(o)?A(e,o.getNode(-1==e),1==e):(a=t(o),n(a)&&L(o,a)?A(e,a.getNode(-1==e),1==e):s?$(o.toRange()):null):s?r:null)}function H(e,t,n){var r,i,o,l,c,u,d,f,p;if(p=_(n),r=M(e,n),i=t(re,a.isAboveLine(1),r),o=h.filter(i,a.isLine(1)),c=h.last(r.getClientRects()),E(r)&&(p=r.getNode()),N(r)&&(p=r.getNode(!0)),!c)return null;if(u=c.left,l=s.findClosestClientRect(o,u),l&&x(l.node))return d=Math.abs(u-l.left),f=Math.abs(u-l.right),A(e,l.node,f>d);if(p){var m=a.positionsUntil(e,re,a.isAboveLine(1),p);if(l=s.findClosestClientRect(h.filter(m,a.isLine(1)),u))return $(l.position.toRange());if(l=h.last(h.filter(m,a.isLine(0))))return $(l.position.toRange())}}function I(t,r){function i(){var t=c.dom.create(c.settings.forced_root_block);return(!e.ie||e.ie>=11)&&(t.innerHTML='<br data-mce-bogus="1">'),t}var o,a,s;if(r.collapsed&&c.settings.forced_root_block){if(o=c.dom.getParent(r.startContainer,"PRE"),!o)return;a=1==t?oe(n.fromRangeStart(r)):ae(n.fromRangeStart(r)),a||(s=i(),1==t?c.$(o).after(s):c.$(o).before(s),c.selection.select(s,!0),c.selection.collapse())}}function F(e,t,n,r){var i;return(i=O(e,t,n,r))?i:(i=I(e,r),i?i:null)}function z(e,t,n){var r;return(r=H(e,t,n))?r:(r=I(e,n),r?r:null)}function U(){return ue("*[data-mce-caret]")[0]}function W(e){e=ue(e),e.attr("data-mce-caret")&&(se.hide(),e.removeAttr("data-mce-caret"),e.removeAttr("data-mce-bogus"),e.removeAttr("style"),k(T()),R(e[0]))}function V(e){var t,r;return e=i.normalizeRange(1,re,e),t=n.fromRangeStart(e),x(t.getNode())?A(1,t.getNode(),!t.isAtEnd()):x(t.getNode(!0))?A(1,t.getNode(!0),!1):(r=c.dom.getParent(t.getNode(),f.or(x,C)),x(r)?A(1,r,!1):(se.hide(),null))}function $(e){var t;return e&&e.collapsed?(t=V(e),t?t:e):e}function q(e){var t,i,o,a;return x(e)?(x(e.previousSibling)&&(o=e.previousSibling),i=ae(n.before(e)),i||(t=oe(n.after(e))),t&&w(t.getNode())&&(a=t.getNode()),r.remove(e.previousSibling),r.remove(e.nextSibling),c.dom.remove(e),ee(),c.dom.isEmpty(c.getBody())?(c.setContent(""),void c.focus()):o?n.after(o).toRange():a?n.before(a).toRange():i?i.toRange():t?t.toRange():null):null}function j(e){var t=c.schema.getTextBlockElements();return e.nodeName in t}function Y(e){return c.dom.isEmpty(e)}function X(e,t,r){var i=c.dom,o,a,s,l;if(o=i.getParent(t.getNode(),i.isBlock),a=i.getParent(r.getNode(),i.isBlock),-1===e){if(l=r.getNode(!0),N(r)&&S(l))return j(o)?(Y(o)&&i.remove(o),n.after(l).toRange()):q(r.getNode(!0))}else if(l=t.getNode(),E(t)&&S(l))return j(a)?(Y(a)&&i.remove(a),n.before(l).toRange()):q(t.getNode());if(o===a||!j(o)||!j(a))return null;for(;s=o.firstChild;)a.appendChild(s);return c.dom.remove(o),r.toRange()}function K(e,t,n,i){var o,a,s,l;return!i.collapsed&&(o=_(i),x(o))?$(q(o)):(a=M(e,i),n(a)&&r.isCaretContainerBlock(i.startContainer)?(l=-1==e?ie.prev(a):ie.next(a),l?$(l.toRange()):i):t(a)?$(q(a.getNode(-1==e))):(s=-1==e?ie.prev(a):ie.next(a),t(s)?-1===e?X(e,a,s):X(e,s,a):void 0))}function G(){function r(e,t){var n=t(T());n&&!e.isDefaultPrevented()&&(e.preventDefault(),k(n))}function i(e){for(var t=c.getBody();e&&e!=t;){if(C(e)||x(e))return e;e=e.parentNode}return null}function o(e,t,n){return n.collapsed?!1:h.reduce(n.getClientRects(),function(n,r){return n||u.containsXY(r,e,t)},!1)}function l(e){var t=!1;e.on("touchstart",function(){t=!1}),e.on("touchmove",function(){t=!0}),e.on("touchend",function(e){var n=i(e.target);x(n)?t||(e.preventDefault(),Z(B(n))):ee()})}function f(){var e,t=i(c.selection.getNode());C(t)&&S(t)&&c.dom.isEmpty(t)&&(e=c.dom.create("br",{"data-mce-bogus":"1"}),c.$(t).empty().append(e),c.selection.setRng(n.before(e).toRange()))}function g(e){var t=U();if(t)return"compositionstart"==e.type?(e.preventDefault(),e.stopPropagation(),void W(t)):void(" "!=t.innerHTML&&W(t))}function v(e){var t;switch(e.keyCode){case d.DELETE:t=f();break;case d.BACKSPACE:t=f()}t&&e.preventDefault()}var w=b(F,1,oe,E),_=b(F,-1,ae,N),R=b(K,1,E,N),D=b(K,-1,N,E),L=b(z,-1,a.upUntil),M=b(z,1,a.downUntil);c.on("mouseup",function(){var e=T();e.collapsed&&k(V(e))}),c.on("click",function(e){var t;t=i(e.target),t&&x(t)&&(e.preventDefault(),c.focus())});var P=function(e){var r=new t(e);if(!e.firstChild)return!1;var i=n.before(e.firstChild),o=r.next(i);return o&&!E(o)&&!N(o)},O=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n===r},H=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n&&!O(n,r)&&P(n)};l(c),c.on("mousedown",function(e){var t;if(t=i(e.target))x(t)?(e.preventDefault(),Z(B(t))):(ee(),o(e.clientX,e.clientY,c.selection.getRng())||c.selection.placeCaretAt(e.clientX,e.clientY));else{ee(),se.hide();var n=s.closestCaret(re,e.clientX,e.clientY);n&&(H(e.target,n.node)||(e.preventDefault(),c.getBody().focus(),k(A(1,n.node,n.before))))}}),c.on("keydown",function(e){if(!d.modifierPressed(e))switch(e.keyCode){case d.RIGHT:r(e,w);break;case d.DOWN:r(e,M);break;case d.LEFT:r(e,_);break;case d.UP:r(e,L);break;case d.DELETE:r(e,R);break;case d.BACKSPACE:r(e,D);break;default:x(c.selection.getNode())&&e.preventDefault()}}),c.on("keyup compositionstart",function(e){g(e),v(e)},!0),c.on("cut",function(){var e=c.selection.getNode();x(e)&&p.setEditorTimeout(c,function(){k($(q(e)))})}),c.on("getSelectionRange",function(e){var t=e.range;if(ce){if(!ce.parentNode)return void(ce=null);t=t.cloneRange(),t.selectNode(ce),e.range=t}}),c.on("setSelectionRange",function(e){var t;t=Z(e.range),t&&(e.range=t)}),c.on("focus",function(){p.setEditorTimeout(c,function(){c.selection.setRng($(c.selection.getRng()))},0)}),c.on("copy",function(t){var n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!e.ie){var r=y();r&&(t.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),m.init(c)}function J(){var e=c.contentStyles,t=".mce-content-body";e.push(se.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")}function Q(e){return r.isCaretContainer(e.startContainer)||r.isCaretContainer(e.endContainer)}function Z(t){var n,r=c.$,i=c.dom,o,a,s,l,u,d,f,h,p;if(!t)return ee(),null;if(t.collapsed){if(ee(),!Q(t)){if(f=M(1,t),x(f.getNode()))return A(1,f.getNode(),!f.isAtEnd());if(x(f.getNode(!0)))return A(1,f.getNode(!0),!1)}return null}return s=t.startContainer,l=t.startOffset,u=t.endOffset,3==s.nodeType&&0==l&&x(s.parentNode)&&(s=s.parentNode,l=i.nodeIndex(s),s=s.parentNode),1!=s.nodeType?(ee(),null):(u==l+1&&(n=s.childNodes[l]),x(n)?(h=p=n.cloneNode(!0),d=c.fire("ObjectSelected",{target:n,targetClone:h}),d.isDefaultPrevented()?(ee(),null):(h=d.targetClone,o=r("#"+le),0===o.length&&(o=r('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",le),o.appendTo(c.getBody())),t=c.dom.createRng(),h===p&&e.ie?(o.empty().append(g.ZWSP).append(h).append(g.ZWSP),t.setStart(o[0].firstChild,0),t.setEnd(o[0].lastChild,1)):(o.empty().append("\xa0").append(h).append("\xa0"),t.setStart(o[0].firstChild,1),t.setEnd(o[0].lastChild,0)),o.css({top:i.getPos(n,c.getBody()).y}),o[0].focus(),a=c.selection.getSel(),a.removeAllRanges(),a.addRange(t),c.$("*[data-mce-selected]").removeAttr("data-mce-selected"),n.setAttribute("data-mce-selected",1),ce=n,t)):(ee(),null))}function ee(){ce&&(ce.removeAttribute("data-mce-selected"),c.$("#"+le).remove(),ce=null)}function te(){se.destroy(),ce=null}function ne(){se.hide()}var re=c.getBody(),ie=new t(re),oe=b(v,ie.next),ae=b(v,ie.prev),se=new o(c.getBody(),S),le="sel-"+c.dom.uniqueId(),ce,ue=c.$;return e.ceFalse&&(G(),J()),{showBlockCaretContainer:W,hideFakeCaret:ne,destroy:te}}var b=f.curry,C=l.isContentEditableTrue,x=l.isContentEditableFalse,w=l.isElement,N=i.isAfterContentEditableFalse,E=i.isBeforeContentEditableFalse,_=c.getSelectedNode;return y}),r(et,[],function(){var e=0,t=function(){var e=function(){return Math.round(4294967295*Math.random()).toString(36)},t=(new Date).getTime();return"s"+t.toString(36)+e()+e()+e()},n=function(n){return n+e++ +t()};return{uuid:n}}),r(tt,[w,g,E,R,A,O,P,Y,J,Q,Z,ee,oe,ae,N,f,Ae,Pe,B,L,He,d,m,u,Ie,Fe,ze,je,Ze,et],function(e,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A){function B(e,t,i){var o=this,a,s,l;a=o.documentBaseUrl=i.documentBaseURL,s=i.baseURI,l=i.defaultSettings,t=P({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:a,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o,ie7_compat:!0},l,t),l&&l.external_plugins&&t.external_plugins&&(t.external_plugins=P({},l.external_plugins,t.external_plugins)),o.settings=t,r.language=t.language||"en",r.languageLoad=t.language_load,r.baseURL=i.baseURL,o.id=t.id=e,o.setDirty(!1),o.plugins={},o.documentBaseURI=new p(t.document_base_url||a,{base_uri:s}),o.baseURI=s,o.contentCSS=[],o.contentStyles=[],o.shortcuts=new k(o),o.loadedCSS={},o.editorCommands=new h(o),t.target&&(o.targetElm=t.target),o.suffix=i.suffix,o.editorManager=i,o.inline=t.inline,o.settings.content_editable=o.inline,t.cache_suffix&&(w.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),t.override_viewport===!1&&(w.overrideViewPort=!1),i.fire("SetupEditor",o),o.execCallback("setup",o),o.$=n.overrideDefaults(function(){return{context:o.inline?o.getBody():o.getDoc(),element:o.getBody()}})}var D=e.DOM,L=r.ThemeManager,M=r.PluginManager,P=N.extend,O=N.each,H=N.explode,I=N.inArray,F=N.trim,z=N.resolve,U=g.Event,W=w.gecko,V=w.ie;return B.prototype={render:function(){function e(){D.unbind(window,"ready",e),n.render()}function t(){var e=m.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!L.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",L.load(r.theme,t)}N.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),O(r.external_plugins,function(e,t){M.load(t,e),r.plugins+=" "+t}),O(r.plugins.split(/[ ,]/),function(e){if(e=F(e),e&&!M.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=M.dependencies(e);O(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=M.createUrl(t,e),M.load(e.resource,e)})}else M.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!U.domLoaded)return void D.bind(window,"ready",e);if(n.getElement()&&w.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||D.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(D.insertAfter(D.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},D.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.setDirty(!1),a._mceOldSubmit(a)})),n.windowManager=new v(n),n.notificationManager=new y(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=D.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),n.editorManager.add(n),t()}},init:function(){function e(n){var r=M.get(n),i,o;if(i=M.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=F(n),r&&-1===I(m,n)){if(O(M.dependencies(n),function(t){e(t)}),t.plugins[n])return;o=new r(t,i,t.$),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n))}}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,h,p,m=[];if(t.rtl=n.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(n.language),n.aria_label=n.aria_label||D.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=L.get(n.theme),t.theme=new c(t,L.urls[n.theme]),t.theme.init&&t.theme.init(t,L.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""),t.$)):t.theme=n.theme),O(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,h=/^[0-9\.]+(|px)$/i,h.test(""+i)&&(i=Math.max(parseInt(i,10),100)),h.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&O(H(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();if(t.iframeHTML=n.doctype+"<html><head>",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+='<base href="'+t.documentBaseURI.getURI()+'" />'),!w.caretAfter&&n.ie7_compat&&(t.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'),t.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',!/#$/.test(document.location.href))for(p=0;p<t.contentCSS.length;p++){var g=t.contentCSS[p];t.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+N._addCacheSuffix(g)+'" />',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),n.content_security_policy&&(t.iframeHTML+='<meta http-equiv="Content-Security-Policy" content="'+n.content_security_policy+'" />'),t.iframeHTML+='</head><body id="'+d+'" class="mce-content-body '+f+'" data-id="'+t.id+'"><br></body></html>';var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';document.domain!=location.hostname&&w.ie&&w.ie<12&&(u=v);var y=D.create("iframe",{id:t.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}});if(y.onload=function(){y.onload=null,t.fire("load")},D.setAttrib(y,"src",u||'javascript:""'),t.contentAreaContainer=l.iframeContainer,t.iframeElement=y,s=D.add(l.iframeContainer,y),V)try{t.getDoc()}catch(b){s.src=u=v}l.editorContainer&&(D.get(l.editorContainer).style.display=t.orgDisplay,t.hidden=D.isHidden(l.editorContainer)),t.getElement().style.display="none",D.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,r=n.settings,s=n.getElement(),h=n.getDoc(),p,m;r.inline||(n.getElement().style.visibility=n.orgVisibility),t||r.content_editable||(h.open(),h.write(n.iframeHTML),h.close()),r.content_editable&&(n.on("remove",function(){var e=this.getBody();D.removeClass(e,"mce-content-body"),D.removeClass(e,"mce-edit-focus"),D.setAttrib(e,"contentEditable",null)}),D.addClass(s,"mce-content-body"),n.contentDocument=h=r.content_document||document,n.contentWindow=r.content_window||window,n.bodyElement=s,r.content_document=r.content_window=null,r.root_name=s.nodeName.toLowerCase()),p=n.getBody(),p.disabled=!0,n.readonly=r.readonly,n.readonly||(n.inline&&"static"==D.getStyle(p,"position",!0)&&(p.style.position="relative"),p.contentEditable=n.getParam("content_editable_state",!0)),p.disabled=!1,n.editorUpload=new T(n),n.schema=new b(r),n.dom=new e(h,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:n.inline?n.getBody():null,collect:r.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new C(r,n.schema),n.parser.addAttributeFilter("src,href,style,tabindex",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)if(i=e[r],a=i.attr(t),s="data-mce-"+t,!i.attributes.map[s]){if(0===a.indexOf("data:")||0===a.indexOf("blob:"))continue;"style"===t?(a=o.serializeStyle(o.parseStyle(a),i.name),a.length||(a=null),i.attr(s,a),i.attr(t,a)):"tabindex"===t?(i.attr(s,a),i.attr(t,null)):i.attr(s,n.convertURL(a,t,i.name))}}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("type")||"no/type",0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,r,i=n.schema.getNonEmptyElements();t--;)r=e[t],r.isEmpty(i)&&(r.append(new o("br",1)).shortEnded=!0)}),n.serializer=new a(r,n),n.selection=new l(n.dom,n.getWin(),n.serializer,n),n.formatter=new c(n),n.undoManager=new u(n),n.forceBlocks=new f(n),n.enterKey=new d(n),n._nodeChangeDispatcher=new i(n),n._selectionOverrides=new R(n),n.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(h.body.spellcheck=!1,D.setAttrib(p,"spellcheck","false")),n.quirks=new x(n),n.fire("PostRender"),r.directionality&&(p.dir=r.directionality),r.nowrap&&(p.style.whiteSpace="nowrap"),r.protect&&n.on("BeforeSetContent",function(e){O(r.protect,function(t){e.content=e.content.replace(t,function(e){return"<!--mce:protected "+escape(e)+"-->"})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),r.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,n.bindPendingEventDelegates(),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.on("compositionstart compositionend",function(e){n.composing="compositionstart"===e.type}),n.contentStyles.length>0&&(m="",O(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),O(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),r.auto_focus&&E.setEditorTimeout(n,function(){var e;e=r.auto_focus===!0?n:n.editorManager.get(r.auto_focus),e.destroyed||e.focus()},100),s=h=p=null},focus:function(e){function t(e){return n.dom.getParent(e,function(e){return"true"===n.dom.getContentEditable(e)})}var n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l=n.getBody(),c;if(!e){if(o=r.getRng(),o.item&&(a=o.item(0)),n.quirks.refreshContentEditable(),c=t(r.getNode()),n.$.contains(l,c))return c.focus(),r.normalize(),void n.editorManager.setActive(n);if(i||(w.opera||n.getBody().focus(),n.getWin().focus()),W||i){if(l.setActive)try{l.setActive()}catch(u){l.focus()}else l.focus();i&&r.normalize()}a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())}n.editorManager.setActive(n)},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?z(r):0,n=z(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?(e=n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}),this.editorManager.translate(e)):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?O(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(e){e=e.split("="),e.length>1?i[F(e[0])]=F(e[1]):i[F(e[0])]=F(e)}):i=r,i):r},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addContextToolbar:function(e,t){var n=this,r;n.contextToolbars=n.contextToolbars||[],"string"==typeof e&&(r=e,e=function(e){return n.dom.is(e,r)}),n.contextToolbars.push({id:A.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable=!0:(D.show(e.getContainer()),D.hide(e.id)),e.load(),e.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(V&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e==e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(D.hide(e.getContainer()),D.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),"raw"==e.format&&t.fire("RawSaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=D.getParent(t.id,"form"))&&O(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&t.setDirty(!1),r},setContent:function(e,t){var n=this,r=n.getBody(),i,o;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(o=V&&11>V?"":'<br data-mce-bogus="1">',"TABLE"==r.nodeName?e="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(r.nodeName)&&(e="<li>"+o+"</li>"),i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=o,e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):V||e||(e='<br data-mce-bogus="1">'),n.dom.setHTML(r,e),n.fire("SetContent",t)):("raw"!==t.format&&(e=new s({validate:n.validate},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=F(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?t.serializer.getTrimmedContent():"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),"text"!=e.format?e.content=F(n):e.content=n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=P({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!=t&&this.fire("dirty")},setMode:function(e){S.setMode(this,e)},getContainer:function(){var e=this;return e.container||(e.container=D.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=D.get(this.id)),this.targetElm},getWin:function(){var e=this,t;return e.contentWindow||(t=e.iframeElement,t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),O(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||!n.hasVisual?i.removeClass(e,o):i.addClass(e,o));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&n.hasVisual?i.addClass(e,o):i.removeClass(e,o)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&D.remove(e.getElement().nextSibling),e.inline||(V&&10>V&&e.getDoc().execCommand("SelectAll",!1,null),D.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),D.remove(e.getContainer()),e._selectionOverrides.destroy(),e.editorUpload.destroy(),e.destroy())},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),D.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},P(B.prototype,_),B}),r(nt,[],function(){var e={},t="en";return{setCode:function(e){e&&(t=e,this.rtl=this.data[e]?"rtl"===this.data[e]._dir:!1)},getCode:function(){return t},rtl:!1,add:function(t,n){var r=e[t];r||(e[t]=r={});for(var i in n)r[i]=n[i];this.setCode(t)},translate:function(n){var r;if(r=e[t],r||(r={}),"undefined"==typeof n)return n;if("string"!=typeof n&&n.raw)return n.raw;if(n.push){var i=n.slice(1);n=(r[n[0]]||n[0]).replace(/\{([0-9]+)\}/g,function(e,t){return i[t]})}return(r[n]||n).replace(/{context:\w+}$/,"")},data:e}}),r(rt,[w,u,d],function(e,t,n){function r(e){function l(){try{return document.activeElement}catch(e){return document.body}}function c(e,t){if(t&&t.startContainer){if(!e.isChildOf(t.startContainer,e.getRoot())||!e.isChildOf(t.endContainer,e.getRoot()))return;return{startContainer:t.startContainer, startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset}}return t}function u(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function d(e){return!!s.getParent(e,r.isEditorUIElement)}function f(r){var f=r.editor;f.on("init",function(){(f.inline||n.ie)&&("onbeforedeactivate"in document&&n.ie<9?f.dom.bind(f.getBody(),"beforedeactivate",function(e){if(e.target==f.getBody())try{f.lastRng=f.selection.getRng()}catch(t){}}):f.on("nodechange mouseup keyup",function(e){var t=l();"nodechange"==e.type&&e.selectionChange||(t&&t.id==f.id+"_ifr"&&(t=f.getBody()),f.dom.isChildOf(t,f.getBody())&&(f.lastRng=f.selection.getRng()))}),n.webkit&&!i&&(i=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(f.lastRng=n)}},s.bind(document,"selectionchange",i)))}),f.on("setcontent",function(){f.lastRng=null}),f.on("mousedown",function(){f.selection.lastFocusBookmark=null}),f.on("focusin",function(){var t=e.focusedEditor,n;f.selection.lastFocusBookmark&&(n=u(f,f.selection.lastFocusBookmark),f.selection.lastFocusBookmark=null,f.selection.setRng(n)),t!=f&&(t&&t.fire("blur",{focusedEditor:f}),e.setActive(f),e.focusedEditor=f,f.fire("focus",{blurredEditor:t}),f.focus(!0)),f.lastRng=null}),f.on("focusout",function(){t.setEditorTimeout(f,function(){var t=e.focusedEditor;d(l())||t!=f||(f.fire("blur",{focusedEditor:null}),e.focusedEditor=null,f.selection&&(f.selection.lastFocusBookmark=null))})}),o||(o=function(t){var n=e.activeEditor,r;r=t.target,n&&r.ownerDocument==document&&(n.selection&&r!=n.getBody()&&(n.selection.lastFocusBookmark=c(n.dom,n.lastRng)),r==document.body||d(r)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},s.bind(document,"focusin",o)),f.inline&&!a&&(a=function(t){var n=e.activeEditor,r=n.dom;if(n.inline&&r&&!r.isChildOf(t.target,n.getBody())){var i=n.selection.getRng();i.collapsed||(n.lastRng=i)}},s.bind(document,"mouseup",a))}function h(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(s.unbind(document,"selectionchange",i),s.unbind(document,"focusin",o),s.unbind(document,"mouseup",a),i=o=a=null)}e.on("AddEditor",f),e.on("RemoveEditor",h)}var i,o,a,s=e.DOM;return r.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},r}),r(it,[tt,g,w,ae,d,m,c,ue,nt,rt],function(e,t,n,r,i,o,a,s,l,c){function u(e){g(C.editors,function(t){"scroll"===e.type?t.fire("ScrollWindow",e):t.fire("ResizeWindow",e)})}function d(e,n){n!==x&&(n?t(window).on("resize scroll",u):t(window).off("resize scroll",u),x=n)}function f(e){var t=C.editors,n;delete t[e.id];for(var r=0;r<t.length;r++)if(t[r]==e){t.splice(r,1),n=!0;break}return C.activeEditor==e&&(C.activeEditor=t[0]),C.focusedEditor==e&&(C.focusedEditor=null),n}function h(e){return e&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(f(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null),e}var p=n.DOM,m=o.explode,g=o.each,v=o.extend,y=0,b,C,x=!1;return C={$:t,majorVersion:"4",minorVersion:"4.3",releaseDate:"2016-09-01",editors:[],i18n:l,activeEditor:null,setup:function(){var e=this,t,n,i="",o,a;if(n=r.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/")),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else{for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){a=s[l].src;var u=a.substring(a.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(a)){-1!=u.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/"));break}}!t&&document.currentScript&&(a=document.currentScript.src,-1!=a.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/")))}e.baseURL=new r(n).toAbsolute(t),e.documentBaseURL=n,e.baseURI=new r(e.baseURL),e.suffix=i,e.focusManager=new c(e)},overrideDefaults:function(e){var t,n;t=e.base_url,t&&(this.baseURL=new r(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new r(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n),this.defaultSettings=e},init:function(n){function r(e,t){return e.inline&&t.tagName.toLowerCase()in C}function i(e,t){window.console&&!window.test&&window.console.log(e,t)}function s(e){var t=e.id;return t||(t=e.name,t=t&&!p.get(t)?e.name:p.uniqueId(),e.setAttribute("id",t)),t}function l(e){var t=n[e];if(t)return t.apply(f,Array.prototype.slice.call(arguments,2))}function c(e,t){return t.constructor===RegExp?t.test(e.className):p.hasClass(e,t)}function u(e){var t,n=[];if(e.types)return g(e.types,function(e){n=n.concat(p.select(e.selector))}),n;if(e.selector)return p.select(e.selector);if(e.target)return[e.target];switch(e.mode){case"exact":t=e.elements||"",t.length>0&&g(m(t),function(e){var t;(t=p.get(e))?n.push(t):g(document.forms,function(t){g(t.elements,function(t){t.name===e&&(e="mce_editor_"+y++,p.setAttrib(t,"id",e),n.push(t))})})});break;case"textareas":case"specific_textareas":g(p.select("textarea"),function(t){e.editor_deselector&&c(t,e.editor_deselector)||e.editor_selector&&!c(t,e.editor_selector)||n.push(t)})}return n}function d(){function a(t,n,r){var i=new e(t,n,f);m.push(i),i.on("init",function(){++c===y.length&&x(m)}),i.targetElm=i.targetElm||r,i.render()}var c=0,m=[],y;return p.unbind(window,"ready",d),l("onpageload"),y=t.unique(u(n)),n.types?void g(n.types,function(e){o.each(y,function(t){return p.is(t,e.selector)?(a(s(t),v({},n,e),t),!1):!0})}):(o.each(y,function(e){h(f.get(e.id))}),y=o.grep(y,function(e){return!f.get(e.id)}),void g(y,function(e){r(n,e)?i("Could not initialize inline editor on invalid inline target element",e):a(s(e),n,e)}))}var f=this,b,C;C=o.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var x=function(e){b=e};return f.settings=n,p.bind(window,"ready",d),new a(function(e){b?e(b):x=function(t){e(t)}})},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),d(n,!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),b||(b=function(){t.fire("BeforeUnload")},p.bind(window,"beforeunload",b)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void g(p.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(f(i)&&t.fire("RemoveEditor",{editor:i}),r.length||p.unbind(window,"beforeunload",b),i.remove(),d(r,r.length>0),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){g(this.editors,function(e){e.save()})},addI18n:function(e,t){l.add(e,t)},translate:function(e){return l.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},v(C,s),C.setup(),window.tinymce=window.tinyMCE=C,C}),r(ot,[it,m],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(n,r){"html4"===t.settings.schema&&e(r,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(at,[ue,m],function(e,t){var n={send:function(e){function r(){!e.async||4==i.readyState||o++>1e4?(e.success&&1e4>o&&200==i.status?e.success.call(e.success_scope,""+i.responseText,i,e):e.error&&e.error.call(e.error_scope,o>1e4?"TIMED_OUT":"GENERAL",i,e),i=null):setTimeout(r,10)}var i,o=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async!==!1,e.data=e.data||"",n.fire("beforeInitialize",{settings:e}),i=new XMLHttpRequest){if(i.overrideMimeType&&i.overrideMimeType(e.content_type),i.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(i.withCredentials=!0),e.content_type&&i.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&t.each(e.requestheaders,function(e){i.setRequestHeader(e.key,e.value)}),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i=n.fire("beforeSend",{xhr:i,settings:e}).xhr,i.send(e.data),!e.async)return r();setTimeout(r,10)}}};return t.extend(n,e),n}),r(st,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r<t.length;r++)i+=(r>0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(lt,[st,at,m],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(ct,[w],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(ut,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(dt,[w,f,N,E,m,d],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(ft,[se,m],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t=this,n=t.settings,r,i,o,a;r=n.firstControlClass,i=n.lastControlClass,e.each(function(e){e.classes.remove(r).remove(i).add(n.controlClass),e.visible()&&(o||(o=e),a=e)}),o&&o.classes.add(r),a&&a.classes.add(i)},renderHtml:function(e){var t=this,n="";return t.applyClasses(e.items()),e.items().each(function(e){n+=e.renderHtml()}),n},recalc:function(){},postRender:function(){},isNative:function(){return!1}})}),r(ht,[ft],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}})}),r(pt,[De],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t._super(e),e=t.settings,n=t.settings.size,t.on("click mousedown",function(e){e.preventDefault()}),t.on("touchstart",function(e){t.fire("click",e),e.preventDefault()}),e.subtype&&t.classes.add(e.subtype),n&&t.classes.add("btn-"+n),e.icon&&t.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e=this.getEl().firstChild,t;e&&(t=e.style,t.width=t.height="100%"),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("icon"),i,o=e.state.get("text"),a="";return i=e.settings.image,i?(r="none","string"!=typeof i&&(i=window.getSelection?i[0]:i[1]),i=" style=\"background-image: url('"+i+"')\""):i="",o&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(o)+"</span>"),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'<div id="'+t+'" class="'+e.classes+'" tabindex="-1" aria-labelledby="'+t+'"><button role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+i+"></i>":"")+a+"</button></div>"},bindStates:function(){function e(e){var i=n("span."+r,t.getEl());e?(i[0]||(n("button:first",t.getEl()).append('<span class="'+r+'"></span>'),i=n("span."+r,t.getEl())),i.html(t.encode(e))):i.remove(),t.classes.toggle("btn-has-text",!!e)}var t=this,n=t.$,r=t.classPrefix+"txt";return t.state.on("change:text",function(t){e(t.value)}),t.state.on("change:icon",function(n){var r=n.value,i=t.classPrefix;t.settings.icon=r,r=r?i+"ico "+i+"i-"+t.settings.icon:"";var o=t.getEl().firstChild,a=o.getElementsByTagName("i")[0];r?(a&&a==o.firstChild||(a=document.createElement("i"),o.insertBefore(a,o.firstChild)),a.className=r):a&&o.removeChild(a),e(t.state.get("text"))}),t._super()}})}),r(mt,[xe],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(gt,[De],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'" unselectable="on" aria-labelledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'label">'+e.encode(e.state.get("text"))+"</span></div>"},bindStates:function(){function e(e){t.classes.toggle("checked",e),t.aria("checked",e)}var t=this;return t.state.on("change:text",function(e){t.getEl("al").firstChild.data=t.translate(e.value)}),t.state.on("change:checked change:value",function(n){t.fire("change"),e(n.value)}),t.state.on("change:icon",function(e){var n=e.value,r=t.classPrefix;if("undefined"==typeof n)return t.settings.icon;t.settings.icon=n,n=n?r+"ico "+r+"i-"+t.settings.icon:"";var i=t.getEl().firstChild,o=i.getElementsByTagName("i")[0];n?(o&&o==i.firstChild||(o=document.createElement("i"),i.insertBefore(o,i.firstChild)),o.className=n):o&&i.removeChild(o)}),t.state.get("checked")&&e(!0),t._super()}})}),r(vt,[De,be,pe,g],function(e,t,n,r){return e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.classes.add("combobox"),t.subinput=!0,t.ariaTarget="inp",e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){var i=n.target,o=t.getEl();if(r.contains(o,i)||i==o)for(;i&&i!=o;)i.id&&-1!=i.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),i=i.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){var r=t.state.get("value"),i=t.getEl("inp").value;return e.preventDefault(),t.state.set("value",i),r!=i&&t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),t.on("keyup",function(e){"INPUT"==e.target.nodeName&&t.state.set("value",e.target.value)})},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),i=e.getEl("open"),o=e.layoutRect(),a,s;a=i?o.w-n.getSize(i).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(s=e.layoutRect().h-2+"px"),r(t.firstChild).css({width:a,lineHeight:s}),e._super(),e},postRender:function(){var e=this;return r(this.getEl("inp")).on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)}),e._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=e.state.get("value")||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e.state.get("text"),(o||a)&&(s='<div id="'+t+'-open" class="'+r+"btn "+r+'open" tabIndex="-1" role="button"><button id="'+t+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!=o?'<i class="'+o+'"></i>':'<i class="'+r+'caret"></i>')+(a?(o?" ":"")+a:"")+"</button></div>",e.classes.add("has-open")),'<div id="'+t+'" class="'+e.classes+'"><input id="'+t+'-inp" class="'+r+'textbox" value="'+e.encode(i,!1)+'" hidefocus="1"'+l+' placeholder="'+e.encode(n.placeholder)+'" />'+s+"</div>"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl("inp").value!=t.value&&(e.getEl("inp").value=t.value)}),e.state.on("change:disabled",function(t){e.getEl("inp").disabled=t.value}),e._super()},remove:function(){r(this.getEl("inp")).off(),this._super()}})}),r(yt,[vt],function(e){return e.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl().getElementsByTagName("i")[0];if(t)try{t.style.background=e}catch(n){}},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.state.get("rendered")&&e.repaintColor(t.value)}),e._super()}})}),r(bt,[pt,ke],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),r(Ct,[bt,w],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("text"),i=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",a="";return r&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(r)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(i?'<i class="'+i+'"'+o+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+a+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(xt,[],function(){function e(e){function i(e,i,o){var a,s,l,c,u,d;return a=0,s=0,l=0,e/=255,i/=255,o/=255,u=t(e,t(i,o)),d=n(e,n(i,o)),u==d?(l=u,{h:0,s:0,v:100*l}):(c=e==u?i-o:o==u?e-i:o-e,a=e==u?3:o==u?1:5,a=60*(a-c/(d-u)),s=(d-u)/d,l=d,{h:r(a),s:r(100*s),v:r(100*l)})}function o(e,i,o){var a,s,l,c;if(e=(parseInt(e,10)||0)%360,i=parseInt(i,10)/100,o=parseInt(o,10)/100,i=n(0,t(i,1)),o=n(0,t(o,1)),0===i)return void(d=f=h=r(255*o));switch(a=e/60,s=o*i,l=s*(1-Math.abs(a%2-1)),c=o-s,Math.floor(a)){case 0:d=s,f=l,h=0;break;case 1:d=l,f=s,h=0;break;case 2:d=0,f=s,h=l;break;case 3:d=0,f=l,h=s;break;case 4:d=l,f=0,h=s;break;case 5:d=s,f=0,h=l;break;default:d=f=h=0}d=r(255*(d+c)),f=r(255*(f+c)),h=r(255*(h+c))}function a(){function e(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+e(d)+e(f)+e(h)}function s(){return{r:d,g:f,b:h}}function l(){return i(d,f,h)}function c(e){var t;return"object"==typeof e?"r"in e?(d=e.r,f=e.g,h=e.b):"v"in e&&o(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(d=parseInt(t[1],10),f=parseInt(t[2],10),h=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(d=parseInt(t[1],16),f=parseInt(t[2],16),h=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(d=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16),h=parseInt(t[3]+t[3],16)),d=0>d?0:d>255?255:d,f=0>f?0:f>255?255:f,h=0>h?0:h>255?255:h,u}var u=this,d=0,f=0,h=0;e&&c(e),u.toRgb=s,u.toHsv=l,u.toHex=a,u.parse=c}var t=Math.min,n=Math.max,r=Math.round;return e}),r(wt,[De,we,pe,xt],function(e,t,n,r){return e.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){function e(e,t){var r=n.getPos(e),i,o;return i=t.pageX-r.x,o=t.pageY-r.y,i=Math.max(0,Math.min(i/e.clientWidth,1)),o=Math.max(0,Math.min(o/e.clientHeight,1)),{x:i,y:o}}function i(e,t){var i=(360-e.h)/360;n.css(d,{top:100*i+"%"}),t||n.css(h,{left:e.s+"%",top:100-e.v+"%"}),f.style.background=new r({s:100,v:100,h:e.h}).toHex(),s.color().parse({s:e.s,v:e.v,h:e.h})}function o(t){var n;n=e(f,t),c.s=100*n.x,c.v=100*(1-n.y),i(c),s.fire("change")}function a(t){var n;n=e(u,t),c=l.toHsv(),c.h=360*(1-n.y),i(c,!0),s.fire("change")}var s=this,l=s.color(),c,u,d,f,h;u=s.getEl("h"),d=s.getEl("hp"),f=s.getEl("sv"),h=s.getEl("svp"),s._repaint=function(){c=l.toHsv(),i(c)},s._super(),s._svdraghelper=new t(s._id+"-sv",{start:o,drag:o}),s._hdraghelper=new t(s._id+"-h",{start:a,drag:a}),s._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;return arguments.length?(t.color().parse(e),void(t._rendered&&t._repaint())):t.color().toHex()},color:function(){return this._color||(this._color=new r),this._color},renderHtml:function(){function e(){var e,t,n="",i,a;for(i="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",a=o.split(","),e=0,t=a.length-1;t>e;e++)n+='<div class="'+r+'colorpicker-h-chunk" style="height:'+100/t+"%;"+i+a[e]+",endColorstr="+a[e+1]+");-ms-"+i+a[e]+",endColorstr="+a[e+1]+')"></div>';return n}var t=this,n=t._id,r=t.classPrefix,i,o="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",a="background: -ms-linear-gradient(top,"+o+");background: linear-gradient(to bottom,"+o+");";return i='<div id="'+n+'-h" class="'+r+'colorpicker-h" style="'+a+'">'+e()+'<div id="'+n+'-hp" class="'+r+'colorpicker-h-marker"></div></div>','<div id="'+n+'" class="'+t.classes+'"><div id="'+n+'-sv" class="'+r+'colorpicker-sv"><div class="'+r+'colorpicker-overlay1"><div class="'+r+'colorpicker-overlay2"><div id="'+n+'-svp" class="'+r+'colorpicker-selector1"><div class="'+r+'colorpicker-selector2"></div></div></div></div></div>'+i+"</div>"}})}),r(Nt,[De],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.classes.add("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.row()[n],index:n})}),t.row(t.settings.row)},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){var e=this;return'<div id="'+e._id+'" class="'+e.classes+'">'+e._getDataPathHtml(e.state.get("row"))+"</div>"},bindStates:function(){var e=this;return e.state.on("change:row",function(t){e.innerHtml(e._getDataPathHtml(t.value))}),e._super()},_getDataPathHtml:function(e){var t=this,n=e||[],r,i,o="",a=t.classPrefix;for(r=0,i=n.length;i>r;r++)o+=(r>0?'<div class="'+a+'divider" aria-hidden="true"> '+t.settings.delimiter+" </div>":"")+'<div role="button" class="'+a+"path-item"+(r==i-1?" "+a+"last":"")+'" data-index="'+r+'" tabindex="-1" id="'+t._id+"-"+r+'" aria-level="'+r+'">'+n[r].name+"</div>";return o||(o='<div class="'+a+'path-item">\xa0</div>'),o}})}),r(Et,[Nt],function(e){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var t=this,n=t.settings.editor;return n.settings.elementpath!==!1&&(t.on("select",function(e){n.focus(),n.selection.select(this.row()[e.index].element),n.nodeChanged()}),n.on("nodeChange",function(r){for(var i=[],o=r.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=n.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});if(s.isDefaultPrevented()||i.push({name:s.name,element:o[a]}),s.isPropagationStopped())break}t.row(i)})),t._super()}})}),r(_t,[xe],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(St,[xe,_t,m],function(e,t,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,r=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),r.each(function(r){var i,o=r.settings.label;o&&(i=new t(n.extend({items:{type:"label",id:r._id+"-l",text:o,flex:0,forId:r._id,disabled:r.disabled()}},e.settings.formItemDefaults)),i.type="formitem",r.aria("labelledby",r._id+"-l"),"undefined"==typeof r.settings.flex&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.fromJSON(e.settings.data)},bindStates:function(){function e(){var e=0,n=[],r,i,o;if(t.settings.labelGapCalc!==!1)for(o="children"==t.settings.labelGapCalc?t.find("formitem"):t.items(),o.filter("formitem").each(function(t){var r=t.items()[0],i=r.getEl().clientWidth;e=i>e?i:e,n.push(r)}),i=t.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=e+i}var t=this;t._super(),t.on("show",e),e()}})}),r(kt,[St],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}})}),r(Tt,[vt,m],function(e,t){return e.extend({init:function(e){var n=this,r=tinymce.activeEditor,i=r.settings,o,a,s;e.spellcheck=!1,s=i.file_picker_types||i.file_browser_callback_types,s&&(s=t.makeMap(s,/[, ]/)),s&&!s[e.filetype]||(a=i.file_picker_callback,!a||s&&!s[e.filetype]?(a=i.file_browser_callback,!a||s&&!s[e.filetype]||(o=function(){a(n.getEl("inp").id,n.value(),e.filetype,window)})):o=function(){var i=n.fire("beforecall").meta;i=t.extend({filetype:e.filetype},i),a.call(r,function(e,t){n.value(e).fire("change",{meta:t})},n.value(),i)}),o&&(e.icon="browse",e.onaction=o),n._super(e)}})}),r(Rt,[ht],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(At,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v=[],y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F,z=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e.paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,"row-reversed"!=f&&"column-reverse"!=f||(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(S="y",E="h",_="minH",k="maxH",R="innerH",T="top",A="deltaH",B="contentH",O="left",M="w",D="x",L="innerW", P="minW",H="right",I="deltaW",F="contentW"):(S="x",E="w",_="minW",k="maxW",R="innerW",T="left",A="deltaW",B="contentW",O="top",M="h",D="y",L="innerH",P="minH",H="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],N=u=0,t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),m=h.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,p[k]&&v.push(h),p.flex=g),d-=p[_],y=o[O]+p[P]+o[H],y>N&&(N=y);if(x={},0>d?x[_]=i[_]-d+i[A]:x[_]=i[R]-d+i[A],x[P]=N+i[I],x[B]=i[R]-d,x[F]=N,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)h=v[t],p=h.layoutRect(),b=p[k],y=p[_]+p.flex*C,y>b?(d-=p[k]-p[_],u-=p.flex,p.flex=0,p.maxFlexSize=b):p.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[D]=o[O],t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),y=p.maxFlexSize||p[_],"center"===s?x[D]=Math.round(i[L]/2-p[M]/2):"stretch"===s?(x[M]=z(p[P]||0,i[L]-o[O]-o[H]),x[D]=o[O]):"end"===s&&(x[D]=i[L]-p[M]-o.top),p.flex>0&&(y+=p.flex*C),x[E]=y,x[S]=w,h.layoutRect(x),h.recalc&&h.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var W=e.parent();W&&(W._lastRect=null,W.recalc())}}})}),r(Bt,[ft],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}})}),r(Dt,[ye,De,ke,m,w,it,d],function(e,t,n,r,i,o,a){function s(e){e.settings.ui_container&&(a.container=i.DOM.select(e.settings.ui_container)[0])}function l(t){t.on("ScriptsLoaded",function(){t.rtl&&(e.rtl=!0)})}function c(e){function t(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;u(i.parents,function(e){return u(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function r(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function i(){function t(e){var n=[];if(e)return u(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=t(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a,o.cmd=e.cmd}n.push(o)}),n}function n(){var n;return n=t(e.settings.style_formats_merge?e.settings.style_formats?o.concat(e.settings.style_formats):o:e.settings.style_formats||o)}var r=0,i=[],o=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){u(i,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:n(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?e.formatter.getCssText(this.settings.format):void 0},onPostRender:function(){var t=this;t.parent().on("show",function(){var n,r;n=t.settings.format,n&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),r=t.settings.cmd,r&&t.active(e.queryCommandState(r))})},onclick:function(){this.settings.format&&l(this.settings.format),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}function o(t){return function(){var n=this;e.formatter?e.formatter.formatChanged(t,function(e){n.active(e)}):e.on("init",function(){e.formatter.formatChanged(t,function(e){n.active(e)})})}}function a(t){return function(){function n(){return e.undoManager?e.undoManager[t]():!1}var r=this;t="redo"==t?"hasRedo":"hasUndo",r.disabled(!n()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){r.disabled(e.readonly||!n())})}}function s(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function l(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var c;c=i(),u({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:o(n),onclick:function(){l(n)}})}),u({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),u({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:o(n)})}),e.addButton("undo",{tooltip:"Undo",onPostRender:a("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:a("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:s,cmd:"mceToggleVisualAid"}),e.addButton("remove",{tooltip:"Remove",icon:"remove",cmd:"Delete"}),u({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return u(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return u(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return u(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var u=r.each;o.on("AddEditor",function(e){var t=e.editor;l(t),c(t),s(t)}),e.translate=function(e){return o.translate(e)},t.tooltips=!a.iOS}),r(Lt,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E=[],_=[],S,k,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e.paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)_.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),S=c.minW,k=c.minH,E[d]=S>E[d]?S:E[d],_[f]=k>_[f]?k:_[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,N=0,f=0;n>f;f++)N+=_[f]+(f>0?b:0),R-=(f>0?b:0)+_[f];if(w+=g.left+g.right,N+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=N+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var D;D="start"==t.packV?0:R>0?Math.floor(R/n):0;var L=0,M=t.flexWidths;if(M)for(d=0;d<M.length;d++)L+=M[d];else L=r;var P=T/L;for(d=0;r>d;d++)E[d]+=M?M[d]*P:P;for(p=g.top,f=0;n>f;f++){for(h=g.left,s=_[f]+D,d=0;r>d&&(B=A?f*r+r-1-d:f*r+d,u=i[B],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(E[d],c.startMinWidth),c.x=h,c.y=p,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=h+a/2-c.w/2:"right"==v?c.x=h+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=p+s/2-c.h/2:"bottom"==v?c.y=p+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),h+=a+y,u.recalc&&u.recalc();p+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var O=e.parent();O&&(O._lastRect=null,O.recalc())}}})}),r(Mt,[De,u],function(e,t){return e.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,n){var r=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,n&&n()):t.setTimeout(function(){r.html(e)}),this}})}),r(Pt,[De],function(e){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("infobox"),t.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+e.encode(e.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+t+"ico "+t+'i-help"></i></button></div></div>'},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl("body").firstChild.data=e.encode(t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e.state.on("change:help",function(t){e.classes.toggle("has-help",t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ot,[De,pe],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.classes.add("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e=this,t,n,r=e.settings.forId;return!r&&(n=e.settings.forName)&&(t=e.getRoot().find("#"+n)[0],t&&(r=t._id)),r?'<label id="'+e._id+'" class="'+e.classes+'"'+(r?' for="'+r+'"':"")+">"+e.encode(e.state.get("text"))+"</label>":'<span id="'+e._id+'" class="'+e.classes+'">'+e.encode(e.state.get("text"))+"</span>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.innerHtml(e.encode(t.value)),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ht,[xe],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.classes.add("toolbar")},postRender:function(){var e=this;return e.items().each(function(e){e.classes.add("toolbar-item")}),e._super()}})}),r(It,[Ht],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(Ft,[pt,be,It],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(){var e=this,n;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(n=e.state.get("menu")||[],n.length?n={type:"menu",items:n}:n.type=n.type||"menu",n.renderTo?e.menu=n.parent(e).show().renderTo():e.menu=t.create(n).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon,o,a=e.state.get("text"),s="";return o=e.settings.image,o?(i="none","string"!=typeof o&&(o=window.getSelection?o[0]:o[1]),o=" style=\"background-image: url('"+o+"')\""):o="",a&&(e.classes.add("btn-has-text"),s='<span class="'+r+'txt">'+e.encode(a)+"</span>"),i=e.settings.icon?r+"ico "+r+"i-"+i:"",e.aria("role",e.parent()instanceof n?"menuitem":"button"),'<div id="'+t+'" class="'+e.classes+'" tabindex="-1" aria-labelledby="'+t+'"><button id="'+t+'-open" role="presentation" type="button" tabindex="-1">'+(i?'<i class="'+i+'"'+o+"></i>":"")+s+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});return i}),r(zt,[De,be,d,u],function(e,t,n,r){return e.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t=this,n;t._super(e),e=t.settings,t.classes.add("menu-item"),e.menu&&t.classes.add("menu-item-expand"),e.preview&&t.classes.add("menu-item-preview"),n=t.state.get("text"),"-"!==n&&"|"!==n||(t.classes.add("menu-item-sep"),t.aria("role","separator"),t.state.set("text","-")),e.selectable&&(t.aria("role","menuitemcheckbox"),t.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||t.classes.add("menu-item-normal"),t.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&t.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r,i=e.parent();if(i.items().each(function(t){t!==e&&t.hideMenu()}),n.menu){r=e.menu,r?r.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",i.settings.itemDefaults&&(r.itemDefaults=i.settings.itemDefaults),r=e.menu=t.create(r).parent(e).renderTo(),r.reflow(),r.on("cancel",function(t){t.stopPropagation(),e.focus(),r.hide()}),r.on("show hide",function(e){e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),r.on("hide",function(t){t.control===r&&e.classes.remove("selected")}),r.submenu=!0),r._parentMenu=i,r.classes.add("menu-sub");var o=r.testMoveRel(e.getEl(),e.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);r.moveRel(e.getEl(),o),r.rel=o,o="menu-sub-"+o,r.classes.remove(r._lastRel).add(o),r._lastRel=o,e.classes.add("selected"),e.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){function e(e){var t,r,i={};for(i=n.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)r=i[e[t].toLowerCase()],r&&(e[t]=r);return e.join("+")}var t=this,r=t._id,i=t.settings,o=t.classPrefix,a=t.encode(t.state.get("text")),s=t.settings.icon,l="",c=i.shortcut;return s&&t.parent().classes.add("menu-has-icons"),i.image&&(l=" style=\"background-image: url('"+i.image+"')\""),c&&(c=e(c)),s=o+"ico "+o+"i-"+(t.settings.icon||"none"),'<div id="'+r+'" class="'+t.classes+'" tabindex="-1">'+("-"!==a?'<i class="'+s+'"'+l+"></i>\xa0":"")+("-"!==a?'<span id="'+r+'-text" class="'+o+'text">'+a+"</span>":"")+(c?'<div id="'+r+'-shortcut" class="'+o+'menu-shortcut">'+c+"</div>":"")+(i.menu?'<div class="'+o+'caret"></div>':"")+"</div>"},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var i=e.getEl("text");i&&i.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),r.requestAnimationFrame(function(){e.parent().hideAll()})))}),e._super(),e},hover:function(){var e=this;return e.parent().items().each(function(e){e.classes.remove("selected")}),e.classes.toggle("selected",!0),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ut,[g,ye,u],function(e,t,n){return function(r,i){var o=this,a,s=t.classPrefix,l;o.show=function(t,c){function u(){a&&(e(r).append('<div class="'+s+"throbber"+(i?" "+s+"throbber-inline":"")+'"></div>'),c&&c())}return o.hide(),a=!0,t?l=n.setTimeout(u,t):u(),o},o.hide=function(){var e=r.lastChild;return n.clearTimeout(l),e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),a=!1,o}}}),r(Wt,[ke,zt,Ut,m],function(e,t,n,r){return e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var n=e.items,i=n.length;i--;)n[i]=r.extend({},e.itemDefaults,n[i]);t._super(e),t.classes.add("menu")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},load:function(){function e(){t.throbber&&(t.throbber.hide(),t.throbber=null)}var t=this,r,i;i=t.settings.itemsFactory,i&&(t.throbber||(t.throbber=new n(t.getEl("body"),!0),0===t.items().length?(t.throbber.show(),t.fire("loading")):t.throbber.show(100,function(){t.items().remove(),t.fire("loading")}),t.on("hide close",e)),t.requestTime=r=(new Date).getTime(),t.settings.itemsFactory(function(n){return 0===n.length?void t.hide():void(t.requestTime===r&&(t.getEl().style.width="",t.getEl("body").style.width="",e(),t.items().remove(),t.getEl("body").innerHTML="",t.add(n),t.renderNew(),t.fire("loaded")))}))},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.image||n.selectable?(e._hasIcons=!0,!1):void 0}),e.settings.itemsFactory&&e.on("postrender",function(){e.settings.itemsFactory&&e.load()}),e._super()}})}),r(Vt,[Ft,Wt],function(e,t){return e.extend({init:function(e){function t(r){for(var a=0;a<r.length;a++){if(i=r[a].selected||e.value===r[a].value)return o=o||r[a].text,n.state.set("value",r[a].value),!0;if(r[a].menu&&t(r[a].menu))return!0}}var n=this,r,i,o,a;n._super(e),e=n.settings,n._values=r=e.values,r&&("undefined"!=typeof e.value&&t(r),!i&&r.length>0&&(o=r[0].text,n.state.set("value",r[0].value)),n.state.set("menu",r)),n.state.set("text",e.text||o),n.classes.add("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.value()),a=r})},bindStates:function(){function e(e,n){e instanceof t&&e.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}function n(e,t){var r;if(e)for(var i=0;i<e.length;i++){if(e[i].value===t)return e[i];if(e[i].menu&&(r=n(e[i].menu,t)))return r}}var r=this;return r.on("show",function(t){e(t.control,r.value())}),r.state.on("change:value",function(e){var t=n(r.state.get("menu"),e.value);t?r.text(t.text):r.text(r.settings.text)}),r._super()}})}),r($t,[gt],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(qt,[De,we],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"==e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(jt,[De],function(e){function t(e){var t="";if(e)for(var n=0;n<e.length;n++)t+='<option value="'+e[n]+'">'+e[n]+"</option>";return t}return e.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var t=this;t._super(e),t.settings.size&&(t.size=t.settings.size),t.settings.options&&(t._options=t.settings.options),t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e=this,n,r="";return n=t(e._options),e.size&&(r=' size = "'+e.size+'"'),'<select id="'+e._id+'" class="'+e.classes+'"'+r+">"+n+"</select>"},bindStates:function(){var e=this;return e.state.on("change:options",function(n){e.getEl().innerHTML=t(n.value)}),e._super()}})}),r(Yt,[De,we,pe],function(e,t,n){function r(e,t,n){return t>e&&(e=t),e>n&&(e=n),e}function i(e,t,n){e.setAttribute("aria-"+t,n)}function o(e,t){var r,o,a,s,l,c;"v"==e.settings.orientation?(s="top",a="height",o="h"):(s="left",a="width",o="w"),c=e.getEl("handle"),r=(e.layoutRect()[o]||100)-n.getSize(c)[a],l=r*((t-e._minValue)/(e._maxValue-e._minValue))+"px",c.style[s]=l,c.style.height=e.layoutRect().h+"px",i(c,"valuenow",t),i(c,"valuetext",""+e.settings.previewFilter(t)),i(c,"valuemin",e._minValue),i(c,"valuemax",e._maxValue)}return e.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"==e.orientation&&t.classes.add("vertical"),t._minValue=e.minValue||0,t._maxValue=e.maxValue||100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'"><div id="'+t+'-handle" class="'+n+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){function e(e,t,n){return(n+e)/(t-e)}function i(e,t,n){return n*(t-e)-e}function o(t,n){function o(o){var a;a=s.value(),a=i(t,n,e(t,n,a)+.05*o),a=r(a,t,n),s.value(a),s.fire("dragstart",{value:a}),s.fire("drag",{value:a}),s.fire("dragend",{value:a})}s.on("keydown",function(e){switch(e.keyCode){case 37:case 38:o(-1);break;case 39:case 40:o(1)}})}function a(e,i,o){var a,l,c,p,m;s._dragHelper=new t(s._id,{handle:s._id+"-handle",start:function(e){a=e[u],l=parseInt(s.getEl("handle").style[d],10),c=(s.layoutRect()[h]||100)-n.getSize(o)[f],s.fire("dragstart",{value:m})},drag:function(t){var n=t[u]-a;p=r(l+n,0,c),o.style[d]=p+"px",m=e+p/c*(i-e),s.value(m),s.tooltip().text(""+s.settings.previewFilter(m)).show().moveRel(o,"bc tc"),s.fire("drag",{value:m})},stop:function(){s.tooltip().hide(),s.fire("dragend",{value:m})}})}var s=this,l,c,u,d,f,h;l=s._minValue,c=s._maxValue,"v"==s.settings.orientation?(u="screenY",d="top",f="height",h="h"):(u="screenX",d="left",f="width",h="w"),s._super(),o(l,c,s.getEl("handle")),a(l,c,s.getEl("handle"))},repaint:function(){this._super(),o(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){o(e,t.value)}),e._super()}})}),r(Xt,[De],function(e){return e.extend({renderHtml:function(){var e=this;return e.classes.add("spacer"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"></div>'}})}),r(Kt,[Ft,pe,g],function(e,t,n){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,r=e.getEl(),i=e.layoutRect(),o,a;return e._super(),o=r.firstChild,a=r.lastChild,n(o).css({width:i.w-t.getSize(a).width,height:i.h-2}),n(a).css({height:i.h-2}),e},activeMenu:function(e){var t=this;n(t.getEl().lastChild).toggleClass(t.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r,i=e.state.get("icon"),o=e.state.get("text"),a="";return r=e.settings.image,r?(i="none","string"!=typeof r&&(r=window.getSelection?r[0]:r[1]),r=" style=\"background-image: url('"+r+"')\""):r="",i=e.settings.icon?n+"ico "+n+"i-"+i:"",o&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(o)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(i?'<i class="'+i+'"'+r+"></i>":"")+a+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1">'+(e._menuBtnText?(i?"\xa0":"")+e._menuBtnText:"")+' <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void(t&&t.call(this,e));n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Gt,[Bt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}})}),r(Jt,[Ee,g,pe],function(e,t,n){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t(n).removeClass(this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t(n).addClass(this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='<div id="'+o+'" class="'+r+'tab" unselectable="on" role="tab" aria-controls="'+t._id+'" aria-selected="false" tabIndex="-1">'+e.encode(t.settings.title)+"</div>"}),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1"><div id="'+e._id+'-head" class="'+r+'tabs" role="tablist">'+n+'</div><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,t,r,i;r=n.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=n.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,t=e._super(),t.deltaH+=o,t.innerH=t.h-t.deltaH,t}})}),r(Qt,[De,m,pe],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("textbox"),e.multiline?t.classes.add("multiline"):(t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))}),t.on("keyup",function(e){t.state.set("value",e.target.value)}))},repaint:function(){var e=this,t,n,r,i,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e.borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,r=e.settings,i,o;return i={id:e._id,hidefocus:"1"},t.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){i[e]=r[e]}),e.disabled()&&(i.disabled="disabled"),r.subtype&&(i.type=r.subtype),o=n.create(r.multiline?"textarea":"input",i),o.value=e.state.get("value"),o.className=e.classes,o.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e.getEl().value=e.state.get("value"),e._super(),e.$el.on("change",function(t){ e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!=t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.value}),e._super()},remove:function(){this.$el.off(),this._super()}})}),r(Zt,[],function(){var e=this||window,t=function(){return e.tinymce};return"function"==typeof e.define&&(e.define.amd||e.define("ephox/tinymce",[],t)),{}}),a([l,c,u,d,f,h,m,g,v,y,C,w,N,E,T,A,B,D,L,M,P,O,I,F,j,Y,J,Q,oe,ae,se,le,ue,fe,he,ve,ye,be,Ce,xe,we,Ne,Ee,_e,Se,ke,Te,Re,Ae,Be,De,Le,Me,Pe,Ie,ze,tt,nt,rt,it,at,st,lt,ct,ut,dt,ft,ht,pt,mt,gt,vt,yt,bt,Ct,xt,wt,Nt,Et,_t,St,kt,Tt,Rt,At,Bt,Dt,Lt,Mt,Pt,Ot,Ht,It,Ft,zt,Ut,Wt,Vt,$t,qt,jt,Yt,Xt,Kt,Gt,Jt,Qt])}(this); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/customupload/customupload.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20190404 |
| Request Header - size: 500 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/customupload/customupload.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,143 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 1633 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 1,633 bytes. |
// ##################################
// ################################## // ##### CUSTOM UPLOAD BUTTON ##### // ##### josef 2019-04-01 ##### // ################################## // ################################## function apply_custom_fileinput() { // this will create an element with class name 'cstmupldimg' in every // input with attribute 'type' and value of 'file' $('input[type=file]:not(.cstmupldfile)').each(function(){ $(this).addClass("cstmupldfile"); jQuery(this).wrap("<div class='cstmupldimg'></div>"); var container = jQuery(this).closest('.cstmupldimg'); container.append('<i class="fa fa-upload" />') container.append('<span class="xfilename" />') var xfilename_container = container.find('.xfilename'); var choosefile_str = jQuery(this).data('input_label')!=undefined ? jQuery(this).data('input_label'):'Choose File'; xfilename_container.html(choosefile_str); $(this).change(function(e){ if(e.target.files[0]!=undefined) { var fileName = e.target.files[0].name; // $(this).siblings('.cstmupldimg').find('.xfilename').html(fileName); $(this).closest('.cstmupldimg').find('.xfilename').html(fileName); container.attr('title',fileName); } else { $(this).closest('.cstmupldimg').val(null); xfilename_container.html(choosefile_str); container.attr('title',''); } }) $(this).closest('.cstmupldimg').click(function(e) { if(e.originalEvent!=undefined) //20190404 gian karlo , determine that .cstmupldimg is click by the user and not programmatically { jQuery(this).find('.cstmupldfile').click(); } }) }) } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/fullcalendar/fullcalendar.js?v=20220209161352 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 32954565 |
| Request Header - size: 500 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/fullcalendar/fullcalendar.js?v=20220209161352 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 394023 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 394,023 bytes. |
/*!
* FullCalendar v3.1.0 * Docs & License: http://fullcalendar.io/ * (c) 2016 Adam Shaw */ (function(factory) { if (typeof define === 'function' && define.amd) { define([ 'jquery', 'moment' ], factory); } else if (typeof exports === 'object') { // Node/CommonJS module.exports = factory(require('jquery'), require('moment')); } else { factory(jQuery, moment); } })(function($, moment) { ;; var FC = $.fullCalendar = { version: "3.1.0", internalApiVersion: 7 }; var fcViews = FC.views = {}; $.fn.fullCalendar = function(options) { var args = Array.prototype.slice.call(arguments, 1); // for a possible method call var res = this; // what this function will return (this jQuery object by default) this.each(function(i, _element) { // loop each DOM element involved var element = $(_element); var calendar = element.data('fullCalendar'); // get the existing calendar object (if any) var singleRes; // the returned value of this single method call // a method call if (typeof options === 'string') { if (calendar && $.isFunction(calendar[options])) { singleRes = calendar[options].apply(calendar, args); if (!i) { res = singleRes; // record the first method call result } if (options === 'destroy') { // for the destroy method, must remove Calendar object data element.removeData('fullCalendar'); } } } // a new calendar initialization else if (!calendar) { // don't initialize twice calendar = new Calendar(element, options); element.data('fullCalendar', calendar); calendar.render(); } }); return res; }; var complexOptions = [ // names of options that are objects whose properties should be combined 'header', 'footer', 'buttonText', 'buttonIcons', 'themeButtonIcons' ]; // Merges an array of option objects into a single object function mergeOptions(optionObjs) { return mergeProps(optionObjs, complexOptions); } ;; // exports FC.intersectRanges = intersectRanges; FC.applyAll = applyAll; FC.debounce = debounce; FC.isInt = isInt; FC.htmlEscape = htmlEscape; FC.cssToStr = cssToStr; FC.proxy = proxy; FC.capitaliseFirstLetter = capitaliseFirstLetter; /* FullCalendar-specific DOM Utilities ----------------------------------------------------------------------------------------------------------------------*/ // Given the scrollbar widths of some other container, create borders/margins on rowEls in order to match the left // and right space that was offset by the scrollbars. A 1-pixel border first, then margin beyond that. function compensateScroll(rowEls, scrollbarWidths) { if (scrollbarWidths.left) { rowEls.css({ 'border-left-width': 1, 'margin-left': scrollbarWidths.left - 1 }); } if (scrollbarWidths.right) { rowEls.css({ 'border-right-width': 1, 'margin-right': scrollbarWidths.right - 1 }); } } // Undoes compensateScroll and restores all borders/margins function uncompensateScroll(rowEls) { rowEls.css({ 'margin-left': '', 'margin-right': '', 'border-left-width': '', 'border-right-width': '' }); } // Make the mouse cursor express that an event is not allowed in the current area function disableCursor() { $('body').addClass('fc-not-allowed'); } // Returns the mouse cursor to its original look function enableCursor() { $('body').removeClass('fc-not-allowed'); } // Given a total available height to fill, have `els` (essentially child rows) expand to accomodate. // By default, all elements that are shorter than the recommended height are expanded uniformly, not considering // any other els that are already too tall. if `shouldRedistribute` is on, it considers these tall rows and // reduces the available height. function distributeHeight(els, availableHeight, shouldRedistribute) { // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions, // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars. var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE* var flexEls = []; // elements that are allowed to expand. array of DOM nodes var flexOffsets = []; // amount of vertical space it takes up var flexHeights = []; // actual css height var usedHeight = 0; undistributeHeight(els); // give all elements their natural height // find elements that are below the recommended height (expandable). // important to query for heights in a single first pass (to avoid reflow oscillation). els.each(function(i, el) { var minOffset = i === els.length - 1 ? minOffset2 : minOffset1; var naturalOffset = $(el).outerHeight(true); if (naturalOffset < minOffset) { flexEls.push(el); flexOffsets.push(naturalOffset); flexHeights.push($(el).height()); } else { // this element stretches past recommended height (non-expandable). mark the space as occupied. usedHeight += naturalOffset; } }); // readjust the recommended height to only consider the height available to non-maxed-out rows. if (shouldRedistribute) { availableHeight -= usedHeight; minOffset1 = Math.floor(availableHeight / flexEls.length); minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE* } // assign heights to all expandable elements $(flexEls).each(function(i, el) { var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1; var naturalOffset = flexOffsets[i]; var naturalHeight = flexHeights[i]; var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things $(el).height(newHeight); } }); } // Undoes distrubuteHeight, restoring all els to their natural height function undistributeHeight(els) { els.height(''); } // Given `els`, a jQuery set of <td> cells, find the cell with the largest natural width and set the widths of all the // cells to be that width. // PREREQUISITE: if you want a cell to take up width, it needs to have a single inner element w/ display:inline function matchCellWidths(els) { var maxInnerWidth = 0; els.find('> *').each(function(i, innerEl) { var innerWidth = $(innerEl).outerWidth(); if (innerWidth > maxInnerWidth) { maxInnerWidth = innerWidth; } }); maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance els.width(maxInnerWidth); return maxInnerWidth; } // Given one element that resides inside another, // Subtracts the height of the inner element from the outer element. function subtractInnerElHeight(outerEl, innerEl) { var both = outerEl.add(innerEl); var diff; // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked both.css({ position: 'relative', // cause a reflow, which will force fresh dimension recalculation left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll }); diff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions both.css({ position: '', left: '' }); // undo hack return diff; } /* Element Geom Utilities ----------------------------------------------------------------------------------------------------------------------*/ FC.getOuterRect = getOuterRect; FC.getClientRect = getClientRect; FC.getContentRect = getContentRect; FC.getScrollbarWidths = getScrollbarWidths; // borrowed from https://github.com/jquery/jquery-ui/blob/1.11.0/ui/core.js#L51 function getScrollParent(el) { var position = el.css('position'), scrollParent = el.parents().filter(function() { var parent = $(this); return (/(auto|scroll)/).test( parent.css('overflow') + parent.css('overflow-y') + parent.css('overflow-x') ); }).eq(0); return position === 'fixed' || !scrollParent.length ? $(el[0].ownerDocument || document) : scrollParent; } // Queries the outer bounding area of a jQuery element. // Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive). // Origin is optional. function getOuterRect(el, origin) { var offset = el.offset(); var left = offset.left - (origin ? origin.left : 0); var top = offset.top - (origin ? origin.top : 0); return { left: left, right: left + el.outerWidth(), top: top, bottom: top + el.outerHeight() }; } // Queries the area within the margin/border/scrollbars of a jQuery element. Does not go within the padding. // Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive). // Origin is optional. // NOTE: should use clientLeft/clientTop, but very unreliable cross-browser. function getClientRect(el, origin) { var offset = el.offset(); var scrollbarWidths = getScrollbarWidths(el); var left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0); var top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0); return { left: left, right: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars top: top, bottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars }; } // Queries the area within the margin/border/padding of a jQuery element. Assumed not to have scrollbars. // Returns a rectangle with absolute coordinates: left, right (exclusive), top, bottom (exclusive). // Origin is optional. function getContentRect(el, origin) { var offset = el.offset(); // just outside of border, margin not included var left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left') - (origin ? origin.left : 0); var top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top') - (origin ? origin.top : 0); return { left: left, right: left + el.width(), top: top, bottom: top + el.height() }; } // Returns the computed left/right/top/bottom scrollbar widths for the given jQuery element. // NOTE: should use clientLeft/clientTop, but very unreliable cross-browser. function getScrollbarWidths(el) { var leftRightWidth = el.innerWidth() - el[0].clientWidth; // the paddings cancel out, leaving the scrollbars var widths = { left: 0, right: 0, top: 0, bottom: el.innerHeight() - el[0].clientHeight // the paddings cancel out, leaving the bottom scrollbar }; if (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side? widths.left = leftRightWidth; } else { widths.right = leftRightWidth; } return widths; } // Logic for determining if, when the element is right-to-left, the scrollbar appears on the left side var _isLeftRtlScrollbars = null; function getIsLeftRtlScrollbars() { // responsible for caching the computation if (_isLeftRtlScrollbars === null) { _isLeftRtlScrollbars = computeIsLeftRtlScrollbars(); } return _isLeftRtlScrollbars; } function computeIsLeftRtlScrollbars() { // creates an offscreen test element, then removes it var el = $('<div><div/></div>') .css({ position: 'absolute', top: -1000, left: 0, border: 0, padding: 0, overflow: 'scroll', direction: 'rtl' }) .appendTo('body'); var innerEl = el.children(); var res = innerEl.offset().left > el.offset().left; // is the inner div shifted to accommodate a left scrollbar? el.remove(); return res; } // Retrieves a jQuery element's computed CSS value as a floating-point number. // If the queried value is non-numeric (ex: IE can return "medium" for border width), will just return zero. function getCssFloat(el, prop) { return parseFloat(el.css(prop)) || 0; } /* Mouse / Touch Utilities ----------------------------------------------------------------------------------------------------------------------*/ FC.preventDefault = preventDefault; // Returns a boolean whether this was a left mouse click and no ctrl key (which means right click on Mac) function isPrimaryMouseButton(ev) { return ev.which == 1 && !ev.ctrlKey; } function getEvX(ev) { if (ev.pageX !== undefined) { return ev.pageX; } var touches = ev.originalEvent.touches; if (touches) { return touches[0].pageX; } } function getEvY(ev) { if (ev.pageY !== undefined) { return ev.pageY; } var touches = ev.originalEvent.touches; if (touches) { return touches[0].pageY; } } function getEvIsTouch(ev) { return /^touch/.test(ev.type); } function preventSelection(el) { el.addClass('fc-unselectable') .on('selectstart', preventDefault); } // Stops a mouse/touch event from doing it's native browser action function preventDefault(ev) { ev.preventDefault(); } // attach a handler to get called when ANY scroll action happens on the page. // this was impossible to do with normal on/off because 'scroll' doesn't bubble. // http://stackoverflow.com/a/32954565/96342 // returns `true` on success. function bindAnyScroll(handler) { if (window.addEventListener) { window.addEventListener('scroll', handler, true); // useCapture=true return true; } return false; } // undoes bindAnyScroll. must pass in the original function. // returns `true` on success. function unbindAnyScroll(handler) { if (window.removeEventListener) { window.removeEventListener('scroll', handler, true); // useCapture=true return true; } return false; } /* General Geometry Utils ----------------------------------------------------------------------------------------------------------------------*/ FC.intersectRects = intersectRects; // Returns a new rectangle that is the intersection of the two rectangles. If they don't intersect, returns false function intersectRects(rect1, rect2) { var res = { left: Math.max(rect1.left, rect2.left), right: Math.min(rect1.right, rect2.right), top: Math.max(rect1.top, rect2.top), bottom: Math.min(rect1.bottom, rect2.bottom) }; if (res.left < res.right && res.top < res.bottom) { return res; } return false; } // Returns a new point that will have been moved to reside within the given rectangle function constrainPoint(point, rect) { return { left: Math.min(Math.max(point.left, rect.left), rect.right), top: Math.min(Math.max(point.top, rect.top), rect.bottom) }; } // Returns a point that is the center of the given rectangle function getRectCenter(rect) { return { left: (rect.left + rect.right) / 2, top: (rect.top + rect.bottom) / 2 }; } // Subtracts point2's coordinates from point1's coordinates, returning a delta function diffPoints(point1, point2) { return { left: point1.left - point2.left, top: point1.top - point2.top }; } /* Object Ordering by Field ----------------------------------------------------------------------------------------------------------------------*/ FC.parseFieldSpecs = parseFieldSpecs; FC.compareByFieldSpecs = compareByFieldSpecs; FC.compareByFieldSpec = compareByFieldSpec; FC.flexibleCompare = flexibleCompare; function parseFieldSpecs(input) { var specs = []; var tokens = []; var i, token; if (typeof input === 'string') { tokens = input.split(/\s*,\s*/); } else if (typeof input === 'function') { tokens = [ input ]; } else if ($.isArray(input)) { tokens = input; } for (i = 0; i < tokens.length; i++) { token = tokens[i]; if (typeof token === 'string') { specs.push( token.charAt(0) == '-' ? { field: token.substring(1), order: -1 } : { field: token, order: 1 } ); } else if (typeof token === 'function') { specs.push({ func: token }); } } return specs; } function compareByFieldSpecs(obj1, obj2, fieldSpecs) { var i; var cmp; for (i = 0; i < fieldSpecs.length; i++) { cmp = compareByFieldSpec(obj1, obj2, fieldSpecs[i]); if (cmp) { return cmp; } } return 0; } function compareByFieldSpec(obj1, obj2, fieldSpec) { if (fieldSpec.func) { return fieldSpec.func(obj1, obj2); } return flexibleCompare(obj1[fieldSpec.field], obj2[fieldSpec.field]) * (fieldSpec.order || 1); } function flexibleCompare(a, b) { if (!a && !b) { return 0; } if (b == null) { return -1; } if (a == null) { return 1; } if ($.type(a) === 'string' || $.type(b) === 'string') { return String(a).localeCompare(String(b)); } return a - b; } /* FullCalendar-specific Misc Utilities ----------------------------------------------------------------------------------------------------------------------*/ // Computes the intersection of the two ranges. Will return fresh date clones in a range. // Returns undefined if no intersection. // Expects all dates to be normalized to the same timezone beforehand. // TODO: move to date section? function intersectRanges(subjectRange, constraintRange) { var subjectStart = subjectRange.start; var subjectEnd = subjectRange.end; var constraintStart = constraintRange.start; var constraintEnd = constraintRange.end; var segStart, segEnd; var isStart, isEnd; if (subjectEnd > constraintStart && subjectStart < constraintEnd) { // in bounds at all? if (subjectStart >= constraintStart) { segStart = subjectStart.clone(); isStart = true; } else { segStart = constraintStart.clone(); isStart = false; } if (subjectEnd <= constraintEnd) { segEnd = subjectEnd.clone(); isEnd = true; } else { segEnd = constraintEnd.clone(); isEnd = false; } return { start: segStart, end: segEnd, isStart: isStart, isEnd: isEnd }; } } /* Date Utilities ----------------------------------------------------------------------------------------------------------------------*/ FC.computeIntervalUnit = computeIntervalUnit; FC.divideRangeByDuration = divideRangeByDuration; FC.divideDurationByDuration = divideDurationByDuration; FC.multiplyDuration = multiplyDuration; FC.durationHasTime = durationHasTime; var dayIDs = [ 'sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat' ]; var intervalUnits = [ 'year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond' ]; // Diffs the two moments into a Duration where full-days are recorded first, then the remaining time. // Moments will have their timezones normalized. function diffDayTime(a, b) { return moment.duration({ days: a.clone().stripTime().diff(b.clone().stripTime(), 'days'), ms: a.time() - b.time() // time-of-day from day start. disregards timezone }); } // Diffs the two moments via their start-of-day (regardless of timezone). Produces whole-day durations. function diffDay(a, b) { return moment.duration({ days: a.clone().stripTime().diff(b.clone().stripTime(), 'days') }); } // Diffs two moments, producing a duration, made of a whole-unit-increment of the given unit. Uses rounding. function diffByUnit(a, b, unit) { return moment.duration( Math.round(a.diff(b, unit, true)), // returnFloat=true unit ); } // Computes the unit name of the largest whole-unit period of time. // For example, 48 hours will be "days" whereas 49 hours will be "hours". // Accepts start/end, a range object, or an original duration object. function computeIntervalUnit(start, end) { var i, unit; var val; for (i = 0; i < intervalUnits.length; i++) { unit = intervalUnits[i]; val = computeRangeAs(unit, start, end); if (val >= 1 && isInt(val)) { break; } } return unit; // will be "milliseconds" if nothing else matches } // Computes the number of units (like "hours") in the given range. // Range can be a {start,end} object, separate start/end args, or a Duration. // Results are based on Moment's .as() and .diff() methods, so results can depend on internal handling // of month-diffing logic (which tends to vary from version to version). function computeRangeAs(unit, start, end) { if (end != null) { // given start, end return end.diff(start, unit, true); } else if (moment.isDuration(start)) { // given duration return start.as(unit); } else { // given { start, end } range object return start.end.diff(start.start, unit, true); } } // Intelligently divides a range (specified by a start/end params) by a duration function divideRangeByDuration(start, end, dur) { var months; if (durationHasTime(dur)) { return (end - start) / dur; } months = dur.asMonths(); if (Math.abs(months) >= 1 && isInt(months)) { return end.diff(start, 'months', true) / months; } return end.diff(start, 'days', true) / dur.asDays(); } // Intelligently divides one duration by another function divideDurationByDuration(dur1, dur2) { var months1, months2; if (durationHasTime(dur1) || durationHasTime(dur2)) { return dur1 / dur2; } months1 = dur1.asMonths(); months2 = dur2.asMonths(); if ( Math.abs(months1) >= 1 && isInt(months1) && Math.abs(months2) >= 1 && isInt(months2) ) { return months1 / months2; } return dur1.asDays() / dur2.asDays(); } // Intelligently multiplies a duration by a number function multiplyDuration(dur, n) { var months; if (durationHasTime(dur)) { return moment.duration(dur * n); } months = dur.asMonths(); if (Math.abs(months) >= 1 && isInt(months)) { return moment.duration({ months: months * n }); } return moment.duration({ days: dur.asDays() * n }); } // Returns a boolean about whether the given duration has any time parts (hours/minutes/seconds/ms) function durationHasTime(dur) { return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds()); } function isNativeDate(input) { return Object.prototype.toString.call(input) === '[object Date]' || input instanceof Date; } // Returns a boolean about whether the given input is a time string, like "06:40:00" or "06:00" function isTimeString(str) { return /^\d+\:\d+(?:\:\d+\.?(?:\d{3})?)?$/.test(str); } /* Logging and Debug ----------------------------------------------------------------------------------------------------------------------*/ FC.log = function() { var console = window.console; if (console && console.log) { return console.log.apply(console, arguments); } }; FC.warn = function() { var console = window.console; if (console && console.warn) { return console.warn.apply(console, arguments); } else { return FC.log.apply(FC, arguments); } }; /* General Utilities ----------------------------------------------------------------------------------------------------------------------*/ var hasOwnPropMethod = {}.hasOwnProperty; // Merges an array of objects into a single object. // The second argument allows for an array of property names who's object values will be merged together. function mergeProps(propObjs, complexProps) { var dest = {}; var i, name; var complexObjs; var j, val; var props; if (complexProps) { for (i = 0; i < complexProps.length; i++) { name = complexProps[i]; complexObjs = []; // collect the trailing object values, stopping when a non-object is discovered for (j = propObjs.length - 1; j >= 0; j--) { val = propObjs[j][name]; if (typeof val === 'object') { complexObjs.unshift(val); } else if (val !== undefined) { dest[name] = val; // if there were no objects, this value will be used break; } } // if the trailing values were objects, use the merged value if (complexObjs.length) { dest[name] = mergeProps(complexObjs); } } } // copy values into the destination, going from last to first for (i = propObjs.length - 1; i >= 0; i--) { props = propObjs[i]; for (name in props) { if (!(name in dest)) { // if already assigned by previous props or complex props, don't reassign dest[name] = props[name]; } } } return dest; } // Create an object that has the given prototype. Just like Object.create function createObject(proto) { var f = function() {}; f.prototype = proto; return new f(); } FC.createObject = createObject; function copyOwnProps(src, dest) { for (var name in src) { if (hasOwnProp(src, name)) { dest[name] = src[name]; } } } function hasOwnProp(obj, name) { return hasOwnPropMethod.call(obj, name); } // Is the given value a non-object non-function value? function isAtomic(val) { return /undefined|null|boolean|number|string/.test($.type(val)); } function applyAll(functions, thisObj, args) { if ($.isFunction(functions)) { functions = [ functions ]; } if (functions) { var i; var ret; for (i=0; i<functions.length; i++) { ret = functions[i].apply(thisObj, args) || ret; } return ret; } } function firstDefined() { for (var i=0; i<arguments.length; i++) { if (arguments[i] !== undefined) { return arguments[i]; } } } function htmlEscape(s) { return (s + '').replace(/&/g, '&') .replace(/</g, '<') .replace(/>/g, '>') .replace(/'/g, ''') .replace(/"/g, '"') .replace(/\n/g, '<br />'); } function stripHtmlEntities(text) { return text.replace(/&.*?;/g, ''); } // Given a hash of CSS properties, returns a string of CSS. // Uses property names as-is (no camel-case conversion). Will not make statements for null/undefined values. function cssToStr(cssProps) { var statements = []; $.each(cssProps, function(name, val) { if (val != null) { statements.push(name + ':' + val); } }); return statements.join(';'); } // Given an object hash of HTML attribute names to values, // generates a string that can be injected between < > in HTML function attrsToStr(attrs) { var parts = []; $.each(attrs, function(name, val) { if (val != null) { parts.push(name + '="' + htmlEscape(val) + '"'); } }); return parts.join(' '); } function capitaliseFirstLetter(str) { return str.charAt(0).toUpperCase() + str.slice(1); } function compareNumbers(a, b) { // for .sort() return a - b; } function isInt(n) { return n % 1 === 0; } // Returns a method bound to the given object context. // Just like one of the jQuery.proxy signatures, but without the undesired behavior of treating the same method with // different contexts as identical when binding/unbinding events. function proxy(obj, methodName) { var method = obj[methodName]; return function() { return method.apply(obj, arguments); }; } // Returns a function, that, as long as it continues to be invoked, will not // be triggered. The function will be called after it stops being called for // N milliseconds. If `immediate` is passed, trigger the function on the // leading edge, instead of the trailing. // https://github.com/jashkenas/underscore/blob/1.6.0/underscore.js#L714 function debounce(func, wait, immediate) { var timeout, args, context, timestamp, result; var later = function() { var last = +new Date() - timestamp; if (last < wait) { timeout = setTimeout(later, wait - last); } else { timeout = null; if (!immediate) { result = func.apply(context, args); context = args = null; } } }; return function() { context = this; args = arguments; timestamp = +new Date(); var callNow = immediate && !timeout; if (!timeout) { timeout = setTimeout(later, wait); } if (callNow) { result = func.apply(context, args); context = args = null; } return result; }; } ;; /* GENERAL NOTE on moments throughout the *entire rest* of the codebase: All moments are assumed to be ambiguously-zoned unless otherwise noted, with the NOTABLE EXCEOPTION of start/end dates that live on *Event Objects*. Ambiguously-TIMED moments are assumed to be ambiguously-zoned by nature. */ var ambigDateOfMonthRegex = /^\s*\d{4}-\d\d$/; var ambigTimeOrZoneRegex = /^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?)?$/; var newMomentProto = moment.fn; // where we will attach our new methods var oldMomentProto = $.extend({}, newMomentProto); // copy of original moment methods // tell momentjs to transfer these properties upon clone var momentProperties = moment.momentProperties; momentProperties.push('_fullCalendar'); momentProperties.push('_ambigTime'); momentProperties.push('_ambigZone'); // Creating // ------------------------------------------------------------------------------------------------- // Creates a new moment, similar to the vanilla moment(...) constructor, but with // extra features (ambiguous time, enhanced formatting). When given an existing moment, // it will function as a clone (and retain the zone of the moment). Anything else will // result in a moment in the local zone. FC.moment = function() { return makeMoment(arguments); }; // Sames as FC.moment, but forces the resulting moment to be in the UTC timezone. FC.moment.utc = function() { var mom = makeMoment(arguments, true); // Force it into UTC because makeMoment doesn't guarantee it // (if given a pre-existing moment for example) if (mom.hasTime()) { // don't give ambiguously-timed moments a UTC zone mom.utc(); } return mom; }; // Same as FC.moment, but when given an ISO8601 string, the timezone offset is preserved. // ISO8601 strings with no timezone offset will become ambiguously zoned. FC.moment.parseZone = function() { return makeMoment(arguments, true, true); }; // Builds an enhanced moment from args. When given an existing moment, it clones. When given a // native Date, or called with no arguments (the current time), the resulting moment will be local. // Anything else needs to be "parsed" (a string or an array), and will be affected by: // parseAsUTC - if there is no zone information, should we parse the input in UTC? // parseZone - if there is zone information, should we force the zone of the moment? function makeMoment(args, parseAsUTC, parseZone) { var input = args[0]; var isSingleString = args.length == 1 && typeof input === 'string'; var isAmbigTime; var isAmbigZone; var ambigMatch; var mom; if (moment.isMoment(input) || isNativeDate(input) || input === undefined) { mom = moment.apply(null, args); } else { // "parsing" is required isAmbigTime = false; isAmbigZone = false; if (isSingleString) { if (ambigDateOfMonthRegex.test(input)) { // accept strings like '2014-05', but convert to the first of the month input += '-01'; args = [ input ]; // for when we pass it on to moment's constructor isAmbigTime = true; isAmbigZone = true; } else if ((ambigMatch = ambigTimeOrZoneRegex.exec(input))) { isAmbigTime = !ambigMatch[5]; // no time part? isAmbigZone = true; } } else if ($.isArray(input)) { // arrays have no timezone information, so assume ambiguous zone isAmbigZone = true; } // otherwise, probably a string with a format if (parseAsUTC || isAmbigTime) { mom = moment.utc.apply(moment, args); } else { mom = moment.apply(null, args); } if (isAmbigTime) { mom._ambigTime = true; mom._ambigZone = true; // ambiguous time always means ambiguous zone } else if (parseZone) { // let's record the inputted zone somehow if (isAmbigZone) { mom._ambigZone = true; } else if (isSingleString) { mom.utcOffset(input); // if not a valid zone, will assign UTC } } } mom._fullCalendar = true; // flag for extended functionality return mom; } // Week Number // ------------------------------------------------------------------------------------------------- // Returns the week number, considering the locale's custom week number calcuation // `weeks` is an alias for `week` newMomentProto.week = newMomentProto.weeks = function(input) { var weekCalc = this._locale._fullCalendar_weekCalc; if (input == null && typeof weekCalc === 'function') { // custom function only works for getter return weekCalc(this); } else if (weekCalc === 'ISO') { return oldMomentProto.isoWeek.apply(this, arguments); // ISO getter/setter } return oldMomentProto.week.apply(this, arguments); // local getter/setter }; // Time-of-day // ------------------------------------------------------------------------------------------------- // GETTER // Returns a Duration with the hours/minutes/seconds/ms values of the moment. // If the moment has an ambiguous time, a duration of 00:00 will be returned. // // SETTER // You can supply a Duration, a Moment, or a Duration-like argument. // When setting the time, and the moment has an ambiguous time, it then becomes unambiguous. newMomentProto.time = function(time) { // Fallback to the original method (if there is one) if this moment wasn't created via FullCalendar. // `time` is a generic enough method name where this precaution is necessary to avoid collisions w/ other plugins. if (!this._fullCalendar) { return oldMomentProto.time.apply(this, arguments); } if (time == null) { // getter return moment.duration({ hours: this.hours(), minutes: this.minutes(), seconds: this.seconds(), milliseconds: this.milliseconds() }); } else { // setter this._ambigTime = false; // mark that the moment now has a time if (!moment.isDuration(time) && !moment.isMoment(time)) { time = moment.duration(time); } // The day value should cause overflow (so 24 hours becomes 00:00:00 of next day). // Only for Duration times, not Moment times. var dayHours = 0; if (moment.isDuration(time)) { dayHours = Math.floor(time.asDays()) * 24; } // We need to set the individual fields. // Can't use startOf('day') then add duration. In case of DST at start of day. return this.hours(dayHours + time.hours()) .minutes(time.minutes()) .seconds(time.seconds()) .milliseconds(time.milliseconds()); } }; // Converts the moment to UTC, stripping out its time-of-day and timezone offset, // but preserving its YMD. A moment with a stripped time will display no time // nor timezone offset when .format() is called. newMomentProto.stripTime = function() { if (!this._ambigTime) { this.utc(true); // keepLocalTime=true (for keeping *date* value) // set time to zero this.set({ hours: 0, minutes: 0, seconds: 0, ms: 0 }); // Mark the time as ambiguous. This needs to happen after the .utc() call, which might call .utcOffset(), // which clears all ambig flags. this._ambigTime = true; this._ambigZone = true; // if ambiguous time, also ambiguous timezone offset } return this; // for chaining }; // Returns if the moment has a non-ambiguous time (boolean) newMomentProto.hasTime = function() { return !this._ambigTime; }; // Timezone // ------------------------------------------------------------------------------------------------- // Converts the moment to UTC, stripping out its timezone offset, but preserving its // YMD and time-of-day. A moment with a stripped timezone offset will display no // timezone offset when .format() is called. newMomentProto.stripZone = function() { var wasAmbigTime; if (!this._ambigZone) { wasAmbigTime = this._ambigTime; this.utc(true); // keepLocalTime=true (for keeping date and time values) // the above call to .utc()/.utcOffset() unfortunately might clear the ambig flags, so restore this._ambigTime = wasAmbigTime || false; // Mark the zone as ambiguous. This needs to happen after the .utc() call, which might call .utcOffset(), // which clears the ambig flags. this._ambigZone = true; } return this; // for chaining }; // Returns of the moment has a non-ambiguous timezone offset (boolean) newMomentProto.hasZone = function() { return !this._ambigZone; }; // implicitly marks a zone newMomentProto.local = function(keepLocalTime) { // for when converting from ambiguously-zoned to local, // keep the time values when converting from UTC -> local oldMomentProto.local.call(this, this._ambigZone || keepLocalTime); // ensure non-ambiguous // this probably already happened via local() -> utcOffset(), but don't rely on Moment's internals this._ambigTime = false; this._ambigZone = false; return this; // for chaining }; // implicitly marks a zone newMomentProto.utc = function(keepLocalTime) { oldMomentProto.utc.call(this, keepLocalTime); // ensure non-ambiguous // this probably already happened via utc() -> utcOffset(), but don't rely on Moment's internals this._ambigTime = false; this._ambigZone = false; return this; }; // implicitly marks a zone (will probably get called upon .utc() and .local()) newMomentProto.utcOffset = function(tzo) { if (tzo != null) { // setter // these assignments needs to happen before the original zone method is called. // I forget why, something to do with a browser crash. this._ambigTime = false; this._ambigZone = false; } return oldMomentProto.utcOffset.apply(this, arguments); }; // Formatting // ------------------------------------------------------------------------------------------------- newMomentProto.format = function() { if (this._fullCalendar && arguments[0]) { // an enhanced moment? and a format string provided? return formatDate(this, arguments[0]); // our extended formatting } if (this._ambigTime) { return oldMomentFormat(this, 'YYYY-MM-DD'); } if (this._ambigZone) { return oldMomentFormat(this, 'YYYY-MM-DD[T]HH:mm:ss'); } return oldMomentProto.format.apply(this, arguments); }; newMomentProto.toISOString = function() { if (this._ambigTime) { return oldMomentFormat(this, 'YYYY-MM-DD'); } if (this._ambigZone) { return oldMomentFormat(this, 'YYYY-MM-DD[T]HH:mm:ss'); } return oldMomentProto.toISOString.apply(this, arguments); }; ;; // Single Date Formatting // ------------------------------------------------------------------------------------------------- // call this if you want Moment's original format method to be used function oldMomentFormat(mom, formatStr) { return oldMomentProto.format.call(mom, formatStr); // oldMomentProto defined in moment-ext.js } // Formats `date` with a Moment formatting string, but allow our non-zero areas and // additional token. function formatDate(date, formatStr) { return formatDateWithChunks(date, getFormatStringChunks(formatStr)); } function formatDateWithChunks(date, chunks) { var s = ''; var i; for (i=0; i<chunks.length; i++) { s += formatDateWithChunk(date, chunks[i]); } return s; } // addition formatting tokens we want recognized var tokenOverrides = { t: function(date) { // "a" or "p" return oldMomentFormat(date, 'a').charAt(0); }, T: function(date) { // "A" or "P" return oldMomentFormat(date, 'A').charAt(0); } }; function formatDateWithChunk(date, chunk) { var token; var maybeStr; if (typeof chunk === 'string') { // a literal string return chunk; } else if ((token = chunk.token)) { // a token, like "YYYY" if (tokenOverrides[token]) { return tokenOverrides[token](date); // use our custom token } return oldMomentFormat(date, token); } else if (chunk.maybe) { // a grouping of other chunks that must be non-zero maybeStr = formatDateWithChunks(date, chunk.maybe); if (maybeStr.match(/[1-9]/)) { return maybeStr; } } return ''; } // Date Range Formatting // ------------------------------------------------------------------------------------------------- // TODO: make it work with timezone offset // Using a formatting string meant for a single date, generate a range string, like // "Sep 2 - 9 2013", that intelligently inserts a separator where the dates differ. // If the dates are the same as far as the format string is concerned, just return a single // rendering of one date, without any separator. function formatRange(date1, date2, formatStr, separator, isRTL) { var localeData; date1 = FC.moment.parseZone(date1); date2 = FC.moment.parseZone(date2); localeData = date1.localeData(); // Expand localized format strings, like "LL" -> "MMMM D YYYY" formatStr = localeData.longDateFormat(formatStr) || formatStr; // BTW, this is not important for `formatDate` because it is impossible to put custom tokens // or non-zero areas in Moment's localized format strings. separator = separator || ' - '; return formatRangeWithChunks( date1, date2, getFormatStringChunks(formatStr), separator, isRTL ); } FC.formatRange = formatRange; // expose function formatRangeWithChunks(date1, date2, chunks, separator, isRTL) { var unzonedDate1 = date1.clone().stripZone(); // for formatSimilarChunk var unzonedDate2 = date2.clone().stripZone(); // " var chunkStr; // the rendering of the chunk var leftI; var leftStr = ''; var rightI; var rightStr = ''; var middleI; var middleStr1 = ''; var middleStr2 = ''; var middleStr = ''; // Start at the leftmost side of the formatting string and continue until you hit a token // that is not the same between dates. for (leftI=0; leftI<chunks.length; leftI++) { chunkStr = formatSimilarChunk(date1, date2, unzonedDate1, unzonedDate2, chunks[leftI]); if (chunkStr === false) { break; } leftStr += chunkStr; } // Similarly, start at the rightmost side of the formatting string and move left for (rightI=chunks.length-1; rightI>leftI; rightI--) { chunkStr = formatSimilarChunk(date1, date2, unzonedDate1, unzonedDate2, chunks[rightI]); if (chunkStr === false) { break; } rightStr = chunkStr + rightStr; } // The area in the middle is different for both of the dates. // Collect them distinctly so we can jam them together later. for (middleI=leftI; middleI<=rightI; middleI++) { middleStr1 += formatDateWithChunk(date1, chunks[middleI]); middleStr2 += formatDateWithChunk(date2, chunks[middleI]); } if (middleStr1 || middleStr2) { if (isRTL) { middleStr = middleStr2 + separator + middleStr1; } else { middleStr = middleStr1 + separator + middleStr2; } } return leftStr + middleStr + rightStr; } var similarUnitMap = { Y: 'year', M: 'month', D: 'day', // day of month d: 'day', // day of week // prevents a separator between anything time-related... A: 'second', // AM/PM a: 'second', // am/pm T: 'second', // A/P t: 'second', // a/p H: 'second', // hour (24) h: 'second', // hour (12) m: 'second', // minute s: 'second' // second }; // TODO: week maybe? // Given a formatting chunk, and given that both dates are similar in the regard the // formatting chunk is concerned, format date1 against `chunk`. Otherwise, return `false`. function formatSimilarChunk(date1, date2, unzonedDate1, unzonedDate2, chunk) { var token; var unit; if (typeof chunk === 'string') { // a literal string return chunk; } else if ((token = chunk.token)) { unit = similarUnitMap[token.charAt(0)]; // are the dates the same for this unit of measurement? // use the unzoned dates for this calculation because unreliable when near DST (bug #2396) if (unit && unzonedDate1.isSame(unzonedDate2, unit)) { return oldMomentFormat(date1, token); // would be the same if we used `date2` // BTW, don't support custom tokens } } return false; // the chunk is NOT the same for the two dates // BTW, don't support splitting on non-zero areas } // Chunking Utils // ------------------------------------------------------------------------------------------------- var formatStringChunkCache = {}; function getFormatStringChunks(formatStr) { if (formatStr in formatStringChunkCache) { return formatStringChunkCache[formatStr]; } return (formatStringChunkCache[formatStr] = chunkFormatString(formatStr)); } // Break the formatting string into an array of chunks function chunkFormatString(formatStr) { var chunks = []; var chunker = /\[([^\]]*)\]|\(([^\)]*)\)|(LTS|LT|(\w)\4*o?)|([^\w\[\(]+)/g; // TODO: more descrimination var match; while ((match = chunker.exec(formatStr))) { if (match[1]) { // a literal string inside [ ... ] chunks.push(match[1]); } else if (match[2]) { // non-zero formatting inside ( ... ) chunks.push({ maybe: chunkFormatString(match[2]) }); } else if (match[3]) { // a formatting token chunks.push({ token: match[3] }); } else if (match[5]) { // an unenclosed literal string chunks.push(match[5]); } } return chunks; } // Misc Utils // ------------------------------------------------------------------------------------------------- // granularity only goes up until day // TODO: unify with similarUnitMap var tokenGranularities = { Y: { value: 1, unit: 'year' }, M: { value: 2, unit: 'month' }, W: { value: 3, unit: 'week' }, w: { value: 3, unit: 'week' }, D: { value: 4, unit: 'day' }, // day of month d: { value: 4, unit: 'day' } // day of week }; // returns a unit string, either 'year', 'month', 'day', or null // for the most granular formatting token in the string. FC.queryMostGranularFormatUnit = function(formatStr) { var chunks = getFormatStringChunks(formatStr); var i, chunk; var candidate; var best; for (i = 0; i < chunks.length; i++) { chunk = chunks[i]; if (chunk.token) { candidate = tokenGranularities[chunk.token.charAt(0)]; if (candidate) { if (!best || candidate.value > best.value) { best = candidate; } } } } if (best) { return best.unit; } return null; }; ;; FC.Class = Class; // export // Class that all other classes will inherit from function Class() { } // Called on a class to create a subclass. // Last argument contains instance methods. Any argument before the last are considered mixins. Class.extend = function() { var len = arguments.length; var i; var members; for (i = 0; i < len; i++) { members = arguments[i]; if (i < len - 1) { // not the last argument? mixIntoClass(this, members); } } return extendClass(this, members || {}); // members will be undefined if no arguments }; // Adds new member variables/methods to the class's prototype. // Can be called with another class, or a plain object hash containing new members. Class.mixin = function(members) { mixIntoClass(this, members); }; function extendClass(superClass, members) { var subClass; // ensure a constructor for the subclass, forwarding all arguments to the super-constructor if it doesn't exist if (hasOwnProp(members, 'constructor')) { subClass = members.constructor; } if (typeof subClass !== 'function') { subClass = members.constructor = function() { superClass.apply(this, arguments); }; } // build the base prototype for the subclass, which is an new object chained to the superclass's prototype subClass.prototype = createObject(superClass.prototype); // copy each member variable/method onto the the subclass's prototype copyOwnProps(members, subClass.prototype); // copy over all class variables/methods to the subclass, such as `extend` and `mixin` copyOwnProps(superClass, subClass); return subClass; } function mixIntoClass(theClass, members) { copyOwnProps(members, theClass.prototype); } ;; /* Wrap jQuery's Deferred Promise object to be slightly more Promise/A+ compliant. With the added non-standard feature of synchronously executing handlers on resolved promises, which doesn't always happen otherwise (esp with nested .then handlers!?), so, this makes things a lot easier, esp because jQuery 3 changed the synchronicity for Deferred objects. TODO: write tests and more comments */ function Promise(executor) { var deferred = $.Deferred(); var promise = deferred.promise(); if (typeof executor === 'function') { executor( function(value) { // resolve if (Promise.immediate) { promise._value = value; } deferred.resolve(value); }, function() { // reject deferred.reject(); } ); } if (Promise.immediate) { var origThen = promise.then; promise.then = function(onFulfilled, onRejected) { var state = promise.state(); if (state === 'resolved') { if (typeof onFulfilled === 'function') { return Promise.resolve(onFulfilled(promise._value)); } } else if (state === 'rejected') { if (typeof onRejected === 'function') { onRejected(); return promise; // already rejected } } return origThen.call(promise, onFulfilled, onRejected); }; } return promise; // instanceof Promise will break :( TODO: make Promise a real class } FC.Promise = Promise; Promise.immediate = true; Promise.resolve = function(value) { if (value && typeof value.resolve === 'function') { return value.promise(); } if (value && typeof value.then === 'function') { return value; } else { var deferred = $.Deferred().resolve(value); var promise = deferred.promise(); if (Promise.immediate) { var origThen = promise.then; promise._value = value; promise.then = function(onFulfilled, onRejected) { if (typeof onFulfilled === 'function') { return Promise.resolve(onFulfilled(value)); } return origThen.call(promise, onFulfilled, onRejected); }; } return promise; } }; Promise.reject = function() { return $.Deferred().reject().promise(); }; Promise.all = function(inputs) { var hasAllValues = false; var values; var i, input; if (Promise.immediate) { hasAllValues = true; values = []; for (i = 0; i < inputs.length; i++) { input = inputs[i]; if (input && typeof input.state === 'function' && input.state() === 'resolved' && ('_value' in input)) { values.push(input._value); } else if (input && typeof input.then === 'function') { hasAllValues = false; break; } else { values.push(input); } } } if (hasAllValues) { return Promise.resolve(values); } else { return $.when.apply($.when, inputs).then(function() { return $.when($.makeArray(arguments)); }); } }; ;; // TODO: write tests and clean up code function TaskQueue(debounceWait) { var q = []; // array of runFuncs function addTask(taskFunc) { return new Promise(function(resolve) { // should run this function when it's taskFunc's turn to run. // responsible for popping itself off the queue. var runFunc = function() { Promise.resolve(taskFunc()) // result might be async, coerce to promise .then(resolve) // resolve TaskQueue::push's promise, for the caller. will receive result of taskFunc. .then(function() { q.shift(); // pop itself off // run the next task, if any if (q.length) { q[0](); } }); }; // always put the task at the end of the queue, BEFORE running the task q.push(runFunc); // if it's the only task in the queue, run immediately if (q.length === 1) { runFunc(); } }); } this.add = // potentially debounce, for the public method typeof debounceWait === 'number' ? debounce(addTask, debounceWait) : addTask; // if not a number (null/undefined/false), no debounce at all this.addQuickly = addTask; // guaranteed no debounce } FC.TaskQueue = TaskQueue; /* q = new TaskQueue(); function work(i) { return q.push(function() { trigger(); console.log('work' + i); }); } var cnt = 0; function trigger() { if (cnt < 5) { cnt++; work(cnt); } } work(9); */ ;; var EmitterMixin = FC.EmitterMixin = { // jQuery-ification via $(this) allows a non-DOM object to have // the same event handling capabilities (including namespaces). on: function(types, handler) { $(this).on(types, this._prepareIntercept(handler)); return this; // for chaining }, one: function(types, handler) { $(this).one(types, this._prepareIntercept(handler)); return this; // for chaining }, _prepareIntercept: function(handler) { // handlers are always called with an "event" object as their first param. // sneak the `this` context and arguments into the extra parameter object // and forward them on to the original handler. var intercept = function(ev, extra) { return handler.apply( extra.context || this, extra.args || [] ); }; // mimick jQuery's internal "proxy" system (risky, I know) // causing all functions with the same .guid to appear to be the same. // https://github.com/jquery/jquery/blob/2.2.4/src/core.js#L448 // this is needed for calling .off with the original non-intercept handler. if (!handler.guid) { handler.guid = $.guid++; } intercept.guid = handler.guid; return intercept; }, off: function(types, handler) { $(this).off(types, handler); return this; // for chaining }, trigger: function(types) { var args = Array.prototype.slice.call(arguments, 1); // arguments after the first // pass in "extra" info to the intercept $(this).triggerHandler(types, { args: args }); return this; // for chaining }, triggerWith: function(types, context, args) { // `triggerHandler` is less reliant on the DOM compared to `trigger`. // pass in "extra" info to the intercept. $(this).triggerHandler(types, { context: context, args: args }); return this; // for chaining } }; ;; /* Utility methods for easily listening to events on another object, and more importantly, easily unlistening from them. */ var ListenerMixin = FC.ListenerMixin = (function() { var guid = 0; var ListenerMixin = { listenerId: null, /* Given an `other` object that has on/off methods, bind the given `callback` to an event by the given name. The `callback` will be called with the `this` context of the object that .listenTo is being called on. Can be called: .listenTo(other, eventName, callback) OR .listenTo(other, { eventName1: callback1, eventName2: callback2 }) */ listenTo: function(other, arg, callback) { if (typeof arg === 'object') { // given dictionary of callbacks for (var eventName in arg) { if (arg.hasOwnProperty(eventName)) { this.listenTo(other, eventName, arg[eventName]); } } } else if (typeof arg === 'string') { other.on( arg + '.' + this.getListenerNamespace(), // use event namespacing to identify this object $.proxy(callback, this) // always use `this` context // the usually-undesired jQuery guid behavior doesn't matter, // because we always unbind via namespace ); } }, /* Causes the current object to stop listening to events on the `other` object. `eventName` is optional. If omitted, will stop listening to ALL events on `other`. */ stopListeningTo: function(other, eventName) { other.off((eventName || '') + '.' + this.getListenerNamespace()); }, /* Returns a string, unique to this object, to be used for event namespacing */ getListenerNamespace: function() { if (this.listenerId == null) { this.listenerId = guid++; } return '_listener' + this.listenerId; } }; return ListenerMixin; })(); ;; // simple class for toggle a `isIgnoringMouse` flag on delay // initMouseIgnoring must first be called, with a millisecond delay setting. var MouseIgnorerMixin = { isIgnoringMouse: false, // bool delayUnignoreMouse: null, // method initMouseIgnoring: function(delay) { this.delayUnignoreMouse = debounce(proxy(this, 'unignoreMouse'), delay || 1000); }, // temporarily ignore mouse actions on segments tempIgnoreMouse: function() { this.isIgnoringMouse = true; this.delayUnignoreMouse(); }, // delayUnignoreMouse eventually calls this unignoreMouse: function() { this.isIgnoringMouse = false; } }; ;; /* A rectangular panel that is absolutely positioned over other content ------------------------------------------------------------------------------------------------------------------------ Options: - className (string) - content (HTML string or jQuery element set) - parentEl - top - left - right (the x coord of where the right edge should be. not a "CSS" right) - autoHide (boolean) - show (callback) - hide (callback) */ var Popover = Class.extend(ListenerMixin, { isHidden: true, options: null, el: null, // the container element for the popover. generated by this object margin: 10, // the space required between the popover and the edges of the scroll container constructor: function(options) { this.options = options || {}; }, // Shows the popover on the specified position. Renders it if not already show: function() { if (this.isHidden) { if (!this.el) { this.render(); } this.el.show(); this.position(); this.isHidden = false; this.trigger('show'); } }, // Hides the popover, through CSS, but does not remove it from the DOM hide: function() { if (!this.isHidden) { this.el.hide(); this.isHidden = true; this.trigger('hide'); } }, // Creates `this.el` and renders content inside of it render: function() { var _this = this; var options = this.options; this.el = $('<div class="fc-popover"/>') .addClass(options.className || '') .css({ // position initially to the top left to avoid creating scrollbars top: 0, left: 0 }) .append(options.content) .appendTo(options.parentEl); // when a click happens on anything inside with a 'fc-close' className, hide the popover this.el.on('click', '.fc-close', function() { _this.hide(); }); if (options.autoHide) { this.listenTo($(document), 'mousedown', this.documentMousedown); } }, // Triggered when the user clicks *anywhere* in the document, for the autoHide feature documentMousedown: function(ev) { // only hide the popover if the click happened outside the popover if (this.el && !$(ev.target).closest(this.el).length) { this.hide(); } }, // Hides and unregisters any handlers removeElement: function() { this.hide(); if (this.el) { this.el.remove(); this.el = null; } this.stopListeningTo($(document), 'mousedown'); }, // Positions the popover optimally, using the top/left/right options position: function() { var options = this.options; var origin = this.el.offsetParent().offset(); var width = this.el.outerWidth(); var height = this.el.outerHeight(); var windowEl = $(window); var viewportEl = getScrollParent(this.el); var viewportTop; var viewportLeft; var viewportOffset; var top; // the "position" (not "offset") values for the popover var left; // // compute top and left top = options.top || 0; if (options.left !== undefined) { left = options.left; } else if (options.right !== undefined) { left = options.right - width; // derive the left value from the right value } else { left = 0; } if (viewportEl.is(window) || viewportEl.is(document)) { // normalize getScrollParent's result viewportEl = windowEl; viewportTop = 0; // the window is always at the top left viewportLeft = 0; // (and .offset() won't work if called here) } else { viewportOffset = viewportEl.offset(); viewportTop = viewportOffset.top; viewportLeft = viewportOffset.left; } // if the window is scrolled, it causes the visible area to be further down viewportTop += windowEl.scrollTop(); viewportLeft += windowEl.scrollLeft(); // constrain to the view port. if constrained by two edges, give precedence to top/left if (options.viewportConstrain !== false) { top = Math.min(top, viewportTop + viewportEl.outerHeight() - height - this.margin); top = Math.max(top, viewportTop + this.margin); left = Math.min(left, viewportLeft + viewportEl.outerWidth() - width - this.margin); left = Math.max(left, viewportLeft + this.margin); } this.el.css({ top: top - origin.top, left: left - origin.left }); }, // Triggers a callback. Calls a function in the option hash of the same name. // Arguments beyond the first `name` are forwarded on. // TODO: better code reuse for this. Repeat code trigger: function(name) { if (this.options[name]) { this.options[name].apply(this, Array.prototype.slice.call(arguments, 1)); } } }); ;; /* A cache for the left/right/top/bottom/width/height values for one or more elements. Works with both offset (from topleft document) and position (from offsetParent). options: - els - isHorizontal - isVertical */ var CoordCache = FC.CoordCache = Class.extend({ els: null, // jQuery set (assumed to be siblings) forcedOffsetParentEl: null, // options can override the natural offsetParent origin: null, // {left,top} position of offsetParent of els boundingRect: null, // constrain cordinates to this rectangle. {left,right,top,bottom} or null isHorizontal: false, // whether to query for left/right/width isVertical: false, // whether to query for top/bottom/height // arrays of coordinates (offsets from topleft of document) lefts: null, rights: null, tops: null, bottoms: null, constructor: function(options) { this.els = $(options.els); this.isHorizontal = options.isHorizontal; this.isVertical = options.isVertical; this.forcedOffsetParentEl = options.offsetParent ? $(options.offsetParent) : null; }, // Queries the els for coordinates and stores them. // Call this method before using and of the get* methods below. build: function() { var offsetParentEl = this.forcedOffsetParentEl; if (!offsetParentEl && this.els.length > 0) { offsetParentEl = this.els.eq(0).offsetParent(); } this.origin = offsetParentEl ? offsetParentEl.offset() : null; this.boundingRect = this.queryBoundingRect(); if (this.isHorizontal) { this.buildElHorizontals(); } if (this.isVertical) { this.buildElVerticals(); } }, // Destroys all internal data about coordinates, freeing memory clear: function() { this.origin = null; this.boundingRect = null; this.lefts = null; this.rights = null; this.tops = null; this.bottoms = null; }, // When called, if coord caches aren't built, builds them ensureBuilt: function() { if (!this.origin) { this.build(); } }, // Populates the left/right internal coordinate arrays buildElHorizontals: function() { var lefts = []; var rights = []; this.els.each(function(i, node) { var el = $(node); var left = el.offset().left; var width = el.outerWidth(); lefts.push(left); rights.push(left + width); }); this.lefts = lefts; this.rights = rights; }, // Populates the top/bottom internal coordinate arrays buildElVerticals: function() { var tops = []; var bottoms = []; this.els.each(function(i, node) { var el = $(node); var top = el.offset().top; var height = el.outerHeight(); tops.push(top); bottoms.push(top + height); }); this.tops = tops; this.bottoms = bottoms; }, // Given a left offset (from document left), returns the index of the el that it horizontally intersects. // If no intersection is made, returns undefined. getHorizontalIndex: function(leftOffset) { this.ensureBuilt(); var lefts = this.lefts; var rights = this.rights; var len = lefts.length; var i; for (i = 0; i < len; i++) { if (leftOffset >= lefts[i] && leftOffset < rights[i]) { return i; } } }, // Given a top offset (from document top), returns the index of the el that it vertically intersects. // If no intersection is made, returns undefined. getVerticalIndex: function(topOffset) { this.ensureBuilt(); var tops = this.tops; var bottoms = this.bottoms; var len = tops.length; var i; for (i = 0; i < len; i++) { if (topOffset >= tops[i] && topOffset < bottoms[i]) { return i; } } }, // Gets the left offset (from document left) of the element at the given index getLeftOffset: function(leftIndex) { this.ensureBuilt(); return this.lefts[leftIndex]; }, // Gets the left position (from offsetParent left) of the element at the given index getLeftPosition: function(leftIndex) { this.ensureBuilt(); return this.lefts[leftIndex] - this.origin.left; }, // Gets the right offset (from document left) of the element at the given index. // This value is NOT relative to the document's right edge, like the CSS concept of "right" would be. getRightOffset: function(leftIndex) { this.ensureBuilt(); return this.rights[leftIndex]; }, // Gets the right position (from offsetParent left) of the element at the given index. // This value is NOT relative to the offsetParent's right edge, like the CSS concept of "right" would be. getRightPosition: function(leftIndex) { this.ensureBuilt(); return this.rights[leftIndex] - this.origin.left; }, // Gets the width of the element at the given index getWidth: function(leftIndex) { this.ensureBuilt(); return this.rights[leftIndex] - this.lefts[leftIndex]; }, // Gets the top offset (from document top) of the element at the given index getTopOffset: function(topIndex) { this.ensureBuilt(); return this.tops[topIndex]; }, // Gets the top position (from offsetParent top) of the element at the given position getTopPosition: function(topIndex) { this.ensureBuilt(); return this.tops[topIndex] - this.origin.top; }, // Gets the bottom offset (from the document top) of the element at the given index. // This value is NOT relative to the offsetParent's bottom edge, like the CSS concept of "bottom" would be. getBottomOffset: function(topIndex) { this.ensureBuilt(); return this.bottoms[topIndex]; }, // Gets the bottom position (from the offsetParent top) of the element at the given index. // This value is NOT relative to the offsetParent's bottom edge, like the CSS concept of "bottom" would be. getBottomPosition: function(topIndex) { this.ensureBuilt(); return this.bottoms[topIndex] - this.origin.top; }, // Gets the height of the element at the given index getHeight: function(topIndex) { this.ensureBuilt(); return this.bottoms[topIndex] - this.tops[topIndex]; }, // Bounding Rect // TODO: decouple this from CoordCache // Compute and return what the elements' bounding rectangle is, from the user's perspective. // Right now, only returns a rectangle if constrained by an overflow:scroll element. // Returns null if there are no elements queryBoundingRect: function() { var scrollParentEl; if (this.els.length > 0) { scrollParentEl = getScrollParent(this.els.eq(0)); if (!scrollParentEl.is(document)) { return getClientRect(scrollParentEl); } } return null; }, isPointInBounds: function(leftOffset, topOffset) { return this.isLeftInBounds(leftOffset) && this.isTopInBounds(topOffset); }, isLeftInBounds: function(leftOffset) { return !this.boundingRect || (leftOffset >= this.boundingRect.left && leftOffset < this.boundingRect.right); }, isTopInBounds: function(topOffset) { return !this.boundingRect || (topOffset >= this.boundingRect.top && topOffset < this.boundingRect.bottom); } }); ;; /* Tracks a drag's mouse movement, firing various handlers ----------------------------------------------------------------------------------------------------------------------*/ // TODO: use Emitter var DragListener = FC.DragListener = Class.extend(ListenerMixin, MouseIgnorerMixin, { options: null, subjectEl: null, // coordinates of the initial mousedown originX: null, originY: null, // the wrapping element that scrolls, or MIGHT scroll if there's overflow. // TODO: do this for wrappers that have overflow:hidden as well. scrollEl: null, isInteracting: false, isDistanceSurpassed: false, isDelayEnded: false, isDragging: false, isTouch: false, delay: null, delayTimeoutId: null, minDistance: null, handleTouchScrollProxy: null, // calls handleTouchScroll, always bound to `this` constructor: function(options) { this.options = options || {}; this.handleTouchScrollProxy = proxy(this, 'handleTouchScroll'); this.initMouseIgnoring(500); }, // Interaction (high-level) // ----------------------------------------------------------------------------------------------------------------- startInteraction: function(ev, extraOptions) { var isTouch = getEvIsTouch(ev); if (ev.type === 'mousedown') { if (this.isIgnoringMouse) { return; } else if (!isPrimaryMouseButton(ev)) { return; } else { ev.preventDefault(); // prevents native selection in most browsers } } if (!this.isInteracting) { // process options extraOptions = extraOptions || {}; this.delay = firstDefined(extraOptions.delay, this.options.delay, 0); this.minDistance = firstDefined(extraOptions.distance, this.options.distance, 0); this.subjectEl = this.options.subjectEl; this.isInteracting = true; this.isTouch = isTouch; this.isDelayEnded = false; this.isDistanceSurpassed = false; this.originX = getEvX(ev); this.originY = getEvY(ev); this.scrollEl = getScrollParent($(ev.target)); this.bindHandlers(); this.initAutoScroll(); this.handleInteractionStart(ev); this.startDelay(ev); if (!this.minDistance) { this.handleDistanceSurpassed(ev); } } }, handleInteractionStart: function(ev) { this.trigger('interactionStart', ev); }, endInteraction: function(ev, isCancelled) { if (this.isInteracting) { this.endDrag(ev); if (this.delayTimeoutId) { clearTimeout(this.delayTimeoutId); this.delayTimeoutId = null; } this.destroyAutoScroll(); this.unbindHandlers(); this.isInteracting = false; this.handleInteractionEnd(ev, isCancelled); // a touchstart+touchend on the same element will result in the following addition simulated events: // mouseover + mouseout + click // let's ignore these bogus events if (this.isTouch) { this.tempIgnoreMouse(); } } }, handleInteractionEnd: function(ev, isCancelled) { this.trigger('interactionEnd', ev, isCancelled || false); }, // Binding To DOM // ----------------------------------------------------------------------------------------------------------------- bindHandlers: function() { var _this = this; var touchStartIgnores = 1; if (this.isTouch) { this.listenTo($(document), { touchmove: this.handleTouchMove, touchend: this.endInteraction, touchcancel: this.endInteraction, // Sometimes touchend doesn't fire // (can't figure out why. touchcancel doesn't fire either. has to do with scrolling?) // If another touchstart happens, we know it's bogus, so cancel the drag. // touchend will continue to be broken until user does a shorttap/scroll, but this is best we can do. touchstart: function(ev) { if (touchStartIgnores) { // bindHandlers is called from within a touchstart, touchStartIgnores--; // and we don't want this to fire immediately, so ignore. } else { _this.endInteraction(ev, true); // isCancelled=true } } }); // listen to ALL scroll actions on the page if ( !bindAnyScroll(this.handleTouchScrollProxy) && // hopefully this works and short-circuits the rest this.scrollEl // otherwise, attach a single handler to this ) { this.listenTo(this.scrollEl, 'scroll', this.handleTouchScroll); } } else { this.listenTo($(document), { mousemove: this.handleMouseMove, mouseup: this.endInteraction }); } this.listenTo($(document), { selectstart: preventDefault, // don't allow selection while dragging contextmenu: preventDefault // long taps would open menu on Chrome dev tools }); }, unbindHandlers: function() { this.stopListeningTo($(document)); // unbind scroll listening unbindAnyScroll(this.handleTouchScrollProxy); if (this.scrollEl) { this.stopListeningTo(this.scrollEl, 'scroll'); } }, // Drag (high-level) // ----------------------------------------------------------------------------------------------------------------- // extraOptions ignored if drag already started startDrag: function(ev, extraOptions) { this.startInteraction(ev, extraOptions); // ensure interaction began if (!this.isDragging) { this.isDragging = true; this.handleDragStart(ev); } }, handleDragStart: function(ev) { this.trigger('dragStart', ev); }, handleMove: function(ev) { var dx = getEvX(ev) - this.originX; var dy = getEvY(ev) - this.originY; var minDistance = this.minDistance; var distanceSq; // current distance from the origin, squared if (!this.isDistanceSurpassed) { distanceSq = dx * dx + dy * dy; if (distanceSq >= minDistance * minDistance) { // use pythagorean theorem this.handleDistanceSurpassed(ev); } } if (this.isDragging) { this.handleDrag(dx, dy, ev); } }, // Called while the mouse is being moved and when we know a legitimate drag is taking place handleDrag: function(dx, dy, ev) { this.trigger('drag', dx, dy, ev); this.updateAutoScroll(ev); // will possibly cause scrolling }, endDrag: function(ev) { if (this.isDragging) { this.isDragging = false; this.handleDragEnd(ev); } }, handleDragEnd: function(ev) { this.trigger('dragEnd', ev); }, // Delay // ----------------------------------------------------------------------------------------------------------------- startDelay: function(initialEv) { var _this = this; if (this.delay) { this.delayTimeoutId = setTimeout(function() { _this.handleDelayEnd(initialEv); }, this.delay); } else { this.handleDelayEnd(initialEv); } }, handleDelayEnd: function(initialEv) { this.isDelayEnded = true; if (this.isDistanceSurpassed) { this.startDrag(initialEv); } }, // Distance // ----------------------------------------------------------------------------------------------------------------- handleDistanceSurpassed: function(ev) { this.isDistanceSurpassed = true; if (this.isDelayEnded) { this.startDrag(ev); } }, // Mouse / Touch // ----------------------------------------------------------------------------------------------------------------- handleTouchMove: function(ev) { // prevent inertia and touchmove-scrolling while dragging if (this.isDragging) { ev.preventDefault(); } this.handleMove(ev); }, handleMouseMove: function(ev) { this.handleMove(ev); }, // Scrolling (unrelated to auto-scroll) // ----------------------------------------------------------------------------------------------------------------- handleTouchScroll: function(ev) { // if the drag is being initiated by touch, but a scroll happens before // the drag-initiating delay is over, cancel the drag if (!this.isDragging) { this.endInteraction(ev, true); // isCancelled=true } }, // Utils // ----------------------------------------------------------------------------------------------------------------- // Triggers a callback. Calls a function in the option hash of the same name. // Arguments beyond the first `name` are forwarded on. trigger: function(name) { if (this.options[name]) { this.options[name].apply(this, Array.prototype.slice.call(arguments, 1)); } // makes _methods callable by event name. TODO: kill this if (this['_' + name]) { this['_' + name].apply(this, Array.prototype.slice.call(arguments, 1)); } } }); ;; /* this.scrollEl is set in DragListener */ DragListener.mixin({ isAutoScroll: false, scrollBounds: null, // { top, bottom, left, right } scrollTopVel: null, // pixels per second scrollLeftVel: null, // pixels per second scrollIntervalId: null, // ID of setTimeout for scrolling animation loop // defaults scrollSensitivity: 30, // pixels from edge for scrolling to start scrollSpeed: 200, // pixels per second, at maximum speed scrollIntervalMs: 50, // millisecond wait between scroll increment initAutoScroll: function() { var scrollEl = this.scrollEl; this.isAutoScroll = this.options.scroll && scrollEl && !scrollEl.is(window) && !scrollEl.is(document); if (this.isAutoScroll) { // debounce makes sure rapid calls don't happen this.listenTo(scrollEl, 'scroll', debounce(this.handleDebouncedScroll, 100)); } }, destroyAutoScroll: function() { this.endAutoScroll(); // kill any animation loop // remove the scroll handler if there is a scrollEl if (this.isAutoScroll) { this.stopListeningTo(this.scrollEl, 'scroll'); // will probably get removed by unbindHandlers too :( } }, // Computes and stores the bounding rectangle of scrollEl computeScrollBounds: function() { if (this.isAutoScroll) { this.scrollBounds = getOuterRect(this.scrollEl); // TODO: use getClientRect in future. but prevents auto scrolling when on top of scrollbars } }, // Called when the dragging is in progress and scrolling should be updated updateAutoScroll: function(ev) { var sensitivity = this.scrollSensitivity; var bounds = this.scrollBounds; var topCloseness, bottomCloseness; var leftCloseness, rightCloseness; var topVel = 0; var leftVel = 0; if (bounds) { // only scroll if scrollEl exists // compute closeness to edges. valid range is from 0.0 - 1.0 topCloseness = (sensitivity - (getEvY(ev) - bounds.top)) / sensitivity; bottomCloseness = (sensitivity - (bounds.bottom - getEvY(ev))) / sensitivity; leftCloseness = (sensitivity - (getEvX(ev) - bounds.left)) / sensitivity; rightCloseness = (sensitivity - (bounds.right - getEvX(ev))) / sensitivity; // translate vertical closeness into velocity. // mouse must be completely in bounds for velocity to happen. if (topCloseness >= 0 && topCloseness <= 1) { topVel = topCloseness * this.scrollSpeed * -1; // negative. for scrolling up } else if (bottomCloseness >= 0 && bottomCloseness <= 1) { topVel = bottomCloseness * this.scrollSpeed; } // translate horizontal closeness into velocity if (leftCloseness >= 0 && leftCloseness <= 1) { leftVel = leftCloseness * this.scrollSpeed * -1; // negative. for scrolling left } else if (rightCloseness >= 0 && rightCloseness <= 1) { leftVel = rightCloseness * this.scrollSpeed; } } this.setScrollVel(topVel, leftVel); }, // Sets the speed-of-scrolling for the scrollEl setScrollVel: function(topVel, leftVel) { this.scrollTopVel = topVel; this.scrollLeftVel = leftVel; this.constrainScrollVel(); // massages into realistic values // if there is non-zero velocity, and an animation loop hasn't already started, then START if ((this.scrollTopVel || this.scrollLeftVel) && !this.scrollIntervalId) { this.scrollIntervalId = setInterval( proxy(this, 'scrollIntervalFunc'), // scope to `this` this.scrollIntervalMs ); } }, // Forces scrollTopVel and scrollLeftVel to be zero if scrolling has already gone all the way constrainScrollVel: function() { var el = this.scrollEl; if (this.scrollTopVel < 0) { // scrolling up? if (el.scrollTop() <= 0) { // already scrolled all the way up? this.scrollTopVel = 0; } } else if (this.scrollTopVel > 0) { // scrolling down? if (el.scrollTop() + el[0].clientHeight >= el[0].scrollHeight) { // already scrolled all the way down? this.scrollTopVel = 0; } } if (this.scrollLeftVel < 0) { // scrolling left? if (el.scrollLeft() <= 0) { // already scrolled all the left? this.scrollLeftVel = 0; } } else if (this.scrollLeftVel > 0) { // scrolling right? if (el.scrollLeft() + el[0].clientWidth >= el[0].scrollWidth) { // already scrolled all the way right? this.scrollLeftVel = 0; } } }, // This function gets called during every iteration of the scrolling animation loop scrollIntervalFunc: function() { var el = this.scrollEl; var frac = this.scrollIntervalMs / 1000; // considering animation frequency, what the vel should be mult'd by // change the value of scrollEl's scroll if (this.scrollTopVel) { el.scrollTop(el.scrollTop() + this.scrollTopVel * frac); } if (this.scrollLeftVel) { el.scrollLeft(el.scrollLeft() + this.scrollLeftVel * frac); } this.constrainScrollVel(); // since the scroll values changed, recompute the velocities // if scrolled all the way, which causes the vels to be zero, stop the animation loop if (!this.scrollTopVel && !this.scrollLeftVel) { this.endAutoScroll(); } }, // Kills any existing scrolling animation loop endAutoScroll: function() { if (this.scrollIntervalId) { clearInterval(this.scrollIntervalId); this.scrollIntervalId = null; this.handleScrollEnd(); } }, // Get called when the scrollEl is scrolled (NOTE: this is delayed via debounce) handleDebouncedScroll: function() { // recompute all coordinates, but *only* if this is *not* part of our scrolling animation if (!this.scrollIntervalId) { this.handleScrollEnd(); } }, // Called when scrolling has stopped, whether through auto scroll, or the user scrolling handleScrollEnd: function() { } }); ;; /* Tracks mouse movements over a component and raises events about which hit the mouse is over. ------------------------------------------------------------------------------------------------------------------------ options: - subjectEl - subjectCenter */ var HitDragListener = DragListener.extend({ component: null, // converts coordinates to hits // methods: prepareHits, releaseHits, queryHit origHit: null, // the hit the mouse was over when listening started hit: null, // the hit the mouse is over coordAdjust: null, // delta that will be added to the mouse coordinates when computing collisions constructor: function(component, options) { DragListener.call(this, options); // call the super-constructor this.component = component; }, // Called when drag listening starts (but a real drag has not necessarily began). // ev might be undefined if dragging was started manually. handleInteractionStart: function(ev) { var subjectEl = this.subjectEl; var subjectRect; var origPoint; var point; this.computeCoords(); if (ev) { origPoint = { left: getEvX(ev), top: getEvY(ev) }; point = origPoint; // constrain the point to bounds of the element being dragged if (subjectEl) { subjectRect = getOuterRect(subjectEl); // used for centering as well point = constrainPoint(point, subjectRect); } this.origHit = this.queryHit(point.left, point.top); // treat the center of the subject as the collision point? if (subjectEl && this.options.subjectCenter) { // only consider the area the subject overlaps the hit. best for large subjects. // TODO: skip this if hit didn't supply left/right/top/bottom if (this.origHit) { subjectRect = intersectRects(this.origHit, subjectRect) || subjectRect; // in case there is no intersection } point = getRectCenter(subjectRect); } this.coordAdjust = diffPoints(point, origPoint); // point - origPoint } else { this.origHit = null; this.coordAdjust = null; } // call the super-method. do it after origHit has been computed DragListener.prototype.handleInteractionStart.apply(this, arguments); }, // Recomputes the drag-critical positions of elements computeCoords: function() { this.component.prepareHits(); this.computeScrollBounds(); // why is this here?????? }, // Called when the actual drag has started handleDragStart: function(ev) { var hit; DragListener.prototype.handleDragStart.apply(this, arguments); // call the super-method // might be different from this.origHit if the min-distance is large hit = this.queryHit(getEvX(ev), getEvY(ev)); // report the initial hit the mouse is over // especially important if no min-distance and drag starts immediately if (hit) { this.handleHitOver(hit); } }, // Called when the drag moves handleDrag: function(dx, dy, ev) { var hit; DragListener.prototype.handleDrag.apply(this, arguments); // call the super-method hit = this.queryHit(getEvX(ev), getEvY(ev)); if (!isHitsEqual(hit, this.hit)) { // a different hit than before? if (this.hit) { this.handleHitOut(); } if (hit) { this.handleHitOver(hit); } } }, // Called when dragging has been stopped handleDragEnd: function() { this.handleHitDone(); DragListener.prototype.handleDragEnd.apply(this, arguments); // call the super-method }, // Called when a the mouse has just moved over a new hit handleHitOver: function(hit) { var isOrig = isHitsEqual(hit, this.origHit); this.hit = hit; this.trigger('hitOver', this.hit, isOrig, this.origHit); }, // Called when the mouse has just moved out of a hit handleHitOut: function() { if (this.hit) { this.trigger('hitOut', this.hit); this.handleHitDone(); this.hit = null; } }, // Called after a hitOut. Also called before a dragStop handleHitDone: function() { if (this.hit) { this.trigger('hitDone', this.hit); } }, // Called when the interaction ends, whether there was a real drag or not handleInteractionEnd: function() { DragListener.prototype.handleInteractionEnd.apply(this, arguments); // call the super-method this.origHit = null; this.hit = null; this.component.releaseHits(); }, // Called when scrolling has stopped, whether through auto scroll, or the user scrolling handleScrollEnd: function() { DragListener.prototype.handleScrollEnd.apply(this, arguments); // call the super-method this.computeCoords(); // hits' absolute positions will be in new places. recompute }, // Gets the hit underneath the coordinates for the given mouse event queryHit: function(left, top) { if (this.coordAdjust) { left += this.coordAdjust.left; top += this.coordAdjust.top; } return this.component.queryHit(left, top); } }); // Returns `true` if the hits are identically equal. `false` otherwise. Must be from the same component. // Two null values will be considered equal, as two "out of the component" states are the same. function isHitsEqual(hit0, hit1) { if (!hit0 && !hit1) { return true; } if (hit0 && hit1) { return hit0.component === hit1.component && isHitPropsWithin(hit0, hit1) && isHitPropsWithin(hit1, hit0); // ensures all props are identical } return false; } // Returns true if all of subHit's non-standard properties are within superHit function isHitPropsWithin(subHit, superHit) { for (var propName in subHit) { if (!/^(component|left|right|top|bottom)$/.test(propName)) { if (subHit[propName] !== superHit[propName]) { return false; } } } return true; } ;; /* Creates a clone of an element and lets it track the mouse as it moves ----------------------------------------------------------------------------------------------------------------------*/ var MouseFollower = Class.extend(ListenerMixin, { options: null, sourceEl: null, // the element that will be cloned and made to look like it is dragging el: null, // the clone of `sourceEl` that will track the mouse parentEl: null, // the element that `el` (the clone) will be attached to // the initial position of el, relative to the offset parent. made to match the initial offset of sourceEl top0: null, left0: null, // the absolute coordinates of the initiating touch/mouse action y0: null, x0: null, // the number of pixels the mouse has moved from its initial position topDelta: null, leftDelta: null, isFollowing: false, isHidden: false, isAnimating: false, // doing the revert animation? constructor: function(sourceEl, options) { this.options = options = options || {}; this.sourceEl = sourceEl; this.parentEl = options.parentEl ? $(options.parentEl) : sourceEl.parent(); // default to sourceEl's parent }, // Causes the element to start following the mouse start: function(ev) { if (!this.isFollowing) { this.isFollowing = true; this.y0 = getEvY(ev); this.x0 = getEvX(ev); this.topDelta = 0; this.leftDelta = 0; if (!this.isHidden) { this.updatePosition(); } if (getEvIsTouch(ev)) { this.listenTo($(document), 'touchmove', this.handleMove); } else { this.listenTo($(document), 'mousemove', this.handleMove); } } }, // Causes the element to stop following the mouse. If shouldRevert is true, will animate back to original position. // `callback` gets invoked when the animation is complete. If no animation, it is invoked immediately. stop: function(shouldRevert, callback) { var _this = this; var revertDuration = this.options.revertDuration; function complete() { // might be called by .animate(), which might change `this` context _this.isAnimating = false; _this.removeElement(); _this.top0 = _this.left0 = null; // reset state for future updatePosition calls if (callback) { callback(); } } if (this.isFollowing && !this.isAnimating) { // disallow more than one stop animation at a time this.isFollowing = false; this.stopListeningTo($(document)); if (shouldRevert && revertDuration && !this.isHidden) { // do a revert animation? this.isAnimating = true; this.el.animate({ top: this.top0, left: this.left0 }, { duration: revertDuration, complete: complete }); } else { complete(); } } }, // Gets the tracking element. Create it if necessary getEl: function() { var el = this.el; if (!el) { el = this.el = this.sourceEl.clone() .addClass(this.options.additionalClass || '') .css({ position: 'absolute', visibility: '', // in case original element was hidden (commonly through hideEvents()) display: this.isHidden ? 'none' : '', // for when initially hidden margin: 0, right: 'auto', // erase and set width instead bottom: 'auto', // erase and set height instead width: this.sourceEl.width(), // explicit height in case there was a 'right' value height: this.sourceEl.height(), // explicit width in case there was a 'bottom' value opacity: this.options.opacity || '', zIndex: this.options.zIndex }); // we don't want long taps or any mouse interaction causing selection/menus. // would use preventSelection(), but that prevents selectstart, causing problems. el.addClass('fc-unselectable'); el.appendTo(this.parentEl); } return el; }, // Removes the tracking element if it has already been created removeElement: function() { if (this.el) { this.el.remove(); this.el = null; } }, // Update the CSS position of the tracking element updatePosition: function() { var sourceOffset; var origin; this.getEl(); // ensure this.el // make sure origin info was computed if (this.top0 === null) { sourceOffset = this.sourceEl.offset(); origin = this.el.offsetParent().offset(); this.top0 = sourceOffset.top - origin.top; this.left0 = sourceOffset.left - origin.left; } this.el.css({ top: this.top0 + this.topDelta, left: this.left0 + this.leftDelta }); }, // Gets called when the user moves the mouse handleMove: function(ev) { this.topDelta = getEvY(ev) - this.y0; this.leftDelta = getEvX(ev) - this.x0; if (!this.isHidden) { this.updatePosition(); } }, // Temporarily makes the tracking element invisible. Can be called before following starts hide: function() { if (!this.isHidden) { this.isHidden = true; if (this.el) { this.el.hide(); } } }, // Show the tracking element after it has been temporarily hidden show: function() { if (this.isHidden) { this.isHidden = false; this.updatePosition(); this.getEl().show(); } } }); ;; /* An abstract class comprised of a "grid" of areas that each represent a specific datetime ----------------------------------------------------------------------------------------------------------------------*/ var Grid = FC.Grid = Class.extend(ListenerMixin, MouseIgnorerMixin, { // self-config, overridable by subclasses hasDayInteractions: true, // can user click/select ranges of time? view: null, // a View object isRTL: null, // shortcut to the view's isRTL option start: null, end: null, el: null, // the containing element elsByFill: null, // a hash of jQuery element sets used for rendering each fill. Keyed by fill name. // derived from options eventTimeFormat: null, displayEventTime: null, displayEventEnd: null, minResizeDuration: null, // TODO: hack. set by subclasses. minumum event resize duration // if defined, holds the unit identified (ex: "year" or "month") that determines the level of granularity // of the date areas. if not defined, assumes to be day and time granularity. // TODO: port isTimeScale into same system? largeUnit: null, dayDragListener: null, segDragListener: null, segResizeListener: null, externalDragListener: null, constructor: function(view) { this.view = view; this.isRTL = view.opt('isRTL'); this.elsByFill = {}; this.dayDragListener = this.buildDayDragListener(); this.initMouseIgnoring(); }, /* Options ------------------------------------------------------------------------------------------------------------------*/ // Generates the format string used for event time text, if not explicitly defined by 'timeFormat' computeEventTimeFormat: function() { return this.view.opt('smallTimeFormat'); }, // Determines whether events should have their end times displayed, if not explicitly defined by 'displayEventTime'. // Only applies to non-all-day events. computeDisplayEventTime: function() { return true; }, // Determines whether events should have their end times displayed, if not explicitly defined by 'displayEventEnd' computeDisplayEventEnd: function() { return true; }, /* Dates ------------------------------------------------------------------------------------------------------------------*/ // Tells the grid about what period of time to display. // Any date-related internal data should be generated. setRange: function(range) { this.start = range.start.clone(); this.end = range.end.clone(); this.rangeUpdated(); this.processRangeOptions(); }, // Called when internal variables that rely on the range should be updated rangeUpdated: function() { }, // Updates values that rely on options and also relate to range processRangeOptions: function() { var view = this.view; var displayEventTime; var displayEventEnd; this.eventTimeFormat = view.opt('eventTimeFormat') || view.opt('timeFormat') || // deprecated this.computeEventTimeFormat(); displayEventTime = view.opt('displayEventTime'); if (displayEventTime == null) { displayEventTime = this.computeDisplayEventTime(); // might be based off of range } displayEventEnd = view.opt('displayEventEnd'); if (displayEventEnd == null) { displayEventEnd = this.computeDisplayEventEnd(); // might be based off of range } this.displayEventTime = displayEventTime; this.displayEventEnd = displayEventEnd; }, // Converts a span (has unzoned start/end and any other grid-specific location information) // into an array of segments (pieces of events whose format is decided by the grid). spanToSegs: function(span) { // subclasses must implement }, // Diffs the two dates, returning a duration, based on granularity of the grid // TODO: port isTimeScale into this system? diffDates: function(a, b) { if (this.largeUnit) { return diffByUnit(a, b, this.largeUnit); } else { return diffDayTime(a, b); } }, /* Hit Area ------------------------------------------------------------------------------------------------------------------*/ // Called before one or more queryHit calls might happen. Should prepare any cached coordinates for queryHit prepareHits: function() { }, // Called when queryHit calls have subsided. Good place to clear any coordinate caches. releaseHits: function() { }, // Given coordinates from the topleft of the document, return data about the date-related area underneath. // Can return an object with arbitrary properties (although top/right/left/bottom are encouraged). // Must have a `grid` property, a reference to this current grid. TODO: avoid this // The returned object will be processed by getHitSpan and getHitEl. queryHit: function(leftOffset, topOffset) { }, // Given position-level information about a date-related area within the grid, // should return an object with at least a start/end date. Can provide other information as well. getHitSpan: function(hit) { }, // Given position-level information about a date-related area within the grid, // should return a jQuery element that best represents it. passed to dayClick callback. getHitEl: function(hit) { }, /* Rendering ------------------------------------------------------------------------------------------------------------------*/ // Sets the container element that the grid should render inside of. // Does other DOM-related initializations. setElement: function(el) { this.el = el; if (this.hasDayInteractions) { preventSelection(el); this.bindDayHandler('touchstart', this.dayTouchStart); this.bindDayHandler('mousedown', this.dayMousedown); } // attach event-element-related handlers. in Grid.events // same garbage collection note as above. this.bindSegHandlers(); this.bindGlobalHandlers(); }, bindDayHandler: function(name, handler) { var _this = this; // attach a handler to the grid's root element. // jQuery will take care of unregistering them when removeElement gets called. this.el.on(name, function(ev) { if ( !$(ev.target).is( _this.segSelector + ',' + // directly on an event element _this.segSelector + ' *,' + // within an event element '.fc-more,' + // a "more.." link 'a[data-goto]' // a clickable nav link ) ) { return handler.call(_this, ev); } }); }, // Removes the grid's container element from the DOM. Undoes any other DOM-related attachments. // DOES NOT remove any content beforehand (doesn't clear events or call unrenderDates), unlike View removeElement: function() { this.unbindGlobalHandlers(); this.clearDragListeners(); this.el.remove(); // NOTE: we don't null-out this.el for the same reasons we don't do it within View::removeElement }, // Renders the basic structure of grid view before any content is rendered renderSkeleton: function() { // subclasses should implement }, // Renders the grid's date-related content (like areas that represent days/times). // Assumes setRange has already been called and the skeleton has already been rendered. renderDates: function() { // subclasses should implement }, // Unrenders the grid's date-related content unrenderDates: function() { // subclasses should implement }, /* Handlers ------------------------------------------------------------------------------------------------------------------*/ // Binds DOM handlers to elements that reside outside the grid, such as the document bindGlobalHandlers: function() { this.listenTo($(document), { dragstart: this.externalDragStart, // jqui sortstart: this.externalDragStart // jqui }); }, // Unbinds DOM handlers from elements that reside outside the grid unbindGlobalHandlers: function() { this.stopListeningTo($(document)); }, // Process a mousedown on an element that represents a day. For day clicking and selecting. dayMousedown: function(ev) { if (!this.isIgnoringMouse) { this.dayDragListener.startInteraction(ev, { //distance: 5, // needs more work if we want dayClick to fire correctly }); } }, dayTouchStart: function(ev) { var view = this.view; var selectLongPressDelay = view.opt('selectLongPressDelay'); // HACK to prevent a user's clickaway for unselecting a range or an event // from causing a dayClick. if (view.isSelected || view.selectedEvent) { this.tempIgnoreMouse(); } if (selectLongPressDelay == null) { selectLongPressDelay = view.opt('longPressDelay'); // fallback } this.dayDragListener.startInteraction(ev, { delay: selectLongPressDelay }); }, // Creates a listener that tracks the user's drag across day elements. // For day clicking and selecting. buildDayDragListener: function() { var _this = this; var view = this.view; var isSelectable = view.opt('selectable'); var dayClickHit; // null if invalid dayClick var selectionSpan; // null if invalid selection // this listener tracks a mousedown on a day element, and a subsequent drag. // if the drag ends on the same day, it is a 'dayClick'. // if 'selectable' is enabled, this listener also detects selections. var dragListener = new HitDragListener(this, { scroll: view.opt('dragScroll'), interactionStart: function() { dayClickHit = dragListener.origHit; // for dayClick, where no dragging happens selectionSpan = null; }, dragStart: function() { view.unselect(); // since we could be rendering a new selection, we want to clear any old one }, hitOver: function(hit, isOrig, origHit) { if (origHit) { // click needs to have started on a hit // if user dragged to another cell at any point, it can no longer be a dayClick if (!isOrig) { dayClickHit = null; } if (isSelectable) { selectionSpan = _this.computeSelection( _this.getHitSpan(origHit), _this.getHitSpan(hit) ); if (selectionSpan) { _this.renderSelection(selectionSpan); } else if (selectionSpan === false) { disableCursor(); } } } }, hitOut: function() { // called before mouse moves to a different hit OR moved out of all hits dayClickHit = null; selectionSpan = null; _this.unrenderSelection(); }, hitDone: function() { // called after a hitOut OR before a dragEnd enableCursor(); }, interactionEnd: function(ev, isCancelled) { if (!isCancelled) { if ( dayClickHit && !_this.isIgnoringMouse // see hack in dayTouchStart ) { view.triggerDayClick( _this.getHitSpan(dayClickHit), _this.getHitEl(dayClickHit), ev ); } if (selectionSpan) { // the selection will already have been rendered. just report it view.reportSelection(selectionSpan, ev); } } } }); return dragListener; }, // Kills all in-progress dragging. // Useful for when public API methods that result in re-rendering are invoked during a drag. // Also useful for when touch devices misbehave and don't fire their touchend. clearDragListeners: function() { this.dayDragListener.endInteraction(); if (this.segDragListener) { this.segDragListener.endInteraction(); // will clear this.segDragListener } if (this.segResizeListener) { this.segResizeListener.endInteraction(); // will clear this.segResizeListener } if (this.externalDragListener) { this.externalDragListener.endInteraction(); // will clear this.externalDragListener } }, /* Event Helper ------------------------------------------------------------------------------------------------------------------*/ // TODO: should probably move this to Grid.events, like we did event dragging / resizing // Renders a mock event at the given event location, which contains zoned start/end properties. // Returns all mock event elements. renderEventLocationHelper: function(eventLocation, sourceSeg) { var fakeEvent = this.fabricateHelperEvent(eventLocation, sourceSeg); return this.renderHelper(fakeEvent, sourceSeg); // do the actual rendering }, // Builds a fake event given zoned event date properties and a segment is should be inspired from. // The range's end can be null, in which case the mock event that is rendered will have a null end time. // `sourceSeg` is the internal segment object involved in the drag. If null, something external is dragging. fabricateHelperEvent: function(eventLocation, sourceSeg) { var fakeEvent = sourceSeg ? createObject(sourceSeg.event) : {}; // mask the original event object if possible fakeEvent.start = eventLocation.start.clone(); fakeEvent.end = eventLocation.end ? eventLocation.end.clone() : null; fakeEvent.allDay = null; // force it to be freshly computed by normalizeEventDates this.view.calendar.normalizeEventDates(fakeEvent); // this extra className will be useful for differentiating real events from mock events in CSS fakeEvent.className = (fakeEvent.className || []).concat('fc-helper'); // if something external is being dragged in, don't render a resizer if (!sourceSeg) { fakeEvent.editable = false; } return fakeEvent; }, // Renders a mock event. Given zoned event date properties. // Must return all mock event elements. renderHelper: function(eventLocation, sourceSeg) { // subclasses must implement }, // Unrenders a mock event unrenderHelper: function() { // subclasses must implement }, /* Selection ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of a selection. Will highlight by default but can be overridden by subclasses. // Given a span (unzoned start/end and other misc data) renderSelection: function(span) { this.renderHighlight(span); }, // Unrenders any visual indications of a selection. Will unrender a highlight by default. unrenderSelection: function() { this.unrenderHighlight(); }, // Given the first and last date-spans of a selection, returns another date-span object. // Subclasses can override and provide additional data in the span object. Will be passed to renderSelection(). // Will return false if the selection is invalid and this should be indicated to the user. // Will return null/undefined if a selection invalid but no error should be reported. computeSelection: function(span0, span1) { var span = this.computeSelectionSpan(span0, span1); if (span && !this.view.calendar.isSelectionSpanAllowed(span)) { return false; } return span; }, // Given two spans, must return the combination of the two. // TODO: do this separation of concerns (combining VS validation) for event dnd/resize too. computeSelectionSpan: function(span0, span1) { var dates = [ span0.start, span0.end, span1.start, span1.end ]; dates.sort(compareNumbers); // sorts chronologically. works with Moments return { start: dates[0].clone(), end: dates[3].clone() }; }, /* Highlight ------------------------------------------------------------------------------------------------------------------*/ // Renders an emphasis on the given date range. Given a span (unzoned start/end and other misc data) renderHighlight: function(span) { this.renderFill('highlight', this.spanToSegs(span)); }, // Unrenders the emphasis on a date range unrenderHighlight: function() { this.unrenderFill('highlight'); }, // Generates an array of classNames for rendering the highlight. Used by the fill system. highlightSegClasses: function() { return [ 'fc-highlight' ]; }, /* Business Hours ------------------------------------------------------------------------------------------------------------------*/ renderBusinessHours: function() { }, unrenderBusinessHours: function() { }, /* Now Indicator ------------------------------------------------------------------------------------------------------------------*/ getNowIndicatorUnit: function() { }, renderNowIndicator: function(date) { }, unrenderNowIndicator: function() { }, /* Fill System (highlight, background events, business hours) -------------------------------------------------------------------------------------------------------------------- TODO: remove this system. like we did in TimeGrid */ // Renders a set of rectangles over the given segments of time. // MUST RETURN a subset of segs, the segs that were actually rendered. // Responsible for populating this.elsByFill. TODO: better API for expressing this requirement renderFill: function(type, segs) { // subclasses must implement }, // Unrenders a specific type of fill that is currently rendered on the grid unrenderFill: function(type) { var el = this.elsByFill[type]; if (el) { el.remove(); delete this.elsByFill[type]; } }, // Renders and assigns an `el` property for each fill segment. Generic enough to work with different types. // Only returns segments that successfully rendered. // To be harnessed by renderFill (implemented by subclasses). // Analagous to renderFgSegEls. renderFillSegEls: function(type, segs) { var _this = this; var segElMethod = this[type + 'SegEl']; var html = ''; var renderedSegs = []; var i; if (segs.length) { // build a large concatenation of segment HTML for (i = 0; i < segs.length; i++) { html += this.fillSegHtml(type, segs[i]); } // Grab individual elements from the combined HTML string. Use each as the default rendering. // Then, compute the 'el' for each segment. $(html).each(function(i, node) { var seg = segs[i]; var el = $(node); // allow custom filter methods per-type if (segElMethod) { el = segElMethod.call(_this, seg, el); } if (el) { // custom filters did not cancel the render el = $(el); // allow custom filter to return raw DOM node // correct element type? (would be bad if a non-TD were inserted into a table for example) if (el.is(_this.fillSegTag)) { seg.el = el; renderedSegs.push(seg); } } }); } return renderedSegs; }, fillSegTag: 'div', // subclasses can override // Builds the HTML needed for one fill segment. Generic enough to work with different types. fillSegHtml: function(type, seg) { // custom hooks per-type var classesMethod = this[type + 'SegClasses']; var cssMethod = this[type + 'SegCss']; var classes = classesMethod ? classesMethod.call(this, seg) : []; var css = cssToStr(cssMethod ? cssMethod.call(this, seg) : {}); return '<' + this.fillSegTag + (classes.length ? ' class="' + classes.join(' ') + '"' : '') + (css ? ' style="' + css + '"' : '') + ' />'; }, /* Generic rendering utilities for subclasses ------------------------------------------------------------------------------------------------------------------*/ // Computes HTML classNames for a single-day element getDayClasses: function(date, noThemeHighlight) { var view = this.view; var today = view.calendar.getNow(); var classes = [ 'fc-' + dayIDs[date.day()] ]; if ( view.intervalDuration.as('months') == 1 && date.month() != view.intervalStart.month() ) { classes.push('fc-other-month'); } if (date.isSame(today, 'day')) { classes.push('fc-today'); if (noThemeHighlight !== true) { classes.push(view.highlightStateClass); } } else if (date < today) { classes.push('fc-past'); } else { classes.push('fc-future'); } return classes; } }); ;; /* Event-rendering and event-interaction methods for the abstract Grid class ----------------------------------------------------------------------------------------------------------------------*/ Grid.mixin({ // self-config, overridable by subclasses segSelector: '.fc-event-container > *', // what constitutes an event element? mousedOverSeg: null, // the segment object the user's mouse is over. null if over nothing isDraggingSeg: false, // is a segment being dragged? boolean isResizingSeg: false, // is a segment being resized? boolean isDraggingExternal: false, // jqui-dragging an external element? boolean segs: null, // the *event* segments currently rendered in the grid. TODO: rename to `eventSegs` // Renders the given events onto the grid renderEvents: function(events) { var bgEvents = []; var fgEvents = []; var i; for (i = 0; i < events.length; i++) { (isBgEvent(events[i]) ? bgEvents : fgEvents).push(events[i]); } this.segs = [].concat( // record all segs this.renderBgEvents(bgEvents), this.renderFgEvents(fgEvents) ); }, renderBgEvents: function(events) { var segs = this.eventsToSegs(events); // renderBgSegs might return a subset of segs, segs that were actually rendered return this.renderBgSegs(segs) || segs; }, renderFgEvents: function(events) { var segs = this.eventsToSegs(events); // renderFgSegs might return a subset of segs, segs that were actually rendered return this.renderFgSegs(segs) || segs; }, // Unrenders all events currently rendered on the grid unrenderEvents: function() { this.handleSegMouseout(); // trigger an eventMouseout if user's mouse is over an event this.clearDragListeners(); this.unrenderFgSegs(); this.unrenderBgSegs(); this.segs = null; }, // Retrieves all rendered segment objects currently rendered on the grid getEventSegs: function() { return this.segs || []; }, /* Foreground Segment Rendering ------------------------------------------------------------------------------------------------------------------*/ // Renders foreground event segments onto the grid. May return a subset of segs that were rendered. renderFgSegs: function(segs) { // subclasses must implement }, // Unrenders all currently rendered foreground segments unrenderFgSegs: function() { // subclasses must implement }, // Renders and assigns an `el` property for each foreground event segment. // Only returns segments that successfully rendered. // A utility that subclasses may use. renderFgSegEls: function(segs, disableResizing) { var view = this.view; var html = ''; var renderedSegs = []; var i; if (segs.length) { // don't build an empty html string // build a large concatenation of event segment HTML for (i = 0; i < segs.length; i++) { html += this.fgSegHtml(segs[i], disableResizing); } // Grab individual elements from the combined HTML string. Use each as the default rendering. // Then, compute the 'el' for each segment. An el might be null if the eventRender callback returned false. $(html).each(function(i, node) { var seg = segs[i]; var el = view.resolveEventEl(seg.event, $(node)); if (el) { el.data('fc-seg', seg); // used by handlers seg.el = el; renderedSegs.push(seg); } }); } return renderedSegs; }, // Generates the HTML for the default rendering of a foreground event segment. Used by renderFgSegEls() fgSegHtml: function(seg, disableResizing) { // subclasses should implement }, /* Background Segment Rendering ------------------------------------------------------------------------------------------------------------------*/ // Renders the given background event segments onto the grid. // Returns a subset of the segs that were actually rendered. renderBgSegs: function(segs) { return this.renderFill('bgEvent', segs); }, // Unrenders all the currently rendered background event segments unrenderBgSegs: function() { this.unrenderFill('bgEvent'); }, // Renders a background event element, given the default rendering. Called by the fill system. bgEventSegEl: function(seg, el) { return this.view.resolveEventEl(seg.event, el); // will filter through eventRender }, // Generates an array of classNames to be used for the default rendering of a background event. // Called by fillSegHtml. bgEventSegClasses: function(seg) { var event = seg.event; var source = event.source || {}; return [ 'fc-bgevent' ].concat( event.className, source.className || [] ); }, // Generates a semicolon-separated CSS string to be used for the default rendering of a background event. // Called by fillSegHtml. bgEventSegCss: function(seg) { return { 'background-color': this.getSegSkinCss(seg)['background-color'] }; }, // Generates an array of classNames to be used for the rendering business hours overlay. Called by the fill system. // Called by fillSegHtml. businessHoursSegClasses: function(seg) { return [ 'fc-nonbusiness', 'fc-bgevent' ]; }, /* Business Hours ------------------------------------------------------------------------------------------------------------------*/ // Compute business hour segs for the grid's current date range. // Caller must ask if whole-day business hours are needed. // If no `businessHours` configuration value is specified, assumes the calendar default. buildBusinessHourSegs: function(wholeDay, businessHours) { return this.eventsToSegs( this.buildBusinessHourEvents(wholeDay, businessHours) ); }, // Compute business hour *events* for the grid's current date range. // Caller must ask if whole-day business hours are needed. // If no `businessHours` configuration value is specified, assumes the calendar default. buildBusinessHourEvents: function(wholeDay, businessHours) { var calendar = this.view.calendar; var events; if (businessHours == null) { // fallback // access from calendawr. don't access from view. doesn't update with dynamic options. businessHours = calendar.options.businessHours; } events = calendar.computeBusinessHourEvents(wholeDay, businessHours); // HACK. Eventually refactor business hours "events" system. // If no events are given, but businessHours is activated, this means the entire visible range should be // marked as *not* business-hours, via inverse-background rendering. if (!events.length && businessHours) { events = [ $.extend({}, BUSINESS_HOUR_EVENT_DEFAULTS, { start: this.view.end, // guaranteed out-of-range end: this.view.end, // " dow: null }) ]; } return events; }, /* Handlers ------------------------------------------------------------------------------------------------------------------*/ // Attaches event-element-related handlers for *all* rendered event segments of the view. bindSegHandlers: function() { this.bindSegHandlersToEl(this.el); }, // Attaches event-element-related handlers to an arbitrary container element. leverages bubbling. bindSegHandlersToEl: function(el) { this.bindSegHandlerToEl(el, 'touchstart', this.handleSegTouchStart); this.bindSegHandlerToEl(el, 'touchend', this.handleSegTouchEnd); this.bindSegHandlerToEl(el, 'mouseenter', this.handleSegMouseover); this.bindSegHandlerToEl(el, 'mouseleave', this.handleSegMouseout); this.bindSegHandlerToEl(el, 'mousedown', this.handleSegMousedown); this.bindSegHandlerToEl(el, 'click', this.handleSegClick); }, // Executes a handler for any a user-interaction on a segment. // Handler gets called with (seg, ev), and with the `this` context of the Grid bindSegHandlerToEl: function(el, name, handler) { var _this = this; el.on(name, this.segSelector, function(ev) { var seg = $(this).data('fc-seg'); // grab segment data. put there by View::renderEvents // only call the handlers if there is not a drag/resize in progress if (seg && !_this.isDraggingSeg && !_this.isResizingSeg) { return handler.call(_this, seg, ev); // context will be the Grid } }); }, handleSegClick: function(seg, ev) { var res = this.view.publiclyTrigger('eventClick', seg.el[0], seg.event, ev); // can return `false` to cancel if (res === false) { ev.preventDefault(); } }, // Updates internal state and triggers handlers for when an event element is moused over handleSegMouseover: function(seg, ev) { if ( !this.isIgnoringMouse && !this.mousedOverSeg ) { this.mousedOverSeg = seg; if (this.view.isEventResizable(seg.event)) { seg.el.addClass('fc-allow-mouse-resize'); } this.view.publiclyTrigger('eventMouseover', seg.el[0], seg.event, ev); } }, // Updates internal state and triggers handlers for when an event element is moused out. // Can be given no arguments, in which case it will mouseout the segment that was previously moused over. handleSegMouseout: function(seg, ev) { ev = ev || {}; // if given no args, make a mock mouse event if (this.mousedOverSeg) { seg = seg || this.mousedOverSeg; // if given no args, use the currently moused-over segment this.mousedOverSeg = null; if (this.view.isEventResizable(seg.event)) { seg.el.removeClass('fc-allow-mouse-resize'); } this.view.publiclyTrigger('eventMouseout', seg.el[0], seg.event, ev); } }, handleSegMousedown: function(seg, ev) { var isResizing = this.startSegResize(seg, ev, { distance: 5 }); if (!isResizing && this.view.isEventDraggable(seg.event)) { this.buildSegDragListener(seg) .startInteraction(ev, { distance: 5 }); } }, handleSegTouchStart: function(seg, ev) { var view = this.view; var event = seg.event; var isSelected = view.isEventSelected(event); var isDraggable = view.isEventDraggable(event); var isResizable = view.isEventResizable(event); var isResizing = false; var dragListener; var eventLongPressDelay; if (isSelected && isResizable) { // only allow resizing of the event is selected isResizing = this.startSegResize(seg, ev); } if (!isResizing && (isDraggable || isResizable)) { // allowed to be selected? eventLongPressDelay = view.opt('eventLongPressDelay'); if (eventLongPressDelay == null) { eventLongPressDelay = view.opt('longPressDelay'); // fallback } dragListener = isDraggable ? this.buildSegDragListener(seg) : this.buildSegSelectListener(seg); // seg isn't draggable, but still needs to be selected dragListener.startInteraction(ev, { // won't start if already started delay: isSelected ? 0 : eventLongPressDelay // do delay if not already selected }); } // a long tap simulates a mouseover. ignore this bogus mouseover. this.tempIgnoreMouse(); }, handleSegTouchEnd: function(seg, ev) { // touchstart+touchend = click, which simulates a mouseover. // ignore this bogus mouseover. this.tempIgnoreMouse(); }, // returns boolean whether resizing actually started or not. // assumes the seg allows resizing. // `dragOptions` are optional. startSegResize: function(seg, ev, dragOptions) { if ($(ev.target).is('.fc-resizer')) { this.buildSegResizeListener(seg, $(ev.target).is('.fc-start-resizer')) .startInteraction(ev, dragOptions); return true; } return false; }, /* Event Dragging ------------------------------------------------------------------------------------------------------------------*/ // Builds a listener that will track user-dragging on an event segment. // Generic enough to work with any type of Grid. // Has side effect of setting/unsetting `segDragListener` buildSegDragListener: function(seg) { var _this = this; var view = this.view; var calendar = view.calendar; var el = seg.el; var event = seg.event; var isDragging; var mouseFollower; // A clone of the original element that will move with the mouse var dropLocation; // zoned event date properties if (this.segDragListener) { return this.segDragListener; } // Tracks mouse movement over the *view's* coordinate map. Allows dragging and dropping between subcomponents // of the view. var dragListener = this.segDragListener = new HitDragListener(view, { scroll: view.opt('dragScroll'), subjectEl: el, subjectCenter: true, interactionStart: function(ev) { seg.component = _this; // for renderDrag isDragging = false; mouseFollower = new MouseFollower(seg.el, { additionalClass: 'fc-dragging', parentEl: view.el, opacity: dragListener.isTouch ? null : view.opt('dragOpacity'), revertDuration: view.opt('dragRevertDuration'), zIndex: 2 // one above the .fc-view }); mouseFollower.hide(); // don't show until we know this is a real drag mouseFollower.start(ev); }, dragStart: function(ev) { if (dragListener.isTouch && !view.isEventSelected(event)) { // if not previously selected, will fire after a delay. then, select the event view.selectEvent(event); } isDragging = true; _this.handleSegMouseout(seg, ev); // ensure a mouseout on the manipulated event has been reported _this.segDragStart(seg, ev); view.hideEvent(event); // hide all event segments. our mouseFollower will take over }, hitOver: function(hit, isOrig, origHit) { var dragHelperEls; // starting hit could be forced (DayGrid.limit) if (seg.hit) { origHit = seg.hit; } // since we are querying the parent view, might not belong to this grid dropLocation = _this.computeEventDrop( origHit.component.getHitSpan(origHit), hit.component.getHitSpan(hit), event ); if (dropLocation && !calendar.isEventSpanAllowed(_this.eventToSpan(dropLocation), event)) { disableCursor(); dropLocation = null; } // if a valid drop location, have the subclass render a visual indication if (dropLocation && (dragHelperEls = view.renderDrag(dropLocation, seg))) { dragHelperEls.addClass('fc-dragging'); if (!dragListener.isTouch) { _this.applyDragOpacity(dragHelperEls); } mouseFollower.hide(); // if the subclass is already using a mock event "helper", hide our own } else { mouseFollower.show(); // otherwise, have the helper follow the mouse (no snapping) } if (isOrig) { dropLocation = null; // needs to have moved hits to be a valid drop } }, hitOut: function() { // called before mouse moves to a different hit OR moved out of all hits view.unrenderDrag(); // unrender whatever was done in renderDrag mouseFollower.show(); // show in case we are moving out of all hits dropLocation = null; }, hitDone: function() { // Called after a hitOut OR before a dragEnd enableCursor(); }, interactionEnd: function(ev) { delete seg.component; // prevent side effects // do revert animation if hasn't changed. calls a callback when finished (whether animation or not) mouseFollower.stop(!dropLocation, function() { if (isDragging) { view.unrenderDrag(); _this.segDragStop(seg, ev); } if (dropLocation) { // no need to re-show original, will rerender all anyways. esp important if eventRenderWait view.reportEventDrop(event, dropLocation, _this.largeUnit, el, ev); } else { view.showEvent(event); } }); _this.segDragListener = null; } }); return dragListener; }, // seg isn't draggable, but let's use a generic DragListener // simply for the delay, so it can be selected. // Has side effect of setting/unsetting `segDragListener` buildSegSelectListener: function(seg) { var _this = this; var view = this.view; var event = seg.event; if (this.segDragListener) { return this.segDragListener; } var dragListener = this.segDragListener = new DragListener({ dragStart: function(ev) { if (dragListener.isTouch && !view.isEventSelected(event)) { // if not previously selected, will fire after a delay. then, select the event view.selectEvent(event); } }, interactionEnd: function(ev) { _this.segDragListener = null; } }); return dragListener; }, // Called before event segment dragging starts segDragStart: function(seg, ev) { this.isDraggingSeg = true; this.view.publiclyTrigger('eventDragStart', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy }, // Called after event segment dragging stops segDragStop: function(seg, ev) { this.isDraggingSeg = false; this.view.publiclyTrigger('eventDragStop', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy }, // Given the spans an event drag began, and the span event was dropped, calculates the new zoned start/end/allDay // values for the event. Subclasses may override and set additional properties to be used by renderDrag. // A falsy returned value indicates an invalid drop. // DOES NOT consider overlap/constraint. computeEventDrop: function(startSpan, endSpan, event) { var calendar = this.view.calendar; var dragStart = startSpan.start; var dragEnd = endSpan.start; var delta; var dropLocation; // zoned event date properties if (dragStart.hasTime() === dragEnd.hasTime()) { delta = this.diffDates(dragEnd, dragStart); // if an all-day event was in a timed area and it was dragged to a different time, // guarantee an end and adjust start/end to have times if (event.allDay && durationHasTime(delta)) { dropLocation = { start: event.start.clone(), end: calendar.getEventEnd(event), // will be an ambig day allDay: false // for normalizeEventTimes }; calendar.normalizeEventTimes(dropLocation); } // othewise, work off existing values else { dropLocation = pluckEventDateProps(event); } dropLocation.start.add(delta); if (dropLocation.end) { dropLocation.end.add(delta); } } else { // if switching from day <-> timed, start should be reset to the dropped date, and the end cleared dropLocation = { start: dragEnd.clone(), end: null, // end should be cleared allDay: !dragEnd.hasTime() }; } return dropLocation; }, // Utility for apply dragOpacity to a jQuery set applyDragOpacity: function(els) { var opacity = this.view.opt('dragOpacity'); if (opacity != null) { els.css('opacity', opacity); } }, /* External Element Dragging ------------------------------------------------------------------------------------------------------------------*/ // Called when a jQuery UI drag is initiated anywhere in the DOM externalDragStart: function(ev, ui) { var view = this.view; var el; var accept; if (view.opt('droppable')) { // only listen if this setting is on el = $((ui ? ui.item : null) || ev.target); // Test that the dragged element passes the dropAccept selector or filter function. // FYI, the default is "*" (matches all) accept = view.opt('dropAccept'); if ($.isFunction(accept) ? accept.call(el[0], el) : el.is(accept)) { if (!this.isDraggingExternal) { // prevent double-listening if fired twice this.listenToExternalDrag(el, ev, ui); } } } }, // Called when a jQuery UI drag starts and it needs to be monitored for dropping listenToExternalDrag: function(el, ev, ui) { var _this = this; var calendar = this.view.calendar; var meta = getDraggedElMeta(el); // extra data about event drop, including possible event to create var dropLocation; // a null value signals an unsuccessful drag // listener that tracks mouse movement over date-associated pixel regions var dragListener = _this.externalDragListener = new HitDragListener(this, { interactionStart: function() { _this.isDraggingExternal = true; }, hitOver: function(hit) { dropLocation = _this.computeExternalDrop( hit.component.getHitSpan(hit), // since we are querying the parent view, might not belong to this grid meta ); if ( // invalid hit? dropLocation && !calendar.isExternalSpanAllowed(_this.eventToSpan(dropLocation), dropLocation, meta.eventProps) ) { disableCursor(); dropLocation = null; } if (dropLocation) { _this.renderDrag(dropLocation); // called without a seg parameter } }, hitOut: function() { dropLocation = null; // signal unsuccessful }, hitDone: function() { // Called after a hitOut OR before a dragEnd enableCursor(); _this.unrenderDrag(); }, interactionEnd: function(ev) { if (dropLocation) { // element was dropped on a valid hit _this.view.reportExternalDrop(meta, dropLocation, el, ev, ui); } _this.isDraggingExternal = false; _this.externalDragListener = null; } }); dragListener.startDrag(ev); // start listening immediately }, // Given a hit to be dropped upon, and misc data associated with the jqui drag (guaranteed to be a plain object), // returns the zoned start/end dates for the event that would result from the hypothetical drop. end might be null. // Returning a null value signals an invalid drop hit. // DOES NOT consider overlap/constraint. computeExternalDrop: function(span, meta) { var calendar = this.view.calendar; var dropLocation = { start: calendar.applyTimezone(span.start), // simulate a zoned event start date end: null }; // if dropped on an all-day span, and element's metadata specified a time, set it if (meta.startTime && !dropLocation.start.hasTime()) { dropLocation.start.time(meta.startTime); } if (meta.duration) { dropLocation.end = dropLocation.start.clone().add(meta.duration); } return dropLocation; }, /* Drag Rendering (for both events and an external elements) ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of an event or external element being dragged. // `dropLocation` contains hypothetical start/end/allDay values the event would have if dropped. end can be null. // `seg` is the internal segment object that is being dragged. If dragging an external element, `seg` is null. // A truthy returned value indicates this method has rendered a helper element. // Must return elements used for any mock events. renderDrag: function(dropLocation, seg) { // subclasses must implement }, // Unrenders a visual indication of an event or external element being dragged unrenderDrag: function() { // subclasses must implement }, /* Resizing ------------------------------------------------------------------------------------------------------------------*/ // Creates a listener that tracks the user as they resize an event segment. // Generic enough to work with any type of Grid. buildSegResizeListener: function(seg, isStart) { var _this = this; var view = this.view; var calendar = view.calendar; var el = seg.el; var event = seg.event; var eventEnd = calendar.getEventEnd(event); var isDragging; var resizeLocation; // zoned event date properties. falsy if invalid resize // Tracks mouse movement over the *grid's* coordinate map var dragListener = this.segResizeListener = new HitDragListener(this, { scroll: view.opt('dragScroll'), subjectEl: el, interactionStart: function() { isDragging = false; }, dragStart: function(ev) { isDragging = true; _this.handleSegMouseout(seg, ev); // ensure a mouseout on the manipulated event has been reported _this.segResizeStart(seg, ev); }, hitOver: function(hit, isOrig, origHit) { var origHitSpan = _this.getHitSpan(origHit); var hitSpan = _this.getHitSpan(hit); resizeLocation = isStart ? _this.computeEventStartResize(origHitSpan, hitSpan, event) : _this.computeEventEndResize(origHitSpan, hitSpan, event); if (resizeLocation) { if (!calendar.isEventSpanAllowed(_this.eventToSpan(resizeLocation), event)) { disableCursor(); resizeLocation = null; } // no change? (FYI, event dates might have zones) else if ( resizeLocation.start.isSame(event.start.clone().stripZone()) && resizeLocation.end.isSame(eventEnd.clone().stripZone()) ) { resizeLocation = null; } } if (resizeLocation) { view.hideEvent(event); _this.renderEventResize(resizeLocation, seg); } }, hitOut: function() { // called before mouse moves to a different hit OR moved out of all hits resizeLocation = null; view.showEvent(event); // for when out-of-bounds. show original }, hitDone: function() { // resets the rendering to show the original event _this.unrenderEventResize(); enableCursor(); }, interactionEnd: function(ev) { if (isDragging) { _this.segResizeStop(seg, ev); } if (resizeLocation) { // valid date to resize to? // no need to re-show original, will rerender all anyways. esp important if eventRenderWait view.reportEventResize(event, resizeLocation, _this.largeUnit, el, ev); } else { view.showEvent(event); } _this.segResizeListener = null; } }); return dragListener; }, // Called before event segment resizing starts segResizeStart: function(seg, ev) { this.isResizingSeg = true; this.view.publiclyTrigger('eventResizeStart', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy }, // Called after event segment resizing stops segResizeStop: function(seg, ev) { this.isResizingSeg = false; this.view.publiclyTrigger('eventResizeStop', seg.el[0], seg.event, ev, {}); // last argument is jqui dummy }, // Returns new date-information for an event segment being resized from its start computeEventStartResize: function(startSpan, endSpan, event) { return this.computeEventResize('start', startSpan, endSpan, event); }, // Returns new date-information for an event segment being resized from its end computeEventEndResize: function(startSpan, endSpan, event) { return this.computeEventResize('end', startSpan, endSpan, event); }, // Returns new zoned date information for an event segment being resized from its start OR end // `type` is either 'start' or 'end'. // DOES NOT consider overlap/constraint. computeEventResize: function(type, startSpan, endSpan, event) { var calendar = this.view.calendar; var delta = this.diffDates(endSpan[type], startSpan[type]); var resizeLocation; // zoned event date properties var defaultDuration; // build original values to work from, guaranteeing a start and end resizeLocation = { start: event.start.clone(), end: calendar.getEventEnd(event), allDay: event.allDay }; // if an all-day event was in a timed area and was resized to a time, adjust start/end to have times if (resizeLocation.allDay && durationHasTime(delta)) { resizeLocation.allDay = false; calendar.normalizeEventTimes(resizeLocation); } resizeLocation[type].add(delta); // apply delta to start or end // if the event was compressed too small, find a new reasonable duration for it if (!resizeLocation.start.isBefore(resizeLocation.end)) { defaultDuration = this.minResizeDuration || // TODO: hack (event.allDay ? calendar.defaultAllDayEventDuration : calendar.defaultTimedEventDuration); if (type == 'start') { // resizing the start? resizeLocation.start = resizeLocation.end.clone().subtract(defaultDuration); } else { // resizing the end? resizeLocation.end = resizeLocation.start.clone().add(defaultDuration); } } return resizeLocation; }, // Renders a visual indication of an event being resized. // `range` has the updated dates of the event. `seg` is the original segment object involved in the drag. // Must return elements used for any mock events. renderEventResize: function(range, seg) { // subclasses must implement }, // Unrenders a visual indication of an event being resized. unrenderEventResize: function() { // subclasses must implement }, /* Rendering Utils ------------------------------------------------------------------------------------------------------------------*/ // Compute the text that should be displayed on an event's element. // `range` can be the Event object itself, or something range-like, with at least a `start`. // If event times are disabled, or the event has no time, will return a blank string. // If not specified, formatStr will default to the eventTimeFormat setting, // and displayEnd will default to the displayEventEnd setting. getEventTimeText: function(range, formatStr, displayEnd) { if (formatStr == null) { formatStr = this.eventTimeFormat; } if (displayEnd == null) { displayEnd = this.displayEventEnd; } if (this.displayEventTime && range.start.hasTime()) { if (displayEnd && range.end) { return this.view.formatRange(range, formatStr); } else { return range.start.format(formatStr); } } return ''; }, // Generic utility for generating the HTML classNames for an event segment's element getSegClasses: function(seg, isDraggable, isResizable) { var view = this.view; var classes = [ 'fc-event', seg.isStart ? 'fc-start' : 'fc-not-start', seg.isEnd ? 'fc-end' : 'fc-not-end' ].concat(this.getSegCustomClasses(seg)); if (isDraggable) { classes.push('fc-draggable'); } if (isResizable) { classes.push('fc-resizable'); } // event is currently selected? attach a className. if (view.isEventSelected(seg.event)) { classes.push('fc-selected'); } return classes; }, // List of classes that were defined by the caller of the API in some way getSegCustomClasses: function(seg) { var event = seg.event; return [].concat( event.className, // guaranteed to be an array event.source ? event.source.className : [] ); }, // Utility for generating event skin-related CSS properties getSegSkinCss: function(seg) { return { 'background-color': this.getSegBackgroundColor(seg), 'border-color': this.getSegBorderColor(seg), color: this.getSegTextColor(seg) }; }, // Queries for caller-specified color, then falls back to default getSegBackgroundColor: function(seg) { return seg.event.backgroundColor || seg.event.color || this.getSegDefaultBackgroundColor(seg); }, getSegDefaultBackgroundColor: function(seg) { var source = seg.event.source || {}; return source.backgroundColor || source.color || this.view.opt('eventBackgroundColor') || this.view.opt('eventColor'); }, // Queries for caller-specified color, then falls back to default getSegBorderColor: function(seg) { return seg.event.borderColor || seg.event.color || this.getSegDefaultBorderColor(seg); }, getSegDefaultBorderColor: function(seg) { var source = seg.event.source || {}; return source.borderColor || source.color || this.view.opt('eventBorderColor') || this.view.opt('eventColor'); }, // Queries for caller-specified color, then falls back to default getSegTextColor: function(seg) { return seg.event.textColor || this.getSegDefaultTextColor(seg); }, getSegDefaultTextColor: function(seg) { var source = seg.event.source || {}; return source.textColor || this.view.opt('eventTextColor'); }, /* Converting events -> eventRange -> eventSpan -> eventSegs ------------------------------------------------------------------------------------------------------------------*/ // Generates an array of segments for the given single event // Can accept an event "location" as well (which only has start/end and no allDay) eventToSegs: function(event) { return this.eventsToSegs([ event ]); }, eventToSpan: function(event) { return this.eventToSpans(event)[0]; }, // Generates spans (always unzoned) for the given event. // Does not do any inverting for inverse-background events. // Can accept an event "location" as well (which only has start/end and no allDay) eventToSpans: function(event) { var range = this.eventToRange(event); return this.eventRangeToSpans(range, event); }, // Converts an array of event objects into an array of event segment objects. // A custom `segSliceFunc` may be given for arbitrarily slicing up events. // Doesn't guarantee an order for the resulting array. eventsToSegs: function(allEvents, segSliceFunc) { var _this = this; var eventsById = groupEventsById(allEvents); var segs = []; $.each(eventsById, function(id, events) { var ranges = []; var i; for (i = 0; i < events.length; i++) { ranges.push(_this.eventToRange(events[i])); } // inverse-background events (utilize only the first event in calculations) if (isInverseBgEvent(events[0])) { ranges = _this.invertRanges(ranges); for (i = 0; i < ranges.length; i++) { segs.push.apply(segs, // append to _this.eventRangeToSegs(ranges[i], events[0], segSliceFunc)); } } // normal event ranges else { for (i = 0; i < ranges.length; i++) { segs.push.apply(segs, // append to _this.eventRangeToSegs(ranges[i], events[i], segSliceFunc)); } } }); return segs; }, // Generates the unzoned start/end dates an event appears to occupy // Can accept an event "location" as well (which only has start/end and no allDay) eventToRange: function(event) { var calendar = this.view.calendar; var start = event.start.clone().stripZone(); var end = ( event.end ? event.end.clone() : // derive the end from the start and allDay. compute allDay if necessary calendar.getDefaultEventEnd( event.allDay != null ? event.allDay : !event.start.hasTime(), event.start ) ).stripZone(); // hack: dynamic locale change forgets to upate stored event localed calendar.localizeMoment(start); calendar.localizeMoment(end); return { start: start, end: end }; }, // Given an event's range (unzoned start/end), and the event itself, // slice into segments (using the segSliceFunc function if specified) eventRangeToSegs: function(range, event, segSliceFunc) { var spans = this.eventRangeToSpans(range, event); var segs = []; var i; for (i = 0; i < spans.length; i++) { segs.push.apply(segs, // append to this.eventSpanToSegs(spans[i], event, segSliceFunc)); } return segs; }, // Given an event's unzoned date range, return an array of "span" objects. // Subclasses can override. eventRangeToSpans: function(range, event) { return [ $.extend({}, range) ]; // copy into a single-item array }, // Given an event's span (unzoned start/end and other misc data), and the event itself, // slices into segments and attaches event-derived properties to them. eventSpanToSegs: function(span, event, segSliceFunc) { var segs = segSliceFunc ? segSliceFunc(span) : this.spanToSegs(span); var i, seg; for (i = 0; i < segs.length; i++) { seg = segs[i]; seg.event = event; seg.eventStartMS = +span.start; // TODO: not the best name after making spans unzoned seg.eventDurationMS = span.end - span.start; } return segs; }, // Produces a new array of range objects that will cover all the time NOT covered by the given ranges. // SIDE EFFECT: will mutate the given array and will use its date references. invertRanges: function(ranges) { var view = this.view; var viewStart = view.start.clone(); // need a copy var viewEnd = view.end.clone(); // need a copy var inverseRanges = []; var start = viewStart; // the end of the previous range. the start of the new range var i, range; // ranges need to be in order. required for our date-walking algorithm ranges.sort(compareRanges); for (i = 0; i < ranges.length; i++) { range = ranges[i]; // add the span of time before the event (if there is any) if (range.start > start) { // compare millisecond time (skip any ambig logic) inverseRanges.push({ start: start, end: range.start }); } start = range.end; } // add the span of time after the last event (if there is any) if (start < viewEnd) { // compare millisecond time (skip any ambig logic) inverseRanges.push({ start: start, end: viewEnd }); } return inverseRanges; }, sortEventSegs: function(segs) { segs.sort(proxy(this, 'compareEventSegs')); }, // A cmp function for determining which segments should take visual priority compareEventSegs: function(seg1, seg2) { return seg1.eventStartMS - seg2.eventStartMS || // earlier events go first seg2.eventDurationMS - seg1.eventDurationMS || // tie? longer events go first seg2.event.allDay - seg1.event.allDay || // tie? put all-day events first (booleans cast to 0/1) compareByFieldSpecs(seg1.event, seg2.event, this.view.eventOrderSpecs); } }); /* Utilities ----------------------------------------------------------------------------------------------------------------------*/ function pluckEventDateProps(event) { return { start: event.start.clone(), end: event.end ? event.end.clone() : null, allDay: event.allDay // keep it the same }; } FC.pluckEventDateProps = pluckEventDateProps; function isBgEvent(event) { // returns true if background OR inverse-background var rendering = getEventRendering(event); return rendering === 'background' || rendering === 'inverse-background'; } FC.isBgEvent = isBgEvent; // export function isInverseBgEvent(event) { return getEventRendering(event) === 'inverse-background'; } function getEventRendering(event) { return firstDefined((event.source || {}).rendering, event.rendering); } function groupEventsById(events) { var eventsById = {}; var i, event; for (i = 0; i < events.length; i++) { event = events[i]; (eventsById[event._id] || (eventsById[event._id] = [])).push(event); } return eventsById; } // A cmp function for determining which non-inverted "ranges" (see above) happen earlier function compareRanges(range1, range2) { return range1.start - range2.start; // earlier ranges go first } /* External-Dragging-Element Data ----------------------------------------------------------------------------------------------------------------------*/ // Require all HTML5 data-* attributes used by FullCalendar to have this prefix. // A value of '' will query attributes like data-event. A value of 'fc' will query attributes like data-fc-event. FC.dataAttrPrefix = ''; // Given a jQuery element that might represent a dragged FullCalendar event, returns an intermediate data structure // to be used for Event Object creation. // A defined `.eventProps`, even when empty, indicates that an event should be created. function getDraggedElMeta(el) { var prefix = FC.dataAttrPrefix; var eventProps; // properties for creating the event, not related to date/time var startTime; // a Duration var duration; var stick; if (prefix) { prefix += '-'; } eventProps = el.data(prefix + 'event') || null; if (eventProps) { if (typeof eventProps === 'object') { eventProps = $.extend({}, eventProps); // make a copy } else { // something like 1 or true. still signal event creation eventProps = {}; } // pluck special-cased date/time properties startTime = eventProps.start; if (startTime == null) { startTime = eventProps.time; } // accept 'time' as well duration = eventProps.duration; stick = eventProps.stick; delete eventProps.start; delete eventProps.time; delete eventProps.duration; delete eventProps.stick; } // fallback to standalone attribute values for each of the date/time properties if (startTime == null) { startTime = el.data(prefix + 'start'); } if (startTime == null) { startTime = el.data(prefix + 'time'); } // accept 'time' as well if (duration == null) { duration = el.data(prefix + 'duration'); } if (stick == null) { stick = el.data(prefix + 'stick'); } // massage into correct data types startTime = startTime != null ? moment.duration(startTime) : null; duration = duration != null ? moment.duration(duration) : null; stick = Boolean(stick); return { eventProps: eventProps, startTime: startTime, duration: duration, stick: stick }; } ;; /* A set of rendering and date-related methods for a visual component comprised of one or more rows of day columns. Prerequisite: the object being mixed into needs to be a *Grid* */ var DayTableMixin = FC.DayTableMixin = { breakOnWeeks: false, // should create a new row for each week? dayDates: null, // whole-day dates for each column. left to right dayIndices: null, // for each day from start, the offset daysPerRow: null, rowCnt: null, colCnt: null, colHeadFormat: null, // Populates internal variables used for date calculation and rendering updateDayTable: function() { var view = this.view; var date = this.start.clone(); var dayIndex = -1; var dayIndices = []; var dayDates = []; var daysPerRow; var firstDay; var rowCnt; while (date.isBefore(this.end)) { // loop each day from start to end if (view.isHiddenDay(date)) { dayIndices.push(dayIndex + 0.5); // mark that it's between indices } else { dayIndex++; dayIndices.push(dayIndex); dayDates.push(date.clone()); } date.add(1, 'days'); } if (this.breakOnWeeks) { // count columns until the day-of-week repeats firstDay = dayDates[0].day(); for (daysPerRow = 1; daysPerRow < dayDates.length; daysPerRow++) { if (dayDates[daysPerRow].day() == firstDay) { break; } } rowCnt = Math.ceil(dayDates.length / daysPerRow); } else { rowCnt = 1; daysPerRow = dayDates.length; } this.dayDates = dayDates; this.dayIndices = dayIndices; this.daysPerRow = daysPerRow; this.rowCnt = rowCnt; this.updateDayTableCols(); }, // Computes and assigned the colCnt property and updates any options that may be computed from it updateDayTableCols: function() { this.colCnt = this.computeColCnt(); this.colHeadFormat = this.view.opt('columnFormat') || this.computeColHeadFormat(); }, // Determines how many columns there should be in the table computeColCnt: function() { return this.daysPerRow; }, // Computes the ambiguously-timed moment for the given cell getCellDate: function(row, col) { return this.dayDates[ this.getCellDayIndex(row, col) ].clone(); }, // Computes the ambiguously-timed date range for the given cell getCellRange: function(row, col) { var start = this.getCellDate(row, col); var end = start.clone().add(1, 'days'); return { start: start, end: end }; }, // Returns the number of day cells, chronologically, from the first of the grid (0-based) getCellDayIndex: function(row, col) { return row * this.daysPerRow + this.getColDayIndex(col); }, // Returns the numner of day cells, chronologically, from the first cell in *any given row* getColDayIndex: function(col) { if (this.isRTL) { return this.colCnt - 1 - col; } else { return col; } }, // Given a date, returns its chronolocial cell-index from the first cell of the grid. // If the date lies between cells (because of hiddenDays), returns a floating-point value between offsets. // If before the first offset, returns a negative number. // If after the last offset, returns an offset past the last cell offset. // Only works for *start* dates of cells. Will not work for exclusive end dates for cells. getDateDayIndex: function(date) { var dayIndices = this.dayIndices; var dayOffset = date.diff(this.start, 'days'); if (dayOffset < 0) { return dayIndices[0] - 1; } else if (dayOffset >= dayIndices.length) { return dayIndices[dayIndices.length - 1] + 1; } else { return dayIndices[dayOffset]; } }, /* Options ------------------------------------------------------------------------------------------------------------------*/ // Computes a default column header formatting string if `colFormat` is not explicitly defined computeColHeadFormat: function() { // if more than one week row, or if there are a lot of columns with not much space, // put just the day numbers will be in each cell if (this.rowCnt > 1 || this.colCnt > 10) { return 'ddd'; // "Sat" } // multiple days, so full single date string WON'T be in title text else if (this.colCnt > 1) { return this.view.opt('dayOfMonthFormat'); // "Sat 12/10" } // single day, so full single date string will probably be in title text else { return 'dddd'; // "Saturday" } }, /* Slicing ------------------------------------------------------------------------------------------------------------------*/ // Slices up a date range into a segment for every week-row it intersects with sliceRangeByRow: function(range) { var daysPerRow = this.daysPerRow; var normalRange = this.view.computeDayRange(range); // make whole-day range, considering nextDayThreshold var rangeFirst = this.getDateDayIndex(normalRange.start); // inclusive first index var rangeLast = this.getDateDayIndex(normalRange.end.clone().subtract(1, 'days')); // inclusive last index var segs = []; var row; var rowFirst, rowLast; // inclusive day-index range for current row var segFirst, segLast; // inclusive day-index range for segment for (row = 0; row < this.rowCnt; row++) { rowFirst = row * daysPerRow; rowLast = rowFirst + daysPerRow - 1; // intersect segment's offset range with the row's segFirst = Math.max(rangeFirst, rowFirst); segLast = Math.min(rangeLast, rowLast); // deal with in-between indices segFirst = Math.ceil(segFirst); // in-between starts round to next cell segLast = Math.floor(segLast); // in-between ends round to prev cell if (segFirst <= segLast) { // was there any intersection with the current row? segs.push({ row: row, // normalize to start of row firstRowDayIndex: segFirst - rowFirst, lastRowDayIndex: segLast - rowFirst, // must be matching integers to be the segment's start/end isStart: segFirst === rangeFirst, isEnd: segLast === rangeLast }); } } return segs; }, // Slices up a date range into a segment for every day-cell it intersects with. // TODO: make more DRY with sliceRangeByRow somehow. sliceRangeByDay: function(range) { var daysPerRow = this.daysPerRow; var normalRange = this.view.computeDayRange(range); // make whole-day range, considering nextDayThreshold var rangeFirst = this.getDateDayIndex(normalRange.start); // inclusive first index var rangeLast = this.getDateDayIndex(normalRange.end.clone().subtract(1, 'days')); // inclusive last index var segs = []; var row; var rowFirst, rowLast; // inclusive day-index range for current row var i; var segFirst, segLast; // inclusive day-index range for segment for (row = 0; row < this.rowCnt; row++) { rowFirst = row * daysPerRow; rowLast = rowFirst + daysPerRow - 1; for (i = rowFirst; i <= rowLast; i++) { // intersect segment's offset range with the row's segFirst = Math.max(rangeFirst, i); segLast = Math.min(rangeLast, i); // deal with in-between indices segFirst = Math.ceil(segFirst); // in-between starts round to next cell segLast = Math.floor(segLast); // in-between ends round to prev cell if (segFirst <= segLast) { // was there any intersection with the current row? segs.push({ row: row, // normalize to start of row firstRowDayIndex: segFirst - rowFirst, lastRowDayIndex: segLast - rowFirst, // must be matching integers to be the segment's start/end isStart: segFirst === rangeFirst, isEnd: segLast === rangeLast }); } } } return segs; }, /* Header Rendering ------------------------------------------------------------------------------------------------------------------*/ renderHeadHtml: function() { var view = this.view; return '' + '<div class="fc-row ' + view.widgetHeaderClass + '">' + '<table>' + '<thead>' + this.renderHeadTrHtml() + '</thead>' + '</table>' + '</div>'; }, renderHeadIntroHtml: function() { return this.renderIntroHtml(); // fall back to generic }, renderHeadTrHtml: function() { return '' + '<tr>' + (this.isRTL ? '' : this.renderHeadIntroHtml()) + this.renderHeadDateCellsHtml() + (this.isRTL ? this.renderHeadIntroHtml() : '') + '</tr>'; }, renderHeadDateCellsHtml: function() { var htmls = []; var col, date; for (col = 0; col < this.colCnt; col++) { date = this.getCellDate(0, col); htmls.push(this.renderHeadDateCellHtml(date)); } return htmls.join(''); }, // TODO: when internalApiVersion, accept an object for HTML attributes // (colspan should be no different) renderHeadDateCellHtml: function(date, colspan, otherAttrs) { var view = this.view; var classNames = [ 'fc-day-header', view.widgetHeaderClass ]; // if only one row of days, the classNames on the header can represent the specific days beneath if (this.rowCnt === 1) { classNames = classNames.concat( // includes the day-of-week class // noThemeHighlight=true (don't highlight the header) this.getDayClasses(date, true) ); } else { classNames.push('fc-' + dayIDs[date.day()]); // only add the day-of-week class } return '' + '<th class="' + classNames.join(' ') + '"' + (this.rowCnt === 1 ? ' data-date="' + date.format('YYYY-MM-DD') + '"' : '') + (colspan > 1 ? ' colspan="' + colspan + '"' : '') + (otherAttrs ? ' ' + otherAttrs : '') + '>' + // don't make a link if the heading could represent multiple days, or if there's only one day (forceOff) view.buildGotoAnchorHtml( { date: date, forceOff: this.rowCnt > 1 || this.colCnt === 1 }, htmlEscape(date.format(this.colHeadFormat)) // inner HTML ) + '</th>'; }, /* Background Rendering ------------------------------------------------------------------------------------------------------------------*/ renderBgTrHtml: function(row) { return '' + '<tr>' + (this.isRTL ? '' : this.renderBgIntroHtml(row)) + this.renderBgCellsHtml(row) + (this.isRTL ? this.renderBgIntroHtml(row) : '') + '</tr>'; }, renderBgIntroHtml: function(row) { return this.renderIntroHtml(); // fall back to generic }, renderBgCellsHtml: function(row) { var htmls = []; var col, date; for (col = 0; col < this.colCnt; col++) { date = this.getCellDate(row, col); htmls.push(this.renderBgCellHtml(date)); } return htmls.join(''); }, renderBgCellHtml: function(date, otherAttrs) { var view = this.view; var classes = this.getDayClasses(date); classes.unshift('fc-day', view.widgetContentClass); return '<td class="' + classes.join(' ') + '"' + ' data-date="' + date.format('YYYY-MM-DD') + '"' + // if date has a time, won't format it (otherAttrs ? ' ' + otherAttrs : '') + '></td>'; }, /* Generic ------------------------------------------------------------------------------------------------------------------*/ // Generates the default HTML intro for any row. User classes should override renderIntroHtml: function() { }, // TODO: a generic method for dealing with <tr>, RTL, intro // when increment internalApiVersion // wrapTr (scheduler) /* Utils ------------------------------------------------------------------------------------------------------------------*/ // Applies the generic "intro" and "outro" HTML to the given cells. // Intro means the leftmost cell when the calendar is LTR and the rightmost cell when RTL. Vice-versa for outro. bookendCells: function(trEl) { var introHtml = this.renderIntroHtml(); if (introHtml) { if (this.isRTL) { trEl.append(introHtml); } else { trEl.prepend(introHtml); } } } }; ;; /* A component that renders a grid of whole-days that runs horizontally. There can be multiple rows, one per week. ----------------------------------------------------------------------------------------------------------------------*/ var DayGrid = FC.DayGrid = Grid.extend(DayTableMixin, { numbersVisible: false, // should render a row for day/week numbers? set by outside view. TODO: make internal bottomCoordPadding: 0, // hack for extending the hit area for the last row of the coordinate grid rowEls: null, // set of fake row elements cellEls: null, // set of whole-day elements comprising the row's background helperEls: null, // set of cell skeleton elements for rendering the mock event "helper" rowCoordCache: null, colCoordCache: null, // Renders the rows and columns into the component's `this.el`, which should already be assigned. // isRigid determins whether the individual rows should ignore the contents and be a constant height. // Relies on the view's colCnt and rowCnt. In the future, this component should probably be self-sufficient. renderDates: function(isRigid) { var view = this.view; var rowCnt = this.rowCnt; var colCnt = this.colCnt; var html = ''; var row; var col; for (row = 0; row < rowCnt; row++) { html += this.renderDayRowHtml(row, isRigid); } this.el.html(html); this.rowEls = this.el.find('.fc-row'); this.cellEls = this.el.find('.fc-day'); this.rowCoordCache = new CoordCache({ els: this.rowEls, isVertical: true }); this.colCoordCache = new CoordCache({ els: this.cellEls.slice(0, this.colCnt), // only the first row isHorizontal: true }); // trigger dayRender with each cell's element for (row = 0; row < rowCnt; row++) { for (col = 0; col < colCnt; col++) { view.publiclyTrigger( 'dayRender', null, this.getCellDate(row, col), this.getCellEl(row, col) ); } } }, unrenderDates: function() { this.removeSegPopover(); }, renderBusinessHours: function() { var segs = this.buildBusinessHourSegs(true); // wholeDay=true this.renderFill('businessHours', segs, 'bgevent'); }, unrenderBusinessHours: function() { this.unrenderFill('businessHours'); }, // Generates the HTML for a single row, which is a div that wraps a table. // `row` is the row number. renderDayRowHtml: function(row, isRigid) { var view = this.view; var classes = [ 'fc-row', 'fc-week', view.widgetContentClass ]; if (isRigid) { classes.push('fc-rigid'); } return '' + '<div class="' + classes.join(' ') + '">' + '<div class="fc-bg">' + '<table>' + this.renderBgTrHtml(row) + '</table>' + '</div>' + '<div class="fc-content-skeleton">' + '<table>' + (this.numbersVisible ? '<thead>' + this.renderNumberTrHtml(row) + '</thead>' : '' ) + '</table>' + '</div>' + '</div>'; }, /* Grid Number Rendering ------------------------------------------------------------------------------------------------------------------*/ renderNumberTrHtml: function(row) { return '' + '<tr>' + (this.isRTL ? '' : this.renderNumberIntroHtml(row)) + this.renderNumberCellsHtml(row) + (this.isRTL ? this.renderNumberIntroHtml(row) : '') + '</tr>'; }, renderNumberIntroHtml: function(row) { return this.renderIntroHtml(); }, renderNumberCellsHtml: function(row) { var htmls = []; var col, date; for (col = 0; col < this.colCnt; col++) { date = this.getCellDate(row, col); htmls.push(this.renderNumberCellHtml(date)); } return htmls.join(''); }, // Generates the HTML for the <td>s of the "number" row in the DayGrid's content skeleton. // The number row will only exist if either day numbers or week numbers are turned on. renderNumberCellHtml: function(date) { var html = ''; var classes; var weekCalcFirstDoW; if (!this.view.dayNumbersVisible && !this.view.cellWeekNumbersVisible) { // no numbers in day cell (week number must be along the side) return '<td/>'; // will create an empty space above events :( } classes = this.getDayClasses(date); classes.unshift('fc-day-top'); if (this.view.cellWeekNumbersVisible) { // To determine the day of week number change under ISO, we cannot // rely on moment.js methods such as firstDayOfWeek() or weekday(), // because they rely on the locale's dow (possibly overridden by // our firstDay option), which may not be Monday. We cannot change // dow, because that would affect the calendar start day as well. if (date._locale._fullCalendar_weekCalc === 'ISO') { weekCalcFirstDoW = 1; // Monday by ISO 8601 definition } else { weekCalcFirstDoW = date._locale.firstDayOfWeek(); } } html += '<td class="' + classes.join(' ') + '" data-date="' + date.format() + '">'; if (this.view.cellWeekNumbersVisible && (date.day() == weekCalcFirstDoW)) { html += this.view.buildGotoAnchorHtml( { date: date, type: 'week' }, { 'class': 'fc-week-number' }, date.format('w') // inner HTML ); } if (this.view.dayNumbersVisible) { html += this.view.buildGotoAnchorHtml( date, { 'class': 'fc-day-number' }, date.date() // inner HTML ); } html += '</td>'; return html; }, /* Options ------------------------------------------------------------------------------------------------------------------*/ // Computes a default event time formatting string if `timeFormat` is not explicitly defined computeEventTimeFormat: function() { return this.view.opt('extraSmallTimeFormat'); // like "6p" or "6:30p" }, // Computes a default `displayEventEnd` value if one is not expliclty defined computeDisplayEventEnd: function() { return this.colCnt == 1; // we'll likely have space if there's only one day }, /* Dates ------------------------------------------------------------------------------------------------------------------*/ rangeUpdated: function() { this.updateDayTable(); }, // Slices up the given span (unzoned start/end with other misc data) into an array of segments spanToSegs: function(span) { var segs = this.sliceRangeByRow(span); var i, seg; for (i = 0; i < segs.length; i++) { seg = segs[i]; if (this.isRTL) { seg.leftCol = this.daysPerRow - 1 - seg.lastRowDayIndex; seg.rightCol = this.daysPerRow - 1 - seg.firstRowDayIndex; } else { seg.leftCol = seg.firstRowDayIndex; seg.rightCol = seg.lastRowDayIndex; } } return segs; }, /* Hit System ------------------------------------------------------------------------------------------------------------------*/ prepareHits: function() { this.colCoordCache.build(); this.rowCoordCache.build(); this.rowCoordCache.bottoms[this.rowCnt - 1] += this.bottomCoordPadding; // hack }, releaseHits: function() { this.colCoordCache.clear(); this.rowCoordCache.clear(); }, queryHit: function(leftOffset, topOffset) { if (this.colCoordCache.isLeftInBounds(leftOffset) && this.rowCoordCache.isTopInBounds(topOffset)) { var col = this.colCoordCache.getHorizontalIndex(leftOffset); var row = this.rowCoordCache.getVerticalIndex(topOffset); if (row != null && col != null) { return this.getCellHit(row, col); } } }, getHitSpan: function(hit) { return this.getCellRange(hit.row, hit.col); }, getHitEl: function(hit) { return this.getCellEl(hit.row, hit.col); }, /* Cell System ------------------------------------------------------------------------------------------------------------------*/ // FYI: the first column is the leftmost column, regardless of date getCellHit: function(row, col) { return { row: row, col: col, component: this, // needed unfortunately :( left: this.colCoordCache.getLeftOffset(col), right: this.colCoordCache.getRightOffset(col), top: this.rowCoordCache.getTopOffset(row), bottom: this.rowCoordCache.getBottomOffset(row) }; }, getCellEl: function(row, col) { return this.cellEls.eq(row * this.colCnt + col); }, /* Event Drag Visualization ------------------------------------------------------------------------------------------------------------------*/ // TODO: move to DayGrid.event, similar to what we did with Grid's drag methods // Renders a visual indication of an event or external element being dragged. // `eventLocation` has zoned start and end (optional) renderDrag: function(eventLocation, seg) { // always render a highlight underneath this.renderHighlight(this.eventToSpan(eventLocation)); // if a segment from the same calendar but another component is being dragged, render a helper event if (seg && seg.component !== this) { return this.renderEventLocationHelper(eventLocation, seg); // returns mock event elements } }, // Unrenders any visual indication of a hovering event unrenderDrag: function() { this.unrenderHighlight(); this.unrenderHelper(); }, /* Event Resize Visualization ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of an event being resized renderEventResize: function(eventLocation, seg) { this.renderHighlight(this.eventToSpan(eventLocation)); return this.renderEventLocationHelper(eventLocation, seg); // returns mock event elements }, // Unrenders a visual indication of an event being resized unrenderEventResize: function() { this.unrenderHighlight(); this.unrenderHelper(); }, /* Event Helper ------------------------------------------------------------------------------------------------------------------*/ // Renders a mock "helper" event. `sourceSeg` is the associated internal segment object. It can be null. renderHelper: function(event, sourceSeg) { var helperNodes = []; var segs = this.eventToSegs(event); var rowStructs; segs = this.renderFgSegEls(segs); // assigns each seg's el and returns a subset of segs that were rendered rowStructs = this.renderSegRows(segs); // inject each new event skeleton into each associated row this.rowEls.each(function(row, rowNode) { var rowEl = $(rowNode); // the .fc-row var skeletonEl = $('<div class="fc-helper-skeleton"><table/></div>'); // will be absolutely positioned var skeletonTop; // If there is an original segment, match the top position. Otherwise, put it at the row's top level if (sourceSeg && sourceSeg.row === row) { skeletonTop = sourceSeg.el.position().top; } else { skeletonTop = rowEl.find('.fc-content-skeleton tbody').position().top; } skeletonEl.css('top', skeletonTop) .find('table') .append(rowStructs[row].tbodyEl); rowEl.append(skeletonEl); helperNodes.push(skeletonEl[0]); }); return ( // must return the elements rendered this.helperEls = $(helperNodes) // array -> jQuery set ); }, // Unrenders any visual indication of a mock helper event unrenderHelper: function() { if (this.helperEls) { this.helperEls.remove(); this.helperEls = null; } }, /* Fill System (highlight, background events, business hours) ------------------------------------------------------------------------------------------------------------------*/ fillSegTag: 'td', // override the default tag name // Renders a set of rectangles over the given segments of days. // Only returns segments that successfully rendered. renderFill: function(type, segs, className) { var nodes = []; var i, seg; var skeletonEl; segs = this.renderFillSegEls(type, segs); // assignes `.el` to each seg. returns successfully rendered segs for (i = 0; i < segs.length; i++) { seg = segs[i]; skeletonEl = this.renderFillRow(type, seg, className); this.rowEls.eq(seg.row).append(skeletonEl); nodes.push(skeletonEl[0]); } this.elsByFill[type] = $(nodes); return segs; }, // Generates the HTML needed for one row of a fill. Requires the seg's el to be rendered. renderFillRow: function(type, seg, className) { var colCnt = this.colCnt; var startCol = seg.leftCol; var endCol = seg.rightCol + 1; var skeletonEl; var trEl; className = className || type.toLowerCase(); skeletonEl = $( '<div class="fc-' + className + '-skeleton">' + '<table><tr/></table>' + '</div>' ); trEl = skeletonEl.find('tr'); if (startCol > 0) { trEl.append('<td colspan="' + startCol + '"/>'); } trEl.append( seg.el.attr('colspan', endCol - startCol) ); if (endCol < colCnt) { trEl.append('<td colspan="' + (colCnt - endCol) + '"/>'); } this.bookendCells(trEl); return skeletonEl; } }); ;; /* Event-rendering methods for the DayGrid class ----------------------------------------------------------------------------------------------------------------------*/ DayGrid.mixin({ rowStructs: null, // an array of objects, each holding information about a row's foreground event-rendering // Unrenders all events currently rendered on the grid unrenderEvents: function() { this.removeSegPopover(); // removes the "more.." events popover Grid.prototype.unrenderEvents.apply(this, arguments); // calls the super-method }, // Retrieves all rendered segment objects currently rendered on the grid getEventSegs: function() { return Grid.prototype.getEventSegs.call(this) // get the segments from the super-method .concat(this.popoverSegs || []); // append the segments from the "more..." popover }, // Renders the given background event segments onto the grid renderBgSegs: function(segs) { // don't render timed background events var allDaySegs = $.grep(segs, function(seg) { return seg.event.allDay; }); return Grid.prototype.renderBgSegs.call(this, allDaySegs); // call the super-method }, // Renders the given foreground event segments onto the grid renderFgSegs: function(segs) { var rowStructs; // render an `.el` on each seg // returns a subset of the segs. segs that were actually rendered segs = this.renderFgSegEls(segs); rowStructs = this.rowStructs = this.renderSegRows(segs); // append to each row's content skeleton this.rowEls.each(function(i, rowNode) { $(rowNode).find('.fc-content-skeleton > table').append( rowStructs[i].tbodyEl ); }); return segs; // return only the segs that were actually rendered }, // Unrenders all currently rendered foreground event segments unrenderFgSegs: function() { var rowStructs = this.rowStructs || []; var rowStruct; while ((rowStruct = rowStructs.pop())) { rowStruct.tbodyEl.remove(); } this.rowStructs = null; }, // Uses the given events array to generate <tbody> elements that should be appended to each row's content skeleton. // Returns an array of rowStruct objects (see the bottom of `renderSegRow`). // PRECONDITION: each segment shoud already have a rendered and assigned `.el` renderSegRows: function(segs) { var rowStructs = []; var segRows; var row; segRows = this.groupSegRows(segs); // group into nested arrays // iterate each row of segment groupings for (row = 0; row < segRows.length; row++) { rowStructs.push( this.renderSegRow(row, segRows[row]) ); } return rowStructs; }, // Builds the HTML to be used for the default element for an individual segment fgSegHtml: function(seg, disableResizing) { var view = this.view; var event = seg.event; var isDraggable = view.isEventDraggable(event); var isResizableFromStart = !disableResizing && event.allDay && seg.isStart && view.isEventResizableFromStart(event); var isResizableFromEnd = !disableResizing && event.allDay && seg.isEnd && view.isEventResizableFromEnd(event); var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd); var skinCss = cssToStr(this.getSegSkinCss(seg)); var timeHtml = ''; var timeText; var titleHtml; classes.unshift('fc-day-grid-event', 'fc-h-event'); // Only display a timed events time if it is the starting segment if (seg.isStart) { timeText = this.getEventTimeText(event); if (timeText) { timeHtml = '<span class="fc-time">' + htmlEscape(timeText) + '</span>'; } } titleHtml = '<span class="fc-title">' + (htmlEscape(event.title || '') || ' ') + // we always want one line of height '</span>'; return '<a class="' + classes.join(' ') + '"' + (event.url ? ' href="' + htmlEscape(event.url) + '"' : '' ) + (skinCss ? ' style="' + skinCss + '"' : '' ) + '>' + '<div class="fc-content">' + (this.isRTL ? titleHtml + ' ' + timeHtml : // put a natural space in between timeHtml + ' ' + titleHtml // ) + '</div>' + (isResizableFromStart ? '<div class="fc-resizer fc-start-resizer" />' : '' ) + (isResizableFromEnd ? '<div class="fc-resizer fc-end-resizer" />' : '' ) + '</a>'; }, // Given a row # and an array of segments all in the same row, render a <tbody> element, a skeleton that contains // the segments. Returns object with a bunch of internal data about how the render was calculated. // NOTE: modifies rowSegs renderSegRow: function(row, rowSegs) { var colCnt = this.colCnt; var segLevels = this.buildSegLevels(rowSegs); // group into sub-arrays of levels var levelCnt = Math.max(1, segLevels.length); // ensure at least one level var tbody = $('<tbody/>'); var segMatrix = []; // lookup for which segments are rendered into which level+col cells var cellMatrix = []; // lookup for all <td> elements of the level+col matrix var loneCellMatrix = []; // lookup for <td> elements that only take up a single column var i, levelSegs; var col; var tr; var j, seg; var td; // populates empty cells from the current column (`col`) to `endCol` function emptyCellsUntil(endCol) { while (col < endCol) { // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell td = (loneCellMatrix[i - 1] || [])[col]; if (td) { td.attr( 'rowspan', parseInt(td.attr('rowspan') || 1, 10) + 1 ); } else { td = $('<td/>'); tr.append(td); } cellMatrix[i][col] = td; loneCellMatrix[i][col] = td; col++; } } for (i = 0; i < levelCnt; i++) { // iterate through all levels levelSegs = segLevels[i]; col = 0; tr = $('<tr/>'); segMatrix.push([]); cellMatrix.push([]); loneCellMatrix.push([]); // levelCnt might be 1 even though there are no actual levels. protect against this. // this single empty row is useful for styling. if (levelSegs) { for (j = 0; j < levelSegs.length; j++) { // iterate through segments in level seg = levelSegs[j]; emptyCellsUntil(seg.leftCol); // create a container that occupies or more columns. append the event element. td = $('<td class="fc-event-container"/>').append(seg.el); if (seg.leftCol != seg.rightCol) { td.attr('colspan', seg.rightCol - seg.leftCol + 1); } else { // a single-column segment loneCellMatrix[i][col] = td; } while (col <= seg.rightCol) { cellMatrix[i][col] = td; segMatrix[i][col] = seg; col++; } tr.append(td); } } emptyCellsUntil(colCnt); // finish off the row this.bookendCells(tr); tbody.append(tr); } return { // a "rowStruct" row: row, // the row number tbodyEl: tbody, cellMatrix: cellMatrix, segMatrix: segMatrix, segLevels: segLevels, segs: rowSegs }; }, // Stacks a flat array of segments, which are all assumed to be in the same row, into subarrays of vertical levels. // NOTE: modifies segs buildSegLevels: function(segs) { var levels = []; var i, seg; var j; // Give preference to elements with certain criteria, so they have // a chance to be closer to the top. this.sortEventSegs(segs); for (i = 0; i < segs.length; i++) { seg = segs[i]; // loop through levels, starting with the topmost, until the segment doesn't collide with other segments for (j = 0; j < levels.length; j++) { if (!isDaySegCollision(seg, levels[j])) { break; } } // `j` now holds the desired subrow index seg.level = j; // create new level array if needed and append segment (levels[j] || (levels[j] = [])).push(seg); } // order segments left-to-right. very important if calendar is RTL for (j = 0; j < levels.length; j++) { levels[j].sort(compareDaySegCols); } return levels; }, // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's row groupSegRows: function(segs) { var segRows = []; var i; for (i = 0; i < this.rowCnt; i++) { segRows.push([]); } for (i = 0; i < segs.length; i++) { segRows[segs[i].row].push(segs[i]); } return segRows; } }); // Computes whether two segments' columns collide. They are assumed to be in the same row. function isDaySegCollision(seg, otherSegs) { var i, otherSeg; for (i = 0; i < otherSegs.length; i++) { otherSeg = otherSegs[i]; if ( otherSeg.leftCol <= seg.rightCol && otherSeg.rightCol >= seg.leftCol ) { return true; } } return false; } // A cmp function for determining the leftmost event function compareDaySegCols(a, b) { return a.leftCol - b.leftCol; } ;; /* Methods relate to limiting the number events for a given day on a DayGrid ----------------------------------------------------------------------------------------------------------------------*/ // NOTE: all the segs being passed around in here are foreground segs DayGrid.mixin({ segPopover: null, // the Popover that holds events that can't fit in a cell. null when not visible popoverSegs: null, // an array of segment objects that the segPopover holds. null when not visible removeSegPopover: function() { if (this.segPopover) { this.segPopover.hide(); // in handler, will call segPopover's removeElement } }, // Limits the number of "levels" (vertically stacking layers of events) for each row of the grid. // `levelLimit` can be false (don't limit), a number, or true (should be computed). limitRows: function(levelLimit) { var rowStructs = this.rowStructs || []; var row; // row # var rowLevelLimit; for (row = 0; row < rowStructs.length; row++) { this.unlimitRow(row); if (!levelLimit) { rowLevelLimit = false; } else if (typeof levelLimit === 'number') { rowLevelLimit = levelLimit; } else { rowLevelLimit = this.computeRowLevelLimit(row); } if (rowLevelLimit !== false) { this.limitRow(row, rowLevelLimit); } } }, // Computes the number of levels a row will accomodate without going outside its bounds. // Assumes the row is "rigid" (maintains a constant height regardless of what is inside). // `row` is the row number. computeRowLevelLimit: function(row) { var rowEl = this.rowEls.eq(row); // the containing "fake" row div var rowHeight = rowEl.height(); // TODO: cache somehow? var trEls = this.rowStructs[row].tbodyEl.children(); var i, trEl; var trHeight; function iterInnerHeights(i, childNode) { trHeight = Math.max(trHeight, $(childNode).outerHeight()); } // Reveal one level <tr> at a time and stop when we find one out of bounds for (i = 0; i < trEls.length; i++) { trEl = trEls.eq(i).removeClass('fc-limited'); // reset to original state (reveal) // with rowspans>1 and IE8, trEl.outerHeight() would return the height of the largest cell, // so instead, find the tallest inner content element. trHeight = 0; trEl.find('> td > :first-child').each(iterInnerHeights); if (trEl.position().top + trHeight > rowHeight) { return i; } } return false; // should not limit at all }, // Limits the given grid row to the maximum number of levels and injects "more" links if necessary. // `row` is the row number. // `levelLimit` is a number for the maximum (inclusive) number of levels allowed. limitRow: function(row, levelLimit) { var _this = this; var rowStruct = this.rowStructs[row]; var moreNodes = []; // array of "more" <a> links and <td> DOM nodes var col = 0; // col #, left-to-right (not chronologically) var levelSegs; // array of segment objects in the last allowable level, ordered left-to-right var cellMatrix; // a matrix (by level, then column) of all <td> jQuery elements in the row var limitedNodes; // array of temporarily hidden level <tr> and segment <td> DOM nodes var i, seg; var segsBelow; // array of segment objects below `seg` in the current `col` var totalSegsBelow; // total number of segments below `seg` in any of the columns `seg` occupies var colSegsBelow; // array of segment arrays, below seg, one for each column (offset from segs's first column) var td, rowspan; var segMoreNodes; // array of "more" <td> cells that will stand-in for the current seg's cell var j; var moreTd, moreWrap, moreLink; // Iterates through empty level cells and places "more" links inside if need be function emptyCellsUntil(endCol) { // goes from current `col` to `endCol` while (col < endCol) { segsBelow = _this.getCellSegs(row, col, levelLimit); if (segsBelow.length) { td = cellMatrix[levelLimit - 1][col]; moreLink = _this.renderMoreLink(row, col, segsBelow); moreWrap = $('<div/>').append(moreLink); td.append(moreWrap); moreNodes.push(moreWrap[0]); } col++; } } if (levelLimit && levelLimit < rowStruct.segLevels.length) { // is it actually over the limit? levelSegs = rowStruct.segLevels[levelLimit - 1]; cellMatrix = rowStruct.cellMatrix; limitedNodes = rowStruct.tbodyEl.children().slice(levelLimit) // get level <tr> elements past the limit .addClass('fc-limited').get(); // hide elements and get a simple DOM-nodes array // iterate though segments in the last allowable level for (i = 0; i < levelSegs.length; i++) { seg = levelSegs[i]; emptyCellsUntil(seg.leftCol); // process empty cells before the segment // determine *all* segments below `seg` that occupy the same columns colSegsBelow = []; totalSegsBelow = 0; while (col <= seg.rightCol) { segsBelow = this.getCellSegs(row, col, levelLimit); colSegsBelow.push(segsBelow); totalSegsBelow += segsBelow.length; col++; } if (totalSegsBelow) { // do we need to replace this segment with one or many "more" links? td = cellMatrix[levelLimit - 1][seg.leftCol]; // the segment's parent cell rowspan = td.attr('rowspan') || 1; segMoreNodes = []; // make a replacement <td> for each column the segment occupies. will be one for each colspan for (j = 0; j < colSegsBelow.length; j++) { moreTd = $('<td class="fc-more-cell"/>').attr('rowspan', rowspan); segsBelow = colSegsBelow[j]; moreLink = this.renderMoreLink( row, seg.leftCol + j, [ seg ].concat(segsBelow) // count seg as hidden too ); moreWrap = $('<div/>').append(moreLink); moreTd.append(moreWrap); segMoreNodes.push(moreTd[0]); moreNodes.push(moreTd[0]); } td.addClass('fc-limited').after($(segMoreNodes)); // hide original <td> and inject replacements limitedNodes.push(td[0]); } } emptyCellsUntil(this.colCnt); // finish off the level rowStruct.moreEls = $(moreNodes); // for easy undoing later rowStruct.limitedEls = $(limitedNodes); // for easy undoing later } }, // Reveals all levels and removes all "more"-related elements for a grid's row. // `row` is a row number. unlimitRow: function(row) { var rowStruct = this.rowStructs[row]; if (rowStruct.moreEls) { rowStruct.moreEls.remove(); rowStruct.moreEls = null; } if (rowStruct.limitedEls) { rowStruct.limitedEls.removeClass('fc-limited'); rowStruct.limitedEls = null; } }, // Renders an <a> element that represents hidden event element for a cell. // Responsible for attaching click handler as well. renderMoreLink: function(row, col, hiddenSegs) { var _this = this; var view = this.view; return $('<a class="fc-more"/>') .text( this.getMoreLinkText(hiddenSegs.length) ) .on('click', function(ev) { var clickOption = view.opt('eventLimitClick'); var date = _this.getCellDate(row, col); var moreEl = $(this); var dayEl = _this.getCellEl(row, col); var allSegs = _this.getCellSegs(row, col); // rescope the segments to be within the cell's date var reslicedAllSegs = _this.resliceDaySegs(allSegs, date); var reslicedHiddenSegs = _this.resliceDaySegs(hiddenSegs, date); if (typeof clickOption === 'function') { // the returned value can be an atomic option clickOption = view.publiclyTrigger('eventLimitClick', null, { date: date, dayEl: dayEl, moreEl: moreEl, segs: reslicedAllSegs, hiddenSegs: reslicedHiddenSegs }, ev); } if (clickOption === 'popover') { _this.showSegPopover(row, col, moreEl, reslicedAllSegs); } else if (typeof clickOption === 'string') { // a view name view.calendar.zoomTo(date, clickOption); } }); }, // Reveals the popover that displays all events within a cell showSegPopover: function(row, col, moreLink, segs) { var _this = this; var view = this.view; var moreWrap = moreLink.parent(); // the <div> wrapper around the <a> var topEl; // the element we want to match the top coordinate of var options; if (this.rowCnt == 1) { topEl = view.el; // will cause the popover to cover any sort of header } else { topEl = this.rowEls.eq(row); // will align with top of row } options = { className: 'fc-more-popover', content: this.renderSegPopoverContent(row, col, segs), parentEl: this.view.el, // attach to root of view. guarantees outside of scrollbars. top: topEl.offset().top, autoHide: true, // when the user clicks elsewhere, hide the popover viewportConstrain: view.opt('popoverViewportConstrain'), hide: function() { // kill everything when the popover is hidden // notify events to be removed if (_this.popoverSegs) { var seg; for (var i = 0; i < _this.popoverSegs.length; ++i) { seg = _this.popoverSegs[i]; view.publiclyTrigger('eventDestroy', seg.event, seg.event, seg.el); } } _this.segPopover.removeElement(); _this.segPopover = null; _this.popoverSegs = null; } }; // Determine horizontal coordinate. // We use the moreWrap instead of the <td> to avoid border confusion. if (this.isRTL) { options.right = moreWrap.offset().left + moreWrap.outerWidth() + 1; // +1 to be over cell border } else { options.left = moreWrap.offset().left - 1; // -1 to be over cell border } this.segPopover = new Popover(options); this.segPopover.show(); // the popover doesn't live within the grid's container element, and thus won't get the event // delegated-handlers for free. attach event-related handlers to the popover. this.bindSegHandlersToEl(this.segPopover.el); }, // Builds the inner DOM contents of the segment popover renderSegPopoverContent: function(row, col, segs) { var view = this.view; var isTheme = view.opt('theme'); var title = this.getCellDate(row, col).format(view.opt('dayPopoverFormat')); var content = $( '<div class="fc-header ' + view.widgetHeaderClass + '">' + '<span class="fc-close ' + (isTheme ? 'ui-icon ui-icon-closethick' : 'fc-icon fc-icon-x') + '"></span>' + '<span class="fc-title">' + htmlEscape(title) + '</span>' + '<div class="fc-clear"/>' + '</div>' + '<div class="fc-body ' + view.widgetContentClass + '">' + '<div class="fc-event-container"></div>' + '</div>' ); var segContainer = content.find('.fc-event-container'); var i; // render each seg's `el` and only return the visible segs segs = this.renderFgSegEls(segs, true); // disableResizing=true this.popoverSegs = segs; for (i = 0; i < segs.length; i++) { // because segments in the popover are not part of a grid coordinate system, provide a hint to any // grids that want to do drag-n-drop about which cell it came from this.prepareHits(); segs[i].hit = this.getCellHit(row, col); this.releaseHits(); segContainer.append(segs[i].el); } return content; }, // Given the events within an array of segment objects, reslice them to be in a single day resliceDaySegs: function(segs, dayDate) { // build an array of the original events var events = $.map(segs, function(seg) { return seg.event; }); var dayStart = dayDate.clone(); var dayEnd = dayStart.clone().add(1, 'days'); var dayRange = { start: dayStart, end: dayEnd }; // slice the events with a custom slicing function segs = this.eventsToSegs( events, function(range) { var seg = intersectRanges(range, dayRange); // undefind if no intersection return seg ? [ seg ] : []; // must return an array of segments } ); // force an order because eventsToSegs doesn't guarantee one this.sortEventSegs(segs); return segs; }, // Generates the text that should be inside a "more" link, given the number of events it represents getMoreLinkText: function(num) { var opt = this.view.opt('eventLimitText'); if (typeof opt === 'function') { return opt(num); } else { return '+' + num + ' ' + opt; } }, // Returns segments within a given cell. // If `startLevel` is specified, returns only events including and below that level. Otherwise returns all segs. getCellSegs: function(row, col, startLevel) { var segMatrix = this.rowStructs[row].segMatrix; var level = startLevel || 0; var segs = []; var seg; while (level < segMatrix.length) { seg = segMatrix[level][col]; if (seg) { segs.push(seg); } level++; } return segs; } }); ;; /* A component that renders one or more columns of vertical time slots ----------------------------------------------------------------------------------------------------------------------*/ // We mixin DayTable, even though there is only a single row of days var TimeGrid = FC.TimeGrid = Grid.extend(DayTableMixin, { slotDuration: null, // duration of a "slot", a distinct time segment on given day, visualized by lines snapDuration: null, // granularity of time for dragging and selecting snapsPerSlot: null, minTime: null, // Duration object that denotes the first visible time of any given day maxTime: null, // Duration object that denotes the exclusive visible end time of any given day labelFormat: null, // formatting string for times running along vertical axis labelInterval: null, // duration of how often a label should be displayed for a slot colEls: null, // cells elements in the day-row background slatContainerEl: null, // div that wraps all the slat rows slatEls: null, // elements running horizontally across all columns nowIndicatorEls: null, colCoordCache: null, slatCoordCache: null, constructor: function() { Grid.apply(this, arguments); // call the super-constructor this.processOptions(); }, // Renders the time grid into `this.el`, which should already be assigned. // Relies on the view's colCnt. In the future, this component should probably be self-sufficient. renderDates: function() { this.el.html(this.renderHtml()); this.colEls = this.el.find('.fc-day'); this.slatContainerEl = this.el.find('.fc-slats'); this.slatEls = this.slatContainerEl.find('tr'); this.colCoordCache = new CoordCache({ els: this.colEls, isHorizontal: true }); this.slatCoordCache = new CoordCache({ els: this.slatEls, isVertical: true }); this.renderContentSkeleton(); }, // Renders the basic HTML skeleton for the grid renderHtml: function() { return '' + '<div class="fc-bg">' + '<table>' + this.renderBgTrHtml(0) + // row=0 '</table>' + '</div>' + '<div class="fc-slats">' + '<table>' + this.renderSlatRowHtml() + '</table>' + '</div>'; }, // Generates the HTML for the horizontal "slats" that run width-wise. Has a time axis on a side. Depends on RTL. renderSlatRowHtml: function() { var view = this.view; var isRTL = this.isRTL; var html = ''; var slotTime = moment.duration(+this.minTime); // wish there was .clone() for durations var slotDate; // will be on the view's first day, but we only care about its time var isLabeled; var axisHtml; // Calculate the time for each slot while (slotTime < this.maxTime) { slotDate = this.start.clone().time(slotTime); isLabeled = isInt(divideDurationByDuration(slotTime, this.labelInterval)); axisHtml = '<td class="fc-axis fc-time ' + view.widgetContentClass + '" ' + view.axisStyleAttr() + '>' + (isLabeled ? '<span>' + // for matchCellWidths htmlEscape(slotDate.format(this.labelFormat)) + '</span>' : '' ) + '</td>'; html += '<tr data-time="' + slotDate.format('HH:mm:ss') + '"' + (isLabeled ? '' : ' class="fc-minor"') + '>' + (!isRTL ? axisHtml : '') + '<td class="' + view.widgetContentClass + '"/>' + (isRTL ? axisHtml : '') + "</tr>"; slotTime.add(this.slotDuration); } return html; }, /* Options ------------------------------------------------------------------------------------------------------------------*/ // Parses various options into properties of this object processOptions: function() { var view = this.view; var slotDuration = view.opt('slotDuration'); var snapDuration = view.opt('snapDuration'); var input; slotDuration = moment.duration(slotDuration); snapDuration = snapDuration ? moment.duration(snapDuration) : slotDuration; this.slotDuration = slotDuration; this.snapDuration = snapDuration; this.snapsPerSlot = slotDuration / snapDuration; // TODO: ensure an integer multiple? this.minResizeDuration = snapDuration; // hack this.minTime = moment.duration(view.opt('minTime')); this.maxTime = moment.duration(view.opt('maxTime')); // might be an array value (for TimelineView). // if so, getting the most granular entry (the last one probably). input = view.opt('slotLabelFormat'); if ($.isArray(input)) { input = input[input.length - 1]; } this.labelFormat = input || view.opt('smallTimeFormat'); // the computed default input = view.opt('slotLabelInterval'); this.labelInterval = input ? moment.duration(input) : this.computeLabelInterval(slotDuration); }, // Computes an automatic value for slotLabelInterval computeLabelInterval: function(slotDuration) { var i; var labelInterval; var slotsPerLabel; // find the smallest stock label interval that results in more than one slots-per-label for (i = AGENDA_STOCK_SUB_DURATIONS.length - 1; i >= 0; i--) { labelInterval = moment.duration(AGENDA_STOCK_SUB_DURATIONS[i]); slotsPerLabel = divideDurationByDuration(labelInterval, slotDuration); if (isInt(slotsPerLabel) && slotsPerLabel > 1) { return labelInterval; } } return moment.duration(slotDuration); // fall back. clone }, // Computes a default event time formatting string if `timeFormat` is not explicitly defined computeEventTimeFormat: function() { return this.view.opt('noMeridiemTimeFormat'); // like "6:30" (no AM/PM) }, // Computes a default `displayEventEnd` value if one is not expliclty defined computeDisplayEventEnd: function() { return true; }, /* Hit System ------------------------------------------------------------------------------------------------------------------*/ prepareHits: function() { this.colCoordCache.build(); this.slatCoordCache.build(); }, releaseHits: function() { this.colCoordCache.clear(); // NOTE: don't clear slatCoordCache because we rely on it for computeTimeTop }, queryHit: function(leftOffset, topOffset) { var snapsPerSlot = this.snapsPerSlot; var colCoordCache = this.colCoordCache; var slatCoordCache = this.slatCoordCache; if (colCoordCache.isLeftInBounds(leftOffset) && slatCoordCache.isTopInBounds(topOffset)) { var colIndex = colCoordCache.getHorizontalIndex(leftOffset); var slatIndex = slatCoordCache.getVerticalIndex(topOffset); if (colIndex != null && slatIndex != null) { var slatTop = slatCoordCache.getTopOffset(slatIndex); var slatHeight = slatCoordCache.getHeight(slatIndex); var partial = (topOffset - slatTop) / slatHeight; // floating point number between 0 and 1 var localSnapIndex = Math.floor(partial * snapsPerSlot); // the snap # relative to start of slat var snapIndex = slatIndex * snapsPerSlot + localSnapIndex; var snapTop = slatTop + (localSnapIndex / snapsPerSlot) * slatHeight; var snapBottom = slatTop + ((localSnapIndex + 1) / snapsPerSlot) * slatHeight; return { col: colIndex, snap: snapIndex, component: this, // needed unfortunately :( left: colCoordCache.getLeftOffset(colIndex), right: colCoordCache.getRightOffset(colIndex), top: snapTop, bottom: snapBottom }; } } }, getHitSpan: function(hit) { var start = this.getCellDate(0, hit.col); // row=0 var time = this.computeSnapTime(hit.snap); // pass in the snap-index var end; start.time(time); end = start.clone().add(this.snapDuration); return { start: start, end: end }; }, getHitEl: function(hit) { return this.colEls.eq(hit.col); }, /* Dates ------------------------------------------------------------------------------------------------------------------*/ rangeUpdated: function() { this.updateDayTable(); }, // Given a row number of the grid, representing a "snap", returns a time (Duration) from its start-of-day computeSnapTime: function(snapIndex) { return moment.duration(this.minTime + this.snapDuration * snapIndex); }, // Slices up the given span (unzoned start/end with other misc data) into an array of segments spanToSegs: function(span) { var segs = this.sliceRangeByTimes(span); var i; for (i = 0; i < segs.length; i++) { if (this.isRTL) { segs[i].col = this.daysPerRow - 1 - segs[i].dayIndex; } else { segs[i].col = segs[i].dayIndex; } } return segs; }, sliceRangeByTimes: function(range) { var segs = []; var seg; var dayIndex; var dayDate; var dayRange; for (dayIndex = 0; dayIndex < this.daysPerRow; dayIndex++) { dayDate = this.dayDates[dayIndex].clone(); // TODO: better API for this? dayRange = { start: dayDate.clone().time(this.minTime), end: dayDate.clone().time(this.maxTime) }; seg = intersectRanges(range, dayRange); // both will be ambig timezone if (seg) { seg.dayIndex = dayIndex; segs.push(seg); } } return segs; }, /* Coordinates ------------------------------------------------------------------------------------------------------------------*/ updateSize: function(isResize) { // NOT a standard Grid method this.slatCoordCache.build(); if (isResize) { this.updateSegVerticals( [].concat(this.fgSegs || [], this.bgSegs || [], this.businessSegs || []) ); } }, getTotalSlatHeight: function() { return this.slatContainerEl.outerHeight(); }, // Computes the top coordinate, relative to the bounds of the grid, of the given date. // A `startOfDayDate` must be given for avoiding ambiguity over how to treat midnight. computeDateTop: function(date, startOfDayDate) { return this.computeTimeTop( moment.duration( date - startOfDayDate.clone().stripTime() ) ); }, // Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration). computeTimeTop: function(time) { var len = this.slatEls.length; var slatCoverage = (time - this.minTime) / this.slotDuration; // floating-point value of # of slots covered var slatIndex; var slatRemainder; // compute a floating-point number for how many slats should be progressed through. // from 0 to number of slats (inclusive) // constrained because minTime/maxTime might be customized. slatCoverage = Math.max(0, slatCoverage); slatCoverage = Math.min(len, slatCoverage); // an integer index of the furthest whole slat // from 0 to number slats (*exclusive*, so len-1) slatIndex = Math.floor(slatCoverage); slatIndex = Math.min(slatIndex, len - 1); // how much further through the slatIndex slat (from 0.0-1.0) must be covered in addition. // could be 1.0 if slatCoverage is covering *all* the slots slatRemainder = slatCoverage - slatIndex; return this.slatCoordCache.getTopPosition(slatIndex) + this.slatCoordCache.getHeight(slatIndex) * slatRemainder; }, /* Event Drag Visualization ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of an event being dragged over the specified date(s). // A returned value of `true` signals that a mock "helper" event has been rendered. renderDrag: function(eventLocation, seg) { if (seg) { // if there is event information for this drag, render a helper event // returns mock event elements // signal that a helper has been rendered return this.renderEventLocationHelper(eventLocation, seg); } else { // otherwise, just render a highlight this.renderHighlight(this.eventToSpan(eventLocation)); } }, // Unrenders any visual indication of an event being dragged unrenderDrag: function() { this.unrenderHelper(); this.unrenderHighlight(); }, /* Event Resize Visualization ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of an event being resized renderEventResize: function(eventLocation, seg) { return this.renderEventLocationHelper(eventLocation, seg); // returns mock event elements }, // Unrenders any visual indication of an event being resized unrenderEventResize: function() { this.unrenderHelper(); }, /* Event Helper ------------------------------------------------------------------------------------------------------------------*/ // Renders a mock "helper" event. `sourceSeg` is the original segment object and might be null (an external drag) renderHelper: function(event, sourceSeg) { return this.renderHelperSegs(this.eventToSegs(event), sourceSeg); // returns mock event elements }, // Unrenders any mock helper event unrenderHelper: function() { this.unrenderHelperSegs(); }, /* Business Hours ------------------------------------------------------------------------------------------------------------------*/ renderBusinessHours: function() { this.renderBusinessSegs( this.buildBusinessHourSegs() ); }, unrenderBusinessHours: function() { this.unrenderBusinessSegs(); }, /* Now Indicator ------------------------------------------------------------------------------------------------------------------*/ getNowIndicatorUnit: function() { return 'minute'; // will refresh on the minute }, renderNowIndicator: function(date) { // seg system might be overkill, but it handles scenario where line needs to be rendered // more than once because of columns with the same date (resources columns for example) var segs = this.spanToSegs({ start: date, end: date }); var top = this.computeDateTop(date, date); var nodes = []; var i; // render lines within the columns for (i = 0; i < segs.length; i++) { nodes.push($('<div class="fc-now-indicator fc-now-indicator-line"></div>') .css('top', top) .appendTo(this.colContainerEls.eq(segs[i].col))[0]); } // render an arrow over the axis if (segs.length > 0) { // is the current time in view? nodes.push($('<div class="fc-now-indicator fc-now-indicator-arrow"></div>') .css('top', top) .appendTo(this.el.find('.fc-content-skeleton'))[0]); } this.nowIndicatorEls = $(nodes); }, unrenderNowIndicator: function() { if (this.nowIndicatorEls) { this.nowIndicatorEls.remove(); this.nowIndicatorEls = null; } }, /* Selection ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of a selection. Overrides the default, which was to simply render a highlight. renderSelection: function(span) { if (this.view.opt('selectHelper')) { // this setting signals that a mock helper event should be rendered // normally acceps an eventLocation, span has a start/end, which is good enough this.renderEventLocationHelper(span); } else { this.renderHighlight(span); } }, // Unrenders any visual indication of a selection unrenderSelection: function() { this.unrenderHelper(); this.unrenderHighlight(); }, /* Highlight ------------------------------------------------------------------------------------------------------------------*/ renderHighlight: function(span) { this.renderHighlightSegs(this.spanToSegs(span)); }, unrenderHighlight: function() { this.unrenderHighlightSegs(); } }); ;; /* Methods for rendering SEGMENTS, pieces of content that live on the view ( this file is no longer just for events ) ----------------------------------------------------------------------------------------------------------------------*/ TimeGrid.mixin({ colContainerEls: null, // containers for each column // inner-containers for each column where different types of segs live fgContainerEls: null, bgContainerEls: null, helperContainerEls: null, highlightContainerEls: null, businessContainerEls: null, // arrays of different types of displayed segments fgSegs: null, bgSegs: null, helperSegs: null, highlightSegs: null, businessSegs: null, // Renders the DOM that the view's content will live in renderContentSkeleton: function() { var cellHtml = ''; var i; var skeletonEl; for (i = 0; i < this.colCnt; i++) { cellHtml += '<td>' + '<div class="fc-content-col">' + '<div class="fc-event-container fc-helper-container"></div>' + '<div class="fc-event-container"></div>' + '<div class="fc-highlight-container"></div>' + '<div class="fc-bgevent-container"></div>' + '<div class="fc-business-container"></div>' + '</div>' + '</td>'; } skeletonEl = $( '<div class="fc-content-skeleton">' + '<table>' + '<tr>' + cellHtml + '</tr>' + '</table>' + '</div>' ); this.colContainerEls = skeletonEl.find('.fc-content-col'); this.helperContainerEls = skeletonEl.find('.fc-helper-container'); this.fgContainerEls = skeletonEl.find('.fc-event-container:not(.fc-helper-container)'); this.bgContainerEls = skeletonEl.find('.fc-bgevent-container'); this.highlightContainerEls = skeletonEl.find('.fc-highlight-container'); this.businessContainerEls = skeletonEl.find('.fc-business-container'); this.bookendCells(skeletonEl.find('tr')); // TODO: do this on string level this.el.append(skeletonEl); }, /* Foreground Events ------------------------------------------------------------------------------------------------------------------*/ renderFgSegs: function(segs) { segs = this.renderFgSegsIntoContainers(segs, this.fgContainerEls); this.fgSegs = segs; return segs; // needed for Grid::renderEvents }, unrenderFgSegs: function() { this.unrenderNamedSegs('fgSegs'); }, /* Foreground Helper Events ------------------------------------------------------------------------------------------------------------------*/ renderHelperSegs: function(segs, sourceSeg) { var helperEls = []; var i, seg; var sourceEl; segs = this.renderFgSegsIntoContainers(segs, this.helperContainerEls); // Try to make the segment that is in the same row as sourceSeg look the same for (i = 0; i < segs.length; i++) { seg = segs[i]; if (sourceSeg && sourceSeg.col === seg.col) { sourceEl = sourceSeg.el; seg.el.css({ left: sourceEl.css('left'), right: sourceEl.css('right'), 'margin-left': sourceEl.css('margin-left'), 'margin-right': sourceEl.css('margin-right') }); } helperEls.push(seg.el[0]); } this.helperSegs = segs; return $(helperEls); // must return rendered helpers }, unrenderHelperSegs: function() { this.unrenderNamedSegs('helperSegs'); }, /* Background Events ------------------------------------------------------------------------------------------------------------------*/ renderBgSegs: function(segs) { segs = this.renderFillSegEls('bgEvent', segs); // TODO: old fill system this.updateSegVerticals(segs); this.attachSegsByCol(this.groupSegsByCol(segs), this.bgContainerEls); this.bgSegs = segs; return segs; // needed for Grid::renderEvents }, unrenderBgSegs: function() { this.unrenderNamedSegs('bgSegs'); }, /* Highlight ------------------------------------------------------------------------------------------------------------------*/ renderHighlightSegs: function(segs) { segs = this.renderFillSegEls('highlight', segs); // TODO: old fill system this.updateSegVerticals(segs); this.attachSegsByCol(this.groupSegsByCol(segs), this.highlightContainerEls); this.highlightSegs = segs; }, unrenderHighlightSegs: function() { this.unrenderNamedSegs('highlightSegs'); }, /* Business Hours ------------------------------------------------------------------------------------------------------------------*/ renderBusinessSegs: function(segs) { segs = this.renderFillSegEls('businessHours', segs); // TODO: old fill system this.updateSegVerticals(segs); this.attachSegsByCol(this.groupSegsByCol(segs), this.businessContainerEls); this.businessSegs = segs; }, unrenderBusinessSegs: function() { this.unrenderNamedSegs('businessSegs'); }, /* Seg Rendering Utils ------------------------------------------------------------------------------------------------------------------*/ // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's col groupSegsByCol: function(segs) { var segsByCol = []; var i; for (i = 0; i < this.colCnt; i++) { segsByCol.push([]); } for (i = 0; i < segs.length; i++) { segsByCol[segs[i].col].push(segs[i]); } return segsByCol; }, // Given segments grouped by column, insert the segments' elements into a parallel array of container // elements, each living within a column. attachSegsByCol: function(segsByCol, containerEls) { var col; var segs; var i; for (col = 0; col < this.colCnt; col++) { // iterate each column grouping segs = segsByCol[col]; for (i = 0; i < segs.length; i++) { containerEls.eq(col).append(segs[i].el); } } }, // Given the name of a property of `this` object, assumed to be an array of segments, // loops through each segment and removes from DOM. Will null-out the property afterwards. unrenderNamedSegs: function(propName) { var segs = this[propName]; var i; if (segs) { for (i = 0; i < segs.length; i++) { segs[i].el.remove(); } this[propName] = null; } }, /* Foreground Event Rendering Utils ------------------------------------------------------------------------------------------------------------------*/ // Given an array of foreground segments, render a DOM element for each, computes position, // and attaches to the column inner-container elements. renderFgSegsIntoContainers: function(segs, containerEls) { var segsByCol; var col; segs = this.renderFgSegEls(segs); // will call fgSegHtml segsByCol = this.groupSegsByCol(segs); for (col = 0; col < this.colCnt; col++) { this.updateFgSegCoords(segsByCol[col]); } this.attachSegsByCol(segsByCol, containerEls); return segs; }, // Renders the HTML for a single event segment's default rendering fgSegHtml: function(seg, disableResizing) { var view = this.view; var event = seg.event; var isDraggable = view.isEventDraggable(event); var isResizableFromStart = !disableResizing && seg.isStart && view.isEventResizableFromStart(event); var isResizableFromEnd = !disableResizing && seg.isEnd && view.isEventResizableFromEnd(event); var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd); var skinCss = cssToStr(this.getSegSkinCss(seg)); var timeText; var fullTimeText; // more verbose time text. for the print stylesheet var startTimeText; // just the start time text classes.unshift('fc-time-grid-event', 'fc-v-event'); if (view.isMultiDayEvent(event)) { // if the event appears to span more than one day... // Don't display time text on segments that run entirely through a day. // That would appear as midnight-midnight and would look dumb. // Otherwise, display the time text for the *segment's* times (like 6pm-midnight or midnight-10am) if (seg.isStart || seg.isEnd) { timeText = this.getEventTimeText(seg); fullTimeText = this.getEventTimeText(seg, 'LT'); startTimeText = this.getEventTimeText(seg, null, false); // displayEnd=false } } else { // Display the normal time text for the *event's* times timeText = this.getEventTimeText(event); fullTimeText = this.getEventTimeText(event, 'LT'); startTimeText = this.getEventTimeText(event, null, false); // displayEnd=false } return '<a class="' + classes.join(' ') + '"' + (event.url ? ' href="' + htmlEscape(event.url) + '"' : '' ) + (skinCss ? ' style="' + skinCss + '"' : '' ) + '>' + '<div class="fc-content">' + (timeText ? '<div class="fc-time"' + ' data-start="' + htmlEscape(startTimeText) + '"' + ' data-full="' + htmlEscape(fullTimeText) + '"' + '>' + '<span>' + htmlEscape(timeText) + '</span>' + '</div>' : '' ) + (event.title ? '<div class="fc-title">' + htmlEscape(event.title) + '</div>' : '' ) + '</div>' + '<div class="fc-bg"/>' + /* TODO: write CSS for this (isResizableFromStart ? '<div class="fc-resizer fc-start-resizer" />' : '' ) + */ (isResizableFromEnd ? '<div class="fc-resizer fc-end-resizer" />' : '' ) + '</a>'; }, /* Seg Position Utils ------------------------------------------------------------------------------------------------------------------*/ // Refreshes the CSS top/bottom coordinates for each segment element. // Works when called after initial render, after a window resize/zoom for example. updateSegVerticals: function(segs) { this.computeSegVerticals(segs); this.assignSegVerticals(segs); }, // For each segment in an array, computes and assigns its top and bottom properties computeSegVerticals: function(segs) { var i, seg; for (i = 0; i < segs.length; i++) { seg = segs[i]; seg.top = this.computeDateTop(seg.start, seg.start); seg.bottom = this.computeDateTop(seg.end, seg.start); } }, // Given segments that already have their top/bottom properties computed, applies those values to // the segments' elements. assignSegVerticals: function(segs) { var i, seg; for (i = 0; i < segs.length; i++) { seg = segs[i]; seg.el.css(this.generateSegVerticalCss(seg)); } }, // Generates an object with CSS properties for the top/bottom coordinates of a segment element generateSegVerticalCss: function(seg) { return { top: seg.top, bottom: -seg.bottom // flipped because needs to be space beyond bottom edge of event container }; }, /* Foreground Event Positioning Utils ------------------------------------------------------------------------------------------------------------------*/ // Given segments that are assumed to all live in the *same column*, // compute their verical/horizontal coordinates and assign to their elements. updateFgSegCoords: function(segs) { this.computeSegVerticals(segs); // horizontals relies on this this.computeFgSegHorizontals(segs); // compute horizontal coordinates, z-index's, and reorder the array this.assignSegVerticals(segs); this.assignFgSegHorizontals(segs); }, // Given an array of segments that are all in the same column, sets the backwardCoord and forwardCoord on each. // NOTE: Also reorders the given array by date! computeFgSegHorizontals: function(segs) { var levels; var level0; var i; this.sortEventSegs(segs); // order by certain criteria levels = buildSlotSegLevels(segs); computeForwardSlotSegs(levels); if ((level0 = levels[0])) { for (i = 0; i < level0.length; i++) { computeSlotSegPressures(level0[i]); } for (i = 0; i < level0.length; i++) { this.computeFgSegForwardBack(level0[i], 0, 0); } } }, // Calculate seg.forwardCoord and seg.backwardCoord for the segment, where both values range // from 0 to 1. If the calendar is left-to-right, the seg.backwardCoord maps to "left" and // seg.forwardCoord maps to "right" (via percentage). Vice-versa if the calendar is right-to-left. // // The segment might be part of a "series", which means consecutive segments with the same pressure // who's width is unknown until an edge has been hit. `seriesBackwardPressure` is the number of // segments behind this one in the current series, and `seriesBackwardCoord` is the starting // coordinate of the first segment in the series. computeFgSegForwardBack: function(seg, seriesBackwardPressure, seriesBackwardCoord) { var forwardSegs = seg.forwardSegs; var i; if (seg.forwardCoord === undefined) { // not already computed if (!forwardSegs.length) { // if there are no forward segments, this segment should butt up against the edge seg.forwardCoord = 1; } else { // sort highest pressure first this.sortForwardSegs(forwardSegs); // this segment's forwardCoord will be calculated from the backwardCoord of the // highest-pressure forward segment. this.computeFgSegForwardBack(forwardSegs[0], seriesBackwardPressure + 1, seriesBackwardCoord); seg.forwardCoord = forwardSegs[0].backwardCoord; } // calculate the backwardCoord from the forwardCoord. consider the series seg.backwardCoord = seg.forwardCoord - (seg.forwardCoord - seriesBackwardCoord) / // available width for series (seriesBackwardPressure + 1); // # of segments in the series // use this segment's coordinates to computed the coordinates of the less-pressurized // forward segments for (i=0; i<forwardSegs.length; i++) { this.computeFgSegForwardBack(forwardSegs[i], 0, seg.forwardCoord); } } }, sortForwardSegs: function(forwardSegs) { forwardSegs.sort(proxy(this, 'compareForwardSegs')); }, // A cmp function for determining which forward segment to rely on more when computing coordinates. compareForwardSegs: function(seg1, seg2) { // put higher-pressure first return seg2.forwardPressure - seg1.forwardPressure || // put segments that are closer to initial edge first (and favor ones with no coords yet) (seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) || // do normal sorting... this.compareEventSegs(seg1, seg2); }, // Given foreground event segments that have already had their position coordinates computed, // assigns position-related CSS values to their elements. assignFgSegHorizontals: function(segs) { var i, seg; for (i = 0; i < segs.length; i++) { seg = segs[i]; seg.el.css(this.generateFgSegHorizontalCss(seg)); // if the height is short, add a className for alternate styling if (seg.bottom - seg.top < 30) { seg.el.addClass('fc-short'); } } }, // Generates an object with CSS properties/values that should be applied to an event segment element. // Contains important positioning-related properties that should be applied to any event element, customized or not. generateFgSegHorizontalCss: function(seg) { var shouldOverlap = this.view.opt('slotEventOverlap'); var backwardCoord = seg.backwardCoord; // the left side if LTR. the right side if RTL. floating-point var forwardCoord = seg.forwardCoord; // the right side if LTR. the left side if RTL. floating-point var props = this.generateSegVerticalCss(seg); // get top/bottom first var left; // amount of space from left edge, a fraction of the total width var right; // amount of space from right edge, a fraction of the total width if (shouldOverlap) { // double the width, but don't go beyond the maximum forward coordinate (1.0) forwardCoord = Math.min(1, backwardCoord + (forwardCoord - backwardCoord) * 2); } if (this.isRTL) { left = 1 - forwardCoord; right = backwardCoord; } else { left = backwardCoord; right = 1 - forwardCoord; } props.zIndex = seg.level + 1; // convert from 0-base to 1-based props.left = left * 100 + '%'; props.right = right * 100 + '%'; if (shouldOverlap && seg.forwardPressure) { // add padding to the edge so that forward stacked events don't cover the resizer's icon props[this.isRTL ? 'marginLeft' : 'marginRight'] = 10 * 2; // 10 is a guesstimate of the icon's width } return props; } }); // Builds an array of segments "levels". The first level will be the leftmost tier of segments if the calendar is // left-to-right, or the rightmost if the calendar is right-to-left. Assumes the segments are already ordered by date. function buildSlotSegLevels(segs) { var levels = []; var i, seg; var j; for (i=0; i<segs.length; i++) { seg = segs[i]; // go through all the levels and stop on the first level where there are no collisions for (j=0; j<levels.length; j++) { if (!computeSlotSegCollisions(seg, levels[j]).length) { break; } } seg.level = j; (levels[j] || (levels[j] = [])).push(seg); } return levels; } // For every segment, figure out the other segments that are in subsequent // levels that also occupy the same vertical space. Accumulate in seg.forwardSegs function computeForwardSlotSegs(levels) { var i, level; var j, seg; var k; for (i=0; i<levels.length; i++) { level = levels[i]; for (j=0; j<level.length; j++) { seg = level[j]; seg.forwardSegs = []; for (k=i+1; k<levels.length; k++) { computeSlotSegCollisions(seg, levels[k], seg.forwardSegs); } } } } // Figure out which path forward (via seg.forwardSegs) results in the longest path until // the furthest edge is reached. The number of segments in this path will be seg.forwardPressure function computeSlotSegPressures(seg) { var forwardSegs = seg.forwardSegs; var forwardPressure = 0; var i, forwardSeg; if (seg.forwardPressure === undefined) { // not already computed for (i=0; i<forwardSegs.length; i++) { forwardSeg = forwardSegs[i]; // figure out the child's maximum forward path computeSlotSegPressures(forwardSeg); // either use the existing maximum, or use the child's forward pressure // plus one (for the forwardSeg itself) forwardPressure = Math.max( forwardPressure, 1 + forwardSeg.forwardPressure ); } seg.forwardPressure = forwardPressure; } } // Find all the segments in `otherSegs` that vertically collide with `seg`. // Append into an optionally-supplied `results` array and return. function computeSlotSegCollisions(seg, otherSegs, results) { results = results || []; for (var i=0; i<otherSegs.length; i++) { if (isSlotSegCollision(seg, otherSegs[i])) { results.push(otherSegs[i]); } } return results; } // Do these segments occupy the same vertical space? function isSlotSegCollision(seg1, seg2) { return seg1.bottom > seg2.top && seg1.top < seg2.bottom; } ;; /* An abstract class from which other views inherit from ----------------------------------------------------------------------------------------------------------------------*/ var View = FC.View = Class.extend(EmitterMixin, ListenerMixin, { type: null, // subclass' view name (string) name: null, // deprecated. use `type` instead title: null, // the text that will be displayed in the header's title calendar: null, // owner Calendar object options: null, // hash containing all options. already merged with view-specific-options el: null, // the view's containing element. set by Calendar isDateSet: false, isDateRendered: false, dateRenderQueue: null, isEventsBound: false, isEventsSet: false, isEventsRendered: false, eventRenderQueue: null, // range the view is actually displaying (moments) start: null, end: null, // exclusive // range the view is formally responsible for (moments) // may be different from start/end. for example, a month view might have 1st-31st, excluding padded dates intervalStart: null, intervalEnd: null, // exclusive intervalDuration: null, intervalUnit: null, // name of largest unit being displayed, like "month" or "week" isRTL: false, isSelected: false, // boolean whether a range of time is user-selected or not selectedEvent: null, eventOrderSpecs: null, // criteria for ordering events when they have same date/time // classNames styled by jqui themes widgetHeaderClass: null, widgetContentClass: null, highlightStateClass: null, // for date utils, computed from options nextDayThreshold: null, isHiddenDayHash: null, // now indicator isNowIndicatorRendered: null, initialNowDate: null, // result first getNow call initialNowQueriedMs: null, // ms time the getNow was called nowIndicatorTimeoutID: null, // for refresh timing of now indicator nowIndicatorIntervalID: null, // " constructor: function(calendar, type, options, intervalDuration) { this.calendar = calendar; this.type = this.name = type; // .name is deprecated this.options = options; this.intervalDuration = intervalDuration || moment.duration(1, 'day'); this.nextDayThreshold = moment.duration(this.opt('nextDayThreshold')); this.initThemingProps(); this.initHiddenDays(); this.isRTL = this.opt('isRTL'); this.eventOrderSpecs = parseFieldSpecs(this.opt('eventOrder')); this.dateRenderQueue = new TaskQueue(); this.eventRenderQueue = new TaskQueue(this.opt('eventRenderWait')); this.initialize(); }, // A good place for subclasses to initialize member variables initialize: function() { // subclasses can implement }, // Retrieves an option with the given name opt: function(name) { return this.options[name]; }, // Triggers handlers that are view-related. Modifies args before passing to calendar. publiclyTrigger: function(name, thisObj) { // arguments beyond thisObj are passed along var calendar = this.calendar; return calendar.publiclyTrigger.apply( calendar, [name, thisObj || this].concat( Array.prototype.slice.call(arguments, 2), // arguments beyond thisObj [ this ] // always make the last argument a reference to the view. TODO: deprecate ) ); }, // Returns a proxy of the given promise that will be rejected if the given event fires // before the promise resolves. rejectOn: function(eventName, promise) { var _this = this; return new Promise(function(resolve, reject) { _this.one(eventName, reject); function cleanup() { _this.off(eventName, reject); } promise.then(function(res) { // success cleanup(); resolve(res); }, function() { // failure cleanup(); reject(); }); }); }, /* Date Computation ------------------------------------------------------------------------------------------------------------------*/ // Updates all internal dates for displaying the given unzoned range. setRange: function(range) { $.extend(this, range); // assigns every property to this object's member variables this.updateTitle(); }, // Given a single current unzoned date, produce information about what range to display. // Subclasses can override. Must return all properties. computeRange: function(date) { var intervalUnit = computeIntervalUnit(this.intervalDuration); var intervalStart = date.clone().startOf(intervalUnit); var intervalEnd = intervalStart.clone().add(this.intervalDuration); var start, end; // normalize the range's time-ambiguity if (/year|month|week|day/.test(intervalUnit)) { // whole-days? intervalStart.stripTime(); intervalEnd.stripTime(); } else { // needs to have a time? if (!intervalStart.hasTime()) { intervalStart = this.calendar.time(0); // give 00:00 time } if (!intervalEnd.hasTime()) { intervalEnd = this.calendar.time(0); // give 00:00 time } } start = intervalStart.clone(); start = this.skipHiddenDays(start); end = intervalEnd.clone(); end = this.skipHiddenDays(end, -1, true); // exclusively move backwards return { intervalUnit: intervalUnit, intervalStart: intervalStart, intervalEnd: intervalEnd, start: start, end: end }; }, // Computes the new date when the user hits the prev button, given the current date computePrevDate: function(date) { return this.massageCurrentDate( date.clone().startOf(this.intervalUnit).subtract(this.intervalDuration), -1 ); }, // Computes the new date when the user hits the next button, given the current date computeNextDate: function(date) { return this.massageCurrentDate( date.clone().startOf(this.intervalUnit).add(this.intervalDuration) ); }, // Given an arbitrarily calculated current date of the calendar, returns a date that is ensured to be completely // visible. `direction` is optional and indicates which direction the current date was being // incremented or decremented (1 or -1). massageCurrentDate: function(date, direction) { if (this.intervalDuration.as('days') <= 1) { // if the view displays a single day or smaller if (this.isHiddenDay(date)) { date = this.skipHiddenDays(date, direction); date.startOf('day'); } } return date; }, /* Title and Date Formatting ------------------------------------------------------------------------------------------------------------------*/ // Sets the view's title property to the most updated computed value updateTitle: function() { this.title = this.computeTitle(); this.calendar.setToolbarsTitle(this.title); }, // Computes what the title at the top of the calendar should be for this view computeTitle: function() { return this.formatRange( { // in case intervalStart/End has a time, make sure timezone is correct start: this.calendar.applyTimezone(this.intervalStart), end: this.calendar.applyTimezone(this.intervalEnd) }, this.opt('titleFormat') || this.computeTitleFormat(), this.opt('titleRangeSeparator') ); }, // Generates the format string that should be used to generate the title for the current date range. // Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`. computeTitleFormat: function() { if (this.intervalUnit == 'year') { return 'YYYY'; } else if (this.intervalUnit == 'month') { return this.opt('monthYearFormat'); // like "September 2014" } else if (this.intervalDuration.as('days') > 1) { return 'll'; // multi-day range. shorter, like "Sep 9 - 10 2014" } else { return 'LL'; // one day. longer, like "September 9 2014" } }, // Utility for formatting a range. Accepts a range object, formatting string, and optional separator. // Displays all-day ranges naturally, with an inclusive end. Takes the current isRTL into account. // The timezones of the dates within `range` will be respected. formatRange: function(range, formatStr, separator) { var end = range.end; if (!end.hasTime()) { // all-day? end = end.clone().subtract(1); // convert to inclusive. last ms of previous day } return formatRange(range.start, end, formatStr, separator, this.opt('isRTL')); }, getAllDayHtml: function() { return this.opt('allDayHtml') || htmlEscape(this.opt('allDayText')); }, /* Navigation ------------------------------------------------------------------------------------------------------------------*/ // Generates HTML for an anchor to another view into the calendar. // Will either generate an <a> tag or a non-clickable <span> tag, depending on enabled settings. // `gotoOptions` can either be a moment input, or an object with the form: // { date, type, forceOff } // `type` is a view-type like "day" or "week". default value is "day". // `attrs` and `innerHtml` are use to generate the rest of the HTML tag. buildGotoAnchorHtml: function(gotoOptions, attrs, innerHtml) { var date, type, forceOff; var finalOptions; if ($.isPlainObject(gotoOptions)) { date = gotoOptions.date; type = gotoOptions.type; forceOff = gotoOptions.forceOff; } else { date = gotoOptions; // a single moment input } date = FC.moment(date); // if a string, parse it finalOptions = { // for serialization into the link date: date.format('YYYY-MM-DD'), type: type || 'day' }; if (typeof attrs === 'string') { innerHtml = attrs; attrs = null; } attrs = attrs ? ' ' + attrsToStr(attrs) : ''; // will have a leading space innerHtml = innerHtml || ''; if (!forceOff && this.opt('navLinks')) { return '<a' + attrs + ' data-goto="' + htmlEscape(JSON.stringify(finalOptions)) + '">' + innerHtml + '</a>'; } else { return '<span' + attrs + '>' + innerHtml + '</span>'; } }, // Rendering Non-date-related Content // ----------------------------------------------------------------------------------------------------------------- // Sets the container element that the view should render inside of, does global DOM-related initializations, // and renders all the non-date-related content inside. setElement: function(el) { this.el = el; this.bindGlobalHandlers(); this.renderSkeleton(); }, // Removes the view's container element from the DOM, clearing any content beforehand. // Undoes any other DOM-related attachments. removeElement: function() { this.unsetDate(); this.unrenderSkeleton(); this.unbindGlobalHandlers(); this.el.remove(); // NOTE: don't null-out this.el in case the View was destroyed within an API callback. // We don't null-out the View's other jQuery element references upon destroy, // so we shouldn't kill this.el either. }, // Renders the basic structure of the view before any content is rendered renderSkeleton: function() { // subclasses should implement }, // Unrenders the basic structure of the view unrenderSkeleton: function() { // subclasses should implement }, // Date Setting/Unsetting // ----------------------------------------------------------------------------------------------------------------- setDate: function(date) { var isReset = this.isDateSet; this.isDateSet = true; this.handleDate(date, isReset); this.trigger(isReset ? 'dateReset' : 'dateSet', date); }, unsetDate: function() { if (this.isDateSet) { this.isDateSet = false; this.handleDateUnset(); this.trigger('dateUnset'); } }, // Date Handling // ----------------------------------------------------------------------------------------------------------------- handleDate: function(date, isReset) { var _this = this; this.unbindEvents(); // will do nothing if not already bound this.requestDateRender(date).then(function() { // wish we could start earlier, but setRange/computeRange needs to execute first _this.bindEvents(); // will request events }); }, handleDateUnset: function() { this.unbindEvents(); this.requestDateUnrender(); }, // Date Render Queuing // ----------------------------------------------------------------------------------------------------------------- // if date not specified, uses current requestDateRender: function(date) { var _this = this; return this.dateRenderQueue.add(function() { return _this.executeDateRender(date); }); }, requestDateUnrender: function() { var _this = this; return this.dateRenderQueue.add(function() { return _this.executeDateUnrender(); }); }, // Date High-level Rendering // ----------------------------------------------------------------------------------------------------------------- // if date not specified, uses current executeDateRender: function(date) { var _this = this; // if rendering a new date, reset scroll to initial state (scrollTime) if (date) { this.captureInitialScroll(); } else { this.captureScroll(); // a rerender of the current date } this.freezeHeight(); return this.executeDateUnrender().then(function() { if (date) { _this.setRange(_this.computeRange(date)); } if (_this.render) { _this.render(); // TODO: deprecate } _this.renderDates(); _this.updateSize(); _this.renderBusinessHours(); // might need coordinates, so should go after updateSize() _this.startNowIndicator(); _this.thawHeight(); _this.releaseScroll(); _this.isDateRendered = true; _this.onDateRender(); _this.trigger('dateRender'); }); }, executeDateUnrender: function() { var _this = this; if (_this.isDateRendered) { return this.requestEventsUnrender().then(function() { _this.unselect(); _this.stopNowIndicator(); _this.triggerUnrender(); _this.unrenderBusinessHours(); _this.unrenderDates(); if (_this.destroy) { _this.destroy(); // TODO: deprecate } _this.isDateRendered = false; _this.trigger('dateUnrender'); }); } else { return Promise.resolve(); } }, // Date Rendering Triggers // ----------------------------------------------------------------------------------------------------------------- onDateRender: function() { this.triggerRender(); }, // Date Low-level Rendering // ----------------------------------------------------------------------------------------------------------------- // date-cell content only renderDates: function() { // subclasses should implement }, // date-cell content only unrenderDates: function() { // subclasses should override }, // Misc view rendering utils // ------------------------- // Signals that the view's content has been rendered triggerRender: function() { this.publiclyTrigger('viewRender', this, this, this.el); }, // Signals that the view's content is about to be unrendered triggerUnrender: function() { this.publiclyTrigger('viewDestroy', this, this, this.el); }, // Binds DOM handlers to elements that reside outside the view container, such as the document bindGlobalHandlers: function() { this.listenTo($(document), 'mousedown', this.handleDocumentMousedown); this.listenTo($(document), 'touchstart', this.processUnselect); }, // Unbinds DOM handlers from elements that reside outside the view container unbindGlobalHandlers: function() { this.stopListeningTo($(document)); }, // Initializes internal variables related to theming initThemingProps: function() { var tm = this.opt('theme') ? 'ui' : 'fc'; this.widgetHeaderClass = tm + '-widget-header'; this.widgetContentClass = tm + '-widget-content'; this.highlightStateClass = tm + '-state-highlight'; }, /* Business Hours ------------------------------------------------------------------------------------------------------------------*/ // Renders business-hours onto the view. Assumes updateSize has already been called. renderBusinessHours: function() { // subclasses should implement }, // Unrenders previously-rendered business-hours unrenderBusinessHours: function() { // subclasses should implement }, /* Now Indicator ------------------------------------------------------------------------------------------------------------------*/ // Immediately render the current time indicator and begins re-rendering it at an interval, // which is defined by this.getNowIndicatorUnit(). // TODO: somehow do this for the current whole day's background too startNowIndicator: function() { var _this = this; var unit; var update; var delay; // ms wait value if (this.opt('nowIndicator')) { unit = this.getNowIndicatorUnit(); if (unit) { update = proxy(this, 'updateNowIndicator'); // bind to `this` this.initialNowDate = this.calendar.getNow(); this.initialNowQueriedMs = +new Date(); this.renderNowIndicator(this.initialNowDate); this.isNowIndicatorRendered = true; // wait until the beginning of the next interval delay = this.initialNowDate.clone().startOf(unit).add(1, unit) - this.initialNowDate; this.nowIndicatorTimeoutID = setTimeout(function() { _this.nowIndicatorTimeoutID = null; update(); delay = +moment.duration(1, unit); delay = Math.max(100, delay); // prevent too frequent _this.nowIndicatorIntervalID = setInterval(update, delay); // update every interval }, delay); } } }, // rerenders the now indicator, computing the new current time from the amount of time that has passed // since the initial getNow call. updateNowIndicator: function() { if (this.isNowIndicatorRendered) { this.unrenderNowIndicator(); this.renderNowIndicator( this.initialNowDate.clone().add(new Date() - this.initialNowQueriedMs) // add ms ); } }, // Immediately unrenders the view's current time indicator and stops any re-rendering timers. // Won't cause side effects if indicator isn't rendered. stopNowIndicator: function() { if (this.isNowIndicatorRendered) { if (this.nowIndicatorTimeoutID) { clearTimeout(this.nowIndicatorTimeoutID); this.nowIndicatorTimeoutID = null; } if (this.nowIndicatorIntervalID) { clearTimeout(this.nowIndicatorIntervalID); this.nowIndicatorIntervalID = null; } this.unrenderNowIndicator(); this.isNowIndicatorRendered = false; } }, // Returns a string unit, like 'second' or 'minute' that defined how often the current time indicator // should be refreshed. If something falsy is returned, no time indicator is rendered at all. getNowIndicatorUnit: function() { // subclasses should implement }, // Renders a current time indicator at the given datetime renderNowIndicator: function(date) { // subclasses should implement }, // Undoes the rendering actions from renderNowIndicator unrenderNowIndicator: function() { // subclasses should implement }, /* Dimensions ------------------------------------------------------------------------------------------------------------------*/ // Refreshes anything dependant upon sizing of the container element of the grid updateSize: function(isResize) { if (isResize) { this.captureScroll(); } this.updateHeight(isResize); this.updateWidth(isResize); this.updateNowIndicator(); if (isResize) { this.releaseScroll(); } }, // Refreshes the horizontal dimensions of the calendar updateWidth: function(isResize) { // subclasses should implement }, // Refreshes the vertical dimensions of the calendar updateHeight: function(isResize) { var calendar = this.calendar; // we poll the calendar for height information this.setHeight( calendar.getSuggestedViewHeight(), calendar.isHeightAuto() ); }, // Updates the vertical dimensions of the calendar to the specified height. // if `isAuto` is set to true, height becomes merely a suggestion and the view should use its "natural" height. setHeight: function(height, isAuto) { // subclasses should implement }, /* Scroller ------------------------------------------------------------------------------------------------------------------*/ capturedScroll: null, capturedScrollDepth: 0, captureScroll: function() { if (!(this.capturedScrollDepth++)) { this.capturedScroll = this.isDateRendered ? this.queryScroll() : {}; // require a render first return true; // root? } return false; }, captureInitialScroll: function(forcedScroll) { if (this.captureScroll()) { // root? this.capturedScroll.isInitial = true; if (forcedScroll) { $.extend(this.capturedScroll, forcedScroll); } else { this.capturedScroll.isComputed = true; } } }, releaseScroll: function() { var scroll = this.capturedScroll; var isRoot = this.discardScroll(); if (scroll.isComputed) { if (isRoot) { // only compute initial scroll if it will actually be used (is the root capture) $.extend(scroll, this.computeInitialScroll()); } else { scroll = null; // scroll couldn't be computed. don't apply it to the DOM } } if (scroll) { // we act immediately on a releaseScroll operation, as opposed to captureScroll. // if capture/release wraps a render operation that screws up the scroll, // we still want to restore it a good state after, regardless of depth. if (scroll.isInitial) { this.hardSetScroll(scroll); // outsmart how browsers set scroll on initial DOM } else { this.setScroll(scroll); } } }, discardScroll: function() { if (!(--this.capturedScrollDepth)) { this.capturedScroll = null; return true; // root? } return false; }, computeInitialScroll: function() { return {}; }, queryScroll: function() { return {}; }, hardSetScroll: function(scroll) { var _this = this; var exec = function() { _this.setScroll(scroll); }; exec(); setTimeout(exec, 0); // to surely clear the browser's initial scroll for the DOM }, setScroll: function(scroll) { }, /* Height Freezing ------------------------------------------------------------------------------------------------------------------*/ freezeHeight: function() { this.calendar.freezeContentHeight(); }, thawHeight: function() { this.calendar.thawContentHeight(); }, // Event Binding/Unbinding // ----------------------------------------------------------------------------------------------------------------- bindEvents: function() { var _this = this; if (!this.isEventsBound) { this.isEventsBound = true; this.rejectOn('eventsUnbind', this.requestEvents()).then(function(events) { // TODO: test rejection _this.listenTo(_this.calendar, 'eventsReset', _this.setEvents); _this.setEvents(events); }); } }, unbindEvents: function() { if (this.isEventsBound) { this.isEventsBound = false; this.stopListeningTo(this.calendar, 'eventsReset'); this.unsetEvents(); this.trigger('eventsUnbind'); } }, // Event Setting/Unsetting // ----------------------------------------------------------------------------------------------------------------- setEvents: function(events) { var isReset = this.isEventSet; this.isEventsSet = true; this.handleEvents(events, isReset); this.trigger(isReset ? 'eventsReset' : 'eventsSet', events); }, unsetEvents: function() { if (this.isEventsSet) { this.isEventsSet = false; this.handleEventsUnset(); this.trigger('eventsUnset'); } }, whenEventsSet: function() { var _this = this; if (this.isEventsSet) { return Promise.resolve(this.getCurrentEvents()); } else { return new Promise(function(resolve) { _this.one('eventsSet', resolve); }); } }, // Event Handling // ----------------------------------------------------------------------------------------------------------------- handleEvents: function(events, isReset) { this.requestEventsRender(events); }, handleEventsUnset: function() { this.requestEventsUnrender(); }, // Event Render Queuing // ----------------------------------------------------------------------------------------------------------------- // assumes any previous event renders have been cleared already requestEventsRender: function(events) { var _this = this; return this.eventRenderQueue.add(function() { // might not return a promise if debounced!? bad return _this.executeEventsRender(events); }); }, requestEventsUnrender: function() { var _this = this; if (this.isEventsRendered) { return this.eventRenderQueue.addQuickly(function() { return _this.executeEventsUnrender(); }); } else { return Promise.resolve(); } }, requestCurrentEventsRender: function() { if (this.isEventsSet) { this.requestEventsRender(this.getCurrentEvents()); } else { return Promise.reject(); } }, // Event High-level Rendering // ----------------------------------------------------------------------------------------------------------------- executeEventsRender: function(events) { var _this = this; this.captureScroll(); this.freezeHeight(); return this.executeEventsUnrender().then(function() { _this.renderEvents(events); _this.thawHeight(); _this.releaseScroll(); _this.isEventsRendered = true; _this.onEventsRender(); _this.trigger('eventsRender'); }); }, executeEventsUnrender: function() { if (this.isEventsRendered) { this.onBeforeEventsUnrender(); this.captureScroll(); this.freezeHeight(); if (this.destroyEvents) { this.destroyEvents(); // TODO: deprecate } this.unrenderEvents(); this.thawHeight(); this.releaseScroll(); this.isEventsRendered = false; this.trigger('eventsUnrender'); } return Promise.resolve(); // always synchronous }, // Event Rendering Triggers // ----------------------------------------------------------------------------------------------------------------- // Signals that all events have been rendered onEventsRender: function() { this.renderedEventSegEach(function(seg) { this.publiclyTrigger('eventAfterRender', seg.event, seg.event, seg.el); }); this.publiclyTrigger('eventAfterAllRender'); }, // Signals that all event elements are about to be removed onBeforeEventsUnrender: function() { this.renderedEventSegEach(function(seg) { this.publiclyTrigger('eventDestroy', seg.event, seg.event, seg.el); }); }, // Event Low-level Rendering // ----------------------------------------------------------------------------------------------------------------- // Renders the events onto the view. renderEvents: function(events) { // subclasses should implement }, // Removes event elements from the view. unrenderEvents: function() { // subclasses should implement }, // Event Data Access // ----------------------------------------------------------------------------------------------------------------- requestEvents: function() { return this.calendar.requestEvents(this.start, this.end); }, getCurrentEvents: function() { return this.calendar.getPrunedEventCache(); }, // Event Rendering Utils // ----------------------------------------------------------------------------------------------------------------- // Given an event and the default element used for rendering, returns the element that should actually be used. // Basically runs events and elements through the eventRender hook. resolveEventEl: function(event, el) { var custom = this.publiclyTrigger('eventRender', event, event, el); if (custom === false) { // means don't render at all el = null; } else if (custom && custom !== true) { el = $(custom); } return el; }, // Hides all rendered event segments linked to the given event showEvent: function(event) { this.renderedEventSegEach(function(seg) { seg.el.css('visibility', ''); }, event); }, // Shows all rendered event segments linked to the given event hideEvent: function(event) { this.renderedEventSegEach(function(seg) { seg.el.css('visibility', 'hidden'); }, event); }, // Iterates through event segments that have been rendered (have an el). Goes through all by default. // If the optional `event` argument is specified, only iterates through segments linked to that event. // The `this` value of the callback function will be the view. renderedEventSegEach: function(func, event) { var segs = this.getEventSegs(); var i; for (i = 0; i < segs.length; i++) { if (!event || segs[i].event._id === event._id) { if (segs[i].el) { func.call(this, segs[i]); } } } }, // Retrieves all the rendered segment objects for the view getEventSegs: function() { // subclasses must implement return []; }, /* Event Drag-n-Drop ------------------------------------------------------------------------------------------------------------------*/ // Computes if the given event is allowed to be dragged by the user isEventDraggable: function(event) { return this.isEventStartEditable(event); }, isEventStartEditable: function(event) { return firstDefined( event.startEditable, (event.source || {}).startEditable, this.opt('eventStartEditable'), this.isEventGenerallyEditable(event) ); }, isEventGenerallyEditable: function(event) { return firstDefined( event.editable, (event.source || {}).editable, this.opt('editable') ); }, // Must be called when an event in the view is dropped onto new location. // `dropLocation` is an object that contains the new zoned start/end/allDay values for the event. reportEventDrop: function(event, dropLocation, largeUnit, el, ev) { var calendar = this.calendar; var mutateResult = calendar.mutateEvent(event, dropLocation, largeUnit); var undoFunc = function() { mutateResult.undo(); calendar.reportEventChange(); }; this.triggerEventDrop(event, mutateResult.dateDelta, undoFunc, el, ev); calendar.reportEventChange(); // will rerender events }, // Triggers event-drop handlers that have subscribed via the API triggerEventDrop: function(event, dateDelta, undoFunc, el, ev) { this.publiclyTrigger('eventDrop', el[0], event, dateDelta, undoFunc, ev, {}); // {} = jqui dummy }, /* External Element Drag-n-Drop ------------------------------------------------------------------------------------------------------------------*/ // Must be called when an external element, via jQuery UI, has been dropped onto the calendar. // `meta` is the parsed data that has been embedded into the dragging event. // `dropLocation` is an object that contains the new zoned start/end/allDay values for the event. reportExternalDrop: function(meta, dropLocation, el, ev, ui) { var eventProps = meta.eventProps; var eventInput; var event; // Try to build an event object and render it. TODO: decouple the two if (eventProps) { eventInput = $.extend({}, eventProps, dropLocation); event = this.calendar.renderEvent(eventInput, meta.stick)[0]; // renderEvent returns an array } this.triggerExternalDrop(event, dropLocation, el, ev, ui); }, // Triggers external-drop handlers that have subscribed via the API triggerExternalDrop: function(event, dropLocation, el, ev, ui) { // trigger 'drop' regardless of whether element represents an event this.publiclyTrigger('drop', el[0], dropLocation.start, ev, ui); if (event) { this.publiclyTrigger('eventReceive', null, event); // signal an external event landed } }, /* Drag-n-Drop Rendering (for both events and external elements) ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of a event or external-element drag over the given drop zone. // If an external-element, seg will be `null`. // Must return elements used for any mock events. renderDrag: function(dropLocation, seg) { // subclasses must implement }, // Unrenders a visual indication of an event or external-element being dragged. unrenderDrag: function() { // subclasses must implement }, /* Event Resizing ------------------------------------------------------------------------------------------------------------------*/ // Computes if the given event is allowed to be resized from its starting edge isEventResizableFromStart: function(event) { return this.opt('eventResizableFromStart') && this.isEventResizable(event); }, // Computes if the given event is allowed to be resized from its ending edge isEventResizableFromEnd: function(event) { return this.isEventResizable(event); }, // Computes if the given event is allowed to be resized by the user at all isEventResizable: function(event) { var source = event.source || {}; return firstDefined( event.durationEditable, source.durationEditable, this.opt('eventDurationEditable'), event.editable, source.editable, this.opt('editable') ); }, // Must be called when an event in the view has been resized to a new length reportEventResize: function(event, resizeLocation, largeUnit, el, ev) { var calendar = this.calendar; var mutateResult = calendar.mutateEvent(event, resizeLocation, largeUnit); var undoFunc = function() { mutateResult.undo(); calendar.reportEventChange(); }; this.triggerEventResize(event, mutateResult.durationDelta, undoFunc, el, ev); calendar.reportEventChange(); // will rerender events }, // Triggers event-resize handlers that have subscribed via the API triggerEventResize: function(event, durationDelta, undoFunc, el, ev) { this.publiclyTrigger('eventResize', el[0], event, durationDelta, undoFunc, ev, {}); // {} = jqui dummy }, /* Selection (time range) ------------------------------------------------------------------------------------------------------------------*/ // Selects a date span on the view. `start` and `end` are both Moments. // `ev` is the native mouse event that begin the interaction. select: function(span, ev) { this.unselect(ev); this.renderSelection(span); this.reportSelection(span, ev); }, // Renders a visual indication of the selection renderSelection: function(span) { // subclasses should implement }, // Called when a new selection is made. Updates internal state and triggers handlers. reportSelection: function(span, ev) { this.isSelected = true; this.triggerSelect(span, ev); }, // Triggers handlers to 'select' triggerSelect: function(span, ev) { this.publiclyTrigger( 'select', null, this.calendar.applyTimezone(span.start), // convert to calendar's tz for external API this.calendar.applyTimezone(span.end), // " ev ); }, // Undoes a selection. updates in the internal state and triggers handlers. // `ev` is the native mouse event that began the interaction. unselect: function(ev) { if (this.isSelected) { this.isSelected = false; if (this.destroySelection) { this.destroySelection(); // TODO: deprecate } this.unrenderSelection(); this.publiclyTrigger('unselect', null, ev); } }, // Unrenders a visual indication of selection unrenderSelection: function() { // subclasses should implement }, /* Event Selection ------------------------------------------------------------------------------------------------------------------*/ selectEvent: function(event) { if (!this.selectedEvent || this.selectedEvent !== event) { this.unselectEvent(); this.renderedEventSegEach(function(seg) { seg.el.addClass('fc-selected'); }, event); this.selectedEvent = event; } }, unselectEvent: function() { if (this.selectedEvent) { this.renderedEventSegEach(function(seg) { seg.el.removeClass('fc-selected'); }, this.selectedEvent); this.selectedEvent = null; } }, isEventSelected: function(event) { // event references might change on refetchEvents(), while selectedEvent doesn't, // so compare IDs return this.selectedEvent && this.selectedEvent._id === event._id; }, /* Mouse / Touch Unselecting (time range & event unselection) ------------------------------------------------------------------------------------------------------------------*/ // TODO: move consistently to down/start or up/end? // TODO: don't kill previous selection if touch scrolling handleDocumentMousedown: function(ev) { if (isPrimaryMouseButton(ev)) { this.processUnselect(ev); } }, processUnselect: function(ev) { this.processRangeUnselect(ev); this.processEventUnselect(ev); }, processRangeUnselect: function(ev) { var ignore; // is there a time-range selection? if (this.isSelected && this.opt('unselectAuto')) { // only unselect if the clicked element is not identical to or inside of an 'unselectCancel' element ignore = this.opt('unselectCancel'); if (!ignore || !$(ev.target).closest(ignore).length) { this.unselect(ev); } } }, processEventUnselect: function(ev) { if (this.selectedEvent) { if (!$(ev.target).closest('.fc-selected').length) { this.unselectEvent(); } } }, /* Day Click ------------------------------------------------------------------------------------------------------------------*/ // Triggers handlers to 'dayClick' // Span has start/end of the clicked area. Only the start is useful. triggerDayClick: function(span, dayEl, ev) { this.publiclyTrigger( 'dayClick', dayEl, this.calendar.applyTimezone(span.start), // convert to calendar's timezone for external API ev ); }, /* Date Utils ------------------------------------------------------------------------------------------------------------------*/ // Initializes internal variables related to calculating hidden days-of-week initHiddenDays: function() { var hiddenDays = this.opt('hiddenDays') || []; // array of day-of-week indices that are hidden var isHiddenDayHash = []; // is the day-of-week hidden? (hash with day-of-week-index -> bool) var dayCnt = 0; var i; if (this.opt('weekends') === false) { hiddenDays.push(0, 6); // 0=sunday, 6=saturday } for (i = 0; i < 7; i++) { if ( !(isHiddenDayHash[i] = $.inArray(i, hiddenDays) !== -1) ) { dayCnt++; } } if (!dayCnt) { throw 'invalid hiddenDays'; // all days were hidden? bad. } this.isHiddenDayHash = isHiddenDayHash; }, // Is the current day hidden? // `day` is a day-of-week index (0-6), or a Moment isHiddenDay: function(day) { if (moment.isMoment(day)) { day = day.day(); } return this.isHiddenDayHash[day]; }, // Incrementing the current day until it is no longer a hidden day, returning a copy. // If the initial value of `date` is not a hidden day, don't do anything. // Pass `isExclusive` as `true` if you are dealing with an end date. // `inc` defaults to `1` (increment one day forward each time) skipHiddenDays: function(date, inc, isExclusive) { var out = date.clone(); inc = inc || 1; while ( this.isHiddenDayHash[(out.day() + (isExclusive ? inc : 0) + 7) % 7] ) { out.add(inc, 'days'); } return out; }, // Returns the date range of the full days the given range visually appears to occupy. // Returns a new range object. computeDayRange: function(range) { var startDay = range.start.clone().stripTime(); // the beginning of the day the range starts var end = range.end; var endDay = null; var endTimeMS; if (end) { endDay = end.clone().stripTime(); // the beginning of the day the range exclusively ends endTimeMS = +end.time(); // # of milliseconds into `endDay` // If the end time is actually inclusively part of the next day and is equal to or // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`. // Otherwise, leaving it as inclusive will cause it to exclude `endDay`. if (endTimeMS && endTimeMS >= this.nextDayThreshold) { endDay.add(1, 'days'); } } // If no end was specified, or if it is within `startDay` but not past nextDayThreshold, // assign the default duration of one day. if (!end || endDay <= startDay) { endDay = startDay.clone().add(1, 'days'); } return { start: startDay, end: endDay }; }, // Does the given event visually appear to occupy more than one day? isMultiDayEvent: function(event) { var range = this.computeDayRange(event); // event is range-ish return range.end.diff(range.start, 'days') > 1; } }); ;; /* Embodies a div that has potential scrollbars */ var Scroller = FC.Scroller = Class.extend({ el: null, // the guaranteed outer element scrollEl: null, // the element with the scrollbars overflowX: null, overflowY: null, constructor: function(options) { options = options || {}; this.overflowX = options.overflowX || options.overflow || 'auto'; this.overflowY = options.overflowY || options.overflow || 'auto'; }, render: function() { this.el = this.renderEl(); this.applyOverflow(); }, renderEl: function() { return (this.scrollEl = $('<div class="fc-scroller"></div>')); }, // sets to natural height, unlocks overflow clear: function() { this.setHeight('auto'); this.applyOverflow(); }, destroy: function() { this.el.remove(); }, // Overflow // ----------------------------------------------------------------------------------------------------------------- applyOverflow: function() { this.scrollEl.css({ 'overflow-x': this.overflowX, 'overflow-y': this.overflowY }); }, // Causes any 'auto' overflow values to resolves to 'scroll' or 'hidden'. // Useful for preserving scrollbar widths regardless of future resizes. // Can pass in scrollbarWidths for optimization. lockOverflow: function(scrollbarWidths) { var overflowX = this.overflowX; var overflowY = this.overflowY; scrollbarWidths = scrollbarWidths || this.getScrollbarWidths(); if (overflowX === 'auto') { overflowX = ( scrollbarWidths.top || scrollbarWidths.bottom || // horizontal scrollbars? // OR scrolling pane with massless scrollbars? this.scrollEl[0].scrollWidth - 1 > this.scrollEl[0].clientWidth // subtract 1 because of IE off-by-one issue ) ? 'scroll' : 'hidden'; } if (overflowY === 'auto') { overflowY = ( scrollbarWidths.left || scrollbarWidths.right || // vertical scrollbars? // OR scrolling pane with massless scrollbars? this.scrollEl[0].scrollHeight - 1 > this.scrollEl[0].clientHeight // subtract 1 because of IE off-by-one issue ) ? 'scroll' : 'hidden'; } this.scrollEl.css({ 'overflow-x': overflowX, 'overflow-y': overflowY }); }, // Getters / Setters // ----------------------------------------------------------------------------------------------------------------- setHeight: function(height) { this.scrollEl.height(height); }, getScrollTop: function() { return this.scrollEl.scrollTop(); }, setScrollTop: function(top) { this.scrollEl.scrollTop(top); }, getClientWidth: function() { return this.scrollEl[0].clientWidth; }, getClientHeight: function() { return this.scrollEl[0].clientHeight; }, getScrollbarWidths: function() { return getScrollbarWidths(this.scrollEl); } }); ;; function Iterator(items) { this.items = items || []; } /* Calls a method on every item passing the arguments through */ Iterator.prototype.proxyCall = function(methodName) { var args = Array.prototype.slice.call(arguments, 1); var results = []; this.items.forEach(function(item) { results.push(item[methodName].apply(item, args)); }); return results; }; ;; /* Toolbar with buttons and title ----------------------------------------------------------------------------------------------------------------------*/ function Toolbar(calendar, toolbarOptions) { var t = this; // exports t.setToolbarOptions = setToolbarOptions; t.render = render; t.removeElement = removeElement; t.updateTitle = updateTitle; t.activateButton = activateButton; t.deactivateButton = deactivateButton; t.disableButton = disableButton; t.enableButton = enableButton; t.getViewsWithButtons = getViewsWithButtons; t.el = null; // mirrors local `el` // locals var el; var viewsWithButtons = []; var tm; // method to update toolbar-specific options, not calendar-wide options function setToolbarOptions(newToolbarOptions) { toolbarOptions = newToolbarOptions; } // can be called repeatedly and will rerender function render() { var sections = toolbarOptions.layout; tm = calendar.options.theme ? 'ui' : 'fc'; if (sections) { if (!el) { el = this.el = $("<div class='fc-toolbar "+ toolbarOptions.extraClasses + "'/>"); } else { el.empty(); } el.append(renderSection('left')) .append(renderSection('right')) .append(renderSection('center')) .append('<div class="fc-clear"/>'); } else { removeElement(); } } function removeElement() { if (el) { el.remove(); el = t.el = null; } } function renderSection(position) { var sectionEl = $('<div class="fc-' + position + '"/>'); var buttonStr = toolbarOptions.layout[position]; if (buttonStr) { $.each(buttonStr.split(' '), function(i) { var groupChildren = $(); var isOnlyButtons = true; var groupEl; $.each(this.split(','), function(j, buttonName) { var customButtonProps; var viewSpec; var buttonClick; var overrideText; // text explicitly set by calendar's constructor options. overcomes icons var defaultText; var themeIcon; var normalIcon; var innerHtml; var classes; var button; // the element if (buttonName == 'title') { groupChildren = groupChildren.add($('<h2> </h2>')); // we always want it to take up height isOnlyButtons = false; } else { if ((customButtonProps = (calendar.options.customButtons || {})[buttonName])) { buttonClick = function(ev) { if (customButtonProps.click) { customButtonProps.click.call(button[0], ev); } }; overrideText = ''; // icons will override text defaultText = customButtonProps.text; } else if ((viewSpec = calendar.getViewSpec(buttonName))) { buttonClick = function() { calendar.changeView(buttonName); }; viewsWithButtons.push(buttonName); overrideText = viewSpec.buttonTextOverride; defaultText = viewSpec.buttonTextDefault; } else if (calendar[buttonName]) { // a calendar method buttonClick = function() { calendar[buttonName](); }; overrideText = (calendar.overrides.buttonText || {})[buttonName]; defaultText = calendar.options.buttonText[buttonName]; // everything else is considered default } if (buttonClick) { themeIcon = customButtonProps ? customButtonProps.themeIcon : calendar.options.themeButtonIcons[buttonName]; normalIcon = customButtonProps ? customButtonProps.icon : calendar.options.buttonIcons[buttonName]; if (overrideText) { innerHtml = htmlEscape(overrideText); } else if (themeIcon && calendar.options.theme) { innerHtml = "<span class='ui-icon ui-icon-" + themeIcon + "'></span>"; } else if (normalIcon && !calendar.options.theme) { innerHtml = "<span class='fc-icon fc-icon-" + normalIcon + "'></span>"; } else { innerHtml = htmlEscape(defaultText); } classes = [ 'fc-' + buttonName + '-button', tm + '-button', tm + '-state-default' ]; button = $( // type="button" so that it doesn't submit a form '<button type="button" class="' + classes.join(' ') + '">' + innerHtml + '</button>' ) .click(function(ev) { // don't process clicks for disabled buttons if (!button.hasClass(tm + '-state-disabled')) { buttonClick(ev); // after the click action, if the button becomes the "active" tab, or disabled, // it should never have a hover class, so remove it now. if ( button.hasClass(tm + '-state-active') || button.hasClass(tm + '-state-disabled') ) { button.removeClass(tm + '-state-hover'); } } }) .mousedown(function() { // the *down* effect (mouse pressed in). // only on buttons that are not the "active" tab, or disabled button .not('.' + tm + '-state-active') .not('.' + tm + '-state-disabled') .addClass(tm + '-state-down'); }) .mouseup(function() { // undo the *down* effect button.removeClass(tm + '-state-down'); }) .hover( function() { // the *hover* effect. // only on buttons that are not the "active" tab, or disabled button .not('.' + tm + '-state-active') .not('.' + tm + '-state-disabled') .addClass(tm + '-state-hover'); }, function() { // undo the *hover* effect button .removeClass(tm + '-state-hover') .removeClass(tm + '-state-down'); // if mouseleave happens before mouseup } ); groupChildren = groupChildren.add(button); } } }); if (isOnlyButtons) { groupChildren .first().addClass(tm + '-corner-left').end() .last().addClass(tm + '-corner-right').end(); } if (groupChildren.length > 1) { groupEl = $('<div/>'); if (isOnlyButtons) { groupEl.addClass('fc-button-group'); } groupEl.append(groupChildren); sectionEl.append(groupEl); } else { sectionEl.append(groupChildren); // 1 or 0 children } }); } return sectionEl; } function updateTitle(text) { if (el) { el.find('h2').text(text); } } function activateButton(buttonName) { if (el) { el.find('.fc-' + buttonName + '-button') .addClass(tm + '-state-active'); } } function deactivateButton(buttonName) { if (el) { el.find('.fc-' + buttonName + '-button') .removeClass(tm + '-state-active'); } } function disableButton(buttonName) { if (el) { el.find('.fc-' + buttonName + '-button') .prop('disabled', true) .addClass(tm + '-state-disabled'); } } function enableButton(buttonName) { if (el) { el.find('.fc-' + buttonName + '-button') .prop('disabled', false) .removeClass(tm + '-state-disabled'); } } function getViewsWithButtons() { return viewsWithButtons; } } ;; var Calendar = FC.Calendar = Class.extend({ dirDefaults: null, // option defaults related to LTR or RTL localeDefaults: null, // option defaults related to current locale overrides: null, // option overrides given to the fullCalendar constructor dynamicOverrides: null, // options set with dynamic setter method. higher precedence than view overrides. options: null, // all defaults combined with overrides viewSpecCache: null, // cache of view definitions view: null, // current View object header: null, footer: null, loadingLevel: 0, // number of simultaneous loading tasks // a lot of this class' OOP logic is scoped within this constructor function, // but in the future, write individual methods on the prototype. constructor: Calendar_constructor, // Subclasses can override this for initialization logic after the constructor has been called initialize: function() { }, // Computes the flattened options hash for the calendar and assigns to `this.options`. // Assumes this.overrides and this.dynamicOverrides have already been initialized. populateOptionsHash: function() { var locale, localeDefaults; var isRTL, dirDefaults; locale = firstDefined( // explicit locale option given? this.dynamicOverrides.locale, this.overrides.locale ); localeDefaults = localeOptionHash[locale]; if (!localeDefaults) { // explicit locale option not given or invalid? locale = Calendar.defaults.locale; localeDefaults = localeOptionHash[locale] || {}; } isRTL = firstDefined( // based on options computed so far, is direction RTL? this.dynamicOverrides.isRTL, this.overrides.isRTL, localeDefaults.isRTL, Calendar.defaults.isRTL ); dirDefaults = isRTL ? Calendar.rtlDefaults : {}; this.dirDefaults = dirDefaults; this.localeDefaults = localeDefaults; this.options = mergeOptions([ // merge defaults and overrides. lowest to highest precedence Calendar.defaults, // global defaults dirDefaults, localeDefaults, this.overrides, this.dynamicOverrides ]); populateInstanceComputableOptions(this.options); // fill in gaps with computed options }, // Gets information about how to create a view. Will use a cache. getViewSpec: function(viewType) { var cache = this.viewSpecCache; return cache[viewType] || (cache[viewType] = this.buildViewSpec(viewType)); }, // Given a duration singular unit, like "week" or "day", finds a matching view spec. // Preference is given to views that have corresponding buttons. getUnitViewSpec: function(unit) { var viewTypes; var i; var spec; if ($.inArray(unit, intervalUnits) != -1) { // put views that have buttons first. there will be duplicates, but oh well viewTypes = this.header.getViewsWithButtons(); // TODO: include footer as well? $.each(FC.views, function(viewType) { // all views viewTypes.push(viewType); }); for (i = 0; i < viewTypes.length; i++) { spec = this.getViewSpec(viewTypes[i]); if (spec) { if (spec.singleUnit == unit) { return spec; } } } } }, // Builds an object with information on how to create a given view buildViewSpec: function(requestedViewType) { var viewOverrides = this.overrides.views || {}; var specChain = []; // for the view. lowest to highest priority var defaultsChain = []; // for the view. lowest to highest priority var overridesChain = []; // for the view. lowest to highest priority var viewType = requestedViewType; var spec; // for the view var overrides; // for the view var duration; var unit; // iterate from the specific view definition to a more general one until we hit an actual View class while (viewType) { spec = fcViews[viewType]; overrides = viewOverrides[viewType]; viewType = null; // clear. might repopulate for another iteration if (typeof spec === 'function') { // TODO: deprecate spec = { 'class': spec }; } if (spec) { specChain.unshift(spec); defaultsChain.unshift(spec.defaults || {}); duration = duration || spec.duration; viewType = viewType || spec.type; } if (overrides) { overridesChain.unshift(overrides); // view-specific option hashes have options at zero-level duration = duration || overrides.duration; viewType = viewType || overrides.type; } } spec = mergeProps(specChain); spec.type = requestedViewType; if (!spec['class']) { return false; } if (duration) { duration = moment.duration(duration); if (duration.valueOf()) { // valid? spec.duration = duration; unit = computeIntervalUnit(duration); // view is a single-unit duration, like "week" or "day" // incorporate options for this. lowest priority if (duration.as(unit) === 1) { spec.singleUnit = unit; overridesChain.unshift(viewOverrides[unit] || {}); } } } spec.defaults = mergeOptions(defaultsChain); spec.overrides = mergeOptions(overridesChain); this.buildViewSpecOptions(spec); this.buildViewSpecButtonText(spec, requestedViewType); return spec; }, // Builds and assigns a view spec's options object from its already-assigned defaults and overrides buildViewSpecOptions: function(spec) { spec.options = mergeOptions([ // lowest to highest priority Calendar.defaults, // global defaults spec.defaults, // view's defaults (from ViewSubclass.defaults) this.dirDefaults, this.localeDefaults, // locale and dir take precedence over view's defaults! this.overrides, // calendar's overrides (options given to constructor) spec.overrides, // view's overrides (view-specific options) this.dynamicOverrides // dynamically set via setter. highest precedence ]); populateInstanceComputableOptions(spec.options); }, // Computes and assigns a view spec's buttonText-related options buildViewSpecButtonText: function(spec, requestedViewType) { // given an options object with a possible `buttonText` hash, lookup the buttonText for the // requested view, falling back to a generic unit entry like "week" or "day" function queryButtonText(options) { var buttonText = options.buttonText || {}; return buttonText[requestedViewType] || // view can decide to look up a certain key (spec.buttonTextKey ? buttonText[spec.buttonTextKey] : null) || // a key like "month" (spec.singleUnit ? buttonText[spec.singleUnit] : null); } // highest to lowest priority spec.buttonTextOverride = queryButtonText(this.dynamicOverrides) || queryButtonText(this.overrides) || // constructor-specified buttonText lookup hash takes precedence spec.overrides.buttonText; // `buttonText` for view-specific options is a string // highest to lowest priority. mirrors buildViewSpecOptions spec.buttonTextDefault = queryButtonText(this.localeDefaults) || queryButtonText(this.dirDefaults) || spec.defaults.buttonText || // a single string. from ViewSubclass.defaults queryButtonText(Calendar.defaults) || (spec.duration ? this.humanizeDuration(spec.duration) : null) || // like "3 days" requestedViewType; // fall back to given view name }, // Given a view name for a custom view or a standard view, creates a ready-to-go View object instantiateView: function(viewType) { var spec = this.getViewSpec(viewType); return new spec['class'](this, viewType, spec.options, spec.duration); }, // Returns a boolean about whether the view is okay to instantiate at some point isValidViewType: function(viewType) { return Boolean(this.getViewSpec(viewType)); }, // Should be called when any type of async data fetching begins pushLoading: function() { if (!(this.loadingLevel++)) { this.publiclyTrigger('loading', null, true, this.view); } }, // Should be called when any type of async data fetching completes popLoading: function() { if (!(--this.loadingLevel)) { this.publiclyTrigger('loading', null, false, this.view); } }, // Given arguments to the select method in the API, returns a span (unzoned start/end and other info) buildSelectSpan: function(zonedStartInput, zonedEndInput) { var start = this.moment(zonedStartInput).stripZone(); var end; if (zonedEndInput) { end = this.moment(zonedEndInput).stripZone(); } else if (start.hasTime()) { end = start.clone().add(this.defaultTimedEventDuration); } else { end = start.clone().add(this.defaultAllDayEventDuration); } return { start: start, end: end }; } }); Calendar.mixin(EmitterMixin); function Calendar_constructor(element, overrides) { var t = this; // Exports // ----------------------------------------------------------------------------------- t.render = render; t.destroy = destroy; t.rerenderEvents = rerenderEvents; t.changeView = renderView; // `renderView` will switch to another view t.select = select; t.unselect = unselect; t.prev = prev; t.next = next; t.prevYear = prevYear; t.nextYear = nextYear; t.today = today; t.gotoDate = gotoDate; t.incrementDate = incrementDate; t.zoomTo = zoomTo; t.getDate = getDate; t.getCalendar = getCalendar; t.getView = getView; t.option = option; // getter/setter method t.publiclyTrigger = publiclyTrigger; // Options // ----------------------------------------------------------------------------------- t.dynamicOverrides = {}; t.viewSpecCache = {}; t.optionHandlers = {}; // for Calendar.options.js t.overrides = $.extend({}, overrides); // make a copy t.populateOptionsHash(); // sets this.options // Locale-data Internals // ----------------------------------------------------------------------------------- // Apply overrides to the current locale's data var localeData; // Called immediately, and when any of the options change. // Happens before any internal objects rebuild or rerender, because this is very core. t.bindOptions([ 'locale', 'monthNames', 'monthNamesShort', 'dayNames', 'dayNamesShort', 'firstDay', 'weekNumberCalculation' ], function(locale, monthNames, monthNamesShort, dayNames, dayNamesShort, firstDay, weekNumberCalculation) { // normalize if (weekNumberCalculation === 'iso') { weekNumberCalculation = 'ISO'; // normalize } localeData = createObject( // make a cheap copy getMomentLocaleData(locale) // will fall back to en ); if (monthNames) { localeData._months = monthNames; } if (monthNamesShort) { localeData._monthsShort = monthNamesShort; } if (dayNames) { localeData._weekdays = dayNames; } if (dayNamesShort) { localeData._weekdaysShort = dayNamesShort; } if (firstDay == null && weekNumberCalculation === 'ISO') { firstDay = 1; } if (firstDay != null) { var _week = createObject(localeData._week); // _week: { dow: # } _week.dow = firstDay; localeData._week = _week; } if ( // whitelist certain kinds of input weekNumberCalculation === 'ISO' || weekNumberCalculation === 'local' || typeof weekNumberCalculation === 'function' ) { localeData._fullCalendar_weekCalc = weekNumberCalculation; // moment-ext will know what to do with it } // If the internal current date object already exists, move to new locale. // We do NOT need to do this technique for event dates, because this happens when converting to "segments". if (date) { localizeMoment(date); // sets to localeData } }); // Calendar-specific Date Utilities // ----------------------------------------------------------------------------------- t.defaultAllDayEventDuration = moment.duration(t.options.defaultAllDayEventDuration); t.defaultTimedEventDuration = moment.duration(t.options.defaultTimedEventDuration); // Builds a moment using the settings of the current calendar: timezone and locale. // Accepts anything the vanilla moment() constructor accepts. t.moment = function() { var mom; if (t.options.timezone === 'local') { mom = FC.moment.apply(null, arguments); // Force the moment to be local, because FC.moment doesn't guarantee it. if (mom.hasTime()) { // don't give ambiguously-timed moments a local zone mom.local(); } } else if (t.options.timezone === 'UTC') { mom = FC.moment.utc.apply(null, arguments); // process as UTC } else { mom = FC.moment.parseZone.apply(null, arguments); // let the input decide the zone } localizeMoment(mom); return mom; }; // Updates the given moment's locale settings to the current calendar locale settings. function localizeMoment(mom) { mom._locale = localeData; } t.localizeMoment = localizeMoment; // Returns a boolean about whether or not the calendar knows how to calculate // the timezone offset of arbitrary dates in the current timezone. t.getIsAmbigTimezone = function() { return t.options.timezone !== 'local' && t.options.timezone !== 'UTC'; }; // Returns a copy of the given date in the current timezone. Has no effect on dates without times. t.applyTimezone = function(date) { if (!date.hasTime()) { return date.clone(); } var zonedDate = t.moment(date.toArray()); var timeAdjust = date.time() - zonedDate.time(); var adjustedZonedDate; // Safari sometimes has problems with this coersion when near DST. Adjust if necessary. (bug #2396) if (timeAdjust) { // is the time result different than expected? adjustedZonedDate = zonedDate.clone().add(timeAdjust); // add milliseconds if (date.time() - adjustedZonedDate.time() === 0) { // does it match perfectly now? zonedDate = adjustedZonedDate; } } return zonedDate; }; // Returns a moment for the current date, as defined by the client's computer or from the `now` option. // Will return an moment with an ambiguous timezone. t.getNow = function() { var now = t.options.now; if (typeof now === 'function') { now = now(); } return t.moment(now).stripZone(); }; // Get an event's normalized end date. If not present, calculate it from the defaults. t.getEventEnd = function(event) { if (event.end) { return event.end.clone(); } else { return t.getDefaultEventEnd(event.allDay, event.start); } }; // Given an event's allDay status and start date, return what its fallback end date should be. // TODO: rename to computeDefaultEventEnd t.getDefaultEventEnd = function(allDay, zonedStart) { var end = zonedStart.clone(); if (allDay) { end.stripTime().add(t.defaultAllDayEventDuration); } else { end.add(t.defaultTimedEventDuration); } if (t.getIsAmbigTimezone()) { end.stripZone(); // we don't know what the tzo should be } return end; }; // Produces a human-readable string for the given duration. // Side-effect: changes the locale of the given duration. t.humanizeDuration = function(duration) { return duration.locale(t.options.locale).humanize(); }; // Imports // ----------------------------------------------------------------------------------- EventManager.call(t); // Locals // ----------------------------------------------------------------------------------- var _element = element[0]; var toolbarsManager; var header; var footer; var content; var tm; // for making theme classes var currentView; // NOTE: keep this in sync with this.view var viewsByType = {}; // holds all instantiated view instances, current or not var suggestedViewHeight; var windowResizeProxy; // wraps the windowResize function var ignoreWindowResize = 0; var date; // unzoned // Main Rendering // ----------------------------------------------------------------------------------- // compute the initial ambig-timezone date if (t.options.defaultDate != null) { date = t.moment(t.options.defaultDate).stripZone(); } else { date = t.getNow(); // getNow already returns unzoned } function render() { if (!content) { initialRender(); } else if (elementVisible()) { // mainly for the public API calcSize(); renderView(); } } function initialRender() { element.addClass('fc'); // event delegation for nav links element.on('click.fc', 'a[data-goto]', function(ev) { var anchorEl = $(this); var gotoOptions = anchorEl.data('goto'); // will automatically parse JSON var date = t.moment(gotoOptions.date); var viewType = gotoOptions.type; // property like "navLinkDayClick". might be a string or a function var customAction = currentView.opt('navLink' + capitaliseFirstLetter(viewType) + 'Click'); if (typeof customAction === 'function') { customAction(date, ev); } else { if (typeof customAction === 'string') { viewType = customAction; } zoomTo(date, viewType); } }); // called immediately, and upon option change t.bindOption('theme', function(theme) { tm = theme ? 'ui' : 'fc'; // affects a larger scope element.toggleClass('ui-widget', theme); element.toggleClass('fc-unthemed', !theme); }); // called immediately, and upon option change. // HACK: locale often affects isRTL, so we explicitly listen to that too. t.bindOptions([ 'isRTL', 'locale' ], function(isRTL) { element.toggleClass('fc-ltr', !isRTL); element.toggleClass('fc-rtl', isRTL); }); content = $("<div class='fc-view-container'/>").prependTo(element); var toolbars = buildToolbars(); toolbarsManager = new Iterator(toolbars); header = t.header = toolbars[0]; footer = t.footer = toolbars[1]; renderHeader(); renderFooter(); renderView(t.options.defaultView); if (t.options.handleWindowResize) { windowResizeProxy = debounce(windowResize, t.options.windowResizeDelay); // prevents rapid calls $(window).resize(windowResizeProxy); } } function destroy() { if (currentView) { currentView.removeElement(); // NOTE: don't null-out currentView/t.view in case API methods are called after destroy. // It is still the "current" view, just not rendered. } toolbarsManager.proxyCall('removeElement'); content.remove(); element.removeClass('fc fc-ltr fc-rtl fc-unthemed ui-widget'); element.off('.fc'); // unbind nav link handlers if (windowResizeProxy) { $(window).unbind('resize', windowResizeProxy); } } function elementVisible() { return element.is(':visible'); } // View Rendering // ----------------------------------------------------------------------------------- // Renders a view because of a date change, view-type change, or for the first time. // If not given a viewType, keep the current view but render different dates. // Accepts an optional scroll state to restore to. function renderView(viewType, forcedScroll) { ignoreWindowResize++; var needsClearView = currentView && viewType && currentView.type !== viewType; // if viewType is changing, remove the old view's rendering if (needsClearView) { freezeContentHeight(); // prevent a scroll jump when view element is removed clearView(); } // if viewType changed, or the view was never created, create a fresh view if (!currentView && viewType) { currentView = t.view = viewsByType[viewType] || (viewsByType[viewType] = t.instantiateView(viewType)); currentView.setElement( $("<div class='fc-view fc-" + viewType + "-view' />").appendTo(content) ); toolbarsManager.proxyCall('activateButton', viewType); } if (currentView) { // in case the view should render a period of time that is completely hidden date = currentView.massageCurrentDate(date); // render or rerender the view if ( !currentView.isDateSet || !( // NOT within interval range signals an implicit date window change date >= currentView.intervalStart && date < currentView.intervalEnd ) ) { if (elementVisible()) { if (forcedScroll) { currentView.captureInitialScroll(forcedScroll); } currentView.setDate(date, forcedScroll); if (forcedScroll) { currentView.releaseScroll(); } // need to do this after View::render, so dates are calculated // NOTE: view updates title text proactively updateToolbarsTodayButton(); } } } if (needsClearView) { thawContentHeight(); } ignoreWindowResize--; } // Unrenders the current view and reflects this change in the Header. // Unregsiters the `currentView`, but does not remove from viewByType hash. function clearView() { toolbarsManager.proxyCall('deactivateButton', currentView.type); currentView.removeElement(); currentView = t.view = null; } // Destroys the view, including the view object. Then, re-instantiates it and renders it. // Maintains the same scroll state. // TODO: maintain any other user-manipulated state. function reinitView() { ignoreWindowResize++; freezeContentHeight(); var viewType = currentView.type; var scrollState = currentView.queryScroll(); clearView(); calcSize(); renderView(viewType, scrollState); thawContentHeight(); ignoreWindowResize--; } // Resizing // ----------------------------------------------------------------------------------- t.getSuggestedViewHeight = function() { if (suggestedViewHeight === undefined) { calcSize(); } return suggestedViewHeight; }; t.isHeightAuto = function() { return t.options.contentHeight === 'auto' || t.options.height === 'auto'; }; function updateSize(shouldRecalc) { if (elementVisible()) { if (shouldRecalc) { _calcSize(); } ignoreWindowResize++; currentView.updateSize(true); // isResize=true. will poll getSuggestedViewHeight() and isHeightAuto() ignoreWindowResize--; return true; // signal success } } function calcSize() { if (elementVisible()) { _calcSize(); } } function _calcSize() { // assumes elementVisible var contentHeightInput = t.options.contentHeight; var heightInput = t.options.height; if (typeof contentHeightInput === 'number') { // exists and not 'auto' suggestedViewHeight = contentHeightInput; } else if (typeof contentHeightInput === 'function') { // exists and is a function suggestedViewHeight = contentHeightInput(); } else if (typeof heightInput === 'number') { // exists and not 'auto' suggestedViewHeight = heightInput - queryToolbarsHeight(); } else if (typeof heightInput === 'function') { // exists and is a function suggestedViewHeight = heightInput() - queryToolbarsHeight(); } else if (heightInput === 'parent') { // set to height of parent element suggestedViewHeight = element.parent().height() - queryToolbarsHeight(); } else { suggestedViewHeight = Math.round(content.width() / Math.max(t.options.aspectRatio, .5)); } } function queryToolbarsHeight() { return toolbarsManager.items.reduce(function(accumulator, toolbar) { var toolbarHeight = toolbar.el ? toolbar.el.outerHeight(true) : 0; // includes margin return accumulator + toolbarHeight; }, 0); } function windowResize(ev) { if ( !ignoreWindowResize && ev.target === window && // so we don't process jqui "resize" events that have bubbled up currentView.start // view has already been rendered ) { if (updateSize(true)) { currentView.publiclyTrigger('windowResize', _element); } } } /* Event Rendering -----------------------------------------------------------------------------*/ function rerenderEvents() { // API method. destroys old events if previously rendered. if (elementVisible()) { t.reportEventChange(); // will re-trasmit events to the view, causing a rerender } } /* Toolbars -----------------------------------------------------------------------------*/ function buildToolbars() { return [ new Toolbar(t, computeHeaderOptions()), new Toolbar(t, computeFooterOptions()) ]; } function computeHeaderOptions() { return { extraClasses: 'fc-header-toolbar', layout: t.options.header }; } function computeFooterOptions() { return { extraClasses: 'fc-footer-toolbar', layout: t.options.footer }; } // can be called repeatedly and Header will rerender function renderHeader() { header.setToolbarOptions(computeHeaderOptions()); header.render(); if (header.el) { element.prepend(header.el); } } // can be called repeatedly and Footer will rerender function renderFooter() { footer.setToolbarOptions(computeFooterOptions()); footer.render(); if (footer.el) { element.append(footer.el); } } t.setToolbarsTitle = function(title) { toolbarsManager.proxyCall('updateTitle', title); }; function updateToolbarsTodayButton() { var now = t.getNow(); if (now >= currentView.intervalStart && now < currentView.intervalEnd) { toolbarsManager.proxyCall('disableButton', 'today'); } else { toolbarsManager.proxyCall('enableButton', 'today'); } } /* Selection -----------------------------------------------------------------------------*/ // this public method receives start/end dates in any format, with any timezone function select(zonedStartInput, zonedEndInput) { currentView.select( t.buildSelectSpan.apply(t, arguments) ); } function unselect() { // safe to be called before renderView if (currentView) { currentView.unselect(); } } /* Date -----------------------------------------------------------------------------*/ function prev() { date = currentView.computePrevDate(date); renderView(); } function next() { date = currentView.computeNextDate(date); renderView(); } function prevYear() { date.add(-1, 'years'); renderView(); } function nextYear() { date.add(1, 'years'); renderView(); } function today() { date = t.getNow(); renderView(); } function gotoDate(zonedDateInput) { date = t.moment(zonedDateInput).stripZone(); renderView(); } function incrementDate(delta) { date.add(moment.duration(delta)); renderView(); } // Forces navigation to a view for the given date. // `viewType` can be a specific view name or a generic one like "week" or "day". function zoomTo(newDate, viewType) { var spec; viewType = viewType || 'day'; // day is default zoom spec = t.getViewSpec(viewType) || t.getUnitViewSpec(viewType); date = newDate.clone(); renderView(spec ? spec.type : null); } // for external API function getDate() { return t.applyTimezone(date); // infuse the calendar's timezone } /* Height "Freezing" -----------------------------------------------------------------------------*/ t.freezeContentHeight = freezeContentHeight; t.thawContentHeight = thawContentHeight; var freezeContentHeightDepth = 0; function freezeContentHeight() { if (!(freezeContentHeightDepth++)) { content.css({ width: '100%', height: content.height(), overflow: 'hidden' }); } } function thawContentHeight() { if (!(--freezeContentHeightDepth)) { content.css({ width: '', height: '', overflow: '' }); } } /* Misc -----------------------------------------------------------------------------*/ function getCalendar() { return t; } function getView() { return currentView; } function option(name, value) { var newOptionHash; if (typeof name === 'string') { if (value === undefined) { // getter return t.options[name]; } else { // setter for individual option newOptionHash = {}; newOptionHash[name] = value; setOptions(newOptionHash); } } else if (typeof name === 'object') { // compound setter with object input setOptions(name); } } function setOptions(newOptionHash) { var optionCnt = 0; var optionName; for (optionName in newOptionHash) { t.dynamicOverrides[optionName] = newOptionHash[optionName]; } t.viewSpecCache = {}; // the dynamic override invalidates the options in this cache, so just clear it t.populateOptionsHash(); // this.options needs to be recomputed after the dynamic override // trigger handlers after this.options has been updated for (optionName in newOptionHash) { t.triggerOptionHandlers(optionName); // recall bindOption/bindOptions optionCnt++; } // special-case handling of single option change. // if only one option change, `optionName` will be its name. if (optionCnt === 1) { if (optionName === 'height' || optionName === 'contentHeight' || optionName === 'aspectRatio') { updateSize(true); // true = allow recalculation of height return; } else if (optionName === 'defaultDate') { return; // can't change date this way. use gotoDate instead } else if (optionName === 'businessHours') { if (currentView) { currentView.unrenderBusinessHours(); currentView.renderBusinessHours(); } return; } else if (optionName === 'timezone') { t.rezoneArrayEventSources(); t.refetchEvents(); return; } } // catch-all. rerender the header and footer and rebuild/rerender the current view renderHeader(); renderFooter(); viewsByType = {}; // even non-current views will be affected by this option change. do before rerender reinitView(); } function publiclyTrigger(name, thisObj) { var args = Array.prototype.slice.call(arguments, 2); thisObj = thisObj || _element; this.triggerWith(name, thisObj, args); // Emitter's method if (t.options[name]) { return t.options[name].apply(thisObj, args); } } t.initialize(); } ;; /* Options binding/triggering system. */ Calendar.mixin({ // A map of option names to arrays of handler objects. Initialized to {} in Calendar. // Format for a handler object: // { // func // callback function to be called upon change // names // option names whose values should be given to func // } optionHandlers: null, // Calls handlerFunc immediately, and when the given option has changed. // handlerFunc will be given the option value. bindOption: function(optionName, handlerFunc) { this.bindOptions([ optionName ], handlerFunc); }, // Calls handlerFunc immediately, and when any of the given options change. // handlerFunc will be given each option value as ordered function arguments. bindOptions: function(optionNames, handlerFunc) { var handlerObj = { func: handlerFunc, names: optionNames }; var i; for (i = 0; i < optionNames.length; i++) { this.registerOptionHandlerObj(optionNames[i], handlerObj); } this.triggerOptionHandlerObj(handlerObj); }, // Puts the given handler object into the internal hash registerOptionHandlerObj: function(optionName, handlerObj) { (this.optionHandlers[optionName] || (this.optionHandlers[optionName] = [])) .push(handlerObj); }, // Reports that the given option has changed, and calls all appropriate handlers. triggerOptionHandlers: function(optionName) { var handlerObjs = this.optionHandlers[optionName] || []; var i; for (i = 0; i < handlerObjs.length; i++) { this.triggerOptionHandlerObj(handlerObjs[i]); } }, // Calls the callback for a specific handler object, passing in the appropriate arguments. triggerOptionHandlerObj: function(handlerObj) { var optionNames = handlerObj.names; var optionValues = []; var i; for (i = 0; i < optionNames.length; i++) { optionValues.push(this.options[optionNames[i]]); } handlerObj.func.apply(this, optionValues); // maintain the Calendar's `this` context } }); ;; Calendar.defaults = { titleRangeSeparator: ' \u2013 ', // en dash monthYearFormat: 'MMMM YYYY', // required for en. other locales rely on datepicker computable option defaultTimedEventDuration: '02:00:00', defaultAllDayEventDuration: { days: 1 }, forceEventDuration: false, nextDayThreshold: '09:00:00', // 9am // display defaultView: 'month', aspectRatio: 1.35, header: { left: 'title', center: '', right: 'today prev,next' }, weekends: true, weekNumbers: false, weekNumberTitle: 'W', weekNumberCalculation: 'local', //editable: false, //nowIndicator: false, scrollTime: '06:00:00', // event ajax lazyFetching: true, startParam: 'start', endParam: 'end', timezoneParam: 'timezone', timezone: false, //allDayDefault: undefined, // locale isRTL: false, buttonText: { prev: "prev", next: "next", prevYear: "prev year", nextYear: "next year", year: 'year', // TODO: locale files need to specify this today: 'today', month: 'month', week: 'week', day: 'day' }, buttonIcons: { prev: 'left-single-arrow', next: 'right-single-arrow', prevYear: 'left-double-arrow', nextYear: 'right-double-arrow' }, allDayText: 'all-day', // jquery-ui theming theme: false, themeButtonIcons: { prev: 'circle-triangle-w', next: 'circle-triangle-e', prevYear: 'seek-prev', nextYear: 'seek-next' }, //eventResizableFromStart: false, dragOpacity: .75, dragRevertDuration: 500, dragScroll: true, //selectable: false, unselectAuto: true, dropAccept: '*', eventOrder: 'title', //eventRenderWait: null, eventLimit: false, eventLimitText: 'more', eventLimitClick: 'popover', dayPopoverFormat: 'LL', handleWindowResize: true, windowResizeDelay: 100, // milliseconds before an updateSize happens longPressDelay: 1000 }; Calendar.englishDefaults = { // used by locale.js dayPopoverFormat: 'dddd, MMMM D' }; Calendar.rtlDefaults = { // right-to-left defaults header: { // TODO: smarter solution (first/center/last ?) left: 'next,prev today', center: '', right: 'title' }, buttonIcons: { prev: 'right-single-arrow', next: 'left-single-arrow', prevYear: 'right-double-arrow', nextYear: 'left-double-arrow' }, themeButtonIcons: { prev: 'circle-triangle-e', next: 'circle-triangle-w', nextYear: 'seek-prev', prevYear: 'seek-next' } }; ;; var localeOptionHash = FC.locales = {}; // initialize and expose // TODO: document the structure and ordering of a FullCalendar locale file // Initialize jQuery UI datepicker translations while using some of the translations // Will set this as the default locales for datepicker. FC.datepickerLocale = function(localeCode, dpLocaleCode, dpOptions) { // get the FullCalendar internal option hash for this locale. create if necessary var fcOptions = localeOptionHash[localeCode] || (localeOptionHash[localeCode] = {}); // transfer some simple options from datepicker to fc fcOptions.isRTL = dpOptions.isRTL; fcOptions.weekNumberTitle = dpOptions.weekHeader; // compute some more complex options from datepicker $.each(dpComputableOptions, function(name, func) { fcOptions[name] = func(dpOptions); }); // is jQuery UI Datepicker is on the page? if ($.datepicker) { // Register the locale data. // FullCalendar and MomentJS use locale codes like "pt-br" but Datepicker // does it like "pt-BR" or if it doesn't have the locale, maybe just "pt". // Make an alias so the locale can be referenced either way. $.datepicker.regional[dpLocaleCode] = $.datepicker.regional[localeCode] = // alias dpOptions; // Alias 'en' to the default locale data. Do this every time. $.datepicker.regional.en = $.datepicker.regional['']; // Set as Datepicker's global defaults. $.datepicker.setDefaults(dpOptions); } }; // Sets FullCalendar-specific translations. Will set the locales as the global default. FC.locale = function(localeCode, newFcOptions) { var fcOptions; var momOptions; // get the FullCalendar internal option hash for this locale. create if necessary fcOptions = localeOptionHash[localeCode] || (localeOptionHash[localeCode] = {}); // provided new options for this locales? merge them in if (newFcOptions) { fcOptions = localeOptionHash[localeCode] = mergeOptions([ fcOptions, newFcOptions ]); } // compute locale options that weren't defined. // always do this. newFcOptions can be undefined when initializing from i18n file, // so no way to tell if this is an initialization or a default-setting. momOptions = getMomentLocaleData(localeCode); // will fall back to en $.each(momComputableOptions, function(name, func) { if (fcOptions[name] == null) { fcOptions[name] = func(momOptions, fcOptions); } }); // set it as the default locale for FullCalendar Calendar.defaults.locale = localeCode; }; // NOTE: can't guarantee any of these computations will run because not every locale has datepicker // configs, so make sure there are English fallbacks for these in the defaults file. var dpComputableOptions = { buttonText: function(dpOptions) { return { // the translations sometimes wrongly contain HTML entities prev: stripHtmlEntities(dpOptions.prevText), next: stripHtmlEntities(dpOptions.nextText), today: stripHtmlEntities(dpOptions.currentText) }; }, // Produces format strings like "MMMM YYYY" -> "September 2014" monthYearFormat: function(dpOptions) { return dpOptions.showMonthAfterYear ? 'YYYY[' + dpOptions.yearSuffix + '] MMMM' : 'MMMM YYYY[' + dpOptions.yearSuffix + ']'; } }; var momComputableOptions = { // Produces format strings like "ddd M/D" -> "Fri 9/15" dayOfMonthFormat: function(momOptions, fcOptions) { var format = momOptions.longDateFormat('l'); // for the format like "M/D/YYYY" // strip the year off the edge, as well as other misc non-whitespace chars format = format.replace(/^Y+[^\w\s]*|[^\w\s]*Y+$/g, ''); if (fcOptions.isRTL) { format += ' ddd'; // for RTL, add day-of-week to end } else { format = 'ddd ' + format; // for LTR, add day-of-week to beginning } return format; }, // Produces format strings like "h:mma" -> "6:00pm" mediumTimeFormat: function(momOptions) { // can't be called `timeFormat` because collides with option return momOptions.longDateFormat('LT') .replace(/\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand }, // Produces format strings like "h(:mm)a" -> "6pm" / "6:30pm" smallTimeFormat: function(momOptions) { return momOptions.longDateFormat('LT') .replace(':mm', '(:mm)') .replace(/(\Wmm)$/, '($1)') // like above, but for foreign locales .replace(/\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand }, // Produces format strings like "h(:mm)t" -> "6p" / "6:30p" extraSmallTimeFormat: function(momOptions) { return momOptions.longDateFormat('LT') .replace(':mm', '(:mm)') .replace(/(\Wmm)$/, '($1)') // like above, but for foreign locales .replace(/\s*a$/i, 't'); // convert to AM/PM/am/pm to lowercase one-letter. remove any spaces beforehand }, // Produces format strings like "ha" / "H" -> "6pm" / "18" hourFormat: function(momOptions) { return momOptions.longDateFormat('LT') .replace(':mm', '') .replace(/(\Wmm)$/, '') // like above, but for foreign locales .replace(/\s*a$/i, 'a'); // convert AM/PM/am/pm to lowercase. remove any spaces beforehand }, // Produces format strings like "h:mm" -> "6:30" (with no AM/PM) noMeridiemTimeFormat: function(momOptions) { return momOptions.longDateFormat('LT') .replace(/\s*a$/i, ''); // remove trailing AM/PM } }; // options that should be computed off live calendar options (considers override options) // TODO: best place for this? related to locale? // TODO: flipping text based on isRTL is a bad idea because the CSS `direction` might want to handle it var instanceComputableOptions = { // Produces format strings for results like "Mo 16" smallDayDateFormat: function(options) { return options.isRTL ? 'D dd' : 'dd D'; }, // Produces format strings for results like "Wk 5" weekFormat: function(options) { return options.isRTL ? 'w[ ' + options.weekNumberTitle + ']' : '[' + options.weekNumberTitle + ' ]w'; }, // Produces format strings for results like "Wk5" smallWeekFormat: function(options) { return options.isRTL ? 'w[' + options.weekNumberTitle + ']' : '[' + options.weekNumberTitle + ']w'; } }; function populateInstanceComputableOptions(options) { $.each(instanceComputableOptions, function(name, func) { if (options[name] == null) { options[name] = func(options); } }); } // Returns moment's internal locale data. If doesn't exist, returns English. function getMomentLocaleData(localeCode) { return moment.localeData(localeCode) || moment.localeData('en'); } // Initialize English by forcing computation of moment-derived options. // Also, sets it as the default. FC.locale('en', Calendar.englishDefaults); ;; FC.sourceNormalizers = []; FC.sourceFetchers = []; var ajaxDefaults = { dataType: 'json', cache: false }; var eventGUID = 1; function EventManager() { // assumed to be a calendar var t = this; // exports t.requestEvents = requestEvents; t.reportEventChange = reportEventChange; t.isFetchNeeded = isFetchNeeded; t.fetchEvents = fetchEvents; t.fetchEventSources = fetchEventSources; t.refetchEvents = refetchEvents; t.refetchEventSources = refetchEventSources; t.getEventSources = getEventSources; t.getEventSourceById = getEventSourceById; t.addEventSource = addEventSource; t.removeEventSource = removeEventSource; t.removeEventSources = removeEventSources; t.updateEvent = updateEvent; t.updateEvents = updateEvents; t.renderEvent = renderEvent; t.renderEvents = renderEvents; t.removeEvents = removeEvents; t.clientEvents = clientEvents; t.mutateEvent = mutateEvent; t.normalizeEventDates = normalizeEventDates; t.normalizeEventTimes = normalizeEventTimes; // locals var stickySource = { events: [] }; var sources = [ stickySource ]; var rangeStart, rangeEnd; var pendingSourceCnt = 0; // outstanding fetch requests, max one per source var cache = []; // holds events that have already been expanded var prunedCache; // like cache, but only events that intersect with rangeStart/rangeEnd $.each( (t.options.events ? [ t.options.events ] : []).concat(t.options.eventSources || []), function(i, sourceInput) { var source = buildEventSource(sourceInput); if (source) { sources.push(source); } } ); function requestEvents(start, end) { if (!t.options.lazyFetching || isFetchNeeded(start, end)) { return fetchEvents(start, end); } else { return Promise.resolve(prunedCache); } } function reportEventChange() { prunedCache = filterEventsWithinRange(cache); t.trigger('eventsReset', prunedCache); } function filterEventsWithinRange(events) { var filteredEvents = []; var i, event; for (i = 0; i < events.length; i++) { event = events[i]; if ( event.start.clone().stripZone() < rangeEnd && t.getEventEnd(event).stripZone() > rangeStart ) { filteredEvents.push(event); } } return filteredEvents; } t.getEventCache = function() { return cache; }; t.getPrunedEventCache = function() { return prunedCache; }; /* Fetching -----------------------------------------------------------------------------*/ // start and end are assumed to be unzoned function isFetchNeeded(start, end) { return !rangeStart || // nothing has been fetched yet? start < rangeStart || end > rangeEnd; // is part of the new range outside of the old range? } function fetchEvents(start, end) { rangeStart = start; rangeEnd = end; return refetchEvents(); } // poorly named. fetches all sources with current `rangeStart` and `rangeEnd`. function refetchEvents() { return fetchEventSources(sources, 'reset'); } // poorly named. fetches a subset of event sources. function refetchEventSources(matchInputs) { return fetchEventSources(getEventSourcesByMatchArray(matchInputs)); } // expects an array of event source objects (the originals, not copies) // `specialFetchType` is an optimization parameter that affects purging of the event cache. function fetchEventSources(specificSources, specialFetchType) { var i, source; if (specialFetchType === 'reset') { cache = []; } else if (specialFetchType !== 'add') { cache = excludeEventsBySources(cache, specificSources); } for (i = 0; i < specificSources.length; i++) { source = specificSources[i]; // already-pending sources have already been accounted for in pendingSourceCnt if (source._status !== 'pending') { pendingSourceCnt++; } source._fetchId = (source._fetchId || 0) + 1; source._status = 'pending'; } for (i = 0; i < specificSources.length; i++) { source = specificSources[i]; tryFetchEventSource(source, source._fetchId); } if (pendingSourceCnt) { return new Promise(function(resolve) { t.one('eventsReceived', resolve); // will send prunedCache }); } else { // executed all synchronously, or no sources at all return Promise.resolve(prunedCache); } } // fetches an event source and processes its result ONLY if it is still the current fetch. // caller is responsible for incrementing pendingSourceCnt first. function tryFetchEventSource(source, fetchId) { _fetchEventSource(source, function(eventInputs) { var isArraySource = $.isArray(source.events); var i, eventInput; var abstractEvent; if ( // is this the source's most recent fetch? // if not, rely on an upcoming fetch of this source to decrement pendingSourceCnt fetchId === source._fetchId && // event source no longer valid? source._status !== 'rejected' ) { source._status = 'resolved'; if (eventInputs) { for (i = 0; i < eventInputs.length; i++) { eventInput = eventInputs[i]; if (isArraySource) { // array sources have already been convert to Event Objects abstractEvent = eventInput; } else { abstractEvent = buildEventFromInput(eventInput, source); } if (abstractEvent) { // not false (an invalid event) cache.push.apply( // append cache, expandEvent(abstractEvent) // add individual expanded events to the cache ); } } } decrementPendingSourceCnt(); } }); } function rejectEventSource(source) { var wasPending = source._status === 'pending'; source._status = 'rejected'; if (wasPending) { decrementPendingSourceCnt(); } } function decrementPendingSourceCnt() { pendingSourceCnt--; if (!pendingSourceCnt) { reportEventChange(cache); // updates prunedCache t.trigger('eventsReceived', prunedCache); } } function _fetchEventSource(source, callback) { var i; var fetchers = FC.sourceFetchers; var res; for (i=0; i<fetchers.length; i++) { res = fetchers[i].call( t, // this, the Calendar object source, rangeStart.clone(), rangeEnd.clone(), t.options.timezone, callback ); if (res === true) { // the fetcher is in charge. made its own async request return; } else if (typeof res == 'object') { // the fetcher returned a new source. process it _fetchEventSource(res, callback); return; } } var events = source.events; if (events) { if ($.isFunction(events)) { t.pushLoading(); events.call( t, // this, the Calendar object rangeStart.clone(), rangeEnd.clone(), t.options.timezone, function(events) { callback(events); t.popLoading(); } ); } else if ($.isArray(events)) { callback(events); } else { callback(); } }else{ var url = source.url; if (url) { var success = source.success; var error = source.error; var complete = source.complete; // retrieve any outbound GET/POST $.ajax data from the options var customData; if ($.isFunction(source.data)) { // supplied as a function that returns a key/value object customData = source.data(); } else { // supplied as a straight key/value object customData = source.data; } // use a copy of the custom data so we can modify the parameters // and not affect the passed-in object. var data = $.extend({}, customData || {}); var startParam = firstDefined(source.startParam, t.options.startParam); var endParam = firstDefined(source.endParam, t.options.endParam); var timezoneParam = firstDefined(source.timezoneParam, t.options.timezoneParam); if (startParam) { data[startParam] = rangeStart.format(); } if (endParam) { data[endParam] = rangeEnd.format(); } if (t.options.timezone && t.options.timezone != 'local') { data[timezoneParam] = t.options.timezone; } t.pushLoading(); $.ajax($.extend({}, ajaxDefaults, source, { data: data, success: function(events) { events = events || []; var res = applyAll(success, this, arguments); if ($.isArray(res)) { events = res; } callback(events); }, error: function() { applyAll(error, this, arguments); callback(); }, complete: function() { applyAll(complete, this, arguments); t.popLoading(); } })); }else{ callback(); } } } /* Sources -----------------------------------------------------------------------------*/ function addEventSource(sourceInput) { var source = buildEventSource(sourceInput); if (source) { sources.push(source); fetchEventSources([ source ], 'add'); // will eventually call reportEventChange } } function buildEventSource(sourceInput) { // will return undefined if invalid source var normalizers = FC.sourceNormalizers; var source; var i; if ($.isFunction(sourceInput) || $.isArray(sourceInput)) { source = { events: sourceInput }; } else if (typeof sourceInput === 'string') { source = { url: sourceInput }; } else if (typeof sourceInput === 'object') { source = $.extend({}, sourceInput); // shallow copy } if (source) { // TODO: repeat code, same code for event classNames if (source.className) { if (typeof source.className === 'string') { source.className = source.className.split(/\s+/); } // otherwise, assumed to be an array } else { source.className = []; } // for array sources, we convert to standard Event Objects up front if ($.isArray(source.events)) { source.origArray = source.events; // for removeEventSource source.events = $.map(source.events, function(eventInput) { return buildEventFromInput(eventInput, source); }); } for (i=0; i<normalizers.length; i++) { normalizers[i].call(t, source); } return source; } } function removeEventSource(matchInput) { removeSpecificEventSources( getEventSourcesByMatch(matchInput) ); } // if called with no arguments, removes all. function removeEventSources(matchInputs) { if (matchInputs == null) { removeSpecificEventSources(sources, true); // isAll=true } else { removeSpecificEventSources( getEventSourcesByMatchArray(matchInputs) ); } } function removeSpecificEventSources(targetSources, isAll) { var i; // cancel pending requests for (i = 0; i < targetSources.length; i++) { rejectEventSource(targetSources[i]); } if (isAll) { // an optimization sources = []; cache = []; } else { // remove from persisted source list sources = $.grep(sources, function(source) { for (i = 0; i < targetSources.length; i++) { if (source === targetSources[i]) { return false; // exclude } } return true; // include }); cache = excludeEventsBySources(cache, targetSources); } reportEventChange(); } function getEventSources() { return sources.slice(1); // returns a shallow copy of sources with stickySource removed } function getEventSourceById(id) { return $.grep(sources, function(source) { return source.id && source.id === id; })[0]; } // like getEventSourcesByMatch, but accepts multple match criteria (like multiple IDs) function getEventSourcesByMatchArray(matchInputs) { // coerce into an array if (!matchInputs) { matchInputs = []; } else if (!$.isArray(matchInputs)) { matchInputs = [ matchInputs ]; } var matchingSources = []; var i; // resolve raw inputs to real event source objects for (i = 0; i < matchInputs.length; i++) { matchingSources.push.apply( // append matchingSources, getEventSourcesByMatch(matchInputs[i]) ); } return matchingSources; } // matchInput can either by a real event source object, an ID, or the function/URL for the source. // returns an array of matching source objects. function getEventSourcesByMatch(matchInput) { var i, source; // given an proper event source object for (i = 0; i < sources.length; i++) { source = sources[i]; if (source === matchInput) { return [ source ]; } } // an ID match source = getEventSourceById(matchInput); if (source) { return [ source ]; } return $.grep(sources, function(source) { return isSourcesEquivalent(matchInput, source); }); } function isSourcesEquivalent(source1, source2) { return source1 && source2 && getSourcePrimitive(source1) == getSourcePrimitive(source2); } function getSourcePrimitive(source) { return ( (typeof source === 'object') ? // a normalized event source? (source.origArray || source.googleCalendarId || source.url || source.events) : // get the primitive null ) || source; // the given argument *is* the primitive } // util // returns a filtered array without events that are part of any of the given sources function excludeEventsBySources(specificEvents, specificSources) { return $.grep(specificEvents, function(event) { for (var i = 0; i < specificSources.length; i++) { if (event.source === specificSources[i]) { return false; // exclude } } return true; // keep }); } /* Manipulation -----------------------------------------------------------------------------*/ // Only ever called from the externally-facing API function updateEvent(event) { updateEvents([ event ]); } // Only ever called from the externally-facing API function updateEvents(events) { var i, event; for (i = 0; i < events.length; i++) { event = events[i]; // massage start/end values, even if date string values event.start = t.moment(event.start); if (event.end) { event.end = t.moment(event.end); } else { event.end = null; } mutateEvent(event, getMiscEventProps(event)); // will handle start/end/allDay normalization } reportEventChange(); // reports event modifications (so we can redraw) } // Returns a hash of misc event properties that should be copied over to related events. function getMiscEventProps(event) { var props = {}; $.each(event, function(name, val) { if (isMiscEventPropName(name)) { if (val !== undefined && isAtomic(val)) { // a defined non-object props[name] = val; } } }); return props; } // non-date-related, non-id-related, non-secret function isMiscEventPropName(name) { return !/^_|^(id|allDay|start|end)$/.test(name); } // returns the expanded events that were created function renderEvent(eventInput, stick) { return renderEvents([ eventInput ], stick); } // returns the expanded events that were created function renderEvents(eventInputs, stick) { var renderedEvents = []; var renderableEvents; var abstractEvent; var i, j, event; for (i = 0; i < eventInputs.length; i++) { abstractEvent = buildEventFromInput(eventInputs[i]); if (abstractEvent) { // not false (a valid input) renderableEvents = expandEvent(abstractEvent); for (j = 0; j < renderableEvents.length; j++) { event = renderableEvents[j]; if (!event.source) { if (stick) { stickySource.events.push(event); event.source = stickySource; } cache.push(event); } } renderedEvents = renderedEvents.concat(renderableEvents); } } if (renderedEvents.length) { // any new events rendered? reportEventChange(); } return renderedEvents; } function removeEvents(filter) { var eventID; var i; if (filter == null) { // null or undefined. remove all events filter = function() { return true; }; // will always match } else if (!$.isFunction(filter)) { // an event ID eventID = filter + ''; filter = function(event) { return event._id == eventID; }; } // Purge event(s) from our local cache cache = $.grep(cache, filter, true); // inverse=true // Remove events from array sources. // This works because they have been converted to official Event Objects up front. // (and as a result, event._id has been calculated). for (i=0; i<sources.length; i++) { if ($.isArray(sources[i].events)) { sources[i].events = $.grep(sources[i].events, filter, true); } } reportEventChange(); } function clientEvents(filter) { if ($.isFunction(filter)) { return $.grep(cache, filter); } else if (filter != null) { // not null, not undefined. an event ID filter += ''; return $.grep(cache, function(e) { return e._id == filter; }); } return cache; // else, return all } // Makes sure all array event sources have their internal event objects // converted over to the Calendar's current timezone. t.rezoneArrayEventSources = function() { var i; var events; var j; for (i = 0; i < sources.length; i++) { events = sources[i].events; if ($.isArray(events)) { for (j = 0; j < events.length; j++) { rezoneEventDates(events[j]); } } } }; function rezoneEventDates(event) { event.start = t.moment(event.start); if (event.end) { event.end = t.moment(event.end); } backupEventDates(event); } /* Event Normalization -----------------------------------------------------------------------------*/ // Given a raw object with key/value properties, returns an "abstract" Event object. // An "abstract" event is an event that, if recurring, will not have been expanded yet. // Will return `false` when input is invalid. // `source` is optional function buildEventFromInput(input, source) { var out = {}; var start, end; var allDay; if (t.options.eventDataTransform) { input = t.options.eventDataTransform(input); } if (source && source.eventDataTransform) { input = source.eventDataTransform(input); } // Copy all properties over to the resulting object. // The special-case properties will be copied over afterwards. $.extend(out, input); if (source) { out.source = source; } out._id = input._id || (input.id === undefined ? '_fc' + eventGUID++ : input.id + ''); if (input.className) { if (typeof input.className == 'string') { out.className = input.className.split(/\s+/); } else { // assumed to be an array out.className = input.className; } } else { out.className = []; } start = input.start || input.date; // "date" is an alias for "start" end = input.end; // parse as a time (Duration) if applicable if (isTimeString(start)) { start = moment.duration(start); } if (isTimeString(end)) { end = moment.duration(end); } if (input.dow || moment.isDuration(start) || moment.isDuration(end)) { // the event is "abstract" (recurring) so don't calculate exact start/end dates just yet out.start = start ? moment.duration(start) : null; // will be a Duration or null out.end = end ? moment.duration(end) : null; // will be a Duration or null out._recurring = true; // our internal marker } else { if (start) { start = t.moment(start); if (!start.isValid()) { return false; } } if (end) { end = t.moment(end); if (!end.isValid()) { end = null; // let defaults take over } } allDay = input.allDay; if (allDay === undefined) { // still undefined? fallback to default allDay = firstDefined( source ? source.allDayDefault : undefined, t.options.allDayDefault ); // still undefined? normalizeEventDates will calculate it } assignDatesToEvent(start, end, allDay, out); } t.normalizeEvent(out); // hook for external use. a prototype method return out; } t.buildEventFromInput = buildEventFromInput; // Normalizes and assigns the given dates to the given partially-formed event object. // NOTE: mutates the given start/end moments. does not make a copy. function assignDatesToEvent(start, end, allDay, event) { event.start = start; event.end = end; event.allDay = allDay; normalizeEventDates(event); backupEventDates(event); } // Ensures proper values for allDay/start/end. Accepts an Event object, or a plain object with event-ish properties. // NOTE: Will modify the given object. function normalizeEventDates(eventProps) { normalizeEventTimes(eventProps); if (eventProps.end && !eventProps.end.isAfter(eventProps.start)) { eventProps.end = null; } if (!eventProps.end) { if (t.options.forceEventDuration) { eventProps.end = t.getDefaultEventEnd(eventProps.allDay, eventProps.start); } else { eventProps.end = null; } } } // Ensures the allDay property exists and the timeliness of the start/end dates are consistent function normalizeEventTimes(eventProps) { if (eventProps.allDay == null) { eventProps.allDay = !(eventProps.start.hasTime() || (eventProps.end && eventProps.end.hasTime())); } if (eventProps.allDay) { eventProps.start.stripTime(); if (eventProps.end) { // TODO: consider nextDayThreshold here? If so, will require a lot of testing and adjustment eventProps.end.stripTime(); } } else { if (!eventProps.start.hasTime()) { eventProps.start = t.applyTimezone(eventProps.start.time(0)); // will assign a 00:00 time } if (eventProps.end && !eventProps.end.hasTime()) { eventProps.end = t.applyTimezone(eventProps.end.time(0)); // will assign a 00:00 time } } } // If the given event is a recurring event, break it down into an array of individual instances. // If not a recurring event, return an array with the single original event. // If given a falsy input (probably because of a failed buildEventFromInput call), returns an empty array. // HACK: can override the recurring window by providing custom rangeStart/rangeEnd (for businessHours). function expandEvent(abstractEvent, _rangeStart, _rangeEnd) { var events = []; var dowHash; var dow; var i; var date; var startTime, endTime; var start, end; var event; _rangeStart = _rangeStart || rangeStart; _rangeEnd = _rangeEnd || rangeEnd; if (abstractEvent) { if (abstractEvent._recurring) { // make a boolean hash as to whether the event occurs on each day-of-week if ((dow = abstractEvent.dow)) { dowHash = {}; for (i = 0; i < dow.length; i++) { dowHash[dow[i]] = true; } } // iterate through every day in the current range date = _rangeStart.clone().stripTime(); // holds the date of the current day while (date.isBefore(_rangeEnd)) { if (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week startTime = abstractEvent.start; // the stored start and end properties are times (Durations) endTime = abstractEvent.end; // " start = date.clone(); end = null; if (startTime) { start = start.time(startTime); } if (endTime) { end = date.clone().time(endTime); } event = $.extend({}, abstractEvent); // make a copy of the original assignDatesToEvent( start, end, !startTime && !endTime, // allDay? event ); events.push(event); } date.add(1, 'days'); } } else { events.push(abstractEvent); // return the original event. will be a one-item array } } return events; } t.expandEvent = expandEvent; /* Event Modification Math -----------------------------------------------------------------------------------------*/ // Modifies an event and all related events by applying the given properties. // Special date-diffing logic is used for manipulation of dates. // If `props` does not contain start/end dates, the updated values are assumed to be the event's current start/end. // All date comparisons are done against the event's pristine _start and _end dates. // Returns an object with delta information and a function to undo all operations. // For making computations in a granularity greater than day/time, specify largeUnit. // NOTE: The given `newProps` might be mutated for normalization purposes. function mutateEvent(event, newProps, largeUnit) { var miscProps = {}; var oldProps; var clearEnd; var startDelta; var endDelta; var durationDelta; var undoFunc; // diffs the dates in the appropriate way, returning a duration function diffDates(date1, date0) { // date1 - date0 if (largeUnit) { return diffByUnit(date1, date0, largeUnit); } else if (newProps.allDay) { return diffDay(date1, date0); } else { return diffDayTime(date1, date0); } } newProps = newProps || {}; // normalize new date-related properties if (!newProps.start) { newProps.start = event.start.clone(); } if (newProps.end === undefined) { newProps.end = event.end ? event.end.clone() : null; } if (newProps.allDay == null) { // is null or undefined? newProps.allDay = event.allDay; } normalizeEventDates(newProps); // create normalized versions of the original props to compare against // need a real end value, for diffing oldProps = { start: event._start.clone(), end: event._end ? event._end.clone() : t.getDefaultEventEnd(event._allDay, event._start), allDay: newProps.allDay // normalize the dates in the same regard as the new properties }; normalizeEventDates(oldProps); // need to clear the end date if explicitly changed to null clearEnd = event._end !== null && newProps.end === null; // compute the delta for moving the start date startDelta = diffDates(newProps.start, oldProps.start); // compute the delta for moving the end date if (newProps.end) { endDelta = diffDates(newProps.end, oldProps.end); durationDelta = endDelta.subtract(startDelta); } else { durationDelta = null; } // gather all non-date-related properties $.each(newProps, function(name, val) { if (isMiscEventPropName(name)) { if (val !== undefined) { miscProps[name] = val; } } }); // apply the operations to the event and all related events undoFunc = mutateEvents( clientEvents(event._id), // get events with this ID clearEnd, newProps.allDay, startDelta, durationDelta, miscProps ); return { dateDelta: startDelta, durationDelta: durationDelta, undo: undoFunc }; } // Modifies an array of events in the following ways (operations are in order): // - clear the event's `end` // - convert the event to allDay // - add `dateDelta` to the start and end // - add `durationDelta` to the event's duration // - assign `miscProps` to the event // // Returns a function that can be called to undo all the operations. // // TODO: don't use so many closures. possible memory issues when lots of events with same ID. // function mutateEvents(events, clearEnd, allDay, dateDelta, durationDelta, miscProps) { var isAmbigTimezone = t.getIsAmbigTimezone(); var undoFunctions = []; // normalize zero-length deltas to be null if (dateDelta && !dateDelta.valueOf()) { dateDelta = null; } if (durationDelta && !durationDelta.valueOf()) { durationDelta = null; } $.each(events, function(i, event) { var oldProps; var newProps; // build an object holding all the old values, both date-related and misc. // for the undo function. oldProps = { start: event.start.clone(), end: event.end ? event.end.clone() : null, allDay: event.allDay }; $.each(miscProps, function(name) { oldProps[name] = event[name]; }); // new date-related properties. work off the original date snapshot. // ok to use references because they will be thrown away when backupEventDates is called. newProps = { start: event._start, end: event._end, allDay: allDay // normalize the dates in the same regard as the new properties }; normalizeEventDates(newProps); // massages start/end/allDay // strip or ensure the end date if (clearEnd) { newProps.end = null; } else if (durationDelta && !newProps.end) { // the duration translation requires an end date newProps.end = t.getDefaultEventEnd(newProps.allDay, newProps.start); } if (dateDelta) { newProps.start.add(dateDelta); if (newProps.end) { newProps.end.add(dateDelta); } } if (durationDelta) { newProps.end.add(durationDelta); // end already ensured above } // if the dates have changed, and we know it is impossible to recompute the // timezone offsets, strip the zone. if ( isAmbigTimezone && !newProps.allDay && (dateDelta || durationDelta) ) { newProps.start.stripZone(); if (newProps.end) { newProps.end.stripZone(); } } $.extend(event, miscProps, newProps); // copy over misc props, then date-related props backupEventDates(event); // regenerate internal _start/_end/_allDay undoFunctions.push(function() { $.extend(event, oldProps); backupEventDates(event); // regenerate internal _start/_end/_allDay }); }); return function() { for (var i = 0; i < undoFunctions.length; i++) { undoFunctions[i](); } }; } } // hook for external libs to manipulate event properties upon creation. // should manipulate the event in-place. Calendar.prototype.normalizeEvent = function(event) { }; // Does the given span (start, end, and other location information) // fully contain the other? Calendar.prototype.spanContainsSpan = function(outerSpan, innerSpan) { var eventStart = outerSpan.start.clone().stripZone(); var eventEnd = this.getEventEnd(outerSpan).stripZone(); return innerSpan.start >= eventStart && innerSpan.end <= eventEnd; }; // Returns a list of events that the given event should be compared against when being considered for a move to // the specified span. Attached to the Calendar's prototype because EventManager is a mixin for a Calendar. Calendar.prototype.getPeerEvents = function(span, event) { var cache = this.getEventCache(); var peerEvents = []; var i, otherEvent; for (i = 0; i < cache.length; i++) { otherEvent = cache[i]; if ( !event || event._id !== otherEvent._id // don't compare the event to itself or other related [repeating] events ) { peerEvents.push(otherEvent); } } return peerEvents; }; // updates the "backup" properties, which are preserved in order to compute diffs later on. function backupEventDates(event) { event._allDay = event.allDay; event._start = event.start.clone(); event._end = event.end ? event.end.clone() : null; } /* Overlapping / Constraining -----------------------------------------------------------------------------------------*/ // Determines if the given event can be relocated to the given span (unzoned start/end with other misc data) Calendar.prototype.isEventSpanAllowed = function(span, event) { var source = event.source || {}; var constraint = firstDefined( event.constraint, source.constraint, this.options.eventConstraint ); var overlap = firstDefined( event.overlap, source.overlap, this.options.eventOverlap ); return this.isSpanAllowed(span, constraint, overlap, event) && (!this.options.eventAllow || this.options.eventAllow(span, event) !== false); }; // Determines if an external event can be relocated to the given span (unzoned start/end with other misc data) Calendar.prototype.isExternalSpanAllowed = function(eventSpan, eventLocation, eventProps) { var eventInput; var event; // note: very similar logic is in View's reportExternalDrop if (eventProps) { eventInput = $.extend({}, eventProps, eventLocation); event = this.expandEvent( this.buildEventFromInput(eventInput) )[0]; } if (event) { return this.isEventSpanAllowed(eventSpan, event); } else { // treat it as a selection return this.isSelectionSpanAllowed(eventSpan); } }; // Determines the given span (unzoned start/end with other misc data) can be selected. Calendar.prototype.isSelectionSpanAllowed = function(span) { return this.isSpanAllowed(span, this.options.selectConstraint, this.options.selectOverlap) && (!this.options.selectAllow || this.options.selectAllow(span) !== false); }; // Returns true if the given span (caused by an event drop/resize or a selection) is allowed to exist // according to the constraint/overlap settings. // `event` is not required if checking a selection. Calendar.prototype.isSpanAllowed = function(span, constraint, overlap, event) { var constraintEvents; var anyContainment; var peerEvents; var i, peerEvent; var peerOverlap; // the range must be fully contained by at least one of produced constraint events if (constraint != null) { // not treated as an event! intermediate data structure // TODO: use ranges in the future constraintEvents = this.constraintToEvents(constraint); if (constraintEvents) { // not invalid anyContainment = false; for (i = 0; i < constraintEvents.length; i++) { if (this.spanContainsSpan(constraintEvents[i], span)) { anyContainment = true; break; } } if (!anyContainment) { return false; } } } peerEvents = this.getPeerEvents(span, event); for (i = 0; i < peerEvents.length; i++) { peerEvent = peerEvents[i]; // there needs to be an actual intersection before disallowing anything if (this.eventIntersectsRange(peerEvent, span)) { // evaluate overlap for the given range and short-circuit if necessary if (overlap === false) { return false; } // if the event's overlap is a test function, pass the peer event in question as the first param else if (typeof overlap === 'function' && !overlap(peerEvent, event)) { return false; } // if we are computing if the given range is allowable for an event, consider the other event's // EventObject-specific or Source-specific `overlap` property if (event) { peerOverlap = firstDefined( peerEvent.overlap, (peerEvent.source || {}).overlap // we already considered the global `eventOverlap` ); if (peerOverlap === false) { return false; } // if the peer event's overlap is a test function, pass the subject event as the first param if (typeof peerOverlap === 'function' && !peerOverlap(event, peerEvent)) { return false; } } } } return true; }; // Given an event input from the API, produces an array of event objects. Possible event inputs: // 'businessHours' // An event ID (number or string) // An object with specific start/end dates or a recurring event (like what businessHours accepts) Calendar.prototype.constraintToEvents = function(constraintInput) { if (constraintInput === 'businessHours') { return this.getCurrentBusinessHourEvents(); } if (typeof constraintInput === 'object') { if (constraintInput.start != null) { // needs to be event-like input return this.expandEvent(this.buildEventFromInput(constraintInput)); } else { return null; // invalid } } return this.clientEvents(constraintInput); // probably an ID }; // Does the event's date range intersect with the given range? // start/end already assumed to have stripped zones :( Calendar.prototype.eventIntersectsRange = function(event, range) { var eventStart = event.start.clone().stripZone(); var eventEnd = this.getEventEnd(event).stripZone(); return range.start < eventEnd && range.end > eventStart; }; /* Business Hours -----------------------------------------------------------------------------------------*/ var BUSINESS_HOUR_EVENT_DEFAULTS = { id: '_fcBusinessHours', // will relate events from different calls to expandEvent start: '09:00', end: '17:00', dow: [ 1, 2, 3, 4, 5 ], // monday - friday rendering: 'inverse-background' // classNames are defined in businessHoursSegClasses }; // Return events objects for business hours within the current view. // Abuse of our event system :( Calendar.prototype.getCurrentBusinessHourEvents = function(wholeDay) { return this.computeBusinessHourEvents(wholeDay, this.options.businessHours); }; // Given a raw input value from options, return events objects for business hours within the current view. Calendar.prototype.computeBusinessHourEvents = function(wholeDay, input) { if (input === true) { return this.expandBusinessHourEvents(wholeDay, [ {} ]); } else if ($.isPlainObject(input)) { return this.expandBusinessHourEvents(wholeDay, [ input ]); } else if ($.isArray(input)) { return this.expandBusinessHourEvents(wholeDay, input, true); } else { return []; } }; // inputs expected to be an array of objects. // if ignoreNoDow is true, will ignore entries that don't specify a day-of-week (dow) key. Calendar.prototype.expandBusinessHourEvents = function(wholeDay, inputs, ignoreNoDow) { var view = this.getView(); var events = []; var i, input; for (i = 0; i < inputs.length; i++) { input = inputs[i]; if (ignoreNoDow && !input.dow) { continue; } // give defaults. will make a copy input = $.extend({}, BUSINESS_HOUR_EVENT_DEFAULTS, input); // if a whole-day series is requested, clear the start/end times if (wholeDay) { input.start = null; input.end = null; } events.push.apply(events, // append this.expandEvent( this.buildEventFromInput(input), view.start, view.end ) ); } return events; }; ;; /* An abstract class for the "basic" views, as well as month view. Renders one or more rows of day cells. ----------------------------------------------------------------------------------------------------------------------*/ // It is a manager for a DayGrid subcomponent, which does most of the heavy lifting. // It is responsible for managing width/height. var BasicView = FC.BasicView = View.extend({ scroller: null, dayGridClass: DayGrid, // class the dayGrid will be instantiated from (overridable by subclasses) dayGrid: null, // the main subcomponent that does most of the heavy lifting dayNumbersVisible: false, // display day numbers on each day cell? colWeekNumbersVisible: false, // display week numbers along the side? cellWeekNumbersVisible: false, // display week numbers in day cell? weekNumberWidth: null, // width of all the week-number cells running down the side headContainerEl: null, // div that hold's the dayGrid's rendered date header headRowEl: null, // the fake row element of the day-of-week header initialize: function() { this.dayGrid = this.instantiateDayGrid(); this.scroller = new Scroller({ overflowX: 'hidden', overflowY: 'auto' }); }, // Generates the DayGrid object this view needs. Draws from this.dayGridClass instantiateDayGrid: function() { // generate a subclass on the fly with BasicView-specific behavior // TODO: cache this subclass var subclass = this.dayGridClass.extend(basicDayGridMethods); return new subclass(this); }, // Sets the display range and computes all necessary dates setRange: function(range) { View.prototype.setRange.call(this, range); // call the super-method this.dayGrid.breakOnWeeks = /year|month|week/.test(this.intervalUnit); // do before setRange this.dayGrid.setRange(range); }, // Compute the value to feed into setRange. Overrides superclass. computeRange: function(date) { var range = View.prototype.computeRange.call(this, date); // get value from the super-method // year and month views should be aligned with weeks. this is already done for week if (/year|month/.test(range.intervalUnit)) { range.start.startOf('week'); range.start = this.skipHiddenDays(range.start); // make end-of-week if not already if (range.end.weekday()) { range.end.add(1, 'week').startOf('week'); range.end = this.skipHiddenDays(range.end, -1, true); // exclusively move backwards } } return range; }, // Renders the view into `this.el`, which should already be assigned renderDates: function() { this.dayNumbersVisible = this.dayGrid.rowCnt > 1; // TODO: make grid responsible if (this.opt('weekNumbers')) { if (this.opt('weekNumbersWithinDays')) { this.cellWeekNumbersVisible = true; this.colWeekNumbersVisible = false; } else { this.cellWeekNumbersVisible = false; this.colWeekNumbersVisible = true; }; } this.dayGrid.numbersVisible = this.dayNumbersVisible || this.cellWeekNumbersVisible || this.colWeekNumbersVisible; this.el.addClass('fc-basic-view').html(this.renderSkeletonHtml()); this.renderHead(); this.scroller.render(); var dayGridContainerEl = this.scroller.el.addClass('fc-day-grid-container'); var dayGridEl = $('<div class="fc-day-grid" />').appendTo(dayGridContainerEl); this.el.find('.fc-body > tr > td').append(dayGridContainerEl); this.dayGrid.setElement(dayGridEl); this.dayGrid.renderDates(this.hasRigidRows()); }, // render the day-of-week headers renderHead: function() { this.headContainerEl = this.el.find('.fc-head-container') .html(this.dayGrid.renderHeadHtml()); this.headRowEl = this.headContainerEl.find('.fc-row'); }, // Unrenders the content of the view. Since we haven't separated skeleton rendering from date rendering, // always completely kill the dayGrid's rendering. unrenderDates: function() { this.dayGrid.unrenderDates(); this.dayGrid.removeElement(); this.scroller.destroy(); }, renderBusinessHours: function() { this.dayGrid.renderBusinessHours(); }, unrenderBusinessHours: function() { this.dayGrid.unrenderBusinessHours(); }, // Builds the HTML skeleton for the view. // The day-grid component will render inside of a container defined by this HTML. renderSkeletonHtml: function() { return '' + '<table>' + '<thead class="fc-head">' + '<tr>' + '<td class="fc-head-container ' + this.widgetHeaderClass + '"></td>' + '</tr>' + '</thead>' + '<tbody class="fc-body">' + '<tr>' + '<td class="' + this.widgetContentClass + '"></td>' + '</tr>' + '</tbody>' + '</table>'; }, // Generates an HTML attribute string for setting the width of the week number column, if it is known weekNumberStyleAttr: function() { if (this.weekNumberWidth !== null) { return 'style="width:' + this.weekNumberWidth + 'px"'; } return ''; }, // Determines whether each row should have a constant height hasRigidRows: function() { var eventLimit = this.opt('eventLimit'); return eventLimit && typeof eventLimit !== 'number'; }, /* Dimensions ------------------------------------------------------------------------------------------------------------------*/ // Refreshes the horizontal dimensions of the view updateWidth: function() { if (this.colWeekNumbersVisible) { // Make sure all week number cells running down the side have the same width. // Record the width for cells created later. this.weekNumberWidth = matchCellWidths( this.el.find('.fc-week-number') ); } }, // Adjusts the vertical dimensions of the view to the specified values setHeight: function(totalHeight, isAuto) { var eventLimit = this.opt('eventLimit'); var scrollerHeight; var scrollbarWidths; // reset all heights to be natural this.scroller.clear(); uncompensateScroll(this.headRowEl); this.dayGrid.removeSegPopover(); // kill the "more" popover if displayed // is the event limit a constant level number? if (eventLimit && typeof eventLimit === 'number') { this.dayGrid.limitRows(eventLimit); // limit the levels first so the height can redistribute after } // distribute the height to the rows // (totalHeight is a "recommended" value if isAuto) scrollerHeight = this.computeScrollerHeight(totalHeight); this.setGridHeight(scrollerHeight, isAuto); // is the event limit dynamically calculated? if (eventLimit && typeof eventLimit !== 'number') { this.dayGrid.limitRows(eventLimit); // limit the levels after the grid's row heights have been set } if (!isAuto) { // should we force dimensions of the scroll container? this.scroller.setHeight(scrollerHeight); scrollbarWidths = this.scroller.getScrollbarWidths(); if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars? compensateScroll(this.headRowEl, scrollbarWidths); // doing the scrollbar compensation might have created text overflow which created more height. redo scrollerHeight = this.computeScrollerHeight(totalHeight); this.scroller.setHeight(scrollerHeight); } // guarantees the same scrollbar widths this.scroller.lockOverflow(scrollbarWidths); } }, // given a desired total height of the view, returns what the height of the scroller should be computeScrollerHeight: function(totalHeight) { return totalHeight - subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller }, // Sets the height of just the DayGrid component in this view setGridHeight: function(height, isAuto) { if (isAuto) { undistributeHeight(this.dayGrid.rowEls); // let the rows be their natural height with no expanding } else { distributeHeight(this.dayGrid.rowEls, height, true); // true = compensate for height-hogging rows } }, /* Scroll ------------------------------------------------------------------------------------------------------------------*/ computeInitialScroll: function() { return { top: 0 }; }, queryScroll: function() { return { top: this.scroller.getScrollTop() }; }, setScroll: function(scroll) { this.scroller.setScrollTop(scroll.top); }, /* Hit Areas ------------------------------------------------------------------------------------------------------------------*/ // forward all hit-related method calls to dayGrid prepareHits: function() { this.dayGrid.prepareHits(); }, releaseHits: function() { this.dayGrid.releaseHits(); }, queryHit: function(left, top) { return this.dayGrid.queryHit(left, top); }, getHitSpan: function(hit) { return this.dayGrid.getHitSpan(hit); }, getHitEl: function(hit) { return this.dayGrid.getHitEl(hit); }, /* Events ------------------------------------------------------------------------------------------------------------------*/ // Renders the given events onto the view and populates the segments array renderEvents: function(events) { this.dayGrid.renderEvents(events); this.updateHeight(); // must compensate for events that overflow the row }, // Retrieves all segment objects that are rendered in the view getEventSegs: function() { return this.dayGrid.getEventSegs(); }, // Unrenders all event elements and clears internal segment data unrenderEvents: function() { this.dayGrid.unrenderEvents(); // we DON'T need to call updateHeight() because // a renderEvents() call always happens after this, which will eventually call updateHeight() }, /* Dragging (for both events and external elements) ------------------------------------------------------------------------------------------------------------------*/ // A returned value of `true` signals that a mock "helper" event has been rendered. renderDrag: function(dropLocation, seg) { return this.dayGrid.renderDrag(dropLocation, seg); }, unrenderDrag: function() { this.dayGrid.unrenderDrag(); }, /* Selection ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of a selection renderSelection: function(span) { this.dayGrid.renderSelection(span); }, // Unrenders a visual indications of a selection unrenderSelection: function() { this.dayGrid.unrenderSelection(); } }); // Methods that will customize the rendering behavior of the BasicView's dayGrid var basicDayGridMethods = { // Generates the HTML that will go before the day-of week header cells renderHeadIntroHtml: function() { var view = this.view; if (view.colWeekNumbersVisible) { return '' + '<th class="fc-week-number ' + view.widgetHeaderClass + '" ' + view.weekNumberStyleAttr() + '>' + '<span>' + // needed for matchCellWidths htmlEscape(view.opt('weekNumberTitle')) + '</span>' + '</th>'; } return ''; }, // Generates the HTML that will go before content-skeleton cells that display the day/week numbers renderNumberIntroHtml: function(row) { var view = this.view; var weekStart = this.getCellDate(row, 0); if (view.colWeekNumbersVisible) { return '' + '<td class="fc-week-number" ' + view.weekNumberStyleAttr() + '>' + view.buildGotoAnchorHtml( // aside from link, important for matchCellWidths { date: weekStart, type: 'week', forceOff: this.colCnt === 1 }, weekStart.format('w') // inner HTML ) + '</td>'; } return ''; }, // Generates the HTML that goes before the day bg cells for each day-row renderBgIntroHtml: function() { var view = this.view; if (view.colWeekNumbersVisible) { return '<td class="fc-week-number ' + view.widgetContentClass + '" ' + view.weekNumberStyleAttr() + '></td>'; } return ''; }, // Generates the HTML that goes before every other type of row generated by DayGrid. // Affects helper-skeleton and highlight-skeleton rows. renderIntroHtml: function() { var view = this.view; if (view.colWeekNumbersVisible) { return '<td class="fc-week-number" ' + view.weekNumberStyleAttr() + '></td>'; } return ''; } }; ;; /* A month view with day cells running in rows (one-per-week) and columns ----------------------------------------------------------------------------------------------------------------------*/ var MonthView = FC.MonthView = BasicView.extend({ // Produces information about what range to display computeRange: function(date) { var range = BasicView.prototype.computeRange.call(this, date); // get value from super-method var rowCnt; // ensure 6 weeks if (this.isFixedWeeks()) { rowCnt = Math.ceil(range.end.diff(range.start, 'weeks', true)); // could be partial weeks due to hiddenDays range.end.add(6 - rowCnt, 'weeks'); } return range; }, // Overrides the default BasicView behavior to have special multi-week auto-height logic setGridHeight: function(height, isAuto) { // if auto, make the height of each row the height that it would be if there were 6 weeks if (isAuto) { height *= this.rowCnt / 6; } distributeHeight(this.dayGrid.rowEls, height, !isAuto); // if auto, don't compensate for height-hogging rows }, isFixedWeeks: function() { return this.opt('fixedWeekCount'); } }); ;; fcViews.basic = { 'class': BasicView }; fcViews.basicDay = { type: 'basic', duration: { days: 1 } }; fcViews.basicWeek = { type: 'basic', duration: { weeks: 1 } }; fcViews.month = { 'class': MonthView, duration: { months: 1 }, // important for prev/next defaults: { fixedWeekCount: true } }; ;; /* An abstract class for all agenda-related views. Displays one more columns with time slots running vertically. ----------------------------------------------------------------------------------------------------------------------*/ // Is a manager for the TimeGrid subcomponent and possibly the DayGrid subcomponent (if allDaySlot is on). // Responsible for managing width/height. var AgendaView = FC.AgendaView = View.extend({ scroller: null, timeGridClass: TimeGrid, // class used to instantiate the timeGrid. subclasses can override timeGrid: null, // the main time-grid subcomponent of this view dayGridClass: DayGrid, // class used to instantiate the dayGrid. subclasses can override dayGrid: null, // the "all-day" subcomponent. if all-day is turned off, this will be null axisWidth: null, // the width of the time axis running down the side headContainerEl: null, // div that hold's the timeGrid's rendered date header noScrollRowEls: null, // set of fake row elements that must compensate when scroller has scrollbars // when the time-grid isn't tall enough to occupy the given height, we render an <hr> underneath bottomRuleEl: null, initialize: function() { this.timeGrid = this.instantiateTimeGrid(); if (this.opt('allDaySlot')) { // should we display the "all-day" area? this.dayGrid = this.instantiateDayGrid(); // the all-day subcomponent of this view } this.scroller = new Scroller({ overflowX: 'hidden', overflowY: 'auto' }); }, // Instantiates the TimeGrid object this view needs. Draws from this.timeGridClass instantiateTimeGrid: function() { var subclass = this.timeGridClass.extend(agendaTimeGridMethods); return new subclass(this); }, // Instantiates the DayGrid object this view might need. Draws from this.dayGridClass instantiateDayGrid: function() { var subclass = this.dayGridClass.extend(agendaDayGridMethods); return new subclass(this); }, /* Rendering ------------------------------------------------------------------------------------------------------------------*/ // Sets the display range and computes all necessary dates setRange: function(range) { View.prototype.setRange.call(this, range); // call the super-method this.timeGrid.setRange(range); if (this.dayGrid) { this.dayGrid.setRange(range); } }, // Renders the view into `this.el`, which has already been assigned renderDates: function() { this.el.addClass('fc-agenda-view').html(this.renderSkeletonHtml()); this.renderHead(); this.scroller.render(); var timeGridWrapEl = this.scroller.el.addClass('fc-time-grid-container'); var timeGridEl = $('<div class="fc-time-grid" />').appendTo(timeGridWrapEl); this.el.find('.fc-body > tr > td').append(timeGridWrapEl); this.timeGrid.setElement(timeGridEl); this.timeGrid.renderDates(); // the <hr> that sometimes displays under the time-grid this.bottomRuleEl = $('<hr class="fc-divider ' + this.widgetHeaderClass + '"/>') .appendTo(this.timeGrid.el); // inject it into the time-grid if (this.dayGrid) { this.dayGrid.setElement(this.el.find('.fc-day-grid')); this.dayGrid.renderDates(); // have the day-grid extend it's coordinate area over the <hr> dividing the two grids this.dayGrid.bottomCoordPadding = this.dayGrid.el.next('hr').outerHeight(); } this.noScrollRowEls = this.el.find('.fc-row:not(.fc-scroller *)'); // fake rows not within the scroller }, // render the day-of-week headers renderHead: function() { this.headContainerEl = this.el.find('.fc-head-container') .html(this.timeGrid.renderHeadHtml()); }, // Unrenders the content of the view. Since we haven't separated skeleton rendering from date rendering, // always completely kill each grid's rendering. unrenderDates: function() { this.timeGrid.unrenderDates(); this.timeGrid.removeElement(); if (this.dayGrid) { this.dayGrid.unrenderDates(); this.dayGrid.removeElement(); } this.scroller.destroy(); }, // Builds the HTML skeleton for the view. // The day-grid and time-grid components will render inside containers defined by this HTML. renderSkeletonHtml: function() { return '' + '<table>' + '<thead class="fc-head">' + '<tr>' + '<td class="fc-head-container ' + this.widgetHeaderClass + '"></td>' + '</tr>' + '</thead>' + '<tbody class="fc-body">' + '<tr>' + '<td class="' + this.widgetContentClass + '">' + (this.dayGrid ? '<div class="fc-day-grid"/>' + '<hr class="fc-divider ' + this.widgetHeaderClass + '"/>' : '' ) + '</td>' + '</tr>' + '</tbody>' + '</table>'; }, // Generates an HTML attribute string for setting the width of the axis, if it is known axisStyleAttr: function() { if (this.axisWidth !== null) { return 'style="width:' + this.axisWidth + 'px"'; } return ''; }, /* Business Hours ------------------------------------------------------------------------------------------------------------------*/ renderBusinessHours: function() { this.timeGrid.renderBusinessHours(); if (this.dayGrid) { this.dayGrid.renderBusinessHours(); } }, unrenderBusinessHours: function() { this.timeGrid.unrenderBusinessHours(); if (this.dayGrid) { this.dayGrid.unrenderBusinessHours(); } }, /* Now Indicator ------------------------------------------------------------------------------------------------------------------*/ getNowIndicatorUnit: function() { return this.timeGrid.getNowIndicatorUnit(); }, renderNowIndicator: function(date) { this.timeGrid.renderNowIndicator(date); }, unrenderNowIndicator: function() { this.timeGrid.unrenderNowIndicator(); }, /* Dimensions ------------------------------------------------------------------------------------------------------------------*/ updateSize: function(isResize) { this.timeGrid.updateSize(isResize); View.prototype.updateSize.call(this, isResize); // call the super-method }, // Refreshes the horizontal dimensions of the view updateWidth: function() { // make all axis cells line up, and record the width so newly created axis cells will have it this.axisWidth = matchCellWidths(this.el.find('.fc-axis')); }, // Adjusts the vertical dimensions of the view to the specified values setHeight: function(totalHeight, isAuto) { var eventLimit; var scrollerHeight; var scrollbarWidths; // reset all dimensions back to the original state this.bottomRuleEl.hide(); // .show() will be called later if this <hr> is necessary this.scroller.clear(); // sets height to 'auto' and clears overflow uncompensateScroll(this.noScrollRowEls); // limit number of events in the all-day area if (this.dayGrid) { this.dayGrid.removeSegPopover(); // kill the "more" popover if displayed eventLimit = this.opt('eventLimit'); if (eventLimit && typeof eventLimit !== 'number') { eventLimit = AGENDA_ALL_DAY_EVENT_LIMIT; // make sure "auto" goes to a real number } if (eventLimit) { this.dayGrid.limitRows(eventLimit); } } if (!isAuto) { // should we force dimensions of the scroll container? scrollerHeight = this.computeScrollerHeight(totalHeight); this.scroller.setHeight(scrollerHeight); scrollbarWidths = this.scroller.getScrollbarWidths(); if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars? // make the all-day and header rows lines up compensateScroll(this.noScrollRowEls, scrollbarWidths); // the scrollbar compensation might have changed text flow, which might affect height, so recalculate // and reapply the desired height to the scroller. scrollerHeight = this.computeScrollerHeight(totalHeight); this.scroller.setHeight(scrollerHeight); } // guarantees the same scrollbar widths this.scroller.lockOverflow(scrollbarWidths); // if there's any space below the slats, show the horizontal rule. // this won't cause any new overflow, because lockOverflow already called. if (this.timeGrid.getTotalSlatHeight() < scrollerHeight) { this.bottomRuleEl.show(); } } }, // given a desired total height of the view, returns what the height of the scroller should be computeScrollerHeight: function(totalHeight) { return totalHeight - subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller }, /* Scroll ------------------------------------------------------------------------------------------------------------------*/ // Computes the initial pre-configured scroll state prior to allowing the user to change it computeInitialScroll: function() { var scrollTime = moment.duration(this.opt('scrollTime')); var top = this.timeGrid.computeTimeTop(scrollTime); // zoom can give weird floating-point values. rather scroll a little bit further top = Math.ceil(top); if (top) { top++; // to overcome top border that slots beyond the first have. looks better } return { top: top }; }, queryScroll: function() { return { top: this.scroller.getScrollTop() }; }, setScroll: function(scroll) { this.scroller.setScrollTop(scroll.top); }, /* Hit Areas ------------------------------------------------------------------------------------------------------------------*/ // forward all hit-related method calls to the grids (dayGrid might not be defined) prepareHits: function() { this.timeGrid.prepareHits(); if (this.dayGrid) { this.dayGrid.prepareHits(); } }, releaseHits: function() { this.timeGrid.releaseHits(); if (this.dayGrid) { this.dayGrid.releaseHits(); } }, queryHit: function(left, top) { var hit = this.timeGrid.queryHit(left, top); if (!hit && this.dayGrid) { hit = this.dayGrid.queryHit(left, top); } return hit; }, getHitSpan: function(hit) { // TODO: hit.component is set as a hack to identify where the hit came from return hit.component.getHitSpan(hit); }, getHitEl: function(hit) { // TODO: hit.component is set as a hack to identify where the hit came from return hit.component.getHitEl(hit); }, /* Events ------------------------------------------------------------------------------------------------------------------*/ // Renders events onto the view and populates the View's segment array renderEvents: function(events) { var dayEvents = []; var timedEvents = []; var daySegs = []; var timedSegs; var i; // separate the events into all-day and timed for (i = 0; i < events.length; i++) { if (events[i].allDay) { dayEvents.push(events[i]); } else { timedEvents.push(events[i]); } } // render the events in the subcomponents timedSegs = this.timeGrid.renderEvents(timedEvents); if (this.dayGrid) { daySegs = this.dayGrid.renderEvents(dayEvents); } // the all-day area is flexible and might have a lot of events, so shift the height this.updateHeight(); }, // Retrieves all segment objects that are rendered in the view getEventSegs: function() { return this.timeGrid.getEventSegs().concat( this.dayGrid ? this.dayGrid.getEventSegs() : [] ); }, // Unrenders all event elements and clears internal segment data unrenderEvents: function() { // unrender the events in the subcomponents this.timeGrid.unrenderEvents(); if (this.dayGrid) { this.dayGrid.unrenderEvents(); } // we DON'T need to call updateHeight() because // a renderEvents() call always happens after this, which will eventually call updateHeight() }, /* Dragging (for events and external elements) ------------------------------------------------------------------------------------------------------------------*/ // A returned value of `true` signals that a mock "helper" event has been rendered. renderDrag: function(dropLocation, seg) { if (dropLocation.start.hasTime()) { return this.timeGrid.renderDrag(dropLocation, seg); } else if (this.dayGrid) { return this.dayGrid.renderDrag(dropLocation, seg); } }, unrenderDrag: function() { this.timeGrid.unrenderDrag(); if (this.dayGrid) { this.dayGrid.unrenderDrag(); } }, /* Selection ------------------------------------------------------------------------------------------------------------------*/ // Renders a visual indication of a selection renderSelection: function(span) { if (span.start.hasTime() || span.end.hasTime()) { this.timeGrid.renderSelection(span); } else if (this.dayGrid) { this.dayGrid.renderSelection(span); } }, // Unrenders a visual indications of a selection unrenderSelection: function() { this.timeGrid.unrenderSelection(); if (this.dayGrid) { this.dayGrid.unrenderSelection(); } } }); // Methods that will customize the rendering behavior of the AgendaView's timeGrid // TODO: move into TimeGrid var agendaTimeGridMethods = { // Generates the HTML that will go before the day-of week header cells renderHeadIntroHtml: function() { var view = this.view; var weekText; if (view.opt('weekNumbers')) { weekText = this.start.format(view.opt('smallWeekFormat')); return '' + '<th class="fc-axis fc-week-number ' + view.widgetHeaderClass + '" ' + view.axisStyleAttr() + '>' + view.buildGotoAnchorHtml( // aside from link, important for matchCellWidths { date: this.start, type: 'week', forceOff: this.colCnt > 1 }, htmlEscape(weekText) // inner HTML ) + '</th>'; } else { return '<th class="fc-axis ' + view.widgetHeaderClass + '" ' + view.axisStyleAttr() + '></th>'; } }, // Generates the HTML that goes before the bg of the TimeGrid slot area. Long vertical column. renderBgIntroHtml: function() { var view = this.view; return '<td class="fc-axis ' + view.widgetContentClass + '" ' + view.axisStyleAttr() + '></td>'; }, // Generates the HTML that goes before all other types of cells. // Affects content-skeleton, helper-skeleton, highlight-skeleton for both the time-grid and day-grid. renderIntroHtml: function() { var view = this.view; return '<td class="fc-axis" ' + view.axisStyleAttr() + '></td>'; } }; // Methods that will customize the rendering behavior of the AgendaView's dayGrid var agendaDayGridMethods = { // Generates the HTML that goes before the all-day cells renderBgIntroHtml: function() { var view = this.view; return '' + '<td class="fc-axis ' + view.widgetContentClass + '" ' + view.axisStyleAttr() + '>' + '<span>' + // needed for matchCellWidths view.getAllDayHtml() + '</span>' + '</td>'; }, // Generates the HTML that goes before all other types of cells. // Affects content-skeleton, helper-skeleton, highlight-skeleton for both the time-grid and day-grid. renderIntroHtml: function() { var view = this.view; return '<td class="fc-axis" ' + view.axisStyleAttr() + '></td>'; } }; ;; var AGENDA_ALL_DAY_EVENT_LIMIT = 5; // potential nice values for the slot-duration and interval-duration // from largest to smallest var AGENDA_STOCK_SUB_DURATIONS = [ { hours: 1 }, { minutes: 30 }, { minutes: 15 }, { seconds: 30 }, { seconds: 15 } ]; fcViews.agenda = { 'class': AgendaView, defaults: { allDaySlot: true, slotDuration: '00:30:00', minTime: '00:00:00', maxTime: '24:00:00', slotEventOverlap: true // a bad name. confused with overlap/constraint system } }; fcViews.agendaDay = { type: 'agenda', duration: { days: 1 } }; fcViews.agendaWeek = { type: 'agenda', duration: { weeks: 1 } }; ;; /* Responsible for the scroller, and forwarding event-related actions into the "grid" */ var ListView = View.extend({ grid: null, scroller: null, initialize: function() { this.grid = new ListViewGrid(this); this.scroller = new Scroller({ overflowX: 'hidden', overflowY: 'auto' }); }, setRange: function(range) { View.prototype.setRange.call(this, range); // super this.grid.setRange(range); // needs to process range-related options }, renderSkeleton: function() { this.el.addClass( 'fc-list-view ' + this.widgetContentClass ); this.scroller.render(); this.scroller.el.appendTo(this.el); this.grid.setElement(this.scroller.scrollEl); }, unrenderSkeleton: function() { this.scroller.destroy(); // will remove the Grid too }, setHeight: function(totalHeight, isAuto) { this.scroller.setHeight(this.computeScrollerHeight(totalHeight)); }, computeScrollerHeight: function(totalHeight) { return totalHeight - subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller }, renderEvents: function(events) { this.grid.renderEvents(events); }, unrenderEvents: function() { this.grid.unrenderEvents(); }, isEventResizable: function(event) { return false; }, isEventDraggable: function(event) { return false; } }); /* Responsible for event rendering and user-interaction. Its "el" is the inner-content of the above view's scroller. */ var ListViewGrid = Grid.extend({ segSelector: '.fc-list-item', // which elements accept event actions hasDayInteractions: false, // no day selection or day clicking // slices by day spanToSegs: function(span) { var view = this.view; var dayStart = view.start.clone().time(0); // timed, so segs get times! var dayIndex = 0; var seg; var segs = []; while (dayStart < view.end) { seg = intersectRanges(span, { start: dayStart, end: dayStart.clone().add(1, 'day') }); if (seg) { seg.dayIndex = dayIndex; segs.push(seg); } dayStart.add(1, 'day'); dayIndex++; // detect when span won't go fully into the next day, // and mutate the latest seg to the be the end. if ( seg && !seg.isEnd && span.end.hasTime() && span.end < dayStart.clone().add(this.view.nextDayThreshold) ) { seg.end = span.end.clone(); seg.isEnd = true; break; } } return segs; }, // like "4:00am" computeEventTimeFormat: function() { return this.view.opt('mediumTimeFormat'); }, // for events with a url, the whole <tr> should be clickable, // but it's impossible to wrap with an <a> tag. simulate this. handleSegClick: function(seg, ev) { var url; Grid.prototype.handleSegClick.apply(this, arguments); // super. might prevent the default action // not clicking on or within an <a> with an href if (!$(ev.target).closest('a[href]').length) { url = seg.event.url; if (url && !ev.isDefaultPrevented()) { // jsEvent not cancelled in handler window.location.href = url; // simulate link click } } }, // returns list of foreground segs that were actually rendered renderFgSegs: function(segs) { segs = this.renderFgSegEls(segs); // might filter away hidden events if (!segs.length) { this.renderEmptyMessage(); } else { this.renderSegList(segs); } return segs; }, renderEmptyMessage: function() { this.el.html( '<div class="fc-list-empty-wrap2">' + // TODO: try less wraps '<div class="fc-list-empty-wrap1">' + '<div class="fc-list-empty">' + htmlEscape(this.view.opt('noEventsMessage')) + '</div>' + '</div>' + '</div>' ); }, // render the event segments in the view renderSegList: function(allSegs) { var segsByDay = this.groupSegsByDay(allSegs); // sparse array var dayIndex; var daySegs; var i; var tableEl = $('<table class="fc-list-table"><tbody/></table>'); var tbodyEl = tableEl.find('tbody'); for (dayIndex = 0; dayIndex < segsByDay.length; dayIndex++) { daySegs = segsByDay[dayIndex]; if (daySegs) { // sparse array, so might be undefined // append a day header tbodyEl.append(this.dayHeaderHtml( this.view.start.clone().add(dayIndex, 'days') )); this.sortEventSegs(daySegs); for (i = 0; i < daySegs.length; i++) { tbodyEl.append(daySegs[i].el); // append event row } } } this.el.empty().append(tableEl); }, // Returns a sparse array of arrays, segs grouped by their dayIndex groupSegsByDay: function(segs) { var segsByDay = []; // sparse array var i, seg; for (i = 0; i < segs.length; i++) { seg = segs[i]; (segsByDay[seg.dayIndex] || (segsByDay[seg.dayIndex] = [])) .push(seg); } return segsByDay; }, // generates the HTML for the day headers that live amongst the event rows dayHeaderHtml: function(dayDate) { var view = this.view; var mainFormat = view.opt('listDayFormat'); var altFormat = view.opt('listDayAltFormat'); return '<tr class="fc-list-heading" data-date="' + dayDate.format('YYYY-MM-DD') + '">' + '<td class="' + view.widgetHeaderClass + '" colspan="4">' + (mainFormat ? view.buildGotoAnchorHtml( dayDate, { 'class': 'fc-list-heading-main' }, htmlEscape(dayDate.format(mainFormat)) // inner HTML ) : '') + (altFormat ? view.buildGotoAnchorHtml( dayDate, { 'class': 'fc-list-heading-alt' }, htmlEscape(dayDate.format(altFormat)) // inner HTML ) : '') + '</td>' + '</tr>'; }, // generates the HTML for a single event row fgSegHtml: function(seg) { var view = this.view; var classes = [ 'fc-list-item' ].concat(this.getSegCustomClasses(seg)); var bgColor = this.getSegBackgroundColor(seg); var event = seg.event; var url = event.url; var timeHtml; if (event.allDay) { timeHtml = view.getAllDayHtml(); } else if (view.isMultiDayEvent(event)) { // if the event appears to span more than one day if (seg.isStart || seg.isEnd) { // outer segment that probably lasts part of the day timeHtml = htmlEscape(this.getEventTimeText(seg)); } else { // inner segment that lasts the whole day timeHtml = view.getAllDayHtml(); } } else { // Display the normal time text for the *event's* times timeHtml = htmlEscape(this.getEventTimeText(event)); } if (url) { classes.push('fc-has-url'); } return '<tr class="' + classes.join(' ') + '">' + (this.displayEventTime ? '<td class="fc-list-item-time ' + view.widgetContentClass + '">' + (timeHtml || '') + '</td>' : '') + '<td class="fc-list-item-marker ' + view.widgetContentClass + '">' + '<span class="fc-event-dot"' + (bgColor ? ' style="background-color:' + bgColor + '"' : '') + '></span>' + '</td>' + '<td class="fc-list-item-title ' + view.widgetContentClass + '">' + '<a' + (url ? ' href="' + htmlEscape(url) + '"' : '') + '>' + htmlEscape(seg.event.title || '') + '</a>' + '</td>' + '</tr>'; } }); ;; fcViews.list = { 'class': ListView, buttonTextKey: 'list', // what to lookup in locale files defaults: { buttonText: 'list', // text to display for English listDayFormat: 'LL', // like "January 1, 2016" noEventsMessage: 'No events to display' } }; fcViews.listDay = { type: 'list', duration: { days: 1 }, defaults: { listDayFormat: 'dddd' // day-of-week is all we need. full date is probably in header } }; fcViews.listWeek = { type: 'list', duration: { weeks: 1 }, defaults: { listDayFormat: 'dddd', // day-of-week is more important listDayAltFormat: 'LL' } }; fcViews.listMonth = { type: 'list', duration: { month: 1 }, defaults: { listDayAltFormat: 'dddd' // day-of-week is nice-to-have } }; fcViews.listYear = { type: 'list', duration: { year: 1 }, defaults: { listDayAltFormat: 'dddd' // day-of-week is nice-to-have } }; return FC; // export for Node/CommonJS }); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20030331 |
| Request Header - size: 509 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:05 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 273199 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 273,199 bytes. |
/*!
* jQuery JavaScript Library v1.10.2 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03T13:48Z */ (function( window, undefined ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; var // The deferred used on DOM ready readyList, // A central reference to the root jQuery(document) rootjQuery, // Support: IE<10 // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined` core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) location = window.location, document = window.document, docElem = document.documentElement, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // [[Class]] -> type pairs class2type = {}, // List of deleted data cache ids, so we can reuse them core_deletedIds = [], core_version = "1.10.2", // Save a reference to some core methods core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Used for matching numbers core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, // Used for splitting on whitespace core_rnotwhite = /\S+/g, // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }, // The ready event handler completed = function( event ) { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } }, // Clean-up method for dom ready events detach = function() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: core_version, constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return core_slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }, slice: function() { return this.pushStack( core_slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: core_push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger("ready").off("ready"); } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { if ( obj == null ) { return String( obj ); } return typeof obj === "object" || typeof obj === "function" ? class2type[ core_toString.call(obj) ] || "object" : typeof obj; }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if ( jQuery.support.ownLast ) { for ( key in obj ) { return core_hasOwn.call( obj, key ); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string parseHTML: function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }, parseJSON: function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } if ( data === null ) { return data; } if ( typeof data === "string" ) { // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); if ( data ) { // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } } } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Use native String.trim function wherever possible trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { core_push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( core_indexOf ) { return core_indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var l = second.length, i = first.length, j = 0; if ( typeof l === "number" ) { for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var retVal, ret = [], i = 0, length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return core_concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = core_slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); }, // A method for quickly swapping in/out CSS properties to get correct calculations. // Note: this method belongs to the css module but it's needed here for the support module. // If support gets modularized, this method should be moved back to the css module. swap: function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || type !== "function" && ( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj ); } // All jQuery objects should point back to these rootjQuery = jQuery(document); /*! * Sizzle CSS Selector Engine v1.10.2 * http://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03 */ (function( window, undefined ) { var i, support, cachedruns, Expr, getText, isXML, compile, outermostContext, sortInput, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), hasDuplicate = false, sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; return 0; } return 0; }, // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Prefer arguments quoted, // then not containing pseudos/brackets, // then attribute selectors/non-parenthetical expressions, // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rsibling = new RegExp( whitespace + "*[+~]" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : // BMP codepoint high < 0 ? String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( documentIsHTML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // QSA path if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { nid = old = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && context.parentNode || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key += " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = attrs.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Detect xml * @param {Element|Object} elem An element or a document */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; // Expose support vars for convenience support = Sizzle.support = {}; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.defaultView; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsHTML = !isXML( doc ); // Support: IE>8 // If iframe document is assigned to "document" variable and if iframe has been reloaded, // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 // IE6-8 do not support the defaultView property so parent will be undefined if ( parent && parent.attachEvent && parent !== parent.top ) { parent.attachEvent( "onbeforeunload", function() { setDocument(); }); } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) support.attributes = assert(function( div ) { div.className = "i"; return !div.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if getElementsByClassName can be trusted support.getElementsByClassName = assert(function( div ) { div.innerHTML = "<div class='a'></div><div class='a i'></div>"; // Support: Safari<4 // Catch class over-caching div.firstChild.className = "i"; // Support: Opera<10 // Catch gEBCN failure to find non-leading classes return div.getElementsByClassName("i").length === 2; }); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !doc.getElementsByName || !doc.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && documentIsHTML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select><option selected=''></option></select>"; // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Support: Opera 10-12/IE8 // ^= $= *= and empty values // Should not select anything // Support: Windows 8 Native Apps // The type attribute is restricted during .innerHTML assignment var input = doc.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "t", "" ); if ( div.querySelectorAll("[t^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = docElem.compareDocumentPosition ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); if ( compare ) { // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === doc || contains(preferredDoc, a) ) { return -1; } if ( b === doc || contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } // Not directly comparable, sort on existence of method return a.compareDocumentPosition ? -1 : 1; } : function( a, b ) { var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; // Parentless nodes are either documents or disconnected } else if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return doc; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [elem] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val === undefined ? support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null : val; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array for ( ; (node = elem[i]); i++ ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[5] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] && match[4] !== undefined ) { match[2] = match[4]; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( tokens = [] ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); } function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var data, cache, outerCache, dirkey = dirruns + " " + doneName; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { if ( (data = cache[1]) === true || data === cachedruns ) { return data === true; } } else { cache = outerCache[ dir ] = [ dirkey ]; cache[1] = matcher( elem, context, xml ) || cachedruns; if ( cache[1] === true ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // A counter to specify which element is currently being matched var matcherCachedRuns = 0, bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, expandContext ) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, // We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); if ( outermost ) { outermostContext = context !== document && context; cachedruns = matcherCachedRuns; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below for ( ; (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; cachedruns = ++matcherCachedRuns; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !group ) { group = tokenize( selector ); } i = group.length; while ( i-- ) { cached = matcherFromTokens( group[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); } return cached; }; function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function select( selector, context, results, seed ) { var i, tokens, token, type, find, match = tokenize( selector ); if ( !seed ) { // Try to minimize operations if there is only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && context.parentNode || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } } // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile( selector, match )( seed, context, !documentIsHTML, results, rsibling.test( selector ) ); return results; } // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Support: Chrome<14 // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( document.createElement("div") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert(function( div ) { div.innerHTML = "<input/>"; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert(function( div ) { return div.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return (val = elem.getAttributeNode( name )) && val.specified ? val.value : elem[ name ] === true ? name.toLowerCase() : null; } }); } jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })( window ); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; firingLength = 0; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( list && ( !fired || stack ) ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var action = tuple[ 0 ], fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = core_slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; if( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); jQuery.support = (function( support ) { var all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); // Setup div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // Finish early in limited (non-browser) environments all = div.getElementsByTagName("*") || []; a = div.getElementsByTagName("a")[ 0 ]; if ( !a || !a.style || !all.length ) { return support; } // First batch of tests select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px;float:left;opacity:.5"; // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) support.getSetAttribute = div.className !== "t"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName("tbody").length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !!div.getElementsByTagName("link").length; // Get the style information from getAttribute // (IE uses .cssText instead) support.style = /top/.test( a.getAttribute("style") ); // Make sure that URLs aren't manipulated // (IE normalizes it by default) support.hrefNormalized = a.getAttribute("href") === "/a"; // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 support.opacity = /^0.5/.test( a.style.opacity ); // Verify style float existence // (IE uses styleFloat instead of cssFloat) support.cssFloat = !!a.style.cssFloat; // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) support.checkOn = !!input.value; // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) support.optSelected = opt.selected; // Tests for enctype support on a form (#6743) support.enctype = !!document.createElement("form").enctype; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>"; // Will be defined later support.inlineBlockNeedsLayout = false; support.shrinkWrapBlocks = false; support.pixelPosition = false; support.deleteExpando = true; support.noCloneEvent = true; support.reliableMarginRight = true; support.boxSizingReliable = true; // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE<9 try { delete div.test; } catch( e ) { support.deleteExpando = false; } // Check if we can trust getAttribute("value") input = document.createElement("input"); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "checked", "t" ); input.setAttribute( "name", "t" ); fragment = document.createDocumentFragment(); fragment.appendChild( input ); // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) for ( i in { submit: true, change: true, focusin: true }) { div.setAttribute( eventName = "on" + i, "t" ); support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; } div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Support: IE<9 // Iteration over object's inherited properties before its own. for ( i in jQuery( support ) ) { break; } support.ownLast = i !== "0"; // Run tests that need a body at doc ready jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } container = document.createElement("div"); container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; body.appendChild( container ).appendChild( div ); // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; tds = div.getElementsByTagName("td"); tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Support: IE8 // Check if empty table cells still have offsetWidth/Height support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check box-sizing and margin behavior. div.innerHTML = ""; div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; // Workaround failing boxSizing test due to offsetWidth returning wrong value // with some non-1 values of body zoom, ticket #13543 jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { support.boxSizing = div.offsetWidth === 4; }); // Use window.getComputedStyle because jsdom on node.js will break without it. if ( window.getComputedStyle ) { support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right marginDiv = div.appendChild( document.createElement("div") ); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; support.reliableMarginRight = !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== core_strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Support: IE6 // Check if elements with layout shrink-wrap their children div.style.display = "block"; div.innerHTML = "<div></div>"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); if ( support.inlineBlockNeedsLayout ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); // Null elements to avoid leaks in IE container = div = tds = marginDiv = null; }); // Null elements to avoid leaks in IE all = select = fragment = opt = a = input = null; return support; })({}); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData( elem, name, data, pvt /* Internal Use Only */ ){ if ( !jQuery.acceptData( elem ) ) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( typeof name === "string" ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } i = name.length; while ( i-- ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if ( jQuery.support.deleteExpando || cache != cache.window ) { /* jshint eqeqeq: true */ delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "applet": true, "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { // Do not set data on non-element because it will not be cleared (#8335). if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { return false; } var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; // nodes accept data unless otherwise specified; rejection can be conditional return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); jQuery.fn.extend({ data: function( key, value ) { var attrs, name, data = null, i = 0, elem = this[0]; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attrs = elem.attributes; for ( ; i < attrs.length; i++ ) { name = attrs[i].name; if ( name.indexOf("data-") === 0 ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return arguments.length > 1 ? // Sets one value this.each(function() { jQuery.data( this, key, value ); }) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var nodeHook, boolHook, rclass = /[\t\r\n\f]/g, rreturn = /\r/g, rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, getSetInput = jQuery.support.input; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } elem.className = jQuery.trim( cur ); } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } elem.className = value ? jQuery.trim( cur ) : ""; } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value; if ( typeof stateVal === "boolean" && type === "string" ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), classNames = value.match( core_rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( type === core_strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; }, val: function( value ) { var ret, hooks, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map(val, function ( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { // Use proper attribute retrieval(#6932, #12072) var val = jQuery.find.attr( elem, "value" ); return val != null ? val : elem.text; } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) { optionSet = true; } } // force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return values; } } }, attr: function( elem, name, value ) { var hooks, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === core_strundefined ) { return jQuery.prop( elem, name, value ); } // All attributes are lowercase // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( core_rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( jQuery.expr.match.bool.test( name ) ) { // Set corresponding property to false if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { elem[ propName ] = false; // Support: IE<9 // Also clear defaultChecked/defaultSelected (if appropriate) } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, propFix: { "for": "htmlFor", "class": "className" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? ret : ( elem[ name ] = value ); } else { return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? ret : elem[ name ]; } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); return tabindex ? parseInt( tabindex, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1; } } } }); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr; jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? function( elem, name, isXML ) { var fn = jQuery.expr.attrHandle[ name ], ret = isXML ? undefined : /* jshint eqeqeq: false */ (jQuery.expr.attrHandle[ name ] = undefined) != getter( elem, name, isXML ) ? name.toLowerCase() : null; jQuery.expr.attrHandle[ name ] = fn; return ret; } : function( elem, name, isXML ) { return isXML ? undefined : elem[ jQuery.camelCase( "default-" + name ) ] ? name.toLowerCase() : null; }; }); // fix oldIE attroperties if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = { set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) return name === "value" || value === elem.getAttribute( name ) ? value : undefined; } }; jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = // Some attributes are constructed with empty-string values when not defined function( elem, name, isXML ) { var ret; return isXML ? undefined : (ret = elem.getAttributeNode( name )) && ret.value !== "" ? ret.value : null; }; jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return ret && ret.specified ? ret.value : undefined; }, set: nodeHook.set }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }; }); } // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }; } jQuery.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; }); // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }; if ( !jQuery.support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { // Support: Webkit // "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; }; } }); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = core_hasOwn.call( event, "type" ) ? event.type : event, namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Even when returnValue equals to undefined Firefox will still show alert if ( event.result !== undefined ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === core_strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); var isSimple = /^.[^:#\[\.,]*$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var i, ret = [], self = this, len = self.length; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector || [], true) ); }, filter: function( selector ) { return this.pushStack( winnow(this, selector || [], false) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)) ) { cur = ret.push( cur ); break; } } } return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( jQuery.unique(all) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { ret = jQuery.unique( ret ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } return this.pushStack( ret ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; })); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; }); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; }); } if ( typeof qualifier === "string" ) { if ( isSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, manipulation_rcheckableType = /^(?:checkbox|radio)$/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], area: [ 1, "<map>", "</map>" ], param: [ 1, "<object>", "</object>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } }); }, prepend: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } }); }, before: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { var elem, elems = selector ? jQuery.filter( selector, this ) : this, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var // Snapshot the DOM in case .domManip sweeps something relevant into its fragment args = jQuery.map( this, function( elem ) { return [ elem.nextSibling, elem.parentNode ]; }), i = 0; // Make the changes, replacing each context element with the new content this.domManip( arguments, function( elem ) { var next = args[ i++ ], parent = args[ i++ ]; if ( parent ) { // Don't use the snapshot next if it has moved (#13810) if ( next && next.parentNode !== parent ) { next = this.nextSibling; } jQuery( this ).remove(); parent.insertBefore( elem, next ); } // Allow new content to include elements from the context set }, true ); // Force removal if there was no new content (e.g., from empty arguments) return i ? this : this.remove(); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, callback, allowIntersection ) { // Flatten any nested arrays args = core_concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, self.html() ); } self.domManip( args, callback, allowIntersection ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Hope ajax is available... jQuery._evalUrl( node.src ); } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() core_push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( manipulation_rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !jQuery.support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== core_strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } core_deletedIds.push( id ); } } } } }, _evalUrl: function( url ) { return jQuery.ajax({ url: url, type: "GET", dataType: "script", async: false, global: false, "throws": true }); } }); jQuery.fn.extend({ wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); } }); var iframe, getStyles, curCSS, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, rposition = /^(top|right|bottom|left)$/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), elemdisplay = { BODY: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400 }, cssExpand = [ "Top", "Right", "Bottom", "Left" ], cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function isHidden( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); } } else { if ( !values[ index ] ) { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } jQuery.fn.extend({ css: function( name, value ) { return jQuery.access( this, function( elem, name, value ) { var len, styles, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { if ( typeof state === "boolean" ) { return state ? this.show() : this.hide(); } return this.each(function() { if ( isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "columnCount": true, "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; } }); // NOTE: we've included the "window" in window.getComputedStyle // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { getStyles = function( elem ) { return window.getComputedStyle( elem, null ); }; curCSS = function( elem, name, _computed ) { var width, minWidth, maxWidth, computed = _computed || getStyles( elem ), // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, style = elem.style; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, _computed ) { var left, rs, rsLeft, computed = _computed || getStyles( elem ), ret = computed ? computed[ name ] : undefined, style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } // Try to determine the default display value of an element function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>") .css( "cssText", "display:block !important" ) ).appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; doc.write("<!doctype html><html><body>"); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } // Called ONLY from within css_defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[0], "display" ); elem.remove(); return display; } jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } // These hooks cannot be added until DOM ready because the support test // for it is not run until after DOM ready jQuery(function() { if ( !jQuery.support.reliableMarginRight ) { jQuery.cssHooks.marginRight = { get: function( elem, computed ) { if ( computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } }; } // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = { get: function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } }; }); } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; jQuery.fn.extend({ serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function(){ // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; }) .filter(function(){ var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !manipulation_rcheckableType.test( type ) ); }) .map(function( i, elem ){ var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ){ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); //Serialize an array of form elements or a set of //key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; }); jQuery.fn.extend({ hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); } }); var // Document location ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat("*"); // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( (dataType = dataTypes[i++]) ) { // Prepend if requested if ( dataType[0] === "+" ) { dataType = dataType.slice( 1 ) || "*"; (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); // Otherwise append } else { (structure[ dataType ] = structure[ dataType ] || []).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } }); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, response, type, self = this, off = url.indexOf(" "); if ( off >= 0 ) { selector = url.slice( off, url.length ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax({ url: url, // if "type" variable is undefined, then "GET" method will be used type: type, dataType: "html", data: params }).done(function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); }).complete( callback && function( jqXHR, status ) { self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); }); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ jQuery.fn[ type ] = function( fn ){ return this.on( type, fn ); }; }); jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( (match = rheaders.exec( responseHeadersString )) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to fireGlobals = s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger("ajaxStart"); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) : // Otherwise add one to the end cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader("Last-Modified"); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader("etag"); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); } }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ url: url, type: method, dataType: type, data: data, success: callback }); }; }); /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s[ "throws" ] ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery("head")[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement("script"); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } }); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) ); this[ callback ] = true; return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always(function() { // Restore preexisting value window[ callbackName ] = overwritten; // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; }); // Delegate to script return "script"; } }); var xhrCallbacks, xhrSupported, xhrId = 0, // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject && function() { // Abort all pending requests var key; for ( key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } }; // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties xhrSupported = jQuery.ajaxSettings.xhr(); jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = jQuery.support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport(function( s ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !s.crossDomain || jQuery.support.cors ) { var callback; return { send: function( headers, complete ) { // Get a new xhr var handle, i, xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open( s.type, s.url, s.async, s.username, s.password ); } else { xhr.open( s.type, s.url, s.async ); } // Apply custom fields if provided if ( s.xhrFields ) { for ( i in s.xhrFields ) { xhr[ i ] = s.xhrFields[ i ]; } } // Override mime type if needed if ( s.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( s.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !s.crossDomain && !headers["X-Requested-With"] ) { headers["X-Requested-With"] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } } catch( err ) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( s.hasContent && s.data ) || null ); // Listener callback = function( _, isAbort ) { var status, responseHeaders, statusText, responses; // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; if ( xhrOnUnloadAbort ) { delete xhrCallbacks[ handle ]; } } // If it's an abort if ( isAbort ) { // Abort it manually if needed if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); // When requesting binary data, IE6-9 will throw an exception // on any attempt to access responseText (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && s.isLocal && !s.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } } catch( firefoxAccessException ) { if ( !isAbort ) { complete( -1, firefoxAccessException ); } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, responseHeaders ); } }; if ( !s.async ) { // if we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback setTimeout( callback ); } else { handle = ++xhrId; if ( xhrOnUnloadAbort ) { // Create the active xhrs callbacks list if needed // and attach the unload handler if ( !xhrCallbacks ) { xhrCallbacks = {}; jQuery( window ).unload( xhrOnUnloadAbort ); } // Add to list of active xhrs callbacks xhrCallbacks[ handle ] = callback; } xhr.onreadystatechange = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } }); } var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), rrun = /queueHooks$/, animationPrefilters = [ defaultPrefilter ], tweeners = { "*": [function( prop, value ) { var tween = this.createTween( prop, value ), target = tween.cur(), parts = rfxnum.exec( value ), unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) && rfxnum.exec( jQuery.css( tween.elem, prop ) ), scale = 1, maxIterations = 20; if ( start && start[ 3 ] !== unit ) { // Trust units reported by jQuery.css unit = unit || start[ 3 ]; // Make sure we update the tween properties later on parts = parts || []; // Iteratively approximate from a nonzero starting point start = +target || 1; do { // If previous iteration zeroed out, double until we get *something* // Use a string for doubling factor so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply start = start / scale; jQuery.style( tween.elem, prop, start + unit ); // Update scale, tolerating zero or NaN from tween.cur() // And breaking the loop if scale is unchanged or perfect, or if we've just had enough } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); } // Update tween properties if ( parts ) { start = tween.start = +start || +target || 0; tween.unit = unit; // If a +=/-= token was provided, we're doing a relative animation tween.end = parts[ 1 ] ? start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : +parts[ 2 ]; } return tween; }] }; // Animations created synchronously will run synchronously function createFxNow() { setTimeout(function() { fxNow = undefined; }); return ( fxNow = jQuery.now() ); } function createTween( value, prop, animation ) { var tween, collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( (tween = collection[ index ].call( animation, prop, value )) ) { // we're done with this property return tween; } } } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; }), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ]); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise({ elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {} }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // resolve when we played the last frame // otherwise, reject if ( gotoEnd ) { deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } }), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { return result; } } jQuery.map( props, createTween, animation ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue }) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } function propFilter( props, specialEasing ) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } jQuery.Animation = jQuery.extend( Animation, { tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.split(" "); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; tweeners[ prop ] = tweeners[ prop ] || []; tweeners[ prop ].unshift( callback ); } }, prefilter: function( callback, prepend ) { if ( prepend ) { animationPrefilters.unshift( callback ); } else { animationPrefilters.push( callback ); } } }); function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ var prop, value, toggle, tween, hooks, oldfire, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHidden( elem ), dataShow = jQuery._data( elem, "fxshow" ); // handle queue: false promises if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always(function() { // doing this makes sure that the complete handler will be called // before this completes anim.always(function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } }); }); } // height/width overflow pass if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated if ( jQuery.css( elem, "display" ) === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; } } } if ( opts.overflow ) { style.overflow = "hidden"; if ( !jQuery.support.shrinkWrapBlocks ) { anim.always(function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; }); } } // show/hide pass for ( prop in props ) { value = props[ prop ]; if ( rfxtypes.exec( value ) ) { delete props[ prop ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { continue; } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); } } if ( !jQuery.isEmptyObject( orig ) ) { if ( dataShow ) { if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } } else { dataShow = jQuery._data( elem, "fxshow", {} ); } // store state if its toggle - enables .stop().toggle() to "reverse" if ( toggle ) { dataShow.hidden = !hidden; } if ( hidden ) { jQuery( elem ).show(); } else { anim.done(function() { jQuery( elem ).hide(); }); } anim.done(function() { var prop; jQuery._removeData( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } }); for ( prop in orig ) { tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = tween.start; if ( hidden ) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } } } function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || "swing"; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; if ( tween.elem[ tween.prop ] != null && (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { return tween.elem[ tween.prop ]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Support: IE <=9 // Panic based approach to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; }); jQuery.fn.extend({ fadeTo: function( speed, to, easing, callback ) { // show any hidden elements after setting opacity to 0 return this.filter( isHidden ).css( "opacity", 0 ).show() // animate to the value specified .end().animate({ opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each(function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } }); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each(function() { var index, data = jQuery._data( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.stop ) { hooks.stop.call( this, true ); } // look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // turn off finishing flag delete data.finish; }); } }); // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth? 1 : 0; for( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p*Math.PI ) / 2; } }; jQuery.timers = []; jQuery.fx = Tween.prototype.init; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { if ( timer() && jQuery.timers.push( timer ) ) { jQuery.fx.start(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { clearInterval( timerId ); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Back Compat <1.8 extension point jQuery.fx.step = {}; if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } jQuery.fn.offset = function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== core_strundefined ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }; jQuery.offset = { setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || docElem; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || docElem; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return jQuery.access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return jQuery.access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; }); }); // Limit scope pollution from any deprecated API // (function() { // The number of elements contained in the matched element set jQuery.fn.size = function() { return this.length; }; jQuery.fn.andSelf = jQuery.fn.addBack; // })(); if ( typeof module === "object" && module && typeof module.exports === "object" ) { // Expose jQuery as module.exports in loaders that implement the Node // module pattern (including browserify). Do not create the global, since // the user will be storing it themselves locally, and globals are frowned // upon in the Node module world. module.exports = jQuery; } else { // Otherwise expose jQuery to the global object as usual window.jQuery = window.$ = jQuery; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. if ( typeof define === "function" && define.amd ) { define( "jquery", [], function () { return jQuery; } ); } } })( window ); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20110929 |
| Request Header - size: 509 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:05 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 273199 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 273,199 bytes. |
/*!
* jQuery JavaScript Library v1.10.2 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03T13:48Z */ (function( window, undefined ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; var // The deferred used on DOM ready readyList, // A central reference to the root jQuery(document) rootjQuery, // Support: IE<10 // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined` core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) location = window.location, document = window.document, docElem = document.documentElement, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // [[Class]] -> type pairs class2type = {}, // List of deleted data cache ids, so we can reuse them core_deletedIds = [], core_version = "1.10.2", // Save a reference to some core methods core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Used for matching numbers core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, // Used for splitting on whitespace core_rnotwhite = /\S+/g, // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }, // The ready event handler completed = function( event ) { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } }, // Clean-up method for dom ready events detach = function() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: core_version, constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return core_slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }, slice: function() { return this.pushStack( core_slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: core_push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger("ready").off("ready"); } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { if ( obj == null ) { return String( obj ); } return typeof obj === "object" || typeof obj === "function" ? class2type[ core_toString.call(obj) ] || "object" : typeof obj; }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if ( jQuery.support.ownLast ) { for ( key in obj ) { return core_hasOwn.call( obj, key ); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string parseHTML: function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }, parseJSON: function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } if ( data === null ) { return data; } if ( typeof data === "string" ) { // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); if ( data ) { // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } } } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Use native String.trim function wherever possible trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { core_push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( core_indexOf ) { return core_indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var l = second.length, i = first.length, j = 0; if ( typeof l === "number" ) { for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var retVal, ret = [], i = 0, length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return core_concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = core_slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); }, // A method for quickly swapping in/out CSS properties to get correct calculations. // Note: this method belongs to the css module but it's needed here for the support module. // If support gets modularized, this method should be moved back to the css module. swap: function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || type !== "function" && ( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj ); } // All jQuery objects should point back to these rootjQuery = jQuery(document); /*! * Sizzle CSS Selector Engine v1.10.2 * http://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03 */ (function( window, undefined ) { var i, support, cachedruns, Expr, getText, isXML, compile, outermostContext, sortInput, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), hasDuplicate = false, sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; return 0; } return 0; }, // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Prefer arguments quoted, // then not containing pseudos/brackets, // then attribute selectors/non-parenthetical expressions, // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rsibling = new RegExp( whitespace + "*[+~]" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : // BMP codepoint high < 0 ? String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( documentIsHTML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // QSA path if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { nid = old = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && context.parentNode || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key += " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = attrs.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Detect xml * @param {Element|Object} elem An element or a document */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; // Expose support vars for convenience support = Sizzle.support = {}; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.defaultView; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsHTML = !isXML( doc ); // Support: IE>8 // If iframe document is assigned to "document" variable and if iframe has been reloaded, // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 // IE6-8 do not support the defaultView property so parent will be undefined if ( parent && parent.attachEvent && parent !== parent.top ) { parent.attachEvent( "onbeforeunload", function() { setDocument(); }); } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) support.attributes = assert(function( div ) { div.className = "i"; return !div.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if getElementsByClassName can be trusted support.getElementsByClassName = assert(function( div ) { div.innerHTML = "<div class='a'></div><div class='a i'></div>"; // Support: Safari<4 // Catch class over-caching div.firstChild.className = "i"; // Support: Opera<10 // Catch gEBCN failure to find non-leading classes return div.getElementsByClassName("i").length === 2; }); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !doc.getElementsByName || !doc.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && documentIsHTML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select><option selected=''></option></select>"; // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Support: Opera 10-12/IE8 // ^= $= *= and empty values // Should not select anything // Support: Windows 8 Native Apps // The type attribute is restricted during .innerHTML assignment var input = doc.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "t", "" ); if ( div.querySelectorAll("[t^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = docElem.compareDocumentPosition ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); if ( compare ) { // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === doc || contains(preferredDoc, a) ) { return -1; } if ( b === doc || contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } // Not directly comparable, sort on existence of method return a.compareDocumentPosition ? -1 : 1; } : function( a, b ) { var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; // Parentless nodes are either documents or disconnected } else if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return doc; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [elem] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val === undefined ? support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null : val; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array for ( ; (node = elem[i]); i++ ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[5] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] && match[4] !== undefined ) { match[2] = match[4]; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( tokens = [] ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); } function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var data, cache, outerCache, dirkey = dirruns + " " + doneName; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { if ( (data = cache[1]) === true || data === cachedruns ) { return data === true; } } else { cache = outerCache[ dir ] = [ dirkey ]; cache[1] = matcher( elem, context, xml ) || cachedruns; if ( cache[1] === true ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // A counter to specify which element is currently being matched var matcherCachedRuns = 0, bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, expandContext ) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, // We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); if ( outermost ) { outermostContext = context !== document && context; cachedruns = matcherCachedRuns; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below for ( ; (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; cachedruns = ++matcherCachedRuns; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !group ) { group = tokenize( selector ); } i = group.length; while ( i-- ) { cached = matcherFromTokens( group[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); } return cached; }; function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function select( selector, context, results, seed ) { var i, tokens, token, type, find, match = tokenize( selector ); if ( !seed ) { // Try to minimize operations if there is only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && context.parentNode || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } } // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile( selector, match )( seed, context, !documentIsHTML, results, rsibling.test( selector ) ); return results; } // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Support: Chrome<14 // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( document.createElement("div") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert(function( div ) { div.innerHTML = "<input/>"; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert(function( div ) { return div.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return (val = elem.getAttributeNode( name )) && val.specified ? val.value : elem[ name ] === true ? name.toLowerCase() : null; } }); } jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })( window ); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; firingLength = 0; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( list && ( !fired || stack ) ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var action = tuple[ 0 ], fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = core_slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; if( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); jQuery.support = (function( support ) { var all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); // Setup div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // Finish early in limited (non-browser) environments all = div.getElementsByTagName("*") || []; a = div.getElementsByTagName("a")[ 0 ]; if ( !a || !a.style || !all.length ) { return support; } // First batch of tests select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px;float:left;opacity:.5"; // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) support.getSetAttribute = div.className !== "t"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName("tbody").length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !!div.getElementsByTagName("link").length; // Get the style information from getAttribute // (IE uses .cssText instead) support.style = /top/.test( a.getAttribute("style") ); // Make sure that URLs aren't manipulated // (IE normalizes it by default) support.hrefNormalized = a.getAttribute("href") === "/a"; // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 support.opacity = /^0.5/.test( a.style.opacity ); // Verify style float existence // (IE uses styleFloat instead of cssFloat) support.cssFloat = !!a.style.cssFloat; // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) support.checkOn = !!input.value; // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) support.optSelected = opt.selected; // Tests for enctype support on a form (#6743) support.enctype = !!document.createElement("form").enctype; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>"; // Will be defined later support.inlineBlockNeedsLayout = false; support.shrinkWrapBlocks = false; support.pixelPosition = false; support.deleteExpando = true; support.noCloneEvent = true; support.reliableMarginRight = true; support.boxSizingReliable = true; // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE<9 try { delete div.test; } catch( e ) { support.deleteExpando = false; } // Check if we can trust getAttribute("value") input = document.createElement("input"); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "checked", "t" ); input.setAttribute( "name", "t" ); fragment = document.createDocumentFragment(); fragment.appendChild( input ); // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) for ( i in { submit: true, change: true, focusin: true }) { div.setAttribute( eventName = "on" + i, "t" ); support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; } div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Support: IE<9 // Iteration over object's inherited properties before its own. for ( i in jQuery( support ) ) { break; } support.ownLast = i !== "0"; // Run tests that need a body at doc ready jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } container = document.createElement("div"); container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; body.appendChild( container ).appendChild( div ); // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; tds = div.getElementsByTagName("td"); tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Support: IE8 // Check if empty table cells still have offsetWidth/Height support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check box-sizing and margin behavior. div.innerHTML = ""; div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; // Workaround failing boxSizing test due to offsetWidth returning wrong value // with some non-1 values of body zoom, ticket #13543 jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { support.boxSizing = div.offsetWidth === 4; }); // Use window.getComputedStyle because jsdom on node.js will break without it. if ( window.getComputedStyle ) { support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right marginDiv = div.appendChild( document.createElement("div") ); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; support.reliableMarginRight = !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== core_strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Support: IE6 // Check if elements with layout shrink-wrap their children div.style.display = "block"; div.innerHTML = "<div></div>"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); if ( support.inlineBlockNeedsLayout ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); // Null elements to avoid leaks in IE container = div = tds = marginDiv = null; }); // Null elements to avoid leaks in IE all = select = fragment = opt = a = input = null; return support; })({}); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData( elem, name, data, pvt /* Internal Use Only */ ){ if ( !jQuery.acceptData( elem ) ) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( typeof name === "string" ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } i = name.length; while ( i-- ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if ( jQuery.support.deleteExpando || cache != cache.window ) { /* jshint eqeqeq: true */ delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "applet": true, "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { // Do not set data on non-element because it will not be cleared (#8335). if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { return false; } var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; // nodes accept data unless otherwise specified; rejection can be conditional return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); jQuery.fn.extend({ data: function( key, value ) { var attrs, name, data = null, i = 0, elem = this[0]; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attrs = elem.attributes; for ( ; i < attrs.length; i++ ) { name = attrs[i].name; if ( name.indexOf("data-") === 0 ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return arguments.length > 1 ? // Sets one value this.each(function() { jQuery.data( this, key, value ); }) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var nodeHook, boolHook, rclass = /[\t\r\n\f]/g, rreturn = /\r/g, rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, getSetInput = jQuery.support.input; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } elem.className = jQuery.trim( cur ); } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } elem.className = value ? jQuery.trim( cur ) : ""; } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value; if ( typeof stateVal === "boolean" && type === "string" ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), classNames = value.match( core_rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( type === core_strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; }, val: function( value ) { var ret, hooks, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map(val, function ( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { // Use proper attribute retrieval(#6932, #12072) var val = jQuery.find.attr( elem, "value" ); return val != null ? val : elem.text; } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) { optionSet = true; } } // force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return values; } } }, attr: function( elem, name, value ) { var hooks, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === core_strundefined ) { return jQuery.prop( elem, name, value ); } // All attributes are lowercase // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( core_rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( jQuery.expr.match.bool.test( name ) ) { // Set corresponding property to false if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { elem[ propName ] = false; // Support: IE<9 // Also clear defaultChecked/defaultSelected (if appropriate) } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, propFix: { "for": "htmlFor", "class": "className" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? ret : ( elem[ name ] = value ); } else { return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? ret : elem[ name ]; } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); return tabindex ? parseInt( tabindex, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1; } } } }); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr; jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? function( elem, name, isXML ) { var fn = jQuery.expr.attrHandle[ name ], ret = isXML ? undefined : /* jshint eqeqeq: false */ (jQuery.expr.attrHandle[ name ] = undefined) != getter( elem, name, isXML ) ? name.toLowerCase() : null; jQuery.expr.attrHandle[ name ] = fn; return ret; } : function( elem, name, isXML ) { return isXML ? undefined : elem[ jQuery.camelCase( "default-" + name ) ] ? name.toLowerCase() : null; }; }); // fix oldIE attroperties if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = { set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) return name === "value" || value === elem.getAttribute( name ) ? value : undefined; } }; jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = // Some attributes are constructed with empty-string values when not defined function( elem, name, isXML ) { var ret; return isXML ? undefined : (ret = elem.getAttributeNode( name )) && ret.value !== "" ? ret.value : null; }; jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return ret && ret.specified ? ret.value : undefined; }, set: nodeHook.set }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }; }); } // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }; } jQuery.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; }); // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }; if ( !jQuery.support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { // Support: Webkit // "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; }; } }); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = core_hasOwn.call( event, "type" ) ? event.type : event, namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Even when returnValue equals to undefined Firefox will still show alert if ( event.result !== undefined ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === core_strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); var isSimple = /^.[^:#\[\.,]*$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var i, ret = [], self = this, len = self.length; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector || [], true) ); }, filter: function( selector ) { return this.pushStack( winnow(this, selector || [], false) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)) ) { cur = ret.push( cur ); break; } } } return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( jQuery.unique(all) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { ret = jQuery.unique( ret ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } return this.pushStack( ret ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; })); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; }); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; }); } if ( typeof qualifier === "string" ) { if ( isSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, manipulation_rcheckableType = /^(?:checkbox|radio)$/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], area: [ 1, "<map>", "</map>" ], param: [ 1, "<object>", "</object>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } }); }, prepend: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } }); }, before: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { var elem, elems = selector ? jQuery.filter( selector, this ) : this, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var // Snapshot the DOM in case .domManip sweeps something relevant into its fragment args = jQuery.map( this, function( elem ) { return [ elem.nextSibling, elem.parentNode ]; }), i = 0; // Make the changes, replacing each context element with the new content this.domManip( arguments, function( elem ) { var next = args[ i++ ], parent = args[ i++ ]; if ( parent ) { // Don't use the snapshot next if it has moved (#13810) if ( next && next.parentNode !== parent ) { next = this.nextSibling; } jQuery( this ).remove(); parent.insertBefore( elem, next ); } // Allow new content to include elements from the context set }, true ); // Force removal if there was no new content (e.g., from empty arguments) return i ? this : this.remove(); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, callback, allowIntersection ) { // Flatten any nested arrays args = core_concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, self.html() ); } self.domManip( args, callback, allowIntersection ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Hope ajax is available... jQuery._evalUrl( node.src ); } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() core_push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( manipulation_rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !jQuery.support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== core_strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } core_deletedIds.push( id ); } } } } }, _evalUrl: function( url ) { return jQuery.ajax({ url: url, type: "GET", dataType: "script", async: false, global: false, "throws": true }); } }); jQuery.fn.extend({ wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); } }); var iframe, getStyles, curCSS, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, rposition = /^(top|right|bottom|left)$/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), elemdisplay = { BODY: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400 }, cssExpand = [ "Top", "Right", "Bottom", "Left" ], cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function isHidden( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); } } else { if ( !values[ index ] ) { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } jQuery.fn.extend({ css: function( name, value ) { return jQuery.access( this, function( elem, name, value ) { var len, styles, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { if ( typeof state === "boolean" ) { return state ? this.show() : this.hide(); } return this.each(function() { if ( isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "columnCount": true, "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; } }); // NOTE: we've included the "window" in window.getComputedStyle // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { getStyles = function( elem ) { return window.getComputedStyle( elem, null ); }; curCSS = function( elem, name, _computed ) { var width, minWidth, maxWidth, computed = _computed || getStyles( elem ), // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, style = elem.style; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, _computed ) { var left, rs, rsLeft, computed = _computed || getStyles( elem ), ret = computed ? computed[ name ] : undefined, style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } // Try to determine the default display value of an element function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>") .css( "cssText", "display:block !important" ) ).appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; doc.write("<!doctype html><html><body>"); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } // Called ONLY from within css_defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[0], "display" ); elem.remove(); return display; } jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } // These hooks cannot be added until DOM ready because the support test // for it is not run until after DOM ready jQuery(function() { if ( !jQuery.support.reliableMarginRight ) { jQuery.cssHooks.marginRight = { get: function( elem, computed ) { if ( computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } }; } // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = { get: function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } }; }); } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; jQuery.fn.extend({ serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function(){ // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; }) .filter(function(){ var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !manipulation_rcheckableType.test( type ) ); }) .map(function( i, elem ){ var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ){ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); //Serialize an array of form elements or a set of //key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; }); jQuery.fn.extend({ hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); } }); var // Document location ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat("*"); // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( (dataType = dataTypes[i++]) ) { // Prepend if requested if ( dataType[0] === "+" ) { dataType = dataType.slice( 1 ) || "*"; (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); // Otherwise append } else { (structure[ dataType ] = structure[ dataType ] || []).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } }); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, response, type, self = this, off = url.indexOf(" "); if ( off >= 0 ) { selector = url.slice( off, url.length ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax({ url: url, // if "type" variable is undefined, then "GET" method will be used type: type, dataType: "html", data: params }).done(function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); }).complete( callback && function( jqXHR, status ) { self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); }); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ jQuery.fn[ type ] = function( fn ){ return this.on( type, fn ); }; }); jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( (match = rheaders.exec( responseHeadersString )) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to fireGlobals = s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger("ajaxStart"); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) : // Otherwise add one to the end cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader("Last-Modified"); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader("etag"); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); } }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ url: url, type: method, dataType: type, data: data, success: callback }); }; }); /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s[ "throws" ] ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery("head")[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement("script"); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } }); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) ); this[ callback ] = true; return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always(function() { // Restore preexisting value window[ callbackName ] = overwritten; // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; }); // Delegate to script return "script"; } }); var xhrCallbacks, xhrSupported, xhrId = 0, // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject && function() { // Abort all pending requests var key; for ( key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } }; // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties xhrSupported = jQuery.ajaxSettings.xhr(); jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = jQuery.support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport(function( s ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !s.crossDomain || jQuery.support.cors ) { var callback; return { send: function( headers, complete ) { // Get a new xhr var handle, i, xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open( s.type, s.url, s.async, s.username, s.password ); } else { xhr.open( s.type, s.url, s.async ); } // Apply custom fields if provided if ( s.xhrFields ) { for ( i in s.xhrFields ) { xhr[ i ] = s.xhrFields[ i ]; } } // Override mime type if needed if ( s.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( s.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !s.crossDomain && !headers["X-Requested-With"] ) { headers["X-Requested-With"] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } } catch( err ) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( s.hasContent && s.data ) || null ); // Listener callback = function( _, isAbort ) { var status, responseHeaders, statusText, responses; // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; if ( xhrOnUnloadAbort ) { delete xhrCallbacks[ handle ]; } } // If it's an abort if ( isAbort ) { // Abort it manually if needed if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); // When requesting binary data, IE6-9 will throw an exception // on any attempt to access responseText (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && s.isLocal && !s.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } } catch( firefoxAccessException ) { if ( !isAbort ) { complete( -1, firefoxAccessException ); } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, responseHeaders ); } }; if ( !s.async ) { // if we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback setTimeout( callback ); } else { handle = ++xhrId; if ( xhrOnUnloadAbort ) { // Create the active xhrs callbacks list if needed // and attach the unload handler if ( !xhrCallbacks ) { xhrCallbacks = {}; jQuery( window ).unload( xhrOnUnloadAbort ); } // Add to list of active xhrs callbacks xhrCallbacks[ handle ] = callback; } xhr.onreadystatechange = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } }); } var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), rrun = /queueHooks$/, animationPrefilters = [ defaultPrefilter ], tweeners = { "*": [function( prop, value ) { var tween = this.createTween( prop, value ), target = tween.cur(), parts = rfxnum.exec( value ), unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) && rfxnum.exec( jQuery.css( tween.elem, prop ) ), scale = 1, maxIterations = 20; if ( start && start[ 3 ] !== unit ) { // Trust units reported by jQuery.css unit = unit || start[ 3 ]; // Make sure we update the tween properties later on parts = parts || []; // Iteratively approximate from a nonzero starting point start = +target || 1; do { // If previous iteration zeroed out, double until we get *something* // Use a string for doubling factor so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply start = start / scale; jQuery.style( tween.elem, prop, start + unit ); // Update scale, tolerating zero or NaN from tween.cur() // And breaking the loop if scale is unchanged or perfect, or if we've just had enough } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); } // Update tween properties if ( parts ) { start = tween.start = +start || +target || 0; tween.unit = unit; // If a +=/-= token was provided, we're doing a relative animation tween.end = parts[ 1 ] ? start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : +parts[ 2 ]; } return tween; }] }; // Animations created synchronously will run synchronously function createFxNow() { setTimeout(function() { fxNow = undefined; }); return ( fxNow = jQuery.now() ); } function createTween( value, prop, animation ) { var tween, collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( (tween = collection[ index ].call( animation, prop, value )) ) { // we're done with this property return tween; } } } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; }), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ]); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise({ elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {} }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // resolve when we played the last frame // otherwise, reject if ( gotoEnd ) { deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } }), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { return result; } } jQuery.map( props, createTween, animation ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue }) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } function propFilter( props, specialEasing ) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } jQuery.Animation = jQuery.extend( Animation, { tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.split(" "); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; tweeners[ prop ] = tweeners[ prop ] || []; tweeners[ prop ].unshift( callback ); } }, prefilter: function( callback, prepend ) { if ( prepend ) { animationPrefilters.unshift( callback ); } else { animationPrefilters.push( callback ); } } }); function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ var prop, value, toggle, tween, hooks, oldfire, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHidden( elem ), dataShow = jQuery._data( elem, "fxshow" ); // handle queue: false promises if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always(function() { // doing this makes sure that the complete handler will be called // before this completes anim.always(function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } }); }); } // height/width overflow pass if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated if ( jQuery.css( elem, "display" ) === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; } } } if ( opts.overflow ) { style.overflow = "hidden"; if ( !jQuery.support.shrinkWrapBlocks ) { anim.always(function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; }); } } // show/hide pass for ( prop in props ) { value = props[ prop ]; if ( rfxtypes.exec( value ) ) { delete props[ prop ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { continue; } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); } } if ( !jQuery.isEmptyObject( orig ) ) { if ( dataShow ) { if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } } else { dataShow = jQuery._data( elem, "fxshow", {} ); } // store state if its toggle - enables .stop().toggle() to "reverse" if ( toggle ) { dataShow.hidden = !hidden; } if ( hidden ) { jQuery( elem ).show(); } else { anim.done(function() { jQuery( elem ).hide(); }); } anim.done(function() { var prop; jQuery._removeData( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } }); for ( prop in orig ) { tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = tween.start; if ( hidden ) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } } } function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || "swing"; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; if ( tween.elem[ tween.prop ] != null && (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { return tween.elem[ tween.prop ]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Support: IE <=9 // Panic based approach to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; }); jQuery.fn.extend({ fadeTo: function( speed, to, easing, callback ) { // show any hidden elements after setting opacity to 0 return this.filter( isHidden ).css( "opacity", 0 ).show() // animate to the value specified .end().animate({ opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each(function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } }); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each(function() { var index, data = jQuery._data( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.stop ) { hooks.stop.call( this, true ); } // look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // turn off finishing flag delete data.finish; }); } }); // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth? 1 : 0; for( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p*Math.PI ) / 2; } }; jQuery.timers = []; jQuery.fx = Tween.prototype.init; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { if ( timer() && jQuery.timers.push( timer ) ) { jQuery.fx.start(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { clearInterval( timerId ); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Back Compat <1.8 extension point jQuery.fx.step = {}; if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } jQuery.fn.offset = function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== core_strundefined ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }; jQuery.offset = { setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || docElem; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || docElem; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return jQuery.access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return jQuery.access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; }); }); // Limit scope pollution from any deprecated API // (function() { // The number of elements contained in the matched element set jQuery.fn.size = function() { return this.length; }; jQuery.fn.andSelf = jQuery.fn.addBack; // })(); if ( typeof module === "object" && module && typeof module.exports === "object" ) { // Expose jQuery as module.exports in loaders that implement the Node // module pattern (including browserify). Do not create the global, since // the user will be storing it themselves locally, and globals are frowned // upon in the Node module world. module.exports = jQuery; } else { // Otherwise expose jQuery to the global object as usual window.jQuery = window.$ = jQuery; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. if ( typeof define === "function" && define.amd ) { define( "jquery", [], function () { return jQuery; } ); } } })( window ); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 0123456789 |
| Request Header - size: 519 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:05 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 228560 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 228,560 bytes. |
/*! jQuery UI - v1.10.4 - 2014-03-02
* http://jqueryui.com * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ (function(e,t){function i(t,i){var s,a,o,r=t.nodeName.toLowerCase();return"area"===r?(s=t.parentNode,a=s.name,t.href&&a&&"map"===s.nodeName.toLowerCase()?(o=e("img[usemap=#"+a+"]")[0],!!o&&n(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,a=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,n){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),n&&n.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var n,s,a=e(this[0]);a.length&&a[0]!==document;){if(n=a.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(s=parseInt(a.css("zIndex"),10),!isNaN(s)&&0!==s))return s;a=a.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){a.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),s=isNaN(n);return(s||n>=0)&&i(t,!s)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,n){function s(t,i,n,s){return e.each(a,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var a="Width"===n?["Left","Right"]:["Top","Bottom"],o=n.toLowerCase(),r={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(i){return i===t?r["inner"+n].call(this):this.each(function(){e(this).css(o,s(this,i)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?r["outer"+n].call(this,t):this.each(function(){e(this).css(o,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,n){var s,a=e.ui[t].prototype;for(s in n)a.plugins[s]=a.plugins[s]||[],a.plugins[s].push([i,n[s]])},call:function(e,t,i){var n,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(n=0;s.length>n;n++)e.options[s[n][0]]&&s[n][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[n]>0?!0:(t[n]=1,s=t[n]>0,t[n]=0,s)}})})(jQuery);(function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix||i:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})})(jQuery);(function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,l=Math.round,h=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:a?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var a,p,g,m,v,_,b=t(e.of),y=t.position.getWithinInfo(e.within),k=t.position.getScrollInfo(y),w=(e.collision||"flip").split(" "),D={};return _=n(b),b[0].preventDefault&&(e.at="left top"),p=_.width,g=_.height,m=_.offset,v=t.extend({},m),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=h.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=h.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),D[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=g:"center"===e.at[1]&&(v.top+=g/2),a=i(D.at,p,g),v.left+=a[0],v.top+=a[1],this.each(function(){var n,h,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),_=s(this,"marginTop"),x=u+f+s(this,"marginRight")+k.width,C=d+_+s(this,"marginBottom")+k.height,M=t.extend({},v),T=i(D.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?M.left-=u:"center"===e.my[0]&&(M.left-=u/2),"bottom"===e.my[1]?M.top-=d:"center"===e.my[1]&&(M.top-=d/2),M.left+=T[0],M.top+=T[1],t.support.offsetFractions||(M.left=l(M.left),M.top=l(M.top)),n={marginLeft:f,marginTop:_},t.each(["left","top"],function(i,s){t.ui.position[w[i]]&&t.ui.position[w[i]][s](M,{targetWidth:p,targetHeight:g,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:x,collisionHeight:C,offset:[a[0]+T[0],a[1]+T[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(h=function(t){var i=m.left-M.left,s=i+p-u,n=m.top-M.top,a=n+g-d,l={target:{element:b,left:m.left,top:m.top,width:p,height:g},element:{element:c,left:M.left,top:M.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(l.horizontal="center"),d>g&&g>r(n+a)&&(l.vertical="middle"),l.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,l)}),c.offset(t.extend(M,{using:h}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-o-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-o-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-o-a,t.top+p+f+g>c&&(0>s||r(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,t.top+p+f+g>u&&(i>0||u>r(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(t(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){t("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||t.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1):!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,t(document).width()-this.helperProportions.width-this.margins.left,(t(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(e){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=e.pageX,h=e.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(h=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,l=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("ui-draggable"),n=s.options,a=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,a))})},stop:function(e,i){var s=t(this).data("ui-draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("ui-draggable"),n=this;t.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&t.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("ui-draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("ui-draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:e.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-e.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:e.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(e.pageY-t(document).scrollTop()<s.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-s.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<s.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(e.pageX-t(document).scrollLeft()<s.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-s.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<s.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(){var e=t(this).data("ui-draggable"),i=e.options;e.snapElements=[],t(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=t(this),s=i.offset();this!==e.element[0]&&e.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(e,i){var s,n,a,o,r,l,h,c,u,d,p=t(this).data("ui-draggable"),g=p.options,f=g.snapTolerance,m=i.offset.left,_=m+p.helperProportions.width,v=i.offset.top,b=v+p.helperProportions.height;for(u=p.snapElements.length-1;u>=0;u--)r=p.snapElements[u].left,l=r+p.snapElements[u].width,h=p.snapElements[u].top,c=h+p.snapElements[u].height,r-f>_||m>l+f||h-f>b||v>c+f||!t.contains(p.snapElements[u].item.ownerDocument,p.snapElements[u].item)?(p.snapElements[u].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=!1):("inner"!==g.snapMode&&(s=f>=Math.abs(h-b),n=f>=Math.abs(c-v),a=f>=Math.abs(r-_),o=f>=Math.abs(l-m),s&&(i.position.top=p._convertPositionTo("relative",{top:h-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l}).left-p.margins.left)),d=s||n||a||o,"outer"!==g.snapMode&&(s=f>=Math.abs(h-v),n=f>=Math.abs(c-b),a=f>=Math.abs(r-m),o=f>=Math.abs(l-_),s&&(i.position.top=p._convertPositionTo("relative",{top:h,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[u].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=s||n||a||o||d)}}),t.ui.plugin.add("draggable","stack",{start:function(){var e,i=this.data("ui-draggable").options,s=t.makeArray(t(i.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(e=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(i){t(this).css("zIndex",e+i)}),this.css("zIndex",e+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}t.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],undefined):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},t.ui.ddmanager.droppables[i.scope]=t.ui.ddmanager.droppables[i.scope]||[],t.ui.ddmanager.droppables[i.scope].push(this),i.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(t,i,s){if(!i.offset)return!1;var n,a,o=(t.positionAbs||t.position.absolute).left,r=(t.positionAbs||t.position.absolute).top,l=o+t.helperProportions.width,h=r+t.helperProportions.height,c=i.offset.left,u=i.offset.top,d=c+i.proportions().width,p=u+i.proportions().height;switch(s){case"fit":return o>=c&&d>=l&&r>=u&&p>=h;case"intersect":return o+t.helperProportions.width/2>c&&d>l-t.helperProportions.width/2&&r+t.helperProportions.height/2>u&&p>h-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,a=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(a,u,i.proportions().height)&&e(n,c,i.proportions().width);case"touch":return(r>=u&&p>=r||h>=u&&p>=h||u>r&&h>p)&&(o>=c&&d>=o||l>=c&&d>=l||c>o&&l>d);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,a=t.ui.ddmanager.droppables[e.options.scope]||[],o=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||e&&!a[s].accept.call(a[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue t}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=t.ui.intersect(e,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return t.data(this,"ui-droppable").options.scope===n}),a.length&&(s=t.data(a[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}})(jQuery);(function(t){function e(t){return parseInt(t,10)||0}function i(t){return!isNaN(parseInt(t,10))}t.widget("ui.resizable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),a="ui-resizable-"+s,n=t("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,a;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=t(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,a),this._proportionallyResize()),t(this.handles[i]).length},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(t(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(t(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=e(this.helper.css("left")),n=e(this.helper.css("top")),o.containment&&(s+=t(o.containment).scrollLeft()||0,n+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(e){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,c=this.size.height,u=e.pageX-a.left||0,d=e.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[e,u,d]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==c&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||this._trigger("resize",e,this.ui()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&t.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,a=s?0:c.sizeDiff.width,o={width:c.helper.width()-a,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,h=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(o,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),i(t.left)&&(this.position.left=t.left),i(t.top)&&(this.position.top=t.top),i(t.height)&&(this.size.height=t.height),i(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,s=this.size,n=this.axis;return i(t.height)?t.width=t.height*this.aspectRatio:i(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(s.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(s.height-t.height),t.left=e.left+(s.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,s=this.axis,n=i(t.width)&&e.maxWidth&&e.maxWidth<t.width,a=i(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=i(t.width)&&e.minWidth&&e.minWidth>t.width,r=i(t.height)&&e.minHeight&&e.minHeight>t.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(s),u=/nw|ne|n/.test(s);return o&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),a&&(t.height=e.maxHeight),o&&c&&(t.left=h-e.minWidth),n&&c&&(t.left=h-e.maxWidth),r&&u&&(t.top=l-e.minHeight),a&&u&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var t,e,i,s,n,a=this.helper||this.element;for(t=0;this._proportionallyResizeElements.length>t;t++){if(n=this._proportionallyResizeElements[t],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],e=0;i.length>e;e++)this.borderDif[e]=(parseInt(i[e],10)||0)+(parseInt(s[e],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&t.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=t(this).data("ui-resizable"),c=l.options,u=l.element,d=c.containment,p=d instanceof t?d.get(0):/parent/.test(d)?u.parent().get(0):d;p&&(l.containerElement=t(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(i=t(p),s=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){s[t]=e(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=t.ui.hasScroll(p,"left")?p.scrollWidth:o,h=t.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(e){var i,s,n,a,o=t(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,c=o._aspectRatio||e.shiftKey,u={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-u.left),c&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),c&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-u.left:o.offset.left-u.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-u.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=Math.abs(o.parentData.left)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,c&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,c&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.containerOffset,n=e.containerPosition,a=e.containerElement,o=t(e.helper),r=o.offset(),h=o.outerWidth()-e.sizeDiff.width,l=o.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(a.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(a.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=function(e){t(e).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):t.each(i.alsoResize,function(t){s(t)})},resize:function(e,i){var s=t(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(a[e]=i||null)}),e.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size,n=e.originalSize,a=e.originalPosition,o=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&d>i.maxWidth,g=i.maxHeight&&p>i.maxHeight,m=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),v&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(o)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.top=a.top-u):/^(sw)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.left=a.left-c):(p-l>0?(e.size.height=p,e.position.top=a.top-u):(e.size.height=l,e.position.top=a.top+n.height-l),d-h>0?(e.size.width=d,e.position.left=a.left-c):(e.size.width=h,e.position.left=a.left+n.width-h))}})})(jQuery);(function(t){t.widget("ui.selectable",t.ui.mouse,{version:"1.10.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e=t(i.options.filter,i.element[0]),e.addClass("ui-selectee"),e.each(function(){var e=t(this),i=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:i.left,top:i.top,right:i.left+e.outerWidth(),bottom:i.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=t("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=e.pageX,l=e.pageY;return a>r&&(i=r,r=a,a=i),o>l&&(i=l,l=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:l-o}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),h=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?h=!(i.left>r||a>i.right||i.top>l||o>i.bottom):"fit"===n.tolerance&&(h=i.left>a&&r>i.right&&i.top>o&&l>i.bottom),h?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):undefined}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-t(document).scrollTop()<a.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-a.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<a.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+a.scrollSpeed)),e.pageX-t(document).scrollLeft()<a.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-a.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<a.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return n?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&s||"left"===o&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t("<td> </td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,o,a,r,h,l,c,u,d,p,f=null,g=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],g=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[g].containerCache.over||(this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1);else{for(a=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],o=this.items.length-1;o>=0;o--)t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))&&(u=this.items[o].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[o][l]-c)&&(d=!0,u+=this.items[o][l]),a>Math.abs(u-c)&&(a=Math.abs(u-c),r=this.items[o],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[g].element,!0),this._trigger("change",s,this._uiHash()),this.containers[g]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[g],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery);(function(e){var t=0,i={},a={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",a.height=a.paddingTop=a.paddingBottom=a.borderTopWidth=a.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.10.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e(),content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),undefined):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t),undefined)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,a=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:n=this.headers[(s+1)%a];break;case i.LEFT:case i.UP:n=this.headers[(s-1+a)%a];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:n=this.headers[0];break;case i.END:n=this.headers[a-1]}n&&(e(t.target).attr("tabIndex",-1),e(n).attr("tabIndex",0),n.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,a=this.options,s=a.heightStyle,n=this.element.parent(),r=this.accordionId="ui-accordion-"+(this.element.attr("id")||++t);this.active=this._findActive(a.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(t){var i=e(this),a=i.attr("id"),s=i.next(),n=s.attr("id");a||(a=r+"-header-"+t,i.attr("id",a)),n||(n=r+"-panel-"+t,s.attr("id",n)),i.attr("aria-controls",n),s.attr("aria-labelledby",a)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(a.event),"fill"===s?(i=n.height(),this.element.siblings(":visible").each(function(){var t=e(this),a=t.css("position");"absolute"!==a&&"fixed"!==a&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(i=0,this.headers.next().each(function(){i=Math.max(i,e(this).css("height","").height())}).height(i))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,a=this.active,s=e(t.currentTarget),n=s[0]===a[0],r=n&&i.collapsible,o=r?e():s.next(),h=a.next(),d={oldHeader:a,oldPanel:h,newHeader:r?e():s,newPanel:o};t.preventDefault(),n&&!i.collapsible||this._trigger("beforeActivate",t,d)===!1||(i.active=r?!1:this.headers.index(s),this.active=n?e():s,this._toggle(d),a.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&a.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),n||(s.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),s.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,a=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=a,this.options.animate?this._animate(i,a,t):(a.hide(),i.show(),this._toggleComplete(t)),a.attr({"aria-hidden":"true"}),a.prev().attr("aria-selected","false"),i.length&&a.length?a.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(e,t,s){var n,r,o,h=this,d=0,c=e.length&&(!t.length||e.index()<t.index()),l=this.options.animate||{},u=c&&l.down||l,v=function(){h._toggleComplete(s)};return"number"==typeof u&&(o=u),"string"==typeof u&&(r=u),r=r||u.easing||l.easing,o=o||u.duration||l.duration,t.length?e.length?(n=e.show().outerHeight(),t.animate(i,{duration:o,easing:r,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(a,{duration:o,easing:r,complete:v,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?d+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(n-t.outerHeight()-d),d=0)}}),undefined):t.animate(i,o,r,v):e.animate(a,o,r,v)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}})})(jQuery);(function(e){e.widget("ui.autocomplete",{version:"1.10.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,undefined;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),undefined):(this._searchTimeout(e),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(e),this._change(e),undefined)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:s})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):undefined},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<a>").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[e](t),undefined):(this.search(null,t),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.text(t))}})})(jQuery);(function(e){var t,i="ui-button ui-widget ui-state-default ui-corner-all",n="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",s=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},a=function(t){var i=t.name,n=t.form,s=e([]);return i&&(i=i.replace(/'/g,"\\'"),s=n?e(n).find("[name='"+i+"']"):e("[name='"+i+"']",t.ownerDocument).filter(function(){return!this.form})),s};e.widget("ui.button",{version:"1.10.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,s),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var n=this,o=this.options,r="checkbox"===this.type||"radio"===this.type,h=r?"":"ui-state-active";null===o.label&&(o.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(i).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){o.disabled||this===t&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){o.disabled||e(this).removeClass(h)}).bind("click"+this.eventNamespace,function(e){o.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),r&&this.element.bind("change"+this.eventNamespace,function(){n.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return o.disabled?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(o.disabled)return!1;e(this).addClass("ui-state-active"),n.buttonElement.attr("aria-pressed","true");var t=n.element[0];a(t).not(t).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return o.disabled?!1:(e(this).addClass("ui-state-active"),t=this,n.document.one("mouseup",function(){t=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return o.disabled?!1:(e(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(t){return o.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",o.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(i+" ui-state-active "+n).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.element.prop("disabled",!!t),t&&this.buttonElement.removeClass("ui-state-focus"),undefined):(this._resetButton(),undefined)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?a(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var t=this.buttonElement.removeClass(n),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,a=s.primary&&s.secondary,o=[];s.primary||s.secondary?(this.options.text&&o.push("ui-button-text-icon"+(a?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(o.push(a?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):o.push("ui-button-text-only"),t.addClass(o.join(" "))}}),e.widget("ui.buttonset",{version:"1.10.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(function(e,t){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all' style='display:none'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){e.datepicker._isDisabledDatepicker(n.inline?t.parent()[0]:n.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))})}function s(t,i){e.extend(t,i);for(var a in i)null==i[a]&&(t[a]=i[a]);return t}e.extend(e.ui,{datepicker:{version:"1.10.4"}});var n,r="datepicker";e.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return s(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var a,s,n;a=t.nodeName.toLowerCase(),s="div"===a||"span"===a,t.id||(this.uuid+=1,t.id="dp"+this.uuid),n=this._newInst(e(t),s),n.settings=e.extend({},i||{}),"input"===a?this._connectDatepicker(t,n):s&&this._inlineDatepicker(t,n)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var a=e(t);i.append=e([]),i.trigger=e([]),a.hasClass(this.markerClassName)||(this._attachments(a,i),a.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,r,i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var a,s,n,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=e("<span class='"+this._appendClass+"'>"+r+"</span>"),t[o?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),a=this._get(i,"showOn"),("focus"===a||"both"===a)&&t.focus(this._showDatepicker),("button"===a||"both"===a)&&(s=this._get(i,"buttonText"),n=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:n,alt:s,title:s}):e("<button type='button'></button>").addClass(this._triggerClass).html(n?e("<img/>").attr({src:n,alt:s,title:s}):s)),t[o?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,a,s,n=new Date(2009,11,20),r=this._get(e,"dateFormat");r.match(/[DM]/)&&(t=function(e){for(i=0,a=0,s=0;e.length>s;s++)e[s].length>i&&(i=e[s].length,a=s);return a},n.setMonth(t(this._get(e,r.match(/MM/)?"monthNames":"monthNamesShort"))),n.setDate(t(this._get(e,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-n.getDay())),e.input.attr("size",this._formatDate(e,n).length)}},_inlineDatepicker:function(t,i){var a=e(t);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(i.dpDiv),e.data(t,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,a,n,o){var u,c,h,l,d,p=this._dialogInst;return p||(this.uuid+=1,u="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+u+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},e.data(this._dialogInput[0],r,p)),s(p.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(c=document.documentElement.clientWidth,h=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[c/2-100+l,h/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(t){var i,a=e(t),s=e.data(t,r);a.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,r),"input"===i?(s.append.remove(),s.trigger.remove(),a.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&a.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().removeClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().addClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,a,n){var r,o,u,c,h=this._getInst(i);return 2===arguments.length&&"string"==typeof a?"defaults"===a?e.extend({},e.datepicker._defaults):h?"all"===a?e.extend({},h.settings):this._get(h,a):null:(r=a||{},"string"==typeof a&&(r={},r[a]=n),h&&(this._curInst===h&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),u=this._getMinMaxDate(h,"min"),c=this._getMinMaxDate(h,"max"),s(h.settings,r),null!==u&&r.dateFormat!==t&&r.minDate===t&&(h.settings.minDate=this._formatDate(h,u)),null!==c&&r.dateFormat!==t&&r.maxDate===t&&(h.settings.maxDate=this._formatDate(h,c)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(e(i),h),this._autoSize(h),this._setDate(h,o),this._updateAlternate(h),this._updateDatepicker(h)),t)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,a,s,n=e.datepicker._getInst(t.target),r=!0,o=n.dpDiv.is(".ui-datepicker-rtl");if(n._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),r=!1;break;case 13:return s=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",n.dpDiv),s[0]&&e.datepicker._selectDay(t.target,n.selectedMonth,n.selectedYear,s[0]),i=e.datepicker._get(n,"onSelect"),i?(a=e.datepicker._formatDate(n),i.apply(n.input?n.input[0]:null,[a,n])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?1:-1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?-1:1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),r=t.ctrlKey||t.metaKey;break;default:r=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(i){var a,s,n=e.datepicker._getInst(i.target);return e.datepicker._get(n,"constrainInput")?(a=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">s||!a||a.indexOf(s)>-1):t},_doKeyUp:function(t){var i,a=e.datepicker._getInst(t.target);if(a.input.val()!==a.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,e.datepicker._getFormatConfig(a)),i&&(e.datepicker._setDateFromField(a),e.datepicker._updateAlternate(a),e.datepicker._updateDatepicker(a))}catch(s){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,a,n,r,o,u,c;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),a=e.datepicker._get(i,"beforeShow"),n=a?a.apply(t,[t,i]):{},n!==!1&&(s(i.settings,n),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),r=!1,e(t).parents().each(function(){return r|="fixed"===e(this).css("position"),!r}),o={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),o=e.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(u=e.datepicker._get(i,"showAnim"),c=e.datepicker._get(i,"duration"),i.dpDiv.zIndex(e(t).zIndex()+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[u]?i.dpDiv.show(u,e.datepicker._get(i,"showOptions"),c):i.dpDiv[u||"show"](u?c:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,n=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,a=this._getNumberOfMonths(t),s=a[1],r=17;t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",r*s+"em"),t.dpDiv[(1!==a[0]||1!==a[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,a){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),r=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,u=document.documentElement.clientWidth+(a?0:e(document).scrollLeft()),c=document.documentElement.clientHeight+(a?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?s-r:0,i.left-=a&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=a&&i.top===t.input.offset().top+o?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+s>u&&u>s?Math.abs(i.left+s-u):0),i.top-=Math.min(i.top,i.top+n>c&&c>n?Math.abs(n+o):0),i},_findPos:function(t){for(var i,a=this._getInst(t),s=this._get(a,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[s?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,a,s,n,o=this._curInst;!o||t&&o!==e.data(t,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),a=this._get(o,"duration"),s=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),a,s):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?a:null,s),i||s(),this._datepickerShowing=!1,n=this._get(o,"onClose"),n&&n.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),a=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==a)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,a){var s=e(t),n=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(n,i+("M"===a?this._get(n,"showCurrentAtPos"):0),a),this._updateDatepicker(n))},_gotoToday:function(t){var i,a=e(t),s=this._getInst(a[0]);this._get(s,"gotoCurrent")&&s.currentDay?(s.selectedDay=s.currentDay,s.drawMonth=s.selectedMonth=s.currentMonth,s.drawYear=s.selectedYear=s.currentYear):(i=new Date,s.selectedDay=i.getDate(),s.drawMonth=s.selectedMonth=i.getMonth(),s.drawYear=s.selectedYear=i.getFullYear()),this._notifyChange(s),this._adjustDate(a)},_selectMonthYear:function(t,i,a){var s=e(t),n=this._getInst(s[0]);n["selected"+("M"===a?"Month":"Year")]=n["draw"+("M"===a?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(n),this._adjustDate(s)},_selectDay:function(t,i,a,s){var n,r=e(t);e(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(n=this._getInst(r[0]),n.selectedDay=n.currentDay=e("a",s).html(),n.selectedMonth=n.currentMonth=i,n.selectedYear=n.currentYear=a,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var a,s=e(t),n=this._getInst(s[0]);i=null!=i?i:this._formatDate(n),n.input&&n.input.val(i),this._updateAlternate(n),a=this._get(n,"onSelect"),a?a.apply(n.input?n.input[0]:null,[i,n]):n.input&&n.input.trigger("change"),n.inline?this._updateDatepicker(n):(this._hideDatepicker(),this._lastInput=n.input[0],"object"!=typeof n.input[0]&&n.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,a,s,n=this._get(t,"altField");n&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),a=this._getDate(t),s=this.formatDate(i,a,this._getFormatConfig(t)),e(n).each(function(){e(this).val(s)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(i,a,s){if(null==i||null==a)throw"Invalid arguments";if(a="object"==typeof a?""+a:a+"",""===a)return null;var n,r,o,u,c=0,h=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,l="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,p=(s?s.dayNames:null)||this._defaults.dayNames,g=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,m=(s?s.monthNames:null)||this._defaults.monthNames,f=-1,_=-1,v=-1,k=-1,y=!1,b=function(e){var t=i.length>n+1&&i.charAt(n+1)===e;return t&&n++,t},D=function(e){var t=b(e),i="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,s=RegExp("^\\d{1,"+i+"}"),n=a.substring(c).match(s);if(!n)throw"Missing number at position "+c;return c+=n[0].length,parseInt(n[0],10)},w=function(i,s,n){var r=-1,o=e.map(b(i)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,i){var s=i[1];return a.substr(c,s.length).toLowerCase()===s.toLowerCase()?(r=i[0],c+=s.length,!1):t}),-1!==r)return r+1;throw"Unknown name at position "+c},M=function(){if(a.charAt(c)!==i.charAt(n))throw"Unexpected literal at position "+c;c++};for(n=0;i.length>n;n++)if(y)"'"!==i.charAt(n)||b("'")?M():y=!1;else switch(i.charAt(n)){case"d":v=D("d");break;case"D":w("D",d,p);break;case"o":k=D("o");break;case"m":_=D("m");break;case"M":_=w("M",g,m);break;case"y":f=D("y");break;case"@":u=new Date(D("@")),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"!":u=new Date((D("!")-this._ticksTo1970)/1e4),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"'":b("'")?M():y=!0;break;default:M()}if(a.length>c&&(o=a.substr(c),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===f?f=(new Date).getFullYear():100>f&&(f+=(new Date).getFullYear()-(new Date).getFullYear()%100+(l>=f?0:-100)),k>-1)for(_=1,v=k;;){if(r=this._getDaysInMonth(f,_-1),r>=v)break;_++,v-=r}if(u=this._daylightSavingAdjust(new Date(f,_-1,v)),u.getFullYear()!==f||u.getMonth()+1!==_||u.getDate()!==v)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var a,s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,n=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,u=function(t){var i=e.length>a+1&&e.charAt(a+1)===t;return i&&a++,i},c=function(e,t,i){var a=""+t;if(u(e))for(;i>a.length;)a="0"+a;return a},h=function(e,t,i,a){return u(e)?a[t]:i[t]},l="",d=!1;if(t)for(a=0;e.length>a;a++)if(d)"'"!==e.charAt(a)||u("'")?l+=e.charAt(a):d=!1;else switch(e.charAt(a)){case"d":l+=c("d",t.getDate(),2);break;case"D":l+=h("D",t.getDay(),s,n);break;case"o":l+=c("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":l+=c("m",t.getMonth()+1,2);break;case"M":l+=h("M",t.getMonth(),r,o);break;case"y":l+=u("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=1e4*t.getTime()+this._ticksTo1970;break;case"'":u("'")?l+="'":d=!0;break;default:l+=e.charAt(a)}return l},_possibleChars:function(e){var t,i="",a=!1,s=function(i){var a=e.length>t+1&&e.charAt(t+1)===i;return a&&t++,a};for(t=0;e.length>t;t++)if(a)"'"!==e.charAt(t)||s("'")?i+=e.charAt(t):a=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":s("'")?i+="'":a=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,i){return e.settings[i]!==t?e.settings[i]:this._defaults[i]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),a=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),n=s,r=this._getFormatConfig(e);try{n=this.parseDate(i,a,r)||s}catch(o){a=t?"":a}e.selectedDay=n.getDate(),e.drawMonth=e.selectedMonth=n.getMonth(),e.drawYear=e.selectedYear=n.getFullYear(),e.currentDay=a?n.getDate():0,e.currentMonth=a?n.getMonth():0,e.currentYear=a?n.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,a){var s=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},n=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(a){}for(var s=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,n=s.getFullYear(),r=s.getMonth(),o=s.getDate(),u=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,c=u.exec(i);c;){switch(c[2]||"d"){case"d":case"D":o+=parseInt(c[1],10);break;case"w":case"W":o+=7*parseInt(c[1],10);break;case"m":case"M":r+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r));break;case"y":case"Y":n+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r))}c=u.exec(i)}return new Date(n,r,o)},r=null==i||""===i?a:"string"==typeof i?n(i):"number"==typeof i?isNaN(i)?a:s(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?a:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var a=!t,s=e.selectedMonth,n=e.selectedYear,r=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=r.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=r.getMonth(),e.drawYear=e.selectedYear=e.currentYear=r.getFullYear(),s===e.selectedMonth&&n===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(a?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),a="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(a,-i,"M")},next:function(){e.datepicker._adjustDate(a,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(a)},selectDay:function(){return e.datepicker._selectDay(a,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(a,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(a,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,a,s,n,r,o,u,c,h,l,d,p,g,m,f,_,v,k,y,b,D,w,M,C,x,I,N,T,A,E,S,Y,F,P,O,j,K,R,H=new Date,W=this._daylightSavingAdjust(new Date(H.getFullYear(),H.getMonth(),H.getDate())),L=this._get(e,"isRTL"),U=this._get(e,"showButtonPanel"),B=this._get(e,"hideIfNoPrevNext"),z=this._get(e,"navigationAsDateFormat"),q=this._getNumberOfMonths(e),G=this._get(e,"showCurrentAtPos"),J=this._get(e,"stepMonths"),Q=1!==q[0]||1!==q[1],V=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),$=this._getMinMaxDate(e,"min"),X=this._getMinMaxDate(e,"max"),Z=e.drawMonth-G,et=e.drawYear;if(0>Z&&(Z+=12,et--),X)for(t=this._daylightSavingAdjust(new Date(X.getFullYear(),X.getMonth()-q[0]*q[1]+1,X.getDate())),t=$&&$>t?$:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=z?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-J,1)),this._getFormatConfig(e)):i,a=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>":B?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>",s=this._get(e,"nextText"),s=z?this.formatDate(s,this._daylightSavingAdjust(new Date(et,Z+J,1)),this._getFormatConfig(e)):s,n=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>":B?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>",r=this._get(e,"currentText"),o=this._get(e,"gotoCurrent")&&e.currentDay?V:W,r=z?this.formatDate(r,o,this._getFormatConfig(e)):r,u=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",c=U?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(L?u:"")+(this._isInRange(e,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(L?"":u)+"</div>":"",h=parseInt(this._get(e,"firstDay"),10),h=isNaN(h)?0:h,l=this._get(e,"showWeek"),d=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),g=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),f=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),v=this._get(e,"selectOtherMonths"),k=this._getDefaultDate(e),y="",D=0;q[0]>D;D++){for(w="",this.maxRows=4,M=0;q[1]>M;M++){if(C=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),x=" ui-corner-all",I="",Q){if(I+="<div class='ui-datepicker-group",q[1]>1)switch(M){case 0:I+=" ui-datepicker-group-first",x=" ui-corner-"+(L?"right":"left");break;case q[1]-1:I+=" ui-datepicker-group-last",x=" ui-corner-"+(L?"left":"right");break;default:I+=" ui-datepicker-group-middle",x=""}I+="'>"}for(I+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+x+"'>"+(/all|left/.test(x)&&0===D?L?n:a:"")+(/all|right/.test(x)&&0===D?L?a:n:"")+this._generateMonthYearHeader(e,Z,et,$,X,D>0||M>0,g,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",N=l?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",b=0;7>b;b++)T=(b+h)%7,N+="<th"+((b+h+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[T]+"'>"+p[T]+"</span></th>";for(I+=N+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),E=(this._getFirstDayOfMonth(et,Z)-h+7)%7,S=Math.ceil((E+A)/7),Y=Q?this.maxRows>S?this.maxRows:S:S,this.maxRows=Y,F=this._daylightSavingAdjust(new Date(et,Z,1-E)),P=0;Y>P;P++){for(I+="<tr>",O=l?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(F)+"</td>":"",b=0;7>b;b++)j=f?f.apply(e.input?e.input[0]:null,[F]):[!0,""],K=F.getMonth()!==Z,R=K&&!v||!j[0]||$&&$>F||X&&F>X,O+="<td class='"+((b+h+6)%7>=5?" ui-datepicker-week-end":"")+(K?" ui-datepicker-other-month":"")+(F.getTime()===C.getTime()&&Z===e.selectedMonth&&e._keyEvent||k.getTime()===F.getTime()&&k.getTime()===C.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(K&&!_?"":" "+j[1]+(F.getTime()===V.getTime()?" "+this._currentClass:"")+(F.getTime()===W.getTime()?" ui-datepicker-today":""))+"'"+(K&&!_||!j[2]?"":" title='"+j[2].replace(/'/g,"'")+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+F.getMonth()+"' data-year='"+F.getFullYear()+"'")+">"+(K&&!_?" ":R?"<span class='ui-state-default'>"+F.getDate()+"</span>":"<a class='ui-state-default"+(F.getTime()===W.getTime()?" ui-state-highlight":"")+(F.getTime()===V.getTime()?" ui-state-active":"")+(K?" ui-priority-secondary":"")+"' href='#'>"+F.getDate()+"</a>")+"</td>",F.setDate(F.getDate()+1),F=this._daylightSavingAdjust(F);I+=O+"</tr>"}Z++,Z>11&&(Z=0,et++),I+="</tbody></table>"+(Q?"</div>"+(q[0]>0&&M===q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),w+=I}y+=w}return y+=c,e._keyEvent=!1,y},_generateMonthYearHeader:function(e,t,i,a,s,n,r,o){var u,c,h,l,d,p,g,m,f=this._get(e,"changeMonth"),_=this._get(e,"changeYear"),v=this._get(e,"showMonthAfterYear"),k="<div class='ui-datepicker-title'>",y="";if(n||!f)y+="<span class='ui-datepicker-month'>"+r[t]+"</span>";else{for(u=a&&a.getFullYear()===i,c=s&&s.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",h=0;12>h;h++)(!u||h>=a.getMonth())&&(!c||s.getMonth()>=h)&&(y+="<option value='"+h+"'"+(h===t?" selected='selected'":"")+">"+o[h]+"</option>");y+="</select>"}if(v||(k+=y+(!n&&f&&_?"":" ")),!e.yearshtml)if(e.yearshtml="",n||!_)k+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(l=this._get(e,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?d+parseInt(e,10):parseInt(e,10); return isNaN(t)?d:t},g=p(l[0]),m=Math.max(g,p(l[1]||"")),g=a?Math.max(g,a.getFullYear()):g,m=s?Math.min(m,s.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=g;g++)e.yearshtml+="<option value='"+g+"'"+(g===i?" selected='selected'":"")+">"+g+"</option>";e.yearshtml+="</select>",k+=e.yearshtml,e.yearshtml=null}return k+=this._get(e,"yearSuffix"),v&&(k+=(!n&&f&&_?"":" ")+y),k+="</div>"},_adjustInstDate:function(e,t,i){var a=e.drawYear+("Y"===i?t:0),s=e.drawMonth+("M"===i?t:0),n=Math.min(e.selectedDay,this._getDaysInMonth(a,s))+("D"===i?t:0),r=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(a,s,n)));e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),s=i&&i>t?i:t;return a&&s>a?a:s},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,a){var s=this._getNumberOfMonths(e),n=this._daylightSavingAdjust(new Date(i,a+(0>t?t:s[0]*s[1]),1));return 0>t&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(e,n)},_isInRange:function(e,t){var i,a,s=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),r=null,o=null,u=this._get(e,"yearRange");return u&&(i=u.split(":"),a=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=a),i[1].match(/[+\-].*/)&&(o+=a)),(!s||t.getTime()>=s.getTime())&&(!n||t.getTime()<=n.getTime())&&(!r||t.getFullYear()>=r)&&(!o||o>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,a){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var s=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(a,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),s,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new i,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.10.4"})(jQuery);(function(e){var t={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.10.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,a=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._destroyOverlay(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(s){}this._hide(this.uiDialog,this.options.hide,function(){a._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!t&&this._trigger("focus",e),i},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var e=this.element.find("[autofocus]");e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),undefined;if(t.keyCode===e.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),a=i.filter(":first"),s=i.filter(":last");t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==a[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(s.focus(1),t.preventDefault()):(a.focus(1),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html(" "),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(e.each(i,function(i,a){var s,n;a=e.isFunction(a)?{click:a,text:i}:a,a=e.extend({type:"button"},a),s=a.click,a.click=function(){s.apply(t.element[0],arguments)},n={icons:a.icons,text:a.showText},delete a.icons,delete a.showText,e("<button></button>",a).button(n).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,a=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(a,s){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",a,t(s))},drag:function(e,a){i._trigger("drag",e,t(a))},stop:function(s,n){a.position=[n.position.left-i.document.scrollLeft(),n.position.top-i.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",s,t(n))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,a=this.options,s=a.resizable,n=this.uiDialog.css("position"),r="string"==typeof s?s:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:a.maxWidth,maxHeight:a.maxHeight,minWidth:a.minWidth,minHeight:this._minHeight(),handles:r,start:function(a,s){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",a,t(s))},resize:function(e,a){i._trigger("resize",e,t(a))},stop:function(s,n){a.height=e(this).height(),a.width=e(this).width(),e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",s,t(n))}}).css("position",n)},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(a){var s=this,n=!1,r={};e.each(a,function(e,a){s._setOption(e,a),e in t&&(n=!0),e in i&&(r[e]=a)}),n&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",r)},_setOption:function(e,t){var i,a,s=this.uiDialog;"dialogClass"===e&&s.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=s.is(":data(ui-draggable)"),i&&!t&&s.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(a=s.is(":data(ui-resizable)"),a&&!t&&s.resizable("destroy"),a&&"string"==typeof t&&s.resizable("option","handles",t),a||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,a=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),a.minWidth>a.width&&(a.width=a.minWidth),e=this.uiDialog.css({height:"auto",width:a.width}).outerHeight(),t=Math.max(0,a.minHeight-e),i="number"==typeof a.maxHeight?Math.max(0,a.maxHeight-e):"none","auto"===a.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,a.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=this,i=this.widgetFullName;e.ui.dialog.overlayInstances||this._delay(function(){e.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(a){t._allowInteraction(a)||(a.preventDefault(),e(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),e.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(e.ui.dialog.overlayInstances--,e.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),e.ui.dialog.overlayInstances=0,e.uiBackCompat!==!1&&e.widget("ui.dialog",e.ui.dialog,{_position:function(){var t,i=this.options.position,a=[],s=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(a=i.split?i.split(" "):[i[0],i[1]],1===a.length&&(a[1]=a[0]),e.each(["left","top"],function(e,t){+a[e]===a[e]&&(s[e]=a[e],a[e]=t)}),i={my:a[0]+(0>s[0]?s[0]:"+"+s[0])+" "+a[1]+(0>s[1]?s[1]:"+"+s[1]),at:a.join(" ")}),i=e.extend({},e.ui.dialog.prototype.options.position,i)):i=e.ui.dialog.prototype.options.position,t=this.uiDialog.is(":visible"),t||this.uiDialog.show(),this.uiDialog.position(i),t||this.uiDialog.hide()}})})(jQuery);(function(t){t.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&t(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,l=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:l=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}l&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery);(function(t,e){t.widget("ui.progressbar",{version:"1.10.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})})(jQuery);(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,l,h,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-u.values(e));(n>i||n===i&&(e===u._lastChangedValue||u.values(e)===c.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),l=a.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-a.width()/2,top:e.pageY-l.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,l=this,h=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((l.values(s)-l._valueMin())/(l._valueMax()-l._valueMin())),u["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](u,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===s&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[h?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[h?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery);(function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>▲</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>▼</span>"+"</a>"},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})})(jQuery);(function(t,e){function i(){return++n}function s(t){return t=t.cloneNode(!1),t.hash.length>1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,c))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery);(function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.4",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=o),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function o(t){l.of=t,a.is(":hidden")||a.position(l)}var a,r,h,l=t.extend({},this.options.position);if(n){if(a=this._find(s),a.length)return a.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),a=this._tooltip(s),e(s,a.attr("id")),a.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:o}),o(i)):a.position(t.extend({of:s},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){a.is(":visible")&&(o(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:a}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(a)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),o.stop(!0),this._hide(o,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:o}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})})(jQuery);(function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),f(l,function(t,a){var o,r=a.re.exec(i),l=r&&a.parse(r),h=a.space||"rgba";return l?(o=s[h](l),s[c[h].cache]=o[c[h].cache],n=s._rgba=o._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,o,r,l){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,l],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof h?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if("alpha"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),a=c[n],o=0===this.alpha()?h("transparent"):this,r=o[a.cache]||a.to(o._rgba),l=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],h=s[a],c=u[n.type]||{};null!==h&&(null===o?l[a]=h:(c.mod&&(h-o>c.mod/2?o+=c.mod:o-h>c.mod/2&&(o-=c.mod)),l[a]=i((h-o)*e+o,n)))}),this[n](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),l=Math.min(s,n,a),h=r-l,c=r+l,u=.5*c;return e=l===r?0:s===r?60*(n-a)/h+360:n===r?60*(a-s)/h+120:60*(s-n)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[o]&&(this[o]=l(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=h(c(d)),n[o]=d,n):h(d)},f(a,function(e,i){h.fn[e]||(h.fn[e]=function(n){var a,o=t.type(n),l="alpha"===e?this._hsla?"hsla":"rgba":s,h=this[l](),c=h[i.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1))),h[i.idx]=n,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r="";if("transparent"!==n&&("string"!==t.type(n)||(a=s(n)))){if(n=h(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&o&&o.style;)try{r=t.css(o,"backgroundColor"),o=o.parentNode}catch(l){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},a=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var l=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",h=l.children?o.find("*").addBack():o;h=h.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+"Class"](e[i])})},a(),h=h.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),s=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,h.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return"boolean"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.4",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=""),t.css(s[a],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery);(function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var a,o,r,l=t(this),h=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(l,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",g=i.test(u),m={},v="show"===c;l.parent().is(".ui-effects-wrapper")?t.effects.save(l.parent(),h):t.effects.save(l,h),l.show(),a=t.effects.createWrapper(l).css({overflow:"hidden"}),o=a[p](),r=parseFloat(a.css(f))||0,m[p]=v?o:0,g||(l.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),m[f]=v?r:o+r),v&&(a.css(p,0),g||a.css(f,r+o)),a.animate(m,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&l.hide(),t.effects.restore(l,h),t.effects.removeWrapper(l),n()}})}})(jQuery);(function(t){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"effect"),h="hide"===l,c="show"===l,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||h?1:0),g=e.duration/f,m=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||h)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,g,m)),h&&(d/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m).animate(a,g,m),d=h?2*d:d/2;h&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m)),o.queue(function(){h&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}})(jQuery);(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"hide"),h="show"===l,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),h&&(n.css(d,0),n.css(p,a/2)),f[d]=h?a:0,f[p]=h?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){h||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(h,"pos"===c?-s:s),u[h]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),g||p.hide(),i()}var a,o,r,l,h,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),g="show"===f,m=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(a=0;u>a;a++)for(l=m.top+a*_,c=a-(u-1)/2,o=0;d>o;o++)r=m.left+o*v,h=o-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(g?h*v:0),top:l+(g?c*_:0),opacity:g?0:1}).animate({left:r+(g?0:h*v),top:l+(g?0:c*_),opacity:g?1:0},e.duration||500,e.easing,s)}})(jQuery);(function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}})(jQuery);(function(t){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),l="show"===r,h="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=l!==d,f=p?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[h?0:1]),l&&s.css(d?{height:0,width:c}:{height:c,width:0}),m[f[0]]=l?n[0]:c,v[f[1]]=l?n[1]:0,s.animate(m,g,e.easing).animate(v,g,e.easing,function(){h&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}})(jQuery);(function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}})(jQuery);(function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,l=o||"hide"===a,h=2*(e.times||5)+(l?1:0),c=e.duration/h,u=0,d=n.queue(),p=d.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;h>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,h+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?l:{height:l.height*r,width:l.width*r,outerHeight:l.outerHeight*r,outerWidth:l.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",l=e.origin,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=l||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:h),n.to={height:h.height*c.y,width:h.width*c.x,outerHeight:h.outerHeight*c.y,outerWidth:h.outerWidth*c.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(o,e.mode||"effect"),f=e.restore||"effect"!==p,g=e.scale||"both",m=e.origin||["middle","center"],v=o.css("position"),_=f?r:l,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===p?(o.from=e.to||b,o.to=e.from||s):(o.from=e.from||("show"===p?b:s),o.to=e.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===g||"both"===g)&&(a.from.y!==a.to.y&&(_=_.concat(u),o.from=t.effects.setTransition(o,u,a.from.y,o.from),o.to=t.effects.setTransition(o,u,a.to.y,o.to)),a.from.x!==a.to.x&&(_=_.concat(d),o.from=t.effects.setTransition(o,d,a.from.x,o.from),o.to=t.effects.setTransition(o,d,a.to.x,o.to))),("content"===g||"both"===g)&&a.from.y!==a.to.y&&(_=_.concat(c).concat(h),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),t.effects.save(o,_),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(n=t.effects.getBaseline(m,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===g||"both"===g)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),h=r.concat(u).concat(d),o.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,h),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,u,a.from.y,i.from),i.to=t.effects.setTransition(i,u,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,d,a.from.x,i.from),i.to=t.effects.setTransition(i,d,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,h)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),t.effects.restore(o,_),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",l=e.distance||20,h=e.times||3,c=2*h+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},g={},m={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+l,g[d]=(p?"+=":"-=")+2*l,m[d]=(p?"-=":"+=")+2*l,n.animate(f,u,e.easing),s=1;h>s;s++)n.animate(g,u,e.easing).animate(m,u,e.easing);n.animate(g,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(h,c?isNaN(s)?"-"+s:-s:s),u[h]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,l=a?o.scrollLeft():0,h=n.offset(),c={top:h.top-r,left:h.left-l,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-l,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}})(jQuery); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/jquery.autonumeric.js?v=20220209161352 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 0123456789 |
| Request Header - size: 500 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/jquery.autonumeric.js?v=20220209161352 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:05 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 63255 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 63,255 bytes. |
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?exports.autonumeric=t(require("jquery")):e.autonumeric=t(e.jQuery)}(this,function(e){return function(e){function t(i){if(a[i])return a[i].exports;var r=a[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var a={};return t.m=e,t.c=a,t.p="",t(0)}([function(e,t,a){var i,r,n;a(1),a(1);(function(){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var a=0;a<t.length;a++){var i=t[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,a,i){return a&&e(t.prototype,a),i&&e(t,i),t}}(),s=function(){function e(e,t){var a=[],i=!0,r=!1,n=void 0;try{for(var o,l=e[Symbol.iterator]();!(i=(o=l.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(e){r=!0,n=e}finally{try{!i&&l.return&&l.return()}finally{if(r)throw n}}return a}return function(t,a){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=void 0,d=void 0,m=void 0,h=void 0,g=void 0,v=void 0,p=["b","caption","cite","code","const","dd","del","div","dfn","dt","em","h1","h2","h3","h4","h5","h6","ins","kdb","label","li","option","output","p","q","s","sample","span","strong","td","th","u"],f={digitGroupSeparator:",",noSeparatorOnFocus:!1,digitalGroupSpacing:"3",decimalCharacter:".",decimalCharacterAlternative:null,currencySymbol:"",currencySymbolPlacement:"p",negativePositiveSignPlacement:null,showPositiveSign:!1,suffixText:"",overrideMinMaxLimits:null,maximumValue:"9999999999999.99",minimumValue:"-9999999999999.99",decimalPlacesOverride:null,decimalPlacesShownOnFocus:null,scaleDivisor:null,scaleDecimalPlaces:null,scaleSymbol:null,saveValueToSessionStorage:!1,onInvalidPaste:"error",roundingMethod:"S",allowDecimalPadding:!0,negativeBracketsTypeOnBlur:null,emptyInputBehavior:"focus",leadingZero:"deny",formatOnPageLoad:!0,selectNumberOnly:!1,defaultValueOverride:null,unformatOnSubmit:!1,outputFormat:null,showWarnings:!0,failOnUnknownOption:!1},y={Backspace:8,Tab:9,Enter:13,Shift:16,Ctrl:17,Alt:18,PauseBreak:19,CapsLock:20,Esc:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,LeftArrow:37,UpArrow:38,RightArrow:39,DownArrow:40,Insert:45,Delete:46,num0:48,num1:49,num2:50,num3:51,num4:52,num5:53,num6:54,num7:55,num8:56,num9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,Windows:91,RightClick:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,MultiplyNumpad:106,PlusNumpad:107,MinusNumpad:109,DotNumpad:110,SlashNumpad:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,MyComputer:182,MyCalculator:183,Semicolon:186,Equal:187,Comma:188,Hyphen:189,Dot:190,Slash:191,Backquote:192,LeftBracket:219,Backslash:220,RightBracket:221,Quote:222,Command:224},S={Unidentified:"Unidentified",Alt:"Alt",AltGr:"AltGraph",CapsLock:"CapsLock",Ctrl:"Control",Fn:"Fn",FnLock:"FnLock",Hyper:"Hyper",Meta:"Meta",Windows:"Meta",Command:"Meta",NumLock:"NumLock",ScrollLock:"ScrollLock",Shift:"Shift",Super:"Super",Symbol:"Symbol",SymbolLock:"SymbolLock",Enter:"Enter",Tab:"Tab",Space:" ",DownArrow:"ArrowDown",LeftArrow:"ArrowLeft",RightArrow:"ArrowRight",UpArrow:"ArrowUp",End:"End",Home:"Home",PageDown:"PageDown",PageUp:"PageUp",Backspace:"Backspace",Clear:"Clear",Copy:"Copy",CrSel:"CrSel",Cut:"Cut",Delete:"Delete",EraseEof:"EraseEof",ExSel:"ExSel",Insert:"Insert",Paste:"Paste",Redo:"Redo",Undo:"Undo",Accept:"Accept",Again:"Again",Attn:"Attn",Cancel:"Cancel",ContextMenu:"ContextMenu",Esc:"Escape",Execute:"Execute",Find:"Find",Finish:"Finish",Help:"Help",Pause:"Pause",Play:"Play",Props:"Props",Select:"Select",ZoomIn:"ZoomIn",ZoomOut:"ZoomOut",BrightnessDown:"BrightnessDown",BrightnessUp:"BrightnessUp",Eject:"Eject",LogOff:"LogOff",Power:"Power",PowerOff:"PowerOff",PrintScreen:"PrintScreen",Hibernate:"Hibernate",Standby:"Standby",WakeUp:"WakeUp",Compose:"Compose",Dead:"Dead",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F11",F12:"F12",Print:"Print",num0:"0",num1:"1",num2:"2",num3:"3",num4:"4",num5:"5",num6:"6",num7:"7",num8:"8",num9:"9",numpad0:"0",numpad1:"1",numpad2:"2",numpad3:"3",numpad4:"4",numpad5:"5",numpad6:"6",numpad7:"7",numpad8:"8",numpad9:"9",a:"a",b:"b",c:"c",d:"d",e:"e",f:"f",g:"g",h:"h",i:"i",j:"j",k:"k",l:"l",m:"m",n:"n",o:"o",p:"p",q:"q",r:"r",s:"s",t:"t",u:"u",v:"v",w:"w",x:"x",y:"y",z:"z",MultiplyNumpad:"*",PlusNumpad:"+",MinusNumpad:"-",DotNumpad:".",SlashNumpad:"/",Semicolon:";",Equal:"=",Comma:",",Hyphen:"-",Minus:"-",Plus:"+",Dot:".",Slash:"/",Backquote:"`",LeftBracket:"[",RightBracket:"]",Backslash:"\\",Quote:"'"},b="-999999999999.99",P="999999999999.99",C="U",w="deny",x=!0,O={French:{digitGroupSeparator:".",decimalCharacter:",",decimalCharacterAlternative:".",currencySymbol:" €",currencySymbolPlacement:"s",selectNumberOnly:x,roundingMethod:C,leadingZero:w,minimumValue:b,maximumValue:P},NorthAmerican:{digitGroupSeparator:",",decimalCharacter:".",currencySymbol:"$",currencySymbolPlacement:"p",selectNumberOnly:x,roundingMethod:C,leadingZero:w,minimumValue:b,maximumValue:P},British:{digitGroupSeparator:",",decimalCharacter:".",currencySymbol:"£",currencySymbolPlacement:"p",selectNumberOnly:x,roundingMethod:C,leadingZero:w,minimumValue:b,maximumValue:P},Swiss:{digitGroupSeparator:"'",decimalCharacter:".",currencySymbol:" CHF",currencySymbolPlacement:"s",selectNumberOnly:x,roundingMethod:C,leadingZero:w,minimumValue:b,maximumValue:P},Japanese:{digitGroupSeparator:",",decimalCharacter:".",currencySymbol:"¥",currencySymbolPlacement:"p",selectNumberOnly:x,roundingMethod:C,leadingZero:w,minimumValue:b,maximumValue:P}};O.Spanish=O.French,O.Chinese=O.Japanese,function(o){r=[a(1)],i=o,n="function"==typeof i?i.apply(t,r):i,!(void 0!==n&&(e.exports=n))}(function(e){function t(e){return null===e}function a(e){return void 0===e}function i(e){return null===e||void 0===e||""===e}function r(e){return"string"==typeof e||e instanceof String}function n(e){return"boolean"==typeof e}function b(e){var t=String(e).toLowerCase();return"true"===t||"false"===t}function P(e){return"object"===("undefined"==typeof e?"undefined":c(e))&&null!==e&&!Array.isArray(e)}function C(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function w(e){return!F(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function x(e){return"number"==typeof e&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)}function N(e,t){return Q(e,t.settingsClone,!0).replace(t.settingsClone.decimalCharacter,".")}function k(e,t){return!(!r(e)||!r(t)||""===e||""===t)&&e.indexOf(t)!==-1}function V(e,t){return!(!F(t)||t===[]||a(e))&&t.indexOf(e)!==-1}function F(e){if("[object Array]"===Object.prototype.toString.call([]))return Array.isArray(e)||"object"===("undefined"==typeof e?"undefined":c(e))&&"[object Array]"===Object.prototype.toString.call(e);throw new Error("toString message changed for Object Array")}function A(e){var t=e.split("."),i=s(t,2),r=i[1];return a(r)?0:r.length}function T(e){return"undefined"==typeof e.which?e.keyCode:e.which}function D(e){return"undefined"==typeof e.key||"Unidentified"===e.key?String.fromCharCode(T(e)):e.key}function B(e,t,a){var i=le(e);return se(t,i)>-1&&se(a,i)<1}function L(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?k(e,"-"):M(e)}function M(e){return"-"===e.charAt(0)}function E(e){return!/[1-9]/g.test(e)}function I(e){return M(e)?e:"-"+e}function _(e,t,a){return""+e.substr(0,t)+a+e.substr(t+a.length)}function K(e,t){return Math.max(t.minimumValue,Math.min(t.maximumValue,e))}function R(e,t,a){for(var i=new RegExp("[0-9"+a+"-]"),r=0,n=0;n<t;n++)i.test(e[n])&&r++;return r}function U(e,t,a,i){var r=a.length,n=e.length,o=void 0,l=0;for(o=0;o<r&&l<n&&l<t;o++)(e[l]===a[o]||"."===e[l]&&a[o]===i)&&l++;return o}function j(e,t){for(var a=0,i=0;i<t.length;i++)t[i]===e&&a++;return a}function G(e){return Math.max(e,e-1)}function $(e){var t={};if(a(e.selectionStart)){e.focus();var i=document.selection.createRange();t.length=i.text.length,i.moveStart("character",-e.value.length),t.end=i.text.length,t.start=t.end-t.length}else t.start=e.selectionStart,t.end=e.selectionEnd,t.length=t.end-t.start;return t}function Z(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(i(r)&&(r=t),a(e.selectionStart)){e.focus();var n=e.createTextRange();n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n.select()}else e.selectionStart=t,e.selectionEnd=r}function z(e){throw new Error(e)}function H(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t&&console.warn("Warning: "+e)}function q(t,a){e.each(a,function(e,i){"function"==typeof i?a[e]=i(t,a,e):"function"==typeof t.autoNumeric[i]&&(a[e]=t.autoNumeric[i](t,a,e))})}function W(e,t){return Math.max(A(e),A(t))}function Q(e,t,i){if(""!==t.currencySymbol&&(e=e.replace(t.currencySymbol,"")),t.suffixText)for(;k(e,t.suffixText);)e=e.replace(t.suffixText,"");e=e.replace(t.skipFirstAutoStrip,"$1$2"),("s"===t.negativePositiveSignPlacement||"s"===t.currencySymbolPlacement&&"p"!==t.negativePositiveSignPlacement)&&L(e)&&""!==e&&(t.trailingNegative=!0),e=e.replace(t.skipLastAutoStrip,"$1"),e=e.replace(t.allowedAutoStrip,""),t.decimalCharacterAlternative&&(e=e.replace(t.decimalCharacterAlternative,t.decimalCharacter));var r=e.match(t.numRegAutoStrip);if(e=r?[r[1],r[2],r[3]].join(""):"","allow"===t.leadingZero||"keep"===t.leadingZero){var n="",o=e.split(t.decimalCharacter),l=s(o,2),c=l[0],u=l[1],d=c;k(d,t.negativeSignCharacter)&&(n=t.negativeSignCharacter,d=d.replace(t.negativeSignCharacter,"")),""===n&&d.length>t.mIntPos&&"0"===d.charAt(0)&&(d=d.slice(1)),""!==n&&d.length>t.mIntNeg&&"0"===d.charAt(0)&&(d=d.slice(1)),e=""+n+d+(a(u)?"":t.decimalCharacter+u)}return(i&&"deny"===t.leadingZero||!t.hasFocus&&"allow"===t.leadingZero)&&(e=e.replace(t.stripReg,"$1$2")),e}function J(e,t){if("p"===t.currencySymbolPlacement&&"l"===t.negativePositiveSignPlacement||"s"===t.currencySymbolPlacement&&"p"===t.negativePositiveSignPlacement){var a=t.negativeBracketsTypeOnBlur.split(","),i=s(a,2),r=i[0],n=i[1];t.hasFocus?t.hasFocus&&e.charAt(0)===r&&(e=e.replace(r,t.negativeSignCharacter),e=e.replace(n,"")):(e=e.replace(t.negativeSignCharacter,""),e=r+e+n)}return e}function Y(e,t){e=e.replace(t.currencySymbol,""),e=e.replace(t.digitGroupSeparator,""),"."!==t.decimalCharacter&&(e=e.replace(t.decimalCharacter,".")),L(e)&&e.lastIndexOf("-")===e.length-1&&(e=e.replace("-",""),e="-"+e);var a=_e(e,!0,!1,!1);return isNaN(a)||(e=a.toString()),e}function X(e,a){if(t(a)||"string"===a)return e;var i=void 0;switch(a){case"number":i=Number(e);break;case".-":i=L(e)?e.replace("-","")+"-":e;break;case",":case"-,":i=e.replace(".",",");break;case",-":i=e.replace(".",","),i=L(i)?i.replace("-","")+"-":i;break;case".":case"-.":i=e;break;default:z("The given outputFormat ["+a+"] option is not recognized.")}return i}function ee(e,t){return"."!==t.decimalCharacter&&(e=e.replace(t.decimalCharacter,".")),"-"!==t.negativeSignCharacter&&""!==t.negativeSignCharacter&&(e=e.replace(t.negativeSignCharacter,"-")),e.match(/\d/)||(e+="0"),e}function te(e,t){return"-"!==t.negativeSignCharacter&&""!==t.negativeSignCharacter&&(e=e.replace("-",t.negativeSignCharacter)),"."!==t.decimalCharacter&&(e=e.replace(".",t.decimalCharacter)),e}function ae(e,t,a){return""===e||e===t.negativeSignCharacter?"always"===t.emptyInputBehavior||a?"l"===t.negativePositiveSignPlacement?e+t.currencySymbol+t.suffixText:t.currencySymbol+e+t.suffixText:e:null}function ie(e,i){i.strip&&(e=Q(e,i,!1)),i.trailingNegative&&!L(e)&&(e="-"+e);var r=ae(e,i,!0),n=L(e),o=E(e);if(n&&(e=e.replace("-","")),!t(r))return r;i.digitalGroupSpacing=i.digitalGroupSpacing.toString();var l=void 0;switch(i.digitalGroupSpacing){case"2":l=/(\d)((\d)(\d{2}?)+)$/;break;case"2s":l=/(\d)((?:\d{2}){0,2}\d{3}(?:(?:\d{2}){2}\d{3})*?)$/;break;case"4":l=/(\d)((\d{4}?)+)$/;break;default:l=/(\d)((\d{3}?)+)$/}var c=e.split(i.decimalCharacter),u=s(c,2),d=u[0],m=u[1];if(i.decimalCharacterAlternative&&a(m)){var h=e.split(i.decimalCharacterAlternative),g=s(h,2);d=g[0],m=g[1]}if(""!==i.digitGroupSeparator)for(;l.test(d);)d=d.replace(l,"$1"+i.digitGroupSeparator+"$2");if(0===i.decimalPlacesOverride||a(m)?e=d:(m.length>i.decimalPlacesOverride&&(m=m.substring(0,i.decimalPlacesOverride)),e=d+i.decimalCharacter+m),i.trailingNegative=!1,"p"===i.currencySymbolPlacement)if(n)switch(i.negativePositiveSignPlacement){case"l":e=""+i.negativeSignCharacter+i.currencySymbol+e;break;case"r":e=""+i.currencySymbol+i.negativeSignCharacter+e;break;case"s":e=""+i.currencySymbol+e+i.negativeSignCharacter,i.trailingNegative=!0}else if(i.showPositiveSign&&!o)switch(i.negativePositiveSignPlacement){case"l":e=""+i.positiveSignCharacter+i.currencySymbol+e;break;case"r":e=""+i.currencySymbol+i.positiveSignCharacter+e;break;case"s":e=""+i.currencySymbol+e+i.positiveSignCharacter}else e=i.currencySymbol+e;if("s"===i.currencySymbolPlacement)if(n)switch(i.negativePositiveSignPlacement){case"r":e=""+e+i.currencySymbol+i.negativeSignCharacter,i.trailingNegative=!0;break;case"l":e=""+e+i.negativeSignCharacter+i.currencySymbol,i.trailingNegative=!0;break;case"p":e=""+i.negativeSignCharacter+e+i.currencySymbol}else if(i.showPositiveSign&&!o)switch(i.negativePositiveSignPlacement){case"r":e=""+e+i.currencySymbol+i.positiveSignCharacter;break;case"l":e=""+e+i.positiveSignCharacter+i.currencySymbol;break;case"p":e=""+i.positiveSignCharacter+e+i.currencySymbol}else e+=i.currencySymbol;return null!==i.negativeBracketsTypeOnBlur&&(i.rawValue<0||M(e))&&(e=J(e,i)),e+i.suffixText}function re(e,t){var a=void 0;switch(t){case 0:a=/(\.(?:\d*[1-9])?)0*$/;break;case 1:a=/(\.\d(?:\d*[1-9])?)0*$/;break;default:a=new RegExp("(\\.\\d{"+t+"}(?:\\d*[1-9])?)0*")}return e=e.replace(a,"$1"),0===t&&(e=e.replace(/\.$/,"")),e}function ne(e,t){if(e=""===e?"0":e.toString(),"N05"===t.roundingMethod||"CHF"===t.roundingMethod||"U05"===t.roundingMethod||"D05"===t.roundingMethod){switch(t.roundingMethod){case"N05":e=(Math.round(20*e)/20).toString();break;case"U05":e=(Math.ceil(20*e)/20).toString();break;default:e=(Math.floor(20*e)/20).toString()}var a=void 0;return a=k(e,".")?e.length-e.indexOf(".")<3?e+"0":e:e+".00"}var i="",r=0,n="",o=void 0;o=t.allowDecimalPadding?t.decimalPlacesOverride:0,M(e)&&(n="-",e=e.replace("-","")),e.match(/^\d/)||(e="0"+e),0===Number(e)&&(n=""),(Number(e)>0&&"keep"!==t.leadingZero||e.length>0&&"allow"===t.leadingZero)&&(e=e.replace(/^0*(\d)/,"$1"));var l=e.lastIndexOf("."),s=l===-1,c=s?e.length-1:l,u=e.length-1-c;if(u<=t.decimalPlacesOverride){if(i=e,u<o){s&&(i+=t.decimalCharacter);for(var d="000000";u<o;)d=d.substring(0,o-u),i+=d,u+=d.length}else u>o?i=re(i,o):0===u&&0===o&&(i=i.replace(/\.$/,""));return 0===Number(i)?i:n+i}var m=void 0;m=s?t.decimalPlacesOverride-1:t.decimalPlacesOverride+l;var h=Number(e.charAt(m+1)),g="."===e.charAt(m)?e.charAt(m-1)%2:e.charAt(m)%2,v=e.substring(0,m+1).split("");if(h>4&&"S"===t.roundingMethod||h>4&&"A"===t.roundingMethod&&""===n||h>5&&"A"===t.roundingMethod&&"-"===n||h>5&&"s"===t.roundingMethod||h>5&&"a"===t.roundingMethod&&""===n||h>4&&"a"===t.roundingMethod&&"-"===n||h>5&&"B"===t.roundingMethod||5===h&&"B"===t.roundingMethod&&1===g||h>0&&"C"===t.roundingMethod&&""===n||h>0&&"F"===t.roundingMethod&&"-"===n||h>0&&"U"===t.roundingMethod)for(r=v.length-1;r>=0;r-=1)if("."!==v[r]){if(v[r]=+v[r]+1,v[r]<10)break;r>0&&(v[r]="0")}return v=v.slice(0,m+1),i=re(v.join(""),o),0===Number(i)?i:n+i}function oe(e,t,a){if(e=a?ne(e,t):e,t.decimalCharacter&&t.decimalPlacesOverride){var i=e.split(t.decimalCharacter),r=s(i,2),n=r[0],o=r[1];if(o&&o.length>t.decimalPlacesOverride)if(t.decimalPlacesOverride>0){var l=o.substring(0,t.decimalPlacesOverride);e=""+n+t.decimalCharacter+l}else e=n}return e}function le(e){var t={},a=void 0,i=void 0,r=void 0,n=void 0;if(0===e&&1/e<0&&(e="-0"),e=e.toString(),M(e)?(e=e.slice(1),t.s=-1):t.s=1,a=e.indexOf("."),a>-1&&(e=e.replace(".","")),a<0&&(a=e.length),i=e.search(/[1-9]/i)===-1?e.length:e.search(/[1-9]/i),r=e.length,i===r)t.e=0,t.c=[0];else{for(n=r-1;"0"===e.charAt(n);n-=1)r-=1;for(r-=1,t.e=a-i-1,t.c=[],a=0;i<=r;i+=1)t.c[a]=+e.charAt(i),a+=1}return t}function se(e,t){var a=t.c,i=e.c,r=t.s,n=e.s,o=t.e,l=e.e;if(!a[0]||!i[0]){var s=void 0;return s=a[0]?r:i[0]?-n:0}if(r!==n)return r;var c=r<0;if(o!==l)return o>l^c?1:-1;for(r=-1,o=a.length,l=i.length,n=o<l?o:l,r+=1;r<n;r+=1)if(a[r]!==i[r])return a[r]>i[r]^c?1:-1;var u=void 0;return u=o===l?0:o>l^c?1:-1}function ce(e,t){e=e.toString(),e=e.replace(",",".");var a=le(t.minimumValue),i=le(t.maximumValue),r=le(e),n=void 0;switch(t.overrideMinMaxLimits){case"floor":n=[se(a,r)>-1,!0];break;case"ceiling":n=[!0,se(i,r)<1];break;case"ignore":n=[!0,!0];break;default:n=[se(a,r)>-1,se(i,r)<1]}return n}function ue(t){return r(t)&&(t="#"+t.replace(/(:|\.|\[|]|,|=)/g,"\\$1")),e(t)}function de(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.data("autoNumeric");r||(r={},e.data("autoNumeric",r));var n=r.holder;return(i||a(n)&&t)&&(n=new Re(e.get(0),t),r.holder=n),n}function me(e){e.oDec=e.decimalPlacesOverride,e.oPad=e.allowDecimalPadding,e.oBracket=e.negativeBracketsTypeOnBlur,e.oSep=e.digitGroupSeparator,e.oSign=e.currencySymbol,e.oSuffix=e.suffixText}function he(e){for(var t=e+"=",a=document.cookie.split(";"),i="",r=0;r<a.length;r+=1){for(i=a[r];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null}function ge(){var e="modernizr";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(e){return!1}}function ve(e,t){return""===e?"":0===Number(e)&&"keep"!==t.leadingZero?"0":("keep"!==t.leadingZero&&(e=e.replace(/^(-)?0+(?=\d)/g,"$1"),k(e,".")&&(e=e.replace(/(\.[0-9]*?)0+$/,"$1"))),e=e.replace(/\.$/,""))}function pe(e){var t=e.split("."),a=s(t,2),r=a[0],n=a[1];if(i(n))return r;var o=n.replace(/0+$/g,""),l=void 0;return l=""===o?r:r+"."+o}function fe(e,t,i){if(t.saveValueToSessionStorage){var r=""===e.name||a(e.name)?"AUTO_"+e.id:"AUTO_"+decodeURIComponent(e.name),n=void 0,o=void 0;if(ge()===!1)switch(i){case"set":document.cookie=r+"="+t.rawValue+"; expires= ; path=/";break;case"wipe":n=new Date,n.setTime(n.getTime()+-864e5),o="; expires="+n.toUTCString(),document.cookie=r+"='' ;"+o+"; path=/";break;case"get":return he(r)}else switch(i){case"set":sessionStorage.setItem(r,t.rawValue);break;case"wipe":sessionStorage.removeItem(r);break;case"get":return sessionStorage.getItem(r)}}}function ye(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],a=arguments[1],i=ue(a),r=e("form").index(i),n=e("form:eq("+r+")")[0],o=[],l=[],u=/^(?:submit|button|image|reset|file)$/i,d=/^(?:input|select|textarea|keygen)/i,m=/^(?:checkbox|radio)$/i,h=/^(?:button|checkbox|color|date|datetime|datetime-local|email|file|image|month|number|password|radio|range|reset|search|submit|time|url|week)/i,g=0;if(e.each(n,function(e,t){""===t.name||!d.test(t.localName)||u.test(t.type)||t.disabled||!t.checked&&m.test(t.type)?l.push(-1):(l.push(g),g++)}),g=0,e.each(n,function(e,t){"input"!==t.localName||""!==t.type&&"text"!==t.type&&"hidden"!==t.type&&"tel"!==t.type?(o.push(-1),"input"===t.localName&&h.test(t.type)&&g++):(o.push(g),g++)}),t){var v=i.serializeArray();return e.each(v,function(t,a){var i=l.indexOf(t);if(i>-1&&o[i]>-1){var n=e("form:eq("+r+") input:eq("+o[i]+")"),s=n.data("autoNumeric");"object"===("undefined"==typeof s?"undefined":c(s))&&(a.value=n.autoNumeric("getLocalized").toString())}}),v}var p=function(){var t=i.serialize(),a=t.split("&");return e.each(a,function(t){var i=a[t].split("="),n=s(i,2),u=n[0],d=n[1],m=l.indexOf(t);if(m>-1&&o[m]>-1){var h=e("form:eq("+r+") input:eq("+o[m]+")"),g=h.data("autoNumeric");if("object"===("undefined"==typeof g?"undefined":c(g))&&null!==d){var v=h.autoNumeric("getLocalized").toString();a[t]=u+"="+v}}}),{v:a.join("&")}}();if("object"===("undefined"==typeof p?"undefined":c(p)))return p.v}function Se(e,t,a){var i=t.settingsClone;if("focusin"===a.type||"mouseenter"===a.type&&!e.is(":focus")&&"focus"===i.emptyInputBehavior){i.hasFocus=!0,null!==i.negativeBracketsTypeOnBlur&&""!==i.negativeSignCharacter&&e.val(J(a.target.value,i));var r=Q(a.target.value,i,!0);r=Y(r,i),r=ve(r,i),i.trailingNegative&&(r="-"+r),i.decimalPlacesShownOnFocus?(i.decimalPlacesOverride=i.decimalPlacesShownOnFocus,e.autoNumeric("set",i.rawValue)):i.scaleDivisor?(i.decimalPlacesOverride=i.oDec,e.autoNumeric("set",i.rawValue)):i.noSeparatorOnFocus?(i.digitGroupSeparator="",i.currencySymbol="",i.suffixText="",e.autoNumeric("set",i.rawValue)):r!==i.rawValue&&e.autoNumeric("set",r),t.valueOnFocus=a.target.value,t.lastVal=t.valueOnFocus;var n=ae(t.valueOnFocus,i,!0);null!==n&&""!==n&&"focus"===i.emptyInputBehavior&&(e.val(n),n===i.currencySymbol&&"s"===i.currencySymbolPlacement&&Z(a.target,0,0))}}function be(e,t){return e._updateAutoNumericHolderEventKeycode(t),e.initialValueOnKeydown=t.target.value,e.that.readOnly?void(e.processed=!0):(e.eventKeyCode===y.Enter&&e.valueOnFocus!==t.target.value&&(Ke("change",t.target),e.valueOnFocus=t.target.value),e._updateAutoNumericHolderProperties(t),e._skipAlways(t)?void(e.processed=!0):e.eventKeyCode===y.Backspace||e.eventKeyCode===y.Delete?(e._processCharacterDeletion(),e.processed=!0,e._formatValue(t),t.target.value!==e.lastVal&&e.settingsClone.throwInput&&(Ke("input",t.target),t.preventDefault()),e.lastVal=t.target.value,void(e.settingsClone.throwInput=!0)):void(e.formatted=!1))}function Pe(e,t){var a=D(t);if(a!==S.Insert){var i=e.processed;if(e._updateAutoNumericHolderProperties(t),!e._skipAlways(t)){if(i)return void t.preventDefault();var r=e._processCharacterInsertion(t);if(r){if(e._formatValue(t),t.target.value!==e.lastVal&&e.settingsClone.throwInput)Ke("input",t.target),t.preventDefault();else{if((a===e.settings.decimalCharacter||a===e.settings.decimalCharacterAlternative)&&$(t.target).start===$(t.target).end&&$(t.target).start===t.target.value.indexOf(e.settings.decimalCharacter)){var n=$(t.target).start+1;Z(t.target,n,n)}t.preventDefault()}return e.lastVal=t.target.value,void(e.settingsClone.throwInput=!0)}t.preventDefault(),e.formatted=!1}}}function Ce(e,t,a){e._updateAutoNumericHolderProperties(a);var i=e._skipAlways(a);delete e.valuePartsBeforePaste,i||""===a.target.value||(a.target.value===e.settingsClone.currencySymbol?"s"===e.settingsClone.currencySymbolPlacement?Z(a.target,0,0):Z(a.target,e.settingsClone.currencySymbol.length,e.settingsClone.currencySymbol.length):e.eventKeyCode===y.Tab&&Z(a.target,0,a.target.value.length),(a.target.value===e.settingsClone.suffixText||""===e.settingsClone.rawValue&&""!==e.settingsClone.currencySymbol&&""!==e.settingsClone.suffixText)&&Z(a.target,0,0),null!==e.settingsClone.decimalPlacesShownOnFocus&&e.settingsClone.saveValueToSessionStorage&&fe(a.target,t,"set"),e.formatted||e._formatValue(a),a.target.value!==e.initialValueOnKeydown&&Ke("autoNumeric:formatted",a.target))}function we(e,t,a){if(!e.is(":focus")){var i=a.target.value,r=i,n=t.settingsClone;if(n.hasFocus=!1,n.saveValueToSessionStorage&&fe(a.target,n,"set"),n.noSeparatorOnFocus===!0&&(n.digitGroupSeparator=n.oSep,n.currencySymbol=n.oSign,n.suffixText=n.oSuffix),null!==n.decimalPlacesShownOnFocus&&(n.decimalPlacesOverride=n.oDec,n.allowDecimalPadding=n.oPad,n.negativeBracketsTypeOnBlur=n.oBracket),i=Q(i,n,!0),""!==i){n.trailingNegative&&!L(i)&&(i="-"+i,n.trailingNegative=!1);var o=ce(i,n),l=s(o,2),c=l[0],u=l[1];null===ae(i,n,!1)&&c&&u?(i=ee(i,n),n.rawValue=ve(i,n),n.scaleDivisor&&(i/=n.scaleDivisor,i=i.toString()),n.decimalPlacesOverride=n.scaleDivisor&&n.scaleDecimalPlaces?+n.scaleDecimalPlaces:n.decimalPlacesOverride,i=ne(i,n),i=te(i,n)):(c||e.trigger("autoNumeric:minExceeded"),u||e.trigger("autoNumeric:maxExceeded"),i=n.rawValue)}else"zero"===n.emptyInputBehavior?(n.rawValue="0",i=ne("0",n)):n.rawValue="";var d=ae(i,n,!1);null===d&&(d=ie(i,n)),d!==r&&(d=n.scaleSymbol?d+n.scaleSymbol:d,e.val(d)),d!==t.valueOnFocus&&(e.change(),delete t.valueOnFocus)}}function xe(e,t,a){a.preventDefault();var i=a.clipboardData.getData("text/plain"),r=a.target.value,n=a.target.selectionStart||0,o=a.target.selectionEnd||0,l=o-n,s=!1;l===r.length&&(s=!0);var c=M(i);c&&(i=i.slice(1,i.length));var u=N(i,t),d=void 0;if(d="."===u?".":_e(u,!1,!1,!1),"."!==d&&(!w(d)||""===d))return void("error"===t.settings.onInvalidPaste&&z("The pasted value '"+i+"' is not a valid paste content."));var m=void 0,h=void 0;h=""===a.target.value?"":e.autoNumeric("get");var g=M(h),v=void 0,p=void 0;c&&!g?(h="-"+h,g=!0,v=!0):v=!1;var f=!1;switch(t.settings.onInvalidPaste){case"truncate":case"replace":var y=r.slice(0,n),S=r.slice(o,r.length);p=n!==o?N(y+S,t):N(r,t),g&&(p=I(p)),m=G(R(r,n,t.settings.decimalCharacter)),v&&m++;var b=p.slice(0,m),P=p.slice(m,p.length);"."===d&&(k(b,".")&&(f=!0,b=b.replace(".","")),P=P.replace(".",""));for(var C=le(t.settings.minimumValue),x=le(t.settings.maximumValue),O=p,V=0,F=b;V<d.length&&(F+=d[V],p=F+P,B(p,C,x));)O=p,V++;if(m+=V,"truncate"===t.settings.onInvalidPaste){p=O,f&&m--;break}for(var A=m,T=O.length;V<d.length&&A<T;)if("."!==O[A]){if(p=_(O,A,d[V]),!B(p,C,x))break;O=p,V++,A++}else A++;m=A,f&&m--,p=O;break;case"error":case"ignore":case"clamp":default:var D=r.slice(0,n),L=r.slice(o,r.length);if(p=n!==o?N(D+L,t):N(r,t),g&&(p=I(p)),m=G(R(r,n,t.settings.decimalCharacter)),v&&m++,b=p.slice(0,m),P=p.slice(m,p.length),"."===d&&(k(b,".")&&(f=!0,b=b.replace(".","")),P=P.replace(".","")),p=""+b+d+P,n===o){var E=G(R(r,n,t.settings.decimalCharacter));m=E+d.length}else if(s)m=p.length;else if(""===P)m=G(R(r,n,t.settings.decimalCharacter))+d.length;else{var $=G(R(r,o,t.settings.decimalCharacter)),H=a.target.value.slice(n,o);m=$-l+j(t.settings.digitGroupSeparator,H)+d.length}s||(v&&m++,f&&m--)}if(!w(p)||""===p)return void("error"===t.settings.onInvalidPaste&&z("The pasted value '"+i+"' would result into an invalid content '"+p+"'."));var q=!1,W=!1;try{e.autoNumeric("set",p),q=!0}catch(a){var Q=void 0;switch(t.settings.onInvalidPaste){case"clamp":Q=K(p,t.settings);try{e.autoNumeric("set",Q)}catch(e){z("Fatal error: Unable to set the clamped value '"+Q+"'.")}W=!0,q=!0,p=Q;break;case"error":case"truncate":case"replace":z("The pasted value '"+i+"' results in a value '"+p+"' that is outside of the minimum ["+t.settings.minimumValue+"] and maximum ["+t.settings.maximumValue+"] value range.");case"ignore":default:return}}var J=void 0;if(q)switch(t.settings.onInvalidPaste){case"clamp":if(W){"s"===t.settings.currencySymbolPlacement?Z(a.target,a.target.value.length-t.settings.currencySymbol.length):Z(a.target,a.target.value.length);break}case"error":case"ignore":case"truncate":case"replace":default:J=U(p,m,a.target.value,t.settings.decimalCharacter),Z(a.target,J)}q&&r!==a.target.value&&Ke("input",a.target)}function Oe(e,t){t.target.value!==e.valueOnFocus&&Ke("change",t.target)}function Ne(e,t){e.closest("form").on("submit.autoNumeric",function(){if(t){var a=t.settingsClone;a.unformatOnSubmit&&e.val(a.rawValue)}})}function ke(e){var t=e.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])");t||"input"!==e.prop("tagName").toLowerCase()||z('The input type "'+e.prop("type")+'" is not supported by autoNumeric');var a=e.prop("tagName").toLowerCase();return"input"===a||V(a,p)||z("The <"+a+"> tag is not supported by autoNumeric"),t}function Ve(e,t,a){var r=!0;if(t){var n=a.val(),o=Ie(n,e);if(e.formatOnPageLoad&&""!==n&&i(a.attr("value")))isNaN(o)||1/0===o?z("The value ["+n+"] used in the input is not a valid value autoNumeric can work with."):(a.autoNumeric("set",o),r=!1);else if(null!==e.defaultValueOverride&&e.defaultValueOverride.toString()!==n||null===e.defaultValueOverride&&""!==n&&n!==a.attr("value")||""!==n&&"hidden"===a.attr("type")&&!w(o)){if((null!==e.decimalPlacesShownOnFocus&&e.saveValueToSessionStorage||e.scaleDivisor&&e.saveValueToSessionStorage)&&(e.rawValue=fe(a[0],e,"get")),!e.saveValueToSessionStorage){var l=void 0;null!==e.negativeBracketsTypeOnBlur&&""!==e.negativeSignCharacter?(e.hasFocus=!0,l=J(n,e)):l=n,("s"===e.negativePositiveSignPlacement||"p"!==e.negativePositiveSignPlacement&&"s"===e.currencySymbolPlacement)&&""!==e.negativeSignCharacter&&L(n)?e.rawValue=e.negativeSignCharacter+Q(l,e,!0):e.rawValue=Q(l,e,!0)}r=!1}if(""===n)switch(e.emptyInputBehavior){case"focus":r=!1;break;case"always":a.val(e.currencySymbol),r=!1;break;case"zero":a.autoNumeric("set","0"),r=!1}else r&&n===a.attr("value")&&a.autoNumeric("set",n)}V(a.prop("tagName").toLowerCase(),e.tagList)&&""!==a.text()&&(null!==e.defaultValueOverride?e.defaultValueOverride===a.text()&&a.autoNumeric("set",a.text()):a.autoNumeric("set",a.text()))}function Fe(e){if(t(e.negativePositiveSignPlacement))if(a(e)||!i(e.negativePositiveSignPlacement)||i(e.currencySymbol))e.negativePositiveSignPlacement="l";else switch(e.currencySymbolPlacement){case"s":e.negativePositiveSignPlacement="p";break;case"p":e.negativePositiveSignPlacement="l"}}function Ae(e){var t=e.maximumValue.toString().split("."),a=s(t,1),i=a[0],r=e.minimumValue||0===e.minimumValue?e.minimumValue.toString().split("."):[],n=s(r,1),o=n[0];i=i.replace("-",""),o=o.replace("-",""),e.mIntPos=Math.max(i.length,1),e.mIntNeg=Math.max(o.length,1)}function Te(e){t(e.scaleDivisor)||t(e.scaleDecimalPlaces)?t(e.decimalPlacesOverride)&&(e.decimalPlacesOverride=W(e.minimumValue,e.maximumValue)):e.decimalPlacesOverride=e.scaleDecimalPlaces,e.oDec=String(e.decimalPlacesOverride),e.decimalPlacesOverride=Number(e.decimalPlacesOverride)}function De(e){t(e.decimalCharacterAlternative)&&Number(e.decimalPlacesOverride)>0&&("."===e.decimalCharacter&&","!==e.digitGroupSeparator?e.decimalCharacterAlternative=",":","===e.decimalCharacter&&"."!==e.digitGroupSeparator&&(e.decimalCharacterAlternative="."))}function Be(e){var t="[0-9]",a="[^0-9]",i=e.negativeSignCharacter?"([-\\"+e.negativeSignCharacter+"]?)":"(-?)";e.aNegRegAutoStrip=i;var r=void 0;r=e.negativeSignCharacter?"\\"+e.negativeSignCharacter:"",e.skipFirstAutoStrip=new RegExp(i+"[^-"+r+"\\"+e.decimalCharacter+t+"].*?("+t+"|\\"+e.decimalCharacter+t+")"),e.skipLastAutoStrip=new RegExp("("+t+"\\"+e.decimalCharacter+"?)[^\\"+e.decimalCharacter+t+"]"+a+"*$");var n="-0123456789\\"+e.decimalCharacter;e.allowedAutoStrip=new RegExp("[^"+n+"]","g"),e.numRegAutoStrip=new RegExp(i+"(?:\\"+e.decimalCharacter+"?("+t+"+\\"+e.decimalCharacter+t+"+)|("+t+"*(?:\\"+e.decimalCharacter+t+"*)?))"),e.stripReg=new RegExp("^"+e.aNegRegAutoStrip+"0*("+t+")")}function Le(t){e.each(t,function(e,a){"true"!==a&&"false"!==a||(t[e]="true"===a),"number"==typeof a&&"aScale"!==e&&(t[e]=a.toString())})}function Me(e){var t={aSep:"digitGroupSeparator",nSep:"noSeparatorOnFocus",dGroup:"digitalGroupSpacing",aDec:"decimalCharacter",altDec:"decimalCharacterAlternative",aSign:"currencySymbol",pSign:"currencySymbolPlacement",pNeg:"negativePositiveSignPlacement",aSuffix:"suffixText",oLimits:"overrideMinMaxLimits",vMax:"maximumValue",vMin:"minimumValue",mDec:"decimalPlacesOverride",eDec:"decimalPlacesShownOnFocus",scaleDecimal:"scaleDecimalPlaces",aStor:"saveValueToSessionStorage",mRound:"roundingMethod",aPad:"allowDecimalPadding",nBracket:"negativeBracketsTypeOnBlur",wEmpty:"emptyInputBehavior",lZero:"leadingZero",aForm:"formatOnPageLoad",sNumber:"selectNumberOnly",anDefault:"defaultValueOverride",unSetOnSubmit:"unformatOnSubmit",outputType:"outputFormat",debug:"showWarnings",
digitGroupSeparator:!0,noSeparatorOnFocus:!0,digitalGroupSpacing:!0,decimalCharacter:!0,decimalCharacterAlternative:!0,currencySymbol:!0,currencySymbolPlacement:!0,negativePositiveSignPlacement:!0,showPositiveSign:!0,suffixText:!0,overrideMinMaxLimits:!0,maximumValue:!0,minimumValue:!0,decimalPlacesOverride:!0,decimalPlacesShownOnFocus:!0,scaleDivisor:!0,scaleDecimalPlaces:!0,scaleSymbol:!0,saveValueToSessionStorage:!0,onInvalidPaste:!0,roundingMethod:!0,allowDecimalPadding:!0,negativeBracketsTypeOnBlur:!0,emptyInputBehavior:!0,leadingZero:!0,formatOnPageLoad:!0,selectNumberOnly:!0,defaultValueOverride:!0,unformatOnSubmit:!0,outputFormat:!0,showWarnings:!0,failOnUnknownOption:!0,hasFocus:!0,runOnce:!0,rawValue:!0,trailingNegative:!0,caretFix:!0,throwInput:!0,strip:!0,tagList:!0,negativeSignCharacter:!0,positiveSignCharacter:!0,mIntPos:!0,mIntNeg:!0,oDec:!0,oPad:!0,oBracket:!0,oSep:!0,oSign:!0,oSuffix:!0,aNegRegAutoStrip:!0,skipFirstAutoStrip:!0,skipLastAutoStrip:!0,allowedAutoStrip:!0,numRegAutoStrip:!0,stripReg:!0,holder:!0};for(var a in e)if(e.hasOwnProperty(a)){if(t[a]===!0)continue;t.hasOwnProperty(a)?(H("You are using the deprecated option name '"+a+"'. Please use '"+t[a]+"' instead from now on. The old option name will be dropped soon.",!0),e[t[a]]=e[a],delete e[a]):e.failOnUnknownOption&&z("Option name '"+a+"' is unknown. Please fix the options passed to autoNumeric")}}function Ee(i,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=r.data("autoNumeric");if(!n&&t(i)||Me(i),n||a(o)){if(n)o=e.extend(o,i);else{var l=r.data();o=e.extend({},f,l,i,{hasFocus:!1,runOnce:!1,rawValue:"",trailingNegative:!1,caretFix:!1,throwInput:!0,strip:!0,tagList:p})}return Le(o),Fe(o),o.negativeSignCharacter=o.minimumValue<0?"-":"",o.positiveSignCharacter=o.maximumValue>=0?"+":"",q(r,o),Ae(o),Te(o),De(o),Be(o),g(o,!1),me(o),r.data("autoNumeric",o),o}return null}function Ie(e,t){var a=void 0;return w(Number(e))?a=e:(a=Y(e.toString(),t),w(Number(a))||(H('The value "'+e+'" being "set" is not numeric and therefore cannot be used appropriately.',t.showWarnings),a=NaN)),a}function _e(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=e.toString();if(""===r)return e;a&&(r=r.replace(/٫/,".")),i&&(r=r.replace(/٬/g,"")),r=r.replace(/[٠١٢٣٤٥٦٧٨٩]/g,function(e){return e.charCodeAt(0)-1632}).replace(/[۰۱۲۳۴۵۶۷۸۹]/g,function(e){return e.charCodeAt(0)-1776});var n=Number(r);return isNaN(n)?n:(t&&(r=n),r)}function Ke(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=void 0;window.CustomEvent?i=new CustomEvent(e,{detail:a,bubbles:!1,cancelable:!1}):(i=document.createEvent("CustomEvent"),i.initCustomEvent(e,!0,!0,{detail:a})),t.dispatchEvent(i)}var Re=function(){function t(a,i){o(this,t),this.settings=i,this.that=a,this.$that=e(a),this.formatted=!1,this.settingsClone=i,this.value=a.value}return l(t,[{key:"_updateAutoNumericHolderProperties",value:function(){this.value=this.that.value,this.selection=$(this.that),this.processed=!1,this.formatted=!1}},{key:"_updateAutoNumericHolderEventKeycode",value:function(e){this.eventKeyCode=T(e)}},{key:"_setSelection",value:function(e,t,i){e=Math.max(e,0),t=Math.min(t,this.that.value.length),this.selection={start:e,end:t,length:t-e},(a(i)||i)&&Z(this.that,e,t)}},{key:"_setCaretPosition",value:function(e,t){this._setSelection(e,e,t)}},{key:"_getLeftAndRightPartAroundTheSelection",value:function(){var e=this.value,t=e.substring(0,this.selection.start),a=e.substring(this.selection.end,e.length);return[t,a]}},{key:"_getUnformattedLeftAndRightPartAroundTheSelection",value:function(){var e=this.settingsClone,t=this._getLeftAndRightPartAroundTheSelection(),a=s(t,2),i=a[0],r=a[1];""===i&&""===r&&(e.trailingNegative=!1);var n=!0;return this.eventKeyCode===y.Hyphen&&0===Number(i)&&(n=!1),i=Q(i,this.settingsClone,n),r=Q(r,this.settingsClone,!1),e.trailingNegative&&!L(i)&&(i="-"+i,r="-"===r?"":r,e.trailingNegative=!1),[i,r]}},{key:"_normalizeParts",value:function(e,t){var a=this.settingsClone,i=!0;if(this.eventKeyCode===y.Hyphen&&0===Number(e)&&(i=!1),e=Q(e,a,i),t=Q(t,a,!1),"deny"!==a.leadingZero||this.eventKeyCode!==y.num0&&this.eventKeyCode!==y.numpad0||0!==Number(e)||k(e,a.decimalCharacter)||""===t||(e=e.substring(0,e.length-1)),a.trailingNegative&&!L(e)&&(e="-"+e,a.trailingNegative=!1),this.newValue=e+t,a.decimalCharacter){var r=this.newValue.match(new RegExp("^"+a.aNegRegAutoStrip+"\\"+a.decimalCharacter));r&&(e=e.replace(r[1],r[1]+"0"),this.newValue=e+t)}return[e,t]}},{key:"_setValueParts",value:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.settingsClone,r=this._normalizeParts(e,t),n=ce(this.newValue,i),o=s(n,2),l=o[0],c=o[1],u=r[0].length;if(this.newValue=r.join(""),l&&c){this.newValue=oe(this.newValue,i,a);var d=k(this.newValue,",")?this.newValue.replace(",","."):this.newValue;return""===d||d===i.negativeSignCharacter?i.rawValue="zero"===i.emptyInputBehavior?"0":"":i.rawValue=ve(d,i),u>this.newValue.length&&(u=this.newValue.length),1===u&&"0"===r[0]&&"deny"===i.leadingZero&&(u=""===r[1]||"0"===r[0]&&""!==r[1]?1:0),this.value=this.newValue,this._setCaretPosition(u,!1),!0}return l?c||this.$that.trigger("autoNumeric:maxExceeded"):this.$that.trigger("autoNumeric:minExceeded"),!1}},{key:"_getSignPosition",value:function(){var e=this.settingsClone,t=e.currencySymbol,a=this.that;if(t){var i=t.length;if("p"===e.currencySymbolPlacement){var r=e.negativeSignCharacter&&a.value&&a.value.charAt(0)===e.negativeSignCharacter;return r?[1,i+1]:[0,i]}var n=a.value.length;return[n-i,n]}return[1e3,-1]}},{key:"_expandSelectionOnSign",value:function(e){var t=this._getSignPosition(),a=this.selection;a.start<t[1]&&a.end>t[0]&&((a.start<t[0]||a.end>t[1])&&this.value.substring(Math.max(a.start,t[0]),Math.min(a.end,t[1])).match(/^\s*$/)?a.start<t[0]?this._setSelection(a.start,t[0],e):this._setSelection(t[1],a.end,e):this._setSelection(Math.min(a.start,t[0]),Math.max(a.end,t[1]),e))}},{key:"_checkPaste",value:function(){if(!a(this.valuePartsBeforePaste)){var e=this.valuePartsBeforePaste,t=this._getLeftAndRightPartAroundTheSelection(),i=s(t,2),r=i[0],n=i[1];delete this.valuePartsBeforePaste;var o=r.substr(0,e[0].length)+Q(r.substr(e[0].length),this.settingsClone,!0);this._setValueParts(o,n,!0)||(this.value=e.join(""),this._setCaretPosition(e[0].length,!1))}}},{key:"_skipAlways",value:function(e){if((e.ctrlKey||e.metaKey)&&"keyup"===e.type&&!a(this.valuePartsBeforePaste)||e.shiftKey&&this.eventKeyCode===y.Insert)return this._checkPaste(),!1;if(this.eventKeyCode>=y.F1&&this.eventKeyCode<=y.F12||this.eventKeyCode>=y.Windows&&this.eventKeyCode<=y.RightClick||this.eventKeyCode>=y.Tab&&this.eventKeyCode<y.Space||this.eventKeyCode<y.Backspace&&(0===e.which||e.which===this.eventKeyCode)||this.eventKeyCode===y.NumLock||this.eventKeyCode===y.ScrollLock||this.eventKeyCode===y.Insert||this.eventKeyCode===y.Command)return!0;if((e.ctrlKey||e.metaKey)&&this.eventKeyCode===y.a){if(this.settings.selectNumberOnly){e.preventDefault();var t=this.that.value.length,i=this.settings.currencySymbol.length,r=L(this.that.value)?1:0,n=this.settings.suffixText.length,o=this.settings.currencySymbolPlacement,l=this.settings.negativePositiveSignPlacement,s=void 0;s="s"===o?0:"l"===l&&1===r&&i>0?i+1:i;var c=void 0;if("p"===o)c=t-n;else switch(l){case"l":c=t-(n+i);break;case"r":c=i>0?t-(i+r+n):t-(i+n);break;default:c=t-(i+n)}Z(this.that,s,c)}return!0}return!e.ctrlKey&&!e.metaKey||this.eventKeyCode!==y.c&&this.eventKeyCode!==y.v&&this.eventKeyCode!==y.x?!(!e.ctrlKey&&!e.metaKey)||(this.eventKeyCode===y.LeftArrow||this.eventKeyCode===y.RightArrow?("keydown"!==e.type||e.shiftKey||(this.eventKeyCode!==y.LeftArrow||this.that.value.charAt(this.selection.start-2)!==this.settingsClone.digitGroupSeparator&&this.that.value.charAt(this.selection.start-2)!==this.settingsClone.decimalCharacter?this.eventKeyCode!==y.RightArrow||this.that.value.charAt(this.selection.start+1)!==this.settingsClone.digitGroupSeparator&&this.that.value.charAt(this.selection.start+1)!==this.settingsClone.decimalCharacter||this._setCaretPosition(this.selection.start+1):this._setCaretPosition(this.selection.start-1)),!0):this.eventKeyCode>=y.PageDown&&this.eventKeyCode<=y.DownArrow):("keydown"===e.type&&this._expandSelectionOnSign(),this.eventKeyCode!==y.v&&this.eventKeyCode!==y.Insert||("keydown"===e.type||"keypress"===e.type?a(this.valuePartsBeforePaste)&&(this.valuePartsBeforePaste=this._getLeftAndRightPartAroundTheSelection()):this._checkPaste()),"keydown"===e.type||"keypress"===e.type||this.eventKeyCode===y.c)}},{key:"_processCharacterDeletionIfTrailingNegativeSign",value:function(e){var t=s(e,2),a=t[0],i=t[1],r=this.settingsClone;return"p"===r.currencySymbolPlacement&&"s"===r.negativePositiveSignPlacement&&(this.eventKeyCode===y.Backspace?(r.caretFix=this.selection.start>=this.value.indexOf(r.suffixText)&&""!==r.suffixText,"-"===this.value.charAt(this.selection.start-1)?a=a.substring(1):this.selection.start<=this.value.length-r.suffixText.length&&(a=a.substring(0,a.length-1))):(r.caretFix=this.selection.start>=this.value.indexOf(r.suffixText)&&""!==r.suffixText,this.selection.start>=this.value.indexOf(r.currencySymbol)+r.currencySymbol.length&&(i=i.substring(1,i.length)),L(a)&&"-"===this.value.charAt(this.selection.start)&&(a=a.substring(1)))),"s"===r.currencySymbolPlacement&&"l"===r.negativePositiveSignPlacement&&(r.caretFix=this.selection.start>=this.value.indexOf(r.negativeSignCharacter)+r.negativeSignCharacter.length,this.eventKeyCode===y.Backspace?this.selection.start===this.value.indexOf(r.negativeSignCharacter)+r.negativeSignCharacter.length&&k(this.value,r.negativeSignCharacter)?a=a.substring(1):"-"!==a&&(this.selection.start<=this.value.indexOf(r.negativeSignCharacter)||!k(this.value,r.negativeSignCharacter))&&(a=a.substring(0,a.length-1)):("-"===a[0]&&(i=i.substring(1)),this.selection.start===this.value.indexOf(r.negativeSignCharacter)&&k(this.value,r.negativeSignCharacter)&&(a=a.substring(1)))),"s"===r.currencySymbolPlacement&&"r"===r.negativePositiveSignPlacement&&(r.caretFix=this.selection.start>=this.value.indexOf(r.negativeSignCharacter)+r.negativeSignCharacter.length,this.eventKeyCode===y.Backspace?this.selection.start===this.value.indexOf(r.negativeSignCharacter)+r.negativeSignCharacter.length?a=a.substring(1):"-"!==a&&this.selection.start<=this.value.indexOf(r.negativeSignCharacter)-r.currencySymbol.length?a=a.substring(0,a.length-1):""===a||k(this.value,r.negativeSignCharacter)||(a=a.substring(0,a.length-1)):(r.caretFix=this.selection.start>=this.value.indexOf(r.currencySymbol)&&""!==r.currencySymbol,this.selection.start===this.value.indexOf(r.negativeSignCharacter)&&(a=a.substring(1)),i=i.substring(1))),[a,i]}},{key:"_processCharacterDeletion",value:function(){var e=this.settingsClone,t=void 0,a=void 0;if(this.selection.length){this._expandSelectionOnSign(!1);var i=this._getUnformattedLeftAndRightPartAroundTheSelection(),r=s(i,2);t=r[0],a=r[1]}else{var n=this._getUnformattedLeftAndRightPartAroundTheSelection(),o=s(n,2);if(t=o[0],a=o[1],""===t&&""===a&&(e.throwInput=!1),("p"===e.currencySymbolPlacement&&"s"===e.negativePositiveSignPlacement||"s"===e.currencySymbolPlacement&&("l"===e.negativePositiveSignPlacement||"r"===e.negativePositiveSignPlacement))&&L(this.value)){var l=this._processCharacterDeletionIfTrailingNegativeSign([t,a]),c=s(l,2);t=c[0],a=c[1]}else this.eventKeyCode===y.Backspace?t=t.substring(0,t.length-1):a=a.substring(1,a.length)}this._setValueParts(t,a)}},{key:"_processCharacterInsertion",value:function(e){var t=this.settingsClone,a=this._getUnformattedLeftAndRightPartAroundTheSelection(),i=s(a,2),r=i[0],n=i[1];t.throwInput=!0;var o=D(e);if(o===t.decimalCharacter||t.decimalCharacterAlternative&&o===t.decimalCharacterAlternative||("."===o||","===o)&&this.eventKeyCode===y.DotNumpad)return!t.decimalPlacesOverride||!t.decimalCharacter||(!(!t.negativeSignCharacter||!k(n,t.negativeSignCharacter))||(!!k(r,t.decimalCharacter)||(n.indexOf(t.decimalCharacter)>0||(0===n.indexOf(t.decimalCharacter)&&(n=n.substr(1)),this._setValueParts(r+t.decimalCharacter,n),!0))));if(("-"===o||"+"===o)&&"-"===t.negativeSignCharacter)return!t||("p"===t.currencySymbolPlacement&&"s"===t.negativePositiveSignPlacement||"s"===t.currencySymbolPlacement&&"p"!==t.negativePositiveSignPlacement?(""===r&&k(n,t.negativeSignCharacter)&&(r=t.negativeSignCharacter,n=n.substring(1,n.length)),r=M(r)||k(r,t.negativeSignCharacter)?r.substring(1,r.length):"-"===o?t.negativeSignCharacter+r:r):(""===r&&k(n,t.negativeSignCharacter)&&(r=t.negativeSignCharacter,n=n.substring(1,n.length)),r=r.charAt(0)===t.negativeSignCharacter?r.substring(1,r.length):"-"===o?t.negativeSignCharacter+r:r),this._setValueParts(r,n),!0);var l=Number(o);return l>=0&&l<=9?(t.negativeSignCharacter&&""===r&&k(n,t.negativeSignCharacter)&&(r=t.negativeSignCharacter,n=n.substring(1,n.length)),t.maximumValue<=0&&t.minimumValue<t.maximumValue&&!k(this.value,t.negativeSignCharacter)&&"0"!==o&&(r=t.negativeSignCharacter+r),this._setValueParts(r+o,n),!0):(t.throwInput=!1,!1)}},{key:"_formatValue",value:function(t){var a=this,i=this.settingsClone,r=this.value,n=this._getUnformattedLeftAndRightPartAroundTheSelection(),o=s(n,1),l=o[0];if((""===i.digitGroupSeparator||""!==i.digitGroupSeparator&&!k(r,i.digitGroupSeparator))&&(""===i.currencySymbol||""!==i.currencySymbol&&!k(r,i.currencySymbol))){var c=r.split(i.decimalCharacter),u=s(c,1),d=u[0],m="";L(d)&&(m="-",d=d.replace("-",""),l=l.replace("-","")),""===m&&d.length>i.mIntPos&&"0"===l.charAt(0)&&(l=l.slice(1)),"-"===m&&d.length>i.mIntNeg&&"0"===l.charAt(0)&&(l=l.slice(1)),l=m+l}var h=ie(this.value,this.settingsClone),g=h.length;if(h){var v=l.split("");("s"===i.negativePositiveSignPlacement||"s"===i.currencySymbolPlacement&&"p"!==i.negativePositiveSignPlacement)&&"-"===v[0]&&""!==i.negativeSignCharacter&&(v.shift(),this.eventKeyCode!==y.Backspace&&this.eventKeyCode!==y.Delete||!i.caretFix||("s"===i.currencySymbolPlacement&&"l"===i.negativePositiveSignPlacement&&(v.push("-"),i.caretFix="keydown"===t.type),"p"===i.currencySymbolPlacement&&"s"===i.negativePositiveSignPlacement&&(v.push("-"),i.caretFix="keydown"===t.type),"s"===i.currencySymbolPlacement&&"r"===i.negativePositiveSignPlacement&&!function(){var r=i.currencySymbol.split(""),n=["\\","^","$",".","|","?","*","+","(",")","["],o=[];e.each(r,function(e,t){t=r[e],V(t,n)?o.push("\\"+t):o.push(t)}),a.eventKeyCode===y.Backspace&&o.push("-"),v.push(o.join("")),i.caretFix="keydown"===t.type}()));for(var p=0;p<v.length;p++)v[p].match("\\d")||(v[p]="\\"+v[p]);var f=new RegExp("^.*?"+v.join(".*?")),S=h.match(f);S?(g=S[0].length,i.showPositiveSign&&(0===g&&S.input.charAt(0)===i.positiveSignCharacter&&(g=1===S.input.indexOf(i.currencySymbol)?i.currencySymbol.length+1:1),0===g&&S.input.charAt(i.currencySymbol.length)===i.positiveSignCharacter&&(g=i.currencySymbol.length+1)),(0===g&&h.charAt(0)!==i.negativeSignCharacter||1===g&&h.charAt(0)===i.negativeSignCharacter)&&i.currencySymbol&&"p"===i.currencySymbolPlacement&&(g=this.settingsClone.currencySymbol.length+(M(h)?1:0))):(i.currencySymbol&&"s"===i.currencySymbolPlacement&&(g-=i.currencySymbol.length),i.suffixText&&(g-=i.suffixText.length))}h===this.that.value&&(h!==this.that.value||this.eventKeyCode!==y.num0&&this.eventKeyCode!==y.numpad0)||(this.that.value=h,this._setCaretPosition(g)),this.formatted=!0}}]),t}(),Ue={init:function(a){return this.each(function(){var i=e(this),r=ke(i),n=Ee(a,i,!1);if(t(n))return this;var o=de(i,n,!1);!n.runOnce&&n.formatOnPageLoad&&Ve(n,r,i),n.runOnce=!0,r&&(this.addEventListener("focusin",function(e){Se(i,o,e)},!1),this.addEventListener("mouseenter",function(e){Se(i,o,e)},!1),this.addEventListener("blur",function(e){we(i,o,e)},!1),this.addEventListener("mouseleave",function(e){we(i,o,e)},!1),this.addEventListener("keydown",function(e){be(o,e)},!1),this.addEventListener("keypress",function(e){Pe(o,e)},!1),this.addEventListener("keyup",function(e){Ce(o,n,e)},!1),this.addEventListener("blur",function(e){Oe(o,e)},!1),this.addEventListener("paste",function(e){xe(i,o,e)},!1),Ne(i,o))})},destroy:function(){return e(this).each(function(){var e=ue(this),t=e.data("autoNumeric");"object"===("undefined"==typeof t?"undefined":c(t))&&(e.val(""),fe(e[0],t,"wipe"),e.removeData("autoNumeric"),e.off(".autoNumeric"))})},wipe:function(){return e(this).each(function(){var e=ue(this),t=e.data("autoNumeric");"object"===("undefined"==typeof t?"undefined":c(t))&&(e.val(""),t.rawValue="",fe(e[0],t,"wipe"))})},update:function(t){return e(this).each(function(){var e=ue(this),a=e.autoNumeric("get"),i=Ee(t,e,!0);if(de(e,i,!0),""!==e.val()||""!==e.text())return e.autoNumeric("set",a)})},set:function(t){return e(this).each(function(){if(null!==t&&!a(t)){var e=ue(this),i=e.data("autoNumeric");"object"!==("undefined"==typeof i?"undefined":c(i))&&z('Initializing autoNumeric is required prior to calling the "set" method.'),i.trailingNegative=!1;var r=e.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])"),n=Ie(t,i);if(isNaN(n))return e.val("");if(""===n)return e.val("");var o=ce(n,i),l=s(o,2),u=l[0],d=l[1],m=E(n);if(m&&(n="0"),!u||!d){i.rawValue="",fe(e[0],i,"wipe");var h=n;return n="",u||e.trigger("autoNumeric:minExceeded"),d||e.trigger("autoNumeric:maxExceeded"),z("The value ["+h+"] being set falls outside of the minimumValue ["+i.minimumValue+"] and maximumValue ["+i.maximumValue+"] range set for this element"),e.val("")}if(r||V(e.prop("tagName").toLowerCase(),i.tagList)){var g=!1;if(i.decimalPlacesShownOnFocus){var v=i.decimalPlacesOverride;i.decimalPlacesOverride=i.decimalPlacesShownOnFocus,n=ne(n,i),g=!0,i.decimalPlacesOverride=v}if(i.scaleDivisor&&!i.onOff&&(n=Ie(n,i),n/=i.scaleDivisor,n=n.toString(),i.scaleDecimalPlaces)){var p=i.decimalPlacesOverride;i.decimalPlacesOverride=i.scaleDecimalPlaces,n=ne(n,i),g=!0,i.decimalPlacesOverride=p}g||(n=ne(n,i)),i.rawValue=ve(n.replace(i.decimalCharacter,"."),i),n=te(n,i),n=ie(n,i)}return i.saveValueToSessionStorage&&(i.decimalPlacesShownOnFocus||i.scaleDivisor)&&fe(e[0],i,"set"),!i.hasFocus&&i.scaleSymbol&&(n+=i.scaleSymbol),r?e.val(n):!!V(e.prop("tagName").toLowerCase(),i.tagList)&&e.text(n)}})},unSet:function(){return e(this).each(function(){var e=ue(this),t=e.data("autoNumeric");"object"===("undefined"==typeof t?"undefined":c(t))&&(t.hasFocus=!0,e.val(e.autoNumeric("getLocalized")))})},reSet:function(){return e(this).each(function(){var e=ue(this),t=e.data("autoNumeric");"object"===("undefined"==typeof t?"undefined":c(t))&&e.autoNumeric("set",e.val())})},get:function(){var e=ue(this),t=e.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])"),a=e.data("autoNumeric");"object"!==("undefined"==typeof a?"undefined":c(a))&&z('Initializing autoNumeric is required prior to calling the "get" method.');var i="";if(t?i=e.eq(0).val():V(e.prop("tagName").toLowerCase(),a.tagList)?i=e.eq(0).text():z('The "<'+e.prop("tagName").toLowerCase()+'>" tag is not supported by autoNumeric'),a.decimalPlacesShownOnFocus||a.scaleDivisor)i=a.rawValue;else{var r=L(i);if(!/\d/.test(i)&&"focus"===a.emptyInputBehavior)return"";""!==i&&null!==a.negativeBracketsTypeOnBlur&&(a.hasFocus=!0,i=J(i,a)),(a.runOnce||a.formatOnPageLoad===!1)&&(i=Q(i,a,!0),i=ve(i.replace(a.decimalCharacter,"."),a),a.trailingNegative&&r&&!L(i)&&0!==Number(i)&&(i="-"+i)),(""!==i||""===i&&"zero"===a.emptyInputBehavior)&&(i=ee(i,a))}return pe(i)},getLocalized:function(){var e=ue(this),t=e.autoNumeric("get"),a=e.data("autoNumeric");return 0===Number(t)&&"keep"!==a.leadingZero&&(t="0"),X(t,a.outputFormat)},getNumber:function(){var e=ue(this),t=e.autoNumeric("get");return X(t,"number")},getFormatted:function(){return this.hasOwnProperty("0")&&"value"in this[0]||z("Unable to get the formatted string from the element."),this[0].value},getString:function(){return ye(!1,this)},getArray:function(){return ye(!0,this)},getSettings:function(){return this.data("autoNumeric")}};e.fn.autoNumeric=function(e){if(Ue[e]){for(var t=arguments.length,a=Array(t>1?t-1:0),i=1;i<t;i++)a[i-1]=arguments[i];return Ue[e].apply(this,a)}return"object"!==("undefined"==typeof e?"undefined":c(e))&&e?void z('Method "'+e+'" is not supported by autoNumeric'):Ue.init.apply(this,[e])},m=function(){return f},e.fn.autoNumeric.defaults=f,h=function(){return O},e.fn.autoNumeric.lang=O,u=function(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(a(i)||null===i)return null;r(i)||w(i)||z('The value "'+i+'" being "set" is not numeric and therefore cannot be used appropriately.');var o=e.extend({},f,{strip:!1},n);i<0&&(o.negativeSignCharacter="-"),t(o.decimalPlacesOverride)&&(o.decimalPlacesOverride=W(o.minimumValue,o.maximumValue));var l=Ie(i,o);isNaN(l)&&z("The value ["+l+"] that you are trying to format is not a recognized number.");var c=ce(l,o),u=s(c,2),d=u[0],m=u[1];return d&&m||(Ke("autoFormat.autoNumeric",document,"Range test failed"),z("The value ["+l+"] being set falls outside of the minimumValue ["+o.minimumValue+"] and maximumValue ["+o.maximumValue+"] range set for this element")),l=ne(l,o),l=te(l,o),l=ie(l,o)},e.fn.autoFormat=u,d=function(t,i){if(a(t)||null===t)return null;if(w(t))return Number(t);(F(t)||P(t))&&z("A number or a string representing a number is needed to be able to unformat it, ["+t+"] given.");var r=e.extend({},f,{strip:!1},i),n="-0123456789\\"+r.decimalCharacter,o=new RegExp("[^"+n+"]","gi");return t=t.toString(),L(t)?r.negativeSignCharacter="-":r.negativeBracketsTypeOnBlur&&r.negativeBracketsTypeOnBlur.split(",")[0]===t.charAt(0)&&(r.negativeSignCharacter="-",r.hasFocus=!0,t=J(t,r)),t=t.replace(o,""),t=t.replace(r.decimalCharacter,"."),t=X(t,r.outputFormat)},e.fn.autoUnformat=d,g=function(a){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];(i(a)||!P(a)||C(a))&&z("The userOptions are invalid ; it should be a valid object, ["+a+"] given."),t(a)||Me(a);var l=void 0;l=o?e.extend({},f,a):a,b(l.showWarnings)||n(l.showWarnings)||z("The debug option 'showWarnings' is invalid ; it should be either 'false' or 'true', ["+l.showWarnings+"] given.");var s=/^[0-9]+$/,c=/[0-9]+/,u=/^-?[0-9]+(\.?[0-9]+)?$/,d=/^[0-9]+(\.?[0-9]+)?$/;V(l.digitGroupSeparator,[",","."," "," "," "," ","","'","٬","˙"])||z("The thousand separator character option 'digitGroupSeparator' is invalid ; it should be ',', '.', '٬', '˙', \"'\", ' ', ' ', ' ', ' ' or empty (''), ["+l.digitGroupSeparator+"] given."),b(l.noSeparatorOnFocus)||n(l.noSeparatorOnFocus)||z("The 'noSeparatorOnFocus' option is invalid ; it should be either 'false' or 'true', ["+l.noSeparatorOnFocus+"] given."),s.test(l.digitalGroupSpacing)||z("The digital grouping for thousand separator option 'digitalGroupSpacing' is invalid ; it should be a positive integer, ["+l.digitalGroupSpacing+"] given."),V(l.decimalCharacter,[",",".","·","٫","⎖"])||z("The decimal separator character option 'decimalCharacter' is invalid ; it should be '.', ',', '·', '⎖' or '٫', ["+l.decimalCharacter+"] given."),l.decimalCharacter===l.digitGroupSeparator&&z("autoNumeric will not function properly when the decimal character 'decimalCharacter' ["+l.decimalCharacter+"] and the thousand separator 'digitGroupSeparator' ["+l.digitGroupSeparator+"] are the same character."),t(l.decimalCharacterAlternative)||r(l.decimalCharacterAlternative)||z("The alternate decimal separator character option 'decimalCharacterAlternative' is invalid ; it should be a string, ["+l.decimalCharacterAlternative+"] given."),""===l.currencySymbol||r(l.currencySymbol)||z("The currency symbol option 'currencySymbol' is invalid ; it should be a string, ["+l.currencySymbol+"] given."),V(l.currencySymbolPlacement,["p","s"])||z("The placement of the currency sign option 'currencySymbolPlacement' is invalid ; it should either be 'p' (prefix) or 's' (suffix), ["+l.currencySymbolPlacement+"] given."),V(l.negativePositiveSignPlacement,["p","s","l","r",null])||z("The placement of the negative sign option 'negativePositiveSignPlacement' is invalid ; it should either be 'p' (prefix), 's' (suffix), 'l' (left), 'r' (right) or 'null', ["+l.negativePositiveSignPlacement+"] given."),b(l.showPositiveSign)||n(l.showPositiveSign)||z("The show positive sign option 'showPositiveSign' is invalid ; it should be either 'false' or 'true', ["+l.showPositiveSign+"] given."),(!r(l.suffixText)||""!==l.suffixText&&(L(l.suffixText)||c.test(l.suffixText)))&&z("The additional suffix option 'suffixText' is invalid ; it should not contains the negative sign '-' nor any numerical characters, ["+l.suffixText+"] given."),t(l.overrideMinMaxLimits)||V(l.overrideMinMaxLimits,["ceiling","floor","ignore"])||z("The override min & max limits option 'overrideMinMaxLimits' is invalid ; it should either be 'ceiling', 'floor' or 'ignore', ["+l.overrideMinMaxLimits+"] given."),r(l.maximumValue)&&u.test(l.maximumValue)||z("The maximum possible value option 'maximumValue' is invalid ; it should be a string that represents a positive or negative number, ["+l.maximumValue+"] given."),r(l.minimumValue)&&u.test(l.minimumValue)||z("The minimum possible value option 'minimumValue' is invalid ; it should be a string that represents a positive or negative number, ["+l.minimumValue+"] given."),parseFloat(l.minimumValue)>parseFloat(l.maximumValue)&&z("The minimum possible value option is greater than the maximum possible value option ; 'minimumValue' ["+l.minimumValue+"] should be smaller than 'maximumValue' ["+l.maximumValue+"]."),t(l.decimalPlacesOverride)||x(l.decimalPlacesOverride)&&l.decimalPlacesOverride>=0||r(l.decimalPlacesOverride)&&s.test(l.decimalPlacesOverride)||z("The maximum number of decimal places option 'decimalPlacesOverride' is invalid ; it should be a positive integer, ["+l.decimalPlacesOverride+"] given.");var m=W(l.minimumValue,l.maximumValue);t(l.decimalPlacesOverride)||m===Number(l.decimalPlacesOverride)||H("Setting 'decimalPlacesOverride' to ["+l.decimalPlacesOverride+"] will override the decimals declared in 'minimumValue' ["+l.minimumValue+"] and 'maximumValue' ["+l.maximumValue+"].",l.showWarnings),l.allowDecimalPadding||t(l.decimalPlacesOverride)||H("Setting 'allowDecimalPadding' to [false] will override the current 'decimalPlacesOverride' setting ["+l.decimalPlacesOverride+"].",l.showWarnings),t(l.decimalPlacesShownOnFocus)||r(l.decimalPlacesShownOnFocus)&&s.test(l.decimalPlacesShownOnFocus)||z("The number of expanded decimal places option 'decimalPlacesShownOnFocus' is invalid ; it should be a positive integer, ["+l.decimalPlacesShownOnFocus+"] given."),!t(l.decimalPlacesShownOnFocus)&&!t(l.decimalPlacesOverride)&&Number(l.decimalPlacesOverride)>Number(l.decimalPlacesShownOnFocus)&&H("The extended decimal places 'decimalPlacesShownOnFocus' ["+l.decimalPlacesShownOnFocus+"] should be greater than the 'decimalPlacesOverride' ["+l.decimalPlacesOverride+"] value. Currently, this will limit the ability of your client to manually change some of the decimal places. Do you really want to do that?",l.showWarnings),t(l.scaleDivisor)||d.test(l.scaleDivisor)||z("The scale divisor option 'scaleDivisor' is invalid ; it should be a positive number, preferably an integer, ["+l.scaleDivisor+"] given."),t(l.scaleDecimalPlaces)||s.test(l.scaleDecimalPlaces)||z("The scale number of decimals option 'scaleDecimalPlaces' is invalid ; it should be a positive integer, ["+l.scaleDecimalPlaces+"] given."),t(l.scaleSymbol)||r(l.scaleSymbol)||z("The scale symbol option 'scaleSymbol' is invalid ; it should be a string, ["+l.scaleSymbol+"] given."),b(l.saveValueToSessionStorage)||n(l.saveValueToSessionStorage)||z("The save to session storage option 'saveValueToSessionStorage' is invalid ; it should be either 'false' or 'true', ["+l.saveValueToSessionStorage+"] given."),V(l.onInvalidPaste,["error","ignore","clamp","truncate","replace"])||z("The paste behavior option 'onInvalidPaste' is invalid ; it should either be 'error', 'ignore', 'clamp', 'truncate' or 'replace' (cf. documentation), ["+l.onInvalidPaste+"] given."),V(l.roundingMethod,["S","A","s","a","B","U","D","C","F","N05","CHF","U05","D05"])||z("The rounding method option 'roundingMethod' is invalid ; it should either be 'S', 'A', 's', 'a', 'B', 'U', 'D', 'C', 'F', 'N05', 'CHF', 'U05' or 'D05' (cf. documentation), ["+l.roundingMethod+"] given."),b(l.allowDecimalPadding)||n(l.allowDecimalPadding)||z("The control decimal padding option 'allowDecimalPadding' is invalid ; it should be either 'false' or 'true', ["+l.allowDecimalPadding+"] given."),t(l.negativeBracketsTypeOnBlur)||V(l.negativeBracketsTypeOnBlur,["(,)","[,]","<,>","{,}"])||z("The brackets for negative values option 'negativeBracketsTypeOnBlur' is invalid ; it should either be '(,)', '[,]', '<,>' or '{,}', ["+l.negativeBracketsTypeOnBlur+"] given."),V(l.emptyInputBehavior,["focus","press","always","zero"])||z("The display on empty string option 'emptyInputBehavior' is invalid ; it should either be 'focus', 'press', 'always' or 'zero', ["+l.emptyInputBehavior+"] given."),V(l.leadingZero,["allow","deny","keep"])||z("The leading zero behavior option 'leadingZero' is invalid ; it should either be 'allow', 'deny' or 'keep', ["+l.leadingZero+"] given."),b(l.formatOnPageLoad)||n(l.formatOnPageLoad)||z("The format on initialization option 'formatOnPageLoad' is invalid ; it should be either 'false' or 'true', ["+l.formatOnPageLoad+"] given."),b(l.selectNumberOnly)||n(l.selectNumberOnly)||z("The select number only option 'selectNumberOnly' is invalid ; it should be either 'false' or 'true', ["+l.selectNumberOnly+"] given."),t(l.defaultValueOverride)||""===l.defaultValueOverride||u.test(l.defaultValueOverride)||z("The unformatted default value option 'defaultValueOverride' is invalid ; it should be a string that represents a positive or negative number, ["+l.defaultValueOverride+"] given."),b(l.unformatOnSubmit)||n(l.unformatOnSubmit)||z("The remove formatting on submit option 'unformatOnSubmit' is invalid ; it should be either 'false' or 'true', ["+l.unformatOnSubmit+"] given."),t(l.outputFormat)||V(l.outputFormat,["string","number",".","-.",",","-,",".-",",-"])||z("The custom locale format option 'outputFormat' is invalid ; it should either be null, 'string', 'number', '.', '-.', ',', '-,', '.-' or ',-', ["+l.outputFormat+"] given."),b(l.failOnUnknownOption)||n(l.failOnUnknownOption)||z("The debug option 'failOnUnknownOption' is invalid ; it should be either 'false' or 'true', ["+l.failOnUnknownOption+"] given.")},e.fn.autoValidate=g,v=function(e){var t=!0;try{g(e)}catch(e){t=!1}return t},function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var a=document.createEvent("CustomEvent");return a.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),a}return"function"!=typeof window.CustomEvent&&(e.prototype=window.Event.prototype,void(window.CustomEvent=e))}()}),t.default={format:u,unFormat:d,getDefaultConfig:m,getLanguages:h,validate:g,areSettingsValid:v}}).call(window)},function(t,a){t.exports=e}])}); //# sourceMappingURL=autoNumeric.min.js.map |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20180420 |
| Request Header - size: 234 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php HTTP/1.1
Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 19,386 bytes. |
<style type="text/css">
.div_border_front2 table:nth-child(2) input[type="button"] { color: #fff; background: #627d4d; } #forgot { color: ; } .applist_gradient { background: #627d4d; } .head_title { color: #fff; } .head_title, .apptitle { text-transform: uppercase; } .head_title1, .apptitle1 { text-transform: uppercase; } .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header { background: #627d4d; } .ui-widget-header { background: #627d4d !important; color: #fff; } .ui-dialog .ui-dialog-buttonpane button { color: #fff; } header#header,.theme_header { background: #627d4d !important; } /*header#header2 { background: #627d4d; }*/ ._program li { color: #fff; } .button1 { color: #fff; background: #627d4d; } ._figure span:first-child { color: #fff; } #hris_sub_container ul figure { background: #627d4d; } .dc_empstatico { color: ; /* colored */ } .dbg_empstatico { background: #627d4d; /* colored */ } ::-webkit-scrollbar { background: #627d4d; } ::-webkit-scrollbar-thumb { background: #627d4d; } #hris_sub_container header { color: ; /* colored */ } .gp, .ui-widget-header, .fc-day-header, { background: #627d4d; } .ui-widget-header, .fc-day-header { color : white !important;; } </style><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "/strict.dtd"> <html> <head> <title>WEBTEMPLATE</title> <link REL="SHORTCUT ICON" HREF="./images/lst_logo.ico" /> <link href='../css/applist.css' media='screen' type='text/css' /> <!-- include a theme, can be included into the core instead of 2 separate files --> <link rel="stylesheet" href="lib/alertify/css/themes/bootstrap.min.css" /> <link rel="stylesheet" href="./css/modified_layout.css" type="text/css" media="screen" /> <link rel='stylesheet' type='text/css' media='screen' href='./css/layout.css'/> </head> <body> <form name='myform' id='myform' method='post'> <link rel='stylesheet' type='text/css' href='css/login.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_view.css?v=20220209161346' /><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/layout.css?v=20220209161346' /><script type='text/javascript' src='javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='lib/pager.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/pager.css?v=20220209161346' /><script type='text/javascript' src='lib/alertify/alertify.min.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_page.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/applist.css?v=20220209161346' /> <!-- <link rel="stylesheet" type="text/css" href="css/login_page.css"> --> <input name='xpage_uri' id='xpage_uri'> <input name='xpage_dir' id='xpage_dir'> <input name='txt_action' id='txt_action'> <input name='txtappcde' id='txtappcde'> <input name='txtoutsource' id='txtoutsource'> <input id='seccode_validated' value=""> <input id="gl_comcde" name="gl_comcde" value="ATESTWEBTKM"> <!-- <input type="hidden" id="tmp_redirect_path" name="tmp_redirect_path"> --> <!-- <input type="hidden" id="tmp_appcde" name="tmp_appcde"> --> <style type="text/css"> .seccode_continue:hover { color: white; background-color: #1947D1 !important; border: 0; } .seccode_continue { background-color: #335CD6 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; /* border-radius: .3em; */ width: auto; min-width: 70px; } .seccode_cancel:hover { color: white; background-color: #990000 !important; border: 0; } .seccode_cancel { /* border-radius: .3em; */ background-color: #aa4935 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; width: 70px; /*margin-right: 3px;*/ } </style> <script type='text/javascript'> //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "WEBAPP"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function() {}; jQuery(document).ready(function() { if (jQuery('#seccode_validated').val() == 0 && jQuery('#seccode_validated').val() != '') { alertify.alert('Accesing any programs must start here.'); } jQuery('#seccode_diag').dialog({ title: "Security Code", resizable: false, autoOpen: false, height: 'auto', width: 'auto', position: { my: "center", at: "center", of: window }, modal: true, open: function() { jQuery('body').css('overflow', 'hidden'); jQuery('.ui-button-icon-primary.ui-icon.ui-icon-closethick').closest('button').remove(); jQuery(this).closest('.ui-dialog').find('.seccode_cancel').focus(); }, close: function() { jQuery('body').css('overflow', 'auto'); }, buttons: [{ text: "Continue", "class": 'seccode_continue', click: function() { val_seccode_path(jQuery('#seccode_diag').find('#seccode_path')); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { jQuery('#seccode_diag').dialog('close'); } }, ] }); jQuery('#diag_subsidiary').dialog({ title: 'Select Subsidiary', width: 500, height: 'auto', draggable: false, resizable: false, autoOpen: false, modal: true, open: function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [{ text: "Proceed", "class": 'seccode_continue', click: function() { update_pay_subdrycde_link($(this).find('#pay_subdrycde').val()); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { $(this).dialog('close'); } }, ] }); }) function val_blank_session() { alertify.alert('You must login first.', function() { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) // window.open('login_view.php', '_self'); }) } function val_seccode(xloc, xcde) { var xdata = "event_action=val_seccode"; xdata += "&xloc=" + xloc; xdata += "&xcde=" + xcde; xdata += "&" + jQuery('#myform *').serialize(); return jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata }); } function val_seccode_path(selectObj) { var xdata = "event_action=val_seccode_path"; xdata += "&apploc=" + selectObj.val(); xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { if (xret.bridge_found) { // document.forms.myform.txtappcde.value=selectObj.find("option:selected").data('appcde'); document.forms.myform.action = selectObj.val(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { alertify.alert(selectObj.find(':selected').text(), xret.bridge_found_msg); } } }); } function open_seccode_diag() { var xdata = "event_action=validate_comcde"; xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { jQuery('#seccode_diag').dialog('open'); } }); } function transaction_click(xappcde, xloc, obj) { // alert(xappcde,xloc,obj); document.forms.myform.action = xloc; document.forms.myform.txtappcde.value = xappcde; if (jQuery(obj).hasClass('show_sub_diag') || xappcde == "PAY") { var xdata = "event_action=get_user_subdry&xappcde=" + xappcde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { $.unblockUI(); console.log(response) if (response.pass == true) { if (response.show_diag == true && response.has_access == true) { var subdry_note = "Payroll"; if(xappcde == "PAY_OUTSRC") { subdry_note = "Payroll Out Sourcing"; } jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); // jQuery('#diag_subsidiary').find('#subdry_note').html(subdry_note); jQuery('#diag_subsidiary').dialog('open'); } else if (response.show_diag == false && response.has_access == true) { blockui(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); update_pay_subdrycde_link($('#pay_subdrycde').val()); } } else { alertify.alert('You must have a subsidiary access to use the payroll program.'); } } }); } else { blockui(); //20190311 donita //add check update structure // if(xappcde != "PAY_OUTSRC" || xappcde != "PAY") // { update_empstatus(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action = "admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); // } // else // { // document.forms.myform.method='POST'; // document.forms.myform.target = '_self'; // document.forms.myform.submit(); // } } } function update_empstatus(subdrycde="") { var xdata= "event_action=update_empstatus&subdrycde="+subdrycde; jQuery.ajax({ type : 'post', data : xdata, url : 'login_applist_ajax.php', success : function (xretobj) { } }); } function logout_click() { alertify.confirm('Are you sure you want to logout?', function() { blockui(); var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) } }); }); } function update_pay_subdrycde_link(xsubdrycde) { blockui(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { var xappcde = $('#txtappcde').val(); var xdata = "event_action=update_pay_subdrycde_link&xappcde=" + xappcde; xdata += "&subdrycde=" + xsubdrycde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { jQuery('#diag_subsidiary').dialog('close'); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } }); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action="admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); } function admin_click(xloc) { document.forms.myform.action = xloc; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } function getclientdir(){ var xparams = 'txt_action=getclientdir'; return jQuery.ajax({ dataType: 'json', type: 'post', data: xparams, url : 'login_validate_redirect.php' }) } </script> <style> footer { width: 580px; margin: 0 auto 50px; } footer .ftr_con { margin: 20px auto 0; } footer .ftr_con p { text-align: center; } .appgrp { margin-top: 20px; display: flex; justify-content: center; align-items: center; } </style> <!-- <form id="myform"> </form> --> <div class='applist_body' align='center'> <div class='applist_all'> <div class="logo"> <img src='img/lst.png' style="width: 100%;height: 100%;"> </div> <table border='0' align='center'> <tr> <td align='center'> <table class='applist_table'> <tr> <td align='right' colspan='10'> <span class='applist_logout' onclick='logout_click()'><b>LOGOUT</b></span> </td> </tr> <tr> <td colspan='10'> <hr> </td> </tr> <tr> <td style='white-space:nowrap;' align='center'> <div class="appgrp"> <div class='applist_button' onclick="admin_click('admin/main.php')"> <div class='applist_gradient'> <img class='applist_button_img' src='images/admin.png'> </div> <div class='admin_label'> <p>Admin</p> </div> </div> <div class="applist_button show_sub_diag" onclick='transaction_click("PAY","payroll/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/PAY.png' ></div><div class='admin_label'><p>Payroll</p></div></div><div class="applist_button " onclick='transaction_click("HR","hris/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/hr_0.png' ></div><div class='admin_label'><p>Human Resource Information System</p></div></div><div class="applist_button " onclick='transaction_click("TKM","tkm/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/clock.png' ></div><div class='admin_label'><p>Time Keeping Management</p></div></div> </div> </td> </tr> </table> </td> </tr> <tr style="height:50px;"> <td colspan="100"></td> </tr> <tr> <td colspan="10" align="center"> <input type="button" class="print" onclick="open_seccode_diag()" value="Enter Security Code"> </td> </tr> </table> </div> </div> <br> <br> <br> <div id="seccode_diag" style="display: none;"> <table><tr><td style="width:110px;">Select Program</td><td><select class="input" style="margin-right:10px;" id="seccode_path"><option value="payroll/bridge/">Payroll</option><option value="hris/bridge/">Human Resource Information System</option><option value="tkm/bridge/">Time Keeping Management</option></select></td></tr></table></div> <div id="diag_subsidiary" style="display:none;"> <table style="width:100%"> <!-- <tr> <td colspan="100"><i>Note: Only subsidiaries with <i id="subdry_note"></i> database connection setup.</i></td> </tr> --> <tr> <td><b>Subsidiary</b></td> <td><select id="pay_subdrycde" name="pay_subdrycde" class="input"></select></td> </tr> </table> </div> <!-- <footer> <div class="ftr_con" style='font-size:11px;width:60%'> <p>Copyright © 2015, LEE Systems Technology Ventures</p> <p align='right' style='padding-right : 18px;font-size : 11px;font-weight : bold;'>IP Details : 10.0.0.18</p> </div> </footer> --> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | 20190311 |
| Request Header - size: 234 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/login_applist.php HTTP/1.1
Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 Host: 192.168.2.47 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:01:31 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 19,386 bytes. |
<style type="text/css">
.div_border_front2 table:nth-child(2) input[type="button"] { color: #fff; background: #627d4d; } #forgot { color: ; } .applist_gradient { background: #627d4d; } .head_title { color: #fff; } .head_title, .apptitle { text-transform: uppercase; } .head_title1, .apptitle1 { text-transform: uppercase; } .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header { background: #627d4d; } .ui-widget-header { background: #627d4d !important; color: #fff; } .ui-dialog .ui-dialog-buttonpane button { color: #fff; } header#header,.theme_header { background: #627d4d !important; } /*header#header2 { background: #627d4d; }*/ ._program li { color: #fff; } .button1 { color: #fff; background: #627d4d; } ._figure span:first-child { color: #fff; } #hris_sub_container ul figure { background: #627d4d; } .dc_empstatico { color: ; /* colored */ } .dbg_empstatico { background: #627d4d; /* colored */ } ::-webkit-scrollbar { background: #627d4d; } ::-webkit-scrollbar-thumb { background: #627d4d; } #hris_sub_container header { color: ; /* colored */ } .gp, .ui-widget-header, .fc-day-header, { background: #627d4d; } .ui-widget-header, .fc-day-header { color : white !important;; } </style><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "/strict.dtd"> <html> <head> <title>WEBTEMPLATE</title> <link REL="SHORTCUT ICON" HREF="./images/lst_logo.ico" /> <link href='../css/applist.css' media='screen' type='text/css' /> <!-- include a theme, can be included into the core instead of 2 separate files --> <link rel="stylesheet" href="lib/alertify/css/themes/bootstrap.min.css" /> <link rel="stylesheet" href="./css/modified_layout.css" type="text/css" media="screen" /> <link rel='stylesheet' type='text/css' media='screen' href='./css/layout.css'/> </head> <body> <form name='myform' id='myform' method='post'> <link rel='stylesheet' type='text/css' href='css/login.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_view.css?v=20220209161346' /><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/layout.css?v=20220209161346' /><script type='text/javascript' src='javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='lib/pager.js?v=20220209161352'></script><link rel='stylesheet' type='text/css' href='css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/pager.css?v=20220209161346' /><script type='text/javascript' src='lib/alertify/alertify.min.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/login_page.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/applist.css?v=20220209161346' /> <!-- <link rel="stylesheet" type="text/css" href="css/login_page.css"> --> <input name='xpage_uri' id='xpage_uri'> <input name='xpage_dir' id='xpage_dir'> <input name='txt_action' id='txt_action'> <input name='txtappcde' id='txtappcde'> <input name='txtoutsource' id='txtoutsource'> <input id='seccode_validated' value=""> <input id="gl_comcde" name="gl_comcde" value="ATESTWEBTKM"> <!-- <input type="hidden" id="tmp_redirect_path" name="tmp_redirect_path"> --> <!-- <input type="hidden" id="tmp_appcde" name="tmp_appcde"> --> <style type="text/css"> .seccode_continue:hover { color: white; background-color: #1947D1 !important; border: 0; } .seccode_continue { background-color: #335CD6 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; /* border-radius: .3em; */ width: auto; min-width: 70px; } .seccode_cancel:hover { color: white; background-color: #990000 !important; border: 0; } .seccode_cancel { /* border-radius: .3em; */ background-color: #aa4935 !important; font-weight: bold; height: 30px; border: 0; /*padding: 0 10px;*/ color: white; cursor: pointer; font-family: arial; width: 70px; /*margin-right: 3px;*/ } </style> <script type='text/javascript'> //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "WEBAPP"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function() {}; jQuery(document).ready(function() { if (jQuery('#seccode_validated').val() == 0 && jQuery('#seccode_validated').val() != '') { alertify.alert('Accesing any programs must start here.'); } jQuery('#seccode_diag').dialog({ title: "Security Code", resizable: false, autoOpen: false, height: 'auto', width: 'auto', position: { my: "center", at: "center", of: window }, modal: true, open: function() { jQuery('body').css('overflow', 'hidden'); jQuery('.ui-button-icon-primary.ui-icon.ui-icon-closethick').closest('button').remove(); jQuery(this).closest('.ui-dialog').find('.seccode_cancel').focus(); }, close: function() { jQuery('body').css('overflow', 'auto'); }, buttons: [{ text: "Continue", "class": 'seccode_continue', click: function() { val_seccode_path(jQuery('#seccode_diag').find('#seccode_path')); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { jQuery('#seccode_diag').dialog('close'); } }, ] }); jQuery('#diag_subsidiary').dialog({ title: 'Select Subsidiary', width: 500, height: 'auto', draggable: false, resizable: false, autoOpen: false, modal: true, open: function() { jQuery('.ui-dialog-titlebar-close').hide(); }, buttons: [{ text: "Proceed", "class": 'seccode_continue', click: function() { update_pay_subdrycde_link($(this).find('#pay_subdrycde').val()); } }, { text: "Cancel", "class": 'seccode_cancel', click: function() { $(this).dialog('close'); } }, ] }); }) function val_blank_session() { alertify.alert('You must login first.', function() { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) // window.open('login_view.php', '_self'); }) } function val_seccode(xloc, xcde) { var xdata = "event_action=val_seccode"; xdata += "&xloc=" + xloc; xdata += "&xcde=" + xcde; xdata += "&" + jQuery('#myform *').serialize(); return jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata }); } function val_seccode_path(selectObj) { var xdata = "event_action=val_seccode_path"; xdata += "&apploc=" + selectObj.val(); xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { if (xret.bridge_found) { // document.forms.myform.txtappcde.value=selectObj.find("option:selected").data('appcde'); document.forms.myform.action = selectObj.val(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { alertify.alert(selectObj.find(':selected').text(), xret.bridge_found_msg); } } }); } function open_seccode_diag() { var xdata = "event_action=validate_comcde"; xdata += "&" + jQuery('#myform *').serialize(); jQuery.ajax({ url: 'lstv_sys_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(xret) { jQuery('#seccode_diag').dialog('open'); } }); } function transaction_click(xappcde, xloc, obj) { // alert(xappcde,xloc,obj); document.forms.myform.action = xloc; document.forms.myform.txtappcde.value = xappcde; if (jQuery(obj).hasClass('show_sub_diag') || xappcde == "PAY") { var xdata = "event_action=get_user_subdry&xappcde=" + xappcde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { $.unblockUI(); console.log(response) if (response.pass == true) { if (response.show_diag == true && response.has_access == true) { var subdry_note = "Payroll"; if(xappcde == "PAY_OUTSRC") { subdry_note = "Payroll Out Sourcing"; } jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); // jQuery('#diag_subsidiary').find('#subdry_note').html(subdry_note); jQuery('#diag_subsidiary').dialog('open'); } else if (response.show_diag == false && response.has_access == true) { blockui(); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { jQuery('#diag_subsidiary').find('#pay_subdrycde').html(response.options); update_pay_subdrycde_link($('#pay_subdrycde').val()); } } else { alertify.alert('You must have a subsidiary access to use the payroll program.'); } } }); } else { blockui(); //20190311 donita //add check update structure // if(xappcde != "PAY_OUTSRC" || xappcde != "PAY") // { update_empstatus(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action = "admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); // } // else // { // document.forms.myform.method='POST'; // document.forms.myform.target = '_self'; // document.forms.myform.submit(); // } } } function update_empstatus(subdrycde="") { var xdata= "event_action=update_empstatus&subdrycde="+subdrycde; jQuery.ajax({ type : 'post', data : xdata, url : 'login_applist_ajax.php', success : function (xretobj) { } }); } function logout_click() { alertify.confirm('Are you sure you want to logout?', function() { blockui(); var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { getclientdir().done(function(ret){ var clientprogdir = ret.clientdir; if(clientprogdir != '' && clientprogdir != 'null' && clientprogdir != null){ window.open(clientprogdir, "_self") } else{ window.open('login_view.php', '_self'); } }) } }); }); } function update_pay_subdrycde_link(xsubdrycde) { blockui(); var xdata = "event_action=check_update_structure&xappcde=HRPAYTKM"; jQuery.ajax({ url: 'ajax_check_update_structure.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { if (response.bool) { var xappcde = $('#txtappcde').val(); var xdata = "event_action=update_pay_subdrycde_link&xappcde=" + xappcde; xdata += "&subdrycde=" + xsubdrycde; jQuery.ajax({ url: 'login_applist_ajax.php', type: 'post', dataType: 'json', data: xdata, success: function(response) { jQuery('#diag_subsidiary').dialog('close'); document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } }); } else { if (response.usrlvl == 'user') { alertify.alert("Needs an update. Inform the admin.", function() { var xdata = "txt_action=logout"; jQuery.ajax({ type: 'post', data: xdata, url: 'login_proc.php', success: function(xretobj) { window.open('login_view.php', '_self') } }); }); } else { alertify.confirm(response.appname + " Needs an update. Proceed to update structure?", function() { document.forms.myform.action="admin/view_update_struct.php"; document.forms.myform.txtappcde.value=xappcde; document.forms.myform.txt_action.value='download_database'; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); }, function() { unblockui(); }); } } } }); } function admin_click(xloc) { document.forms.myform.action = xloc; document.forms.myform.method = 'POST'; document.forms.myform.target = '_self'; document.forms.myform.submit(); } function getclientdir(){ var xparams = 'txt_action=getclientdir'; return jQuery.ajax({ dataType: 'json', type: 'post', data: xparams, url : 'login_validate_redirect.php' }) } </script> <style> footer { width: 580px; margin: 0 auto 50px; } footer .ftr_con { margin: 20px auto 0; } footer .ftr_con p { text-align: center; } .appgrp { margin-top: 20px; display: flex; justify-content: center; align-items: center; } </style> <!-- <form id="myform"> </form> --> <div class='applist_body' align='center'> <div class='applist_all'> <div class="logo"> <img src='img/lst.png' style="width: 100%;height: 100%;"> </div> <table border='0' align='center'> <tr> <td align='center'> <table class='applist_table'> <tr> <td align='right' colspan='10'> <span class='applist_logout' onclick='logout_click()'><b>LOGOUT</b></span> </td> </tr> <tr> <td colspan='10'> <hr> </td> </tr> <tr> <td style='white-space:nowrap;' align='center'> <div class="appgrp"> <div class='applist_button' onclick="admin_click('admin/main.php')"> <div class='applist_gradient'> <img class='applist_button_img' src='images/admin.png'> </div> <div class='admin_label'> <p>Admin</p> </div> </div> <div class="applist_button show_sub_diag" onclick='transaction_click("PAY","payroll/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/PAY.png' ></div><div class='admin_label'><p>Payroll</p></div></div><div class="applist_button " onclick='transaction_click("HR","hris/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/hr_0.png' ></div><div class='admin_label'><p>Human Resource Information System</p></div></div><div class="applist_button " onclick='transaction_click("TKM","tkm/main.php",this)'><div class='applist_gradient' ><img class='applist_button_img' src='./images/clock.png' ></div><div class='admin_label'><p>Time Keeping Management</p></div></div> </div> </td> </tr> </table> </td> </tr> <tr style="height:50px;"> <td colspan="100"></td> </tr> <tr> <td colspan="10" align="center"> <input type="button" class="print" onclick="open_seccode_diag()" value="Enter Security Code"> </td> </tr> </table> </div> </div> <br> <br> <br> <div id="seccode_diag" style="display: none;"> <table><tr><td style="width:110px;">Select Program</td><td><select class="input" style="margin-right:10px;" id="seccode_path"><option value="payroll/bridge/">Payroll</option><option value="hris/bridge/">Human Resource Information System</option><option value="tkm/bridge/">Time Keeping Management</option></select></td></tr></table></div> <div id="diag_subsidiary" style="display:none;"> <table style="width:100%"> <!-- <tr> <td colspan="100"><i>Note: Only subsidiaries with <i id="subdry_note"></i> database connection setup.</i></td> </tr> --> <tr> <td><b>Subsidiary</b></td> <td><select id="pay_subdrycde" name="pay_subdrycde" class="input"></select></td> </tr> </table> </div> <!-- <footer> <div class="ftr_con" style='font-size:11px;width:60%'> <p>Copyright © 2015, LEE Systems Technology Ventures</p> <p align='right' style='padding-right : 18px;font-size : 11px;font-weight : bold;'>IP Details : 10.0.0.18</p> </div> </footer> --> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| Instances | 37 |
| Solution |
Manually confirm that the timestamp data is not sensitive, and that the data cannot be aggregated to disclose exploitable patterns.
|
| Reference | http://projects.webappsec.org/w/page/13246936/Information%20Leakage |
| Tags |
OWASP_2021_A01
OWASP_2017_A03 |
| CWE Id | 200 |
| WASC Id | 13 |
| Plugin Id | 10096 |
|
Informational |
Base64 Disclosure |
|---|---|
| Description |
Base64 encoded data was disclosed by the application/web server. Note: in the interests of performance not all base64 strings in the response were analyzed individually, the entire response should be looked at by the analyst/security team/developer(s).
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/css/layout_body_lst.css?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 |
| Request Header - size: 506 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/css/layout_body_lst.css?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: text/css,*/*;q=0.1 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,130 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:59 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 68509 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/css |
| Response Body - size: 68,509 bytes. |
/* Essentials */
/* @import url(http://fonts.googleapis.com/css?family=Lato:300,400,700); */ html, div, map, dt, isindex, form, header, aside, section, section, article, footer { display: block; } html, body { height: 100%; width: 100%; /*min-height:200px;*/ /*min-width: 800px;*/ margin: 0; padding: 0; clear: both; /* font-family: "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif; */ font-family: Arial, Helvetica, sans-serif; font-size: 12px; } .title { border-bottom:1px solid black; } hgroup { min-width: 150px; } h4 { color: black; padding: 0em 0 0.2em; margin: 0; font-weight: 750; font-family:arial; /* text-shadow: 0 -1px 0 black; */ } h6{ /* font-weight: 100; */ padding: 1em 2em; color: #999; /* display: inline-block; */ } #menu_panel{ background: #E0E0E3 url(../images/sidebar.png) repeat; width:100%; height: 90%; margin-top:0px; z-index: 9999999; position: absolute; } #menu_panel a{ font-weight:100; } .clear { clear: both; } .spacer { height: 20px; } a:link, a:visited { color: #77BACE; text-decoration: none; } a:hover { text-decoration: underline; cursor: pointer; } /* Header */ .input{ width:100%; border-radius:.3em; border:1px solid silver; height:35px; font-size:13px; text-indent:5px; } .required{ background-color:#ffffcc; border:1px solid silver; } header#header h1.site_title, header#header h2.section_title { float: left; margin: 0; font-size: 22px; display: block; /* width: 23%; */ width: 160px; height: 55px; font-weight: normal; text-align: left; text-indent: 1.8%; line-height: 55px; color: #fff; text-shadow: 0 -1px 0 #000; } header#header h1.site_title a { color: #fff; text-decoration: none; margin-left: -20px; white-space: nowrap; } header#header h2.section_title { text-align: left; text-indent: 20px; width: 70%; min-width: 200px; /* background: url(../images/header_shadow.png) no-repeat left top; */ } .lbl_user { background: url(../images/icn_user.png) no-repeat right; background-size: 14px 14px; text-shadow: 0 -1px 0 #000; } .hover1:hover{ text-decoration: underline; } .tbl_user { float: right; display: block; width: 22%; padding-top: 10px; /* margin-right:30px;*/ /* padding-right: 20px; */ margin-left: 10px; /* padding-right:20px; */ /* border:1px solid black; */ } .tbl_user p { cursor:pointer; text-align: center; color: #282828; text-decoration: none; /*text-shadow: 0 -1px 0 #000;*/ font-size:14px; margin-left:15px; font-weight: normal } .tbl_user p:hover { text-decoration: underline; } /* Secondary Header Bar */ section#secondary_bar { height: 34px; width: 100%; /*min-width:1280px;*/ /*background: #F1F1F4; url(../images/secondary_bar.png) repeat-x;*/ background: #f1f1f4; box-shadow: 0 1px 2px #999; } section#secondary_bar .user { float: left; width: 23%; min-width: 350px; height: 38px; margin-right:-140px; } .user p { margin:0; padding: 0; color: #666666; font-weight: bold; display: block; width: 60%; height: 35px; /* border:1px solid black; */ /* line-height: 30px; */ text-indent: 25px; text-shadow: 0 1px 0 #fff; margin-left:0; padding-top: 10px; } .user a { text-decoration: none; color: #666666} .user a:hover { color: #77BACE; } .user a.logout_user { float: left; display: block; width: 16px; height: 35px; text-indent: -5000px;text-indent: -5000px; background: url(../images/icn_logout.png) center no-repeat; } /* Breadcrumbs */ section#secondary_bar .breadcrumbs_container { float: left; width: 50%; padding-left:0px; margin-right:0%; display: block; /* padding-right:-200px; */ /* border:1px solid black; */ /* background: url(../images/secondary_bar_shadow.png) no-repeat left top; */ height: 38px; } article.breadcrumbs { float: left; padding: 0 10px; border: 1px solid #ccc; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; /*-webkit-box-shadow: 0 1px 0 #fff;*/ /*-moz-box-shadow: 0 1px 0 #fff;*/ /*box-shadow: 0 1px 0 #fff;*/ height: 23px; margin: 4px 3%; } .breadcrumbs a { display: inline-block; float: left; height: 24px; line-height: 23px; font-size: 13px; } .breadcrumbs a.current, .breadcrumbs a.current:hover { color: #9E9E9E; /*font-weight: bold;*/ /*text-shadow: 0 1px 0 #fff;*/ text-decoration: none; } .breadcrumbs a:link, .breadcrumbs a:visited { color: #44474F; text-decoration: none; /*text-shadow: 0 1px 0 #fff;*/ /*font-weight: bold;*/ } .breadcrumbs a:hover { color: #222222; text-decoration: underline; } .breadcrumb_divider { display: inline-block; width: 12px; height: 24px; background: url(../images/breadcrumb_divider.png) no-repeat; float: left; margin: 0 5px; } /* Search */ .quick_search { text-align: center; padding: 14px 0 10px 0; } .quick_search input[type=text] { -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; border: 1px solid #bbb; height: 26px; width: 90%; color: #ccc; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; -moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; text-indent: 30px; background: #fff url(../images/icn_search.png) no-repeat; background-position: 10px 6px; } .quick_search input[type=text]:focus { outline: none; color: #666666; border: 1px solid #77BACE; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; -moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; } /* Sidebar Menu */ #div_menu .sidebar_con { width: 300px; height: 96%; float: left; overflow-x: hidden; overflow-y: auto; z-index: 1002; position: absolute; background: #E0E0E3 url(../images/sidebar.png) repeat; } aside#sidebar { /* max-width: 24%; height:auto; min-height: 1600px; */ /* min-width: 250px; */ height:560px; overflow-x: hidden; overflow-y: auto; } #sidebar hr { border: none; outline: none; /* background: url(../images/sidebar_divider.png) repeat-x; */ display: block; width: 100%; height: 2px; } #sidebar h3 { color: #1F1F20; text-transform: uppercase; text-shadow: 0 1px 0 #fff; font-size: 12px; margin:0px; display: block; float: left; width: 100%; height: 20px; padding-top:10px; padding-bottom:7px; /* margin-left: 5px; */ text-indent: 20px; word-wrap: break-word; border-top-left-radius:100em; margin-top:2px; border-bottom-left-radius:100em; } .menu_label{ text-shadow: 0 -1px 0; font-size:13px; font-weight: 200; color: #282828; margin-left: -23px; } .menu_label:hover { cursor: pointer; text-decoration: underline; } .toggleLink { /* color: #999999; */ font-size: 10px; text-decoration: none; display: block; float: right; margin-right: 2% } #sidebar .toggleLink:hover { color: #77BACE; text-decoration: none; } #sidebar ul { clear: both; margin: 0; padding: 0; } #sidebar li { list-style: none; margin: 0 0 0 12%; padding: 0; } #sidebar li a { color: black; padding-left: 10px; text-decoration: none; display: inline-block; height: 17px; line-height: 17px; font-weight: normal; /* text-shadow: 0 1px 0 #fff; */ margin: 2px 0; } #sidebar li a:hover { font-weight: 650; } /* Sidebar Icons */ #sidebar li.icn_new_article a { background: url(../images/icn_new_article.png) no-repeat center left; } #sidebar li.icn_edit_article a { background: url(../images/icn_edit_article.png) no-repeat center left; } #sidebar li.icn_categories a { background: url(../images/icn_categories.png) no-repeat center left; } #sidebar li.icn_tags a { background: url(../images/icn_tags.png) no-repeat center left; } #sidebar li.icn_add_user a { background: url(../images/icn_add_user.png) no-repeat center left; } #sidebar li.icn_view_users a { background: url(../images/icn_view_users.png) no-repeat center left; } #sidebar li.icn_profile a { background: url(../images/icn_profile.png) no-repeat center left; } #sidebar li.icn_folder a { background: url(../images/icn_folder.png) no-repeat center left; } #sidebar li.icn_photo a { background: url(../images/icn_photo.png) no-repeat center left; } #sidebar li.icn_audio a { background: url(../images/icn_audio.png) no-repeat center left; } #sidebar li.icn_video a { background: url(../images/icn_video.png) no-repeat center left; } #sidebar li.icn_settings a { background: url(../images/icn_settings.png) no-repeat center left; } #sidebar li.icn_security a { background: url(../images/icn_security.png) no-repeat center left; } #sidebar li.icn_jump_back a { background: url(../images/icn_jump_back.png) no-repeat center left; } #sidebar p { color: #666666; padding-left: 6%; text-shadow: 0 1px 0 #fff; margin: 10px 0 0 0;} #sidebar a { color: #666666; text-decoration: none; } #sidebar a:hover { text-decoration: underline; } #sidebar h3:hover{ background:white; } #sidebar h3.active{ /* text-decoration:underline; */ background-color:white; } #sidebar footer { margin-top: 20%; } aside#sidebar2 { width: 23%; height: auto; min-height:1000px; /* height:100%; */ background: #E0E0E3 url(../images/sidebar.png) repeat; float: left; margin-top: 0px; z-index: 9999999; position: absolute; } #sidebar2 hr { border: none; outline: none; background: url(../images/sidebar_divider.png) repeat-x; display: block; width: 100%; height: 2px; } /* Search */ .quick_search { text-align: center; padding: 14px 0 10px 0; } .quick_search input[type=text] { -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; border: 1px solid #bbb; height: 26px; width: 90%; color: #ccc; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; -moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; text-indent: 30px; background: #fff url(../images/icn_search.png) no-repeat; background-position: 10px 6px; } .quick_search input[type=text]:focus { outline: none; color: #666666; border: 1px solid #77BACE; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; -moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; } /* Sidebar Menu */ #sidebar2 h3 { color: #1F1F20; text-transform: uppercase; text-shadow: 0 1px 0 #fff; font-size: 13px; margin: 10px 0 10px 6%; display: block; float: left; width: 90%; } #sidebar2 h3:hover{ text-decoration:underline; } /*.menu_label{*/ /*/**/ /*margin-left:40px;*/ /**/*/ /*text-shadow: 0 -1px 0 solver;*/ /*font-size:15px;*/ /*font-weight: bold;*/ /*color:#000;*/ /*}*/ /*.menu_label:hover {*/ /*text-decoration: underline;*/ /*}*/ .toggleLink { /* color: #999999; */ font-size: 10px; text-decoration: none; display: block; float: right; margin-right: 2% } #sidebar2 .toggleLink:hover { color: #77BACE; text-decoration: none; } #sidebar2 ul { clear: both; margin: 0; padding: 0; } #sidebar2 li { list-style: none; margin: 0 0 0 12%; padding: 0; } #sidebar2 li a { color: #666666; padding-left: 25px; text-decoration: none; display: inline-block; height: 17px; line-height: 17px; text-shadow: 0 1px 0 #fff; margin: 2px 0; } #sidebar2 li a:hover { color: #444444; } /* Sidebar Icons */ #sidebar2 li.icn_new_article a { background: url(../images/icn_new_article.png) no-repeat center left; } #sidebar2 li.icn_edit_article a { background: url(../images/icn_edit_article.png) no-repeat center left; } #sidebar2 li.icn_categories a { background: url(../images/icn_categories.png) no-repeat center left; } #sidebar2 li.icn_tags a { background: url(../images/icn_tags.png) no-repeat center left; } #sidebar2 li.icn_add_user a { background: url(../images/icn_add_user.png) no-repeat center left; } #sidebar2 li.icn_view_users a { background: url(../images/icn_view_users.png) no-repeat center left; } #sidebar2 li.icn_profile a { background: url(../images/icn_profile.png) no-repeat center left; } #sidebar2 li.icn_folder a { background: url(../images/icn_folder.png) no-repeat center left; } #sidebar2 li.icn_photo a { background: url(../images/icn_photo.png) no-repeat center left; } #sidebar2 li.icn_audio a { background: url(../images/icn_audio.png) no-repeat center left; } #sidebar2 li.icn_video a { background: url(../images/icn_video.png) no-repeat center left; } #sidebar2 li.icn_settings a { background: url(../images/icn_settings.png) no-repeat center left; } #sidebar2 li.icn_security a { background: url(../images/icn_security.png) no-repeat center left; } #sidebar2 li.icn_jump_back a { background: url(../images/icn_jump_back.png) no-repeat center left; } #sidebar2 p { color: #666666; padding-left: 6%; text-shadow: 0 1px 0 #fff; margin: 10px 0 0 0;} #sidebar2 a { color: #666666; text-decoration: none; } #sidebar2 a:hover { text-decoration: underline; } #sidebar2 footer { margin-top: 20%; } .menutable{ width:90%; height:auto; } .menutable a{ font-size:13px; } .menutable tr{ padding-bottom:200px; } /* Main Content */ /* div#main { width: 77%; min-height: 500px; background: url(../images/sidebar_shadow.png) repeat-y left top; float: left; margin-top:0px; } */ #main h3 { color: #1F1F20; text-transform: uppercase; /* text-shadow: 0 1px 0 #fff; */ font-size: 14px; /*margin: 8px 20px;*/ margin-top: 10px; margin-left: 20px; } /* Modules */ .module { /*border: 1px solid #9BA0AF;*/ width: 100%; margin: 20px 3% 0 3%; margin-top: 20px; /*-webkit-border-radius: 5px;*/ /*-moz-border-radius: 5px;*/ /*border-radius: 5px;*/ background: #f1f1f1; box-shadow: 0 1px 3px #888, 0 0 2px #bbb; } #main .module header h3 { display: block; width: 90%; float: left; } .module header { height: 30px; width: 100%; /*background: #F1F1F4 url(../images/secondary_bar.png) repeat-x; background-size:100% 111%; */ /*-webkit-border-top-left-radius: 5px; -webkit-border-top-right-radius: 5px;*/ /*-moz-border-radius-topleft: 5px; -moz-border-radius-topright: 5px;*/ /*border-top-left-radius: 5px; border-top-right-radius: 5px;*/ background: #f1f1f4; box-shadow: 0 1px 2px #aaa; } .module footer { height: 32px; width: 100%; border-top: 1px solid #9CA1B0; background: #F1F1F4 url(../images/module_footer_bg.png) repeat-x; -webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 5px; -moz-border-radius-bottomleft: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 5px; } .module_content { margin: 10px 20px; color: #666;} /* Module Widths */ .width_full { width: 95%; } .width_half { width: 46%; margin-right: 0; float: left; } .width_quarter { width: 26%; margin-right: 0; float: left; } .width_3_quarter { width: 66%; margin-right: 0; float: left; } /* Stats Module */ .stats_graph { width: 64%; float: left; } .stats_overview { background: #F6F6F6; border: 1px solid #ccc; float: right; width: 26%; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .overview_today, .overview_previous { width: 50%; float: left;} .stats_overview p { margin: 0; padding: 0; text-align: center; text-transform: uppercase; text-shadow: 0 1px 0 #fff; } .stats_overview p.overview_day { font-size: 12px; font-weight: bold; margin: 6px 0; } .stats_overview p.overview_count { font-size: 26px; font-weight: bold; color: #333333;} .stats_overview p.overview_type { font-size: 10px; color: #999999; margin-bottom: 8px} /* Content Manager */ .tablesorter { width: 100%; margin: -5px 0 0 0; } .tablesorter td{ margin: 0; padding: 0; border-bottom: 1px dotted #ccc; } .tablesorter thead tr { height: 34px; background: url(../images/table_sorter_header.png) repeat-x; text-align: left; text-indent: 10px; cursor: pointer; } .tablesorter td { padding: 15px 10px; } .tablesorter input[type=image] { margin-right: 10px;} ul.tabs { margin: 3px 10px 0 0; padding: 0; float: right; list-style: none; height: 24px; /*--Set height of tabs--*/ -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; -webkit-box-shadow: 0 1px 0 #fff; -moz-box-shadow: 0 1px 0 #fff; box-shadow: 0 1px 0 #fff; border: 1px solid #ccc; font-weight: bold; text-shadow: 0 1px 0 #fff; } ul.tabs li { float: left; margin: 0; padding: 0; line-height: 24px; } ul.tabs li a { text-decoration: none; color: #999; display: block; padding: 0 10px; height: 24px; } ul.tabs li a:hover { color: #44474F; } html ul.tabs li.active a { color: #44474F; } html ul.tabs li.active, html ul.tabs li.active a:hover { background: #F1F2F4; -webkit-box-shadow: inset 0 2px 3px #818181; -moz-box-shadow: inset 0 2px 3px #818181; box-shadow: inset 0 2px 3px #818181; } html ul.tabs li:first-child, html ul.tabs li:first-child a { -webkit-border-top-left-radius: 5px; -webkit-border-bottom-left-radius: 5px; -moz-border-radius-topleft: 5px; -moz-border-radius-bottomleft: 5px; border-top-left-radius: 5px; border-bottom-left-radius: 5px; } html ul.tabs li:last-child, html ul.tabs li:last-child a { -webkit-border-top-right-radius: 5px; -webkit-border-bottom-right-radius: 5px; -moz-border-radius-topright: 5px; -moz-border-radius-bottomright: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; } #main .module header h3.tabs_involved { display: block; width: 60%; float: left; } /* Messages */ .message { border-bottom: 1px dotted #cccccc; } input[type=submit] { background: #D0D1D4 url(../images/btn_submit.png) repeat-x; border: 1px solid #A8A9A8; -webkit-box-shadow: 0 1px 0 #fff; -moz-box-shadow: 0 1px 0 #fff; box-shadow: 0 1px 0 #fff; font-weight: bold; height: 22px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; padding: 0 10px; color: #666; text-shadow: 0 1px 0 #fff; cursor: pointer; } input[type=submit]:hover { color: #333333; } /* input[type=button] { background: #D0D1D4 url(../images/btn_submit.png) repeat-x; border: 1px solid #A8A9A8; -webkit-box-shadow: 0 1px 0 #fff; -moz-box-shadow: 0 1px 0 #fff; box-shadow: 0 1px 0 #fff; font-weight: bold; height: 22px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; padding: 0 10px; color: #666; text-shadow: 0 1px 0 #fff; cursor: pointer; } input[type=button]:hover { color: #333333; } */ .save { background-color:#339933; font-weight: bold; height: 30px; border: 0; padding: 0 10px; color: white; cursor: pointer; font-family:arial; /*border-radius: .3em;*/ width: auto; min-width: 70px; margin-right: 3px; } .save:hover { color: white; background-color:green; border: 0; } .exit { /*border-radius: .3em;*/ background-color:#aa4935; font-weight: bold; height: 30px; border: 0; padding: 0 10px; color: white; cursor: pointer; font-family:arial; width: auto; min-width: 70px; margin-right: 3px; } .exit:hover { color: white; background-color:#990000; border:0; } .print { background-color:#335CD6; font-weight: bold; height: 30px; border: 0; padding: 0 10px; color: white; cursor: pointer; font-family:arial; /*border-radius: .3em;*/ width: auto; min-width: 70px; margin-right: 3px; } .print:hover { color: white; background-color:#1947D1; border: 0; } input#pager_search_input { padding: 6px; margin: 0 5px; border: 1px solid #bbb; } select#pager_search { padding: 5px; border: 1px solid #bbb; } input[type=submit].alt_btn { background: #D0D1D4 url(../images/btn_submit_2.png) repeat-x; border: 1px solid#30B0C8; -webkit-box-shadow: 0 1px 0 #fff; -moz-box-shadow: 0 1px 0 #fff; box-shadow: 0 1px 0 #fff; font-weight: bold; height: 22px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; padding: 0 10px; color: #003E49; text-shadow: 0 1px 0 #6CDCF9; cursor: pointer; } input[type=submit].alt_btn:hover { color: #001217; } input[type=submit].btn_post_message { background: #D0D1D4 url(../images/post_message.png) no-repeat; display: block; width: 37px; border: none; height: 24px; cursor: pointer; text-indent: -5000px; } input[type=submit].btn_post_message:hover { background-position: 0 -24px; } .post_message { text-align: left; padding: 5px 0; } .post_message input[type=text] { -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; border: 1px solid #bbb; height: 20px; width: 70%; color: #ccc; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; -moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; text-indent: 10px; background-position: 10px 6px; float: left; margin: 0 3.5%; } .post_message input[type=text]:focus { outline: none; border: 1px solid #77BACE; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; -moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; color: #666666; } .post_message input[type=image] { float: left; } .message_list { height: 250px; /* overflow-x:hidden; */ /* overflow-y: scroll; */ } /* New/Edit Article Module */ fieldset { -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; background: #F6F6F6; border: 1px solid #ccc; padding: 1% 0%; margin: 10px 0; } fieldset label { display: block; float: left; width: 200px; height: 25px; line-height: 25px; text-shadow: 0 1px 0 #fff; font-weight: bold; padding-left: 10px; margin: -5px 0 5px 0; text-transform: uppercase; } fieldset input[type=text] { /* -webkit-border-radius: 5px; -moz-border-radius: 5px; */ border-radius: .2em; /* border:1px solid silver */ padding-left: 5px; border: 1px solid #BBBBBB; width: 100%; /* height: 20px; */ /* color: #666666; */ /* -webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; -moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; */ /* background-position: 10px 6px; */ /* margin: 0; display: block; float: left; width: 96%; margin: 0 10px; */ } fieldset input[type=text]:focus { outline: none; border: 1px solid #77BACE; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; -moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; } fieldset input[type=password] { -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; border: 1px solid #BBBBBB; height: 20px; color: #666666; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; -moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; padding-left: 10px; background-position: 10px 6px; margin: 0; display: block; float: left; width: 96%; margin: 0 10px; } fieldset input[type=password]:focus { outline: none; border: 1px solid #77BACE; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; -moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; } fieldset select { width: 96%; margin: 0 10px; border: 1px solid #bbb; height: 20px; color: #666666; } fieldset textarea { -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; border: 1px solid #BBBBBB; color: #666666; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; -moz-box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; box-shadow: inset 0 2px 2px #ccc, 0 1px 0 #fff; padding-left: 10px; background-position: 10px 6px; margin: 0 0.5%; display: block; float: left; width: 96%; margin: 0 10px; } fieldset textarea:focus { outline: none; border: 1px solid #77BACE; -webkit-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; -moz-box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; box-shadow: inset 0 2px 2px #ccc, 0 0 10px #ADDCE6; } .submit_link { float: right; margin-right: 3%; padding: 5px 0; } .submit_link select { width: 150px; border: 1px solid #bbb; height: 20px; color: #666666; } #main .module_content h1 { color: #333333; text-transform: none; text-shadow: 0 1px 0 #fff; font-size: 22px; margin: 8px 0px; } #main .module_content h2 { color: #444444; text-transform: none; text-shadow: 0 1px 0 #fff; font-size: 18px; margin: 8px 0px; } #main .module_content h3 { color: #666666; text-transform: uppercase; text-shadow: 0 1px 0 #fff; font-size: 13px; margin: 8px 0px; } #main .module_content h4 { color: #666666; text-transform: none; text-shadow: 0 1px 0 #fff; font-size: 13px; margin: 8px 0px; } #main .module_content li { line-height: 150%; } /* Alerts */ #main h4.alert_info { display: block; width: 95%; margin: 20px 3% 0 3%; margin-top: 20px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; background: #B5E5EF url(../images/icn_alert_info.png) no-repeat; background-position: 10px 10px; border: 1px solid #77BACE; color: #082B33; padding: 10px 0; text-indent: 40px; font-size: 14px;} #main h4.alert_warning { display: block; width: 95%; margin: 20px 3% 0 3%; margin-top: 20px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; background: #F5F3BA url(../images/icn_alert_warning.png) no-repeat; background-position: 10px 10px; border: 1px solid #C7A20D; color: #796616; padding: 10px 0; text-indent: 40px; font-size: 14px;} #main h4.alert_error { display: block; width: 95%; margin: 20px 3% 0 3%; margin-top: 20px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; background: #F3D9D9 url(../images/icn_alert_error.png) no-repeat; background-position: 10px 10px; border: 1px solid #D20009; color: #7B040F; padding: 10px 0; text-indent: 40px; font-size: 14px;} #main h4.alert_success { display: block; width: 95%; margin: 20px 3% 0 3%; margin-top: 20px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; background: #E2F6C5 url(../images/icn_alert_success.png) no-repeat; background-position: 10px 10px; border: 1px solid #79C20D; color: #32510F; padding: 10px 0; text-indent: 40px; font-size: 14px;} .hoverTable{ width:100.01%; border-collapse:collapse; height:35px; /*border:2px solid #8e8e8e;*/ border-bottom: 1px solid #bbb; font-family:inherit; font-size:13px; } .hovertable th{ font-size:13px; text-align:center; background-color:#8e8e8e; font-weight: 700; color:white; } .hoverTable tr{ height:35px; text-align:center; } .hoverTable tr:nth-child(odd) { background:#ffffff; } .hoverTable tr:nth-child(odd):hover { background-color:#cbcbcb; } .hoverTable tr:nth-child(even) { background:#dfdfdf; } .hoverTable tr:nth-child(even):hover { background-color:#cbcbcb } .odd{ background:#ffffff; } .odd2{ background:#ffffff; } .odd:hover{ background-color:#cbcbcb; } .even{ background:#dfdfdf; } .even2{ background:#dfdfdf; } .even:hover{ background-color:#cbcbcb } /* Misc visuals ----------------------------------*/ /* Corner radius */ /*! jQuery UI - v1.11.2 - 2014-11-05 * http://jqueryui.com * Includes: core.css, draggable.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, menu.css, progressbar.css, selectmenu.css, slider.css, spinner.css, tabs.css, tooltip.css, theme.css * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Helvetica%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=2px&bgColorHeader=dddddd&bgTextureHeader=highlight_soft&bgImgOpacityHeader=50&borderColorHeader=dddddd&fcHeader=444444&iconColorHeader=0073ea&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=dddddd&fcContent=444444&iconColorContent=ff0084&bgColorDefault=f6f6f6&bgTextureDefault=highlight_soft&bgImgOpacityDefault=100&borderColorDefault=dddddd&fcDefault=0073ea&iconColorDefault=666666&bgColorHover=0073ea&bgTextureHover=highlight_soft&bgImgOpacityHover=25&borderColorHover=0073ea&fcHover=ffffff&iconColorHover=ffffff&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=dddddd&fcActive=ff0084&iconColorActive=454545&bgColorHighlight=ffffff&bgTextureHighlight=flat&bgImgOpacityHighlight=55&borderColorHighlight=cccccc&fcHighlight=444444&iconColorHighlight=0073ea&bgColorError=ffffff&bgTextureError=flat&bgImgOpacityError=55&borderColorError=ff0084&fcError=222222&iconColorError=ff0084&bgColorOverlay=eeeeee&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=80&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=60&thicknessShadow=4px&offsetTopShadow=-4px&offsetLeftShadow=-4px&cornerRadiusShadow=0px * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ /* Layout helpers ----------------------------------*/ .ui-helper-hidden { display: none; } .ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; border-collapse: collapse; } .ui-helper-clearfix:after { clear: both; } .ui-helper-clearfix { min-height: 0; /* support: IE7 */ } .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); /* support: IE8 */ } .ui-front { z-index: 1000; } .ui-dialog { z-index: 1001; } /* Interaction Cues ----------------------------------*/ .ui-state-disabled { cursor: default !important; } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } /* Misc visuals ----------------------------------*/ /* Overlays */ .ui-widget-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; /* z-index: 1001; */ } .ui-draggable-handle { -ms-touch-action: none; touch-action: none; } .ui-resizable { position: relative; } .ui-resizable-handle { position: absolute; font-size: 0.1px; display: block; -ms-touch-action: none; touch-action: none; } .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px; } .ui-selectable { -ms-touch-action: none; touch-action: none; } .ui-selectable-helper { position: absolute; z-index: 100; border: 1px dotted black; } .ui-sortable-handle { -ms-touch-action: none; touch-action: none; } .ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin: 2px 0 0 0; padding: .5em .5em .5em .7em; min-height: 0; /* support: IE7 */ font-size: 100%; } .ui-accordion .ui-accordion-icons { padding-left: 2.2em; } .ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; } .ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; } .ui-autocomplete { position: absolute; top: 0; left: 0; cursor: default; } .ui-button { display: inline-block; position: relative; padding: 0; line-height: normal; margin-right: .1em; cursor: pointer; vertical-align: middle; text-align: center; overflow: visible; /* removes extra width in IE */ } .ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; } /* to make room for the icon, a width needs to be set here */ .ui-button-icon-only { width: 2.2em; } /* button elements seem to need a little more width */ button.ui-button-icon-only { width: 2.4em; } .ui-button-icons-only { width: 3.4em; } button.ui-button-icons-only { width: 3.7em; } /* button text element */ .ui-button .ui-button-text { display: block; line-height: normal; } .ui-button-text-only .ui-button-text { padding: .4em 1em; } .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } /* no icon support for input elements, provide padding by default */ input.ui-button { padding: .4em 1em; } /* button icon element(s) */ .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } /* button sets */ .ui-buttonset { margin-right: 7px; } .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } /* workarounds */ /* reset extra padding in Firefox, see h5bp.com/l */ input.ui-button::-moz-focus-inner, button.ui-button::-moz-focus-inner { border: 0; padding: 0; } .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } .ui-datepicker .ui-datepicker-header { position: relative; padding: .2em 0; } .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position: absolute; top: 2px; width: 1.8em; height: 1.8em; } .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } .ui-datepicker .ui-datepicker-prev { left: 2px; } .ui-datepicker .ui-datepicker-next { right: 2px; } .ui-datepicker .ui-datepicker-prev-hover { left: 1px; } .ui-datepicker .ui-datepicker-next-hover { right: 1px; } .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } .ui-datepicker .ui-datepicker-title select { font-size: 1em; margin: 1px 0; } .ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { width: 45%; } .ui-datepicker table { width: 100%; table-layout: fixed; font-size: .9em; border-collapse: collapse; margin: 0 0 .4em; } .ui-datepicker th { /*padding: .7em .3em;*/ padding: .25em .3em; text-align: center; font-weight: bold; border: 0; } .ui-datepicker td { border: 0; padding: 1px; } .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; height: 100%; } .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding: 0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width: auto; overflow: visible; } .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float: left; } /* with multiple calendars */ .ui-datepicker.ui-datepicker-multi { width: auto; } .ui-datepicker-multi .ui-datepicker-group { float: left; } .ui-datepicker-multi .ui-datepicker-group table { width: 95%; margin: 0 auto .4em; } .ui-datepicker-multi-2 .ui-datepicker-group { width: 50%; } .ui-datepicker-multi-3 .ui-datepicker-group { width: 33.3%; } .ui-datepicker-multi-4 .ui-datepicker-group { width: 25%; } .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width: 0; } .ui-datepicker-multi .ui-datepicker-buttonpane { clear: left; } .ui-datepicker-row-break { clear: both; width: 100%; font-size: 0; } /* RTL support */ .ui-datepicker-rtl { direction: rtl; } .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } .ui-datepicker-rtl .ui-datepicker-buttonpane { clear: right; } .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, .ui-datepicker-rtl .ui-datepicker-group { float: right; } .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width: 0; border-left-width: 1px; } .ui-dialog { overflow: hidden; position: absolute; top: 0; left: 0; padding: .2em; outline: 0; } .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; font-size: 20px; } .ui-dialog .ui-dialog-title { float: left; margin: .1em 0; white-space: nowrap; width: 90%; overflow: hidden; text-overflow: ellipsis; } .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 20px; margin: -10px 0 0 0; padding: 1px; height: 20px; } .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; } .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin-top: .5em; padding: .3em 1em .5em .4em; } .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } .ui-dialog .ui-resizable-se { width: 12px; height: 12px; right: -5px; bottom: -5px; background-position: 16px 16px; } .ui-draggable .ui-dialog-titlebar { cursor: move; } .ui-menu { list-style: none; padding: 0; margin: 0; display: block; outline: none; } .ui-menu .ui-menu { position: absolute; } .ui-menu .ui-menu-item { position: relative; margin: 0; padding: 3px 1em 3px .4em; cursor: pointer; min-height: 0; /* support: IE7 */ /* support: IE10, see #8844 */ list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); } .ui-menu .ui-menu-divider { margin: 5px 0; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; } .ui-menu .ui-state-focus, .ui-menu .ui-state-active { margin: -1px; } /* icon support */ .ui-menu-icons { position: relative; } .ui-menu-icons .ui-menu-item { padding-left: 2em; } /* left-aligned */ .ui-menu .ui-icon { position: absolute; top: 0; bottom: 0; left: .2em; margin: auto 0; } /* right-aligned */ .ui-menu .ui-menu-icon { left: auto; right: 0; } .ui-progressbar { height: 2em; text-align: left; overflow: hidden; } .ui-progressbar .ui-progressbar-value { margin: -1px; height: 100%; } .ui-progressbar .ui-progressbar-overlay { background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); height: 100%; filter: alpha(opacity=25); /* support: IE8 */ opacity: 0.25; } .ui-progressbar-indeterminate .ui-progressbar-value { background-image: none; } .ui-selectmenu-menu { padding: 0; margin: 0; position: absolute; top: 0; left: 0; display: none; } .ui-selectmenu-menu .ui-menu { overflow: auto; /* Support: IE7 */ overflow-x: hidden; padding-bottom: 1px; } .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { font-size: 1em; font-weight: bold; line-height: 1.5; padding: 2px 0.4em; margin: 0.5em 0 0 0; height: auto; border: 0; } .ui-selectmenu-open { display: block; } .ui-selectmenu-button { display: inline-block; overflow: hidden; position: relative; text-decoration: none; cursor: pointer; } .ui-selectmenu-button span.ui-icon { right: 0.5em; left: auto; margin-top: -8px; position: absolute; top: 50%; } .ui-selectmenu-button span.ui-selectmenu-text { text-align: left; padding: 0.4em 2.1em 0.4em 1em; display: block; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ui-slider { position: relative; text-align: left; } .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; -ms-touch-action: none; touch-action: none; } .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } /* support: IE8 - See #6727 */ .ui-slider.ui-state-disabled .ui-slider-handle, .ui-slider.ui-state-disabled .ui-slider-range { filter: inherit; } .ui-slider-horizontal { height: .8em; } .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } .ui-slider-horizontal .ui-slider-range-min { left: 0; } .ui-slider-horizontal .ui-slider-range-max { right: 0; } .ui-slider-vertical { width: .8em; height: 100px; } .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } .ui-slider-vertical .ui-slider-range-min { bottom: 0; } .ui-slider-vertical .ui-slider-range-max { top: 0; } .ui-spinner { position: relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; } .ui-spinner-input { border: none; background: none; color: inherit; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; } .ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; } /* more specificity required here to override default borders */ .ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* vertically center icon */ .ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } .ui-spinner-up { top: 0; } .ui-spinner-down { bottom: 0; } /* TR overrides */ .ui-spinner .ui-icon-triangle-1-s { /* need to fix icons sprite */ background-position: -65px -16px; } .ui-tabs { position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ padding: .2em; } .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom-width: 0; padding: 0; white-space: nowrap; } .ui-tabs .ui-tabs-nav .ui-tabs-anchor { float: left; padding: .5em 1em; text-decoration: none; } .ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; } .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { cursor: text; } .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { cursor: pointer; } .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } .ui-tooltip { padding: 8px; position: absolute; z-index: 9999; max-width: 300px; -webkit-box-shadow: 0 0 5px #aaa; box-shadow: 0 0 5px #aaa; } body .ui-tooltip { border-width: 2px; padding: 5px; } /* Component containers ----------------------------------*/ .ui-widget { font-family: Helvetica,Arial,sans-serif; font-size: 1.1em; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Helvetica,Arial,sans-serif; font-size: 1em; } .ui-widget-content { /*border: 1px solid #dddddd;*/ background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x; color: #444444; overflow: visible !important; } .ui-widget-content a { color: #444444; } .ui-widget-header { /*border: 1px solid #dddddd;*/ background: #dddddd url("images/ui-bg_highlight-soft_50_dddddd_1x100.png") 50% 50% repeat-x; color: #444444; font-weight: bold; } .ui-widget-header a { color: #444444; } /* Interaction states ----------------------------------*/ .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } .ui-widget-content { border: 1px solid #ddd; background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x; color: #222222; } .ui-widget-content a { color: #222222; } .ui-widget-header { /*border: 1px solid #aaaaaa;*/ background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x; color: #222222; font-weight: bold; } .ui-widget-header a { color: #222222; } /* Interaction states ----------------------------------*/ .ui-tabs.ui-widget.ui-widget-content .ui-state-default, .ui-datepicker-calendar .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x; font-weight: normal; color: #555555; } /*.ui-state-default,*/ /*.ui-tabs.ui-widget-content .ui-state-default,*/ /*.ui-widget-header .ui-state-default {*/ /*border: 1px solid #d3d3d3;*/ /*background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;*/ /*font-weight: normal;*/ /*color: #555555;*/ /*}*/ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } .ui-datepicker-calendar .ui-state-default.ui-state-hover, .ui-tabs .ui-state-default.ui-state-hover { border: 1px solid #999999; background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x; font-weight: normal; /*color: #212121;*/ } /*.ui-state-hover,*/ /*.ui-widget-content .ui-state-hover,*/ /*.ui-widget-header .ui-state-hover,*/ /*.ui-state-focus,*/ /*.ui-widget-content .ui-state-focus,*/ /*.ui-widget-header .ui-state-focus {*/ /*border: 1px solid #999999;*/ /*background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;*/ /*font-weight: normal;*/ /*color: #212121;*/ /*}*/ /*.ui-state-hover a,*/ /*.ui-state-hover a:hover,*/ /*.ui-state-hover a:link,*/ /*.ui-state-hover a:visited,*/ /*.ui-state-focus a,*/ /*.ui-state-focus a:hover,*/ /*.ui-state-focus a:link,*/ /*.ui-state-focus a:visited {*/ /*color: #212121;*/ /*text-decoration: none;*/ /*}*/ .ui-tabs.ui-widget.ui-widget-content .ui-state-default.ui-state-active, .ui-datepicker-calendar .ui-state-default.ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x; font-weight: bold; color: #212121; } /*.ui-state-active,*/ /*.ui-widget-content .ui-state-active,*/ /*.ui-widget-header .ui-state-active {*/ /*border: 1px solid #aaaaaa;*/ /*background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;*/ /*font-weight: normal;*/ /* color: #212121; */ /*}*/ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } /* Icons ----------------------------------*/ /* states and images */ /* Icons ----------------------------------*/ /* states and images */ .ui-icon { width: 16px; height: 16px; } .ui-icon, .ui-widget-content .ui-icon { background-image: url("images/ui-icons_222222_256x240.png"); } .ui-widget-header .ui-icon { background-image: url("images/ui-icons_222222_256x240.png"); } .ui-state-default .ui-icon { background-image: url("images/ui-icons_888888_256x240.png"); } .ui-state-hover .ui-icon, .ui-state-focus .ui-icon { background-image: url("images/ui-icons_454545_256x240.png"); } .ui-state-active .ui-icon { background-image: url("images/ui-icons_454545_256x240.png"); } .ui-state-highlight .ui-icon { background-image: url("images/ui-icons_2e83ff_256x240.png"); } .ui-state-error .ui-icon, .ui-state-error-text .ui-icon { background-image: url("images/ui-icons_cd0a0a_256x240.png"); } /* positioning */ .ui-icon-blank { background-position: 16px 16px; } .ui-icon-carat-1-n { background-position: 0 0; } .ui-icon-carat-1-ne { background-position: -16px 0; } .ui-icon-carat-1-e { background-position: -32px 0; } .ui-icon-carat-1-se { background-position: -48px 0; } .ui-icon-carat-1-s { background-position: -64px 0; } .ui-icon-carat-1-sw { background-position: -80px 0; } .ui-icon-carat-1-w { background-position: -96px 0; } .ui-icon-carat-1-nw { background-position: -112px 0; } .ui-icon-carat-2-n-s { background-position: -128px 0; } .ui-icon-carat-2-e-w { background-position: -144px 0; } .ui-icon-triangle-1-n { background-position: 0 -16px; } .ui-icon-triangle-1-ne { background-position: -16px -16px; } .ui-icon-triangle-1-e { background-position: -32px -16px; } .ui-icon-triangle-1-se { background-position: -48px -16px; } .ui-icon-triangle-1-s { background-position: -64px -16px; } .ui-icon-triangle-1-sw { background-position: -80px -16px; } .ui-icon-triangle-1-w { background-position: -96px -16px; } .ui-icon-triangle-1-nw { background-position: -112px -16px; } .ui-icon-triangle-2-n-s { background-position: -128px -16px; } .ui-icon-triangle-2-e-w { background-position: -144px -16px; } .ui-icon-arrow-1-n { background-position: 0 -32px; } .ui-icon-arrow-1-ne { background-position: -16px -32px; } .ui-icon-arrow-1-e { background-position: -32px -32px; } .ui-icon-arrow-1-se { background-position: -48px -32px; } .ui-icon-arrow-1-s { background-position: -64px -32px; } .ui-icon-arrow-1-sw { background-position: -80px -32px; } .ui-icon-arrow-1-w { background-position: -96px -32px; } .ui-icon-arrow-1-nw { background-position: -112px -32px; } .ui-icon-arrow-2-n-s { background-position: -128px -32px; } .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } .ui-icon-arrow-2-e-w { background-position: -160px -32px; } .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } .ui-icon-arrowstop-1-n { background-position: -192px -32px; } .ui-icon-arrowstop-1-e { background-position: -208px -32px; } .ui-icon-arrowstop-1-s { background-position: -224px -32px; } .ui-icon-arrowstop-1-w { background-position: -240px -32px; } .ui-icon-arrowthick-1-n { background-position: 0 -48px; } .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } .ui-icon-arrowthick-1-e { background-position: -32px -48px; } .ui-icon-arrowthick-1-se { background-position: -48px -48px; } .ui-icon-arrowthick-1-s { background-position: -64px -48px; } .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } .ui-icon-arrowthick-1-w { background-position: -96px -48px; } .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } .ui-icon-arrow-4 { background-position: 0 -80px; } .ui-icon-arrow-4-diag { background-position: -16px -80px; } .ui-icon-extlink { background-position: -32px -80px; } .ui-icon-newwin { background-position: -48px -80px; } .ui-icon-refresh { background-position: -64px -80px; } .ui-icon-shuffle { background-position: -80px -80px; } .ui-icon-transfer-e-w { background-position: -96px -80px; } .ui-icon-transferthick-e-w { background-position: -112px -80px; } .ui-icon-folder-collapsed { background-position: 0 -96px; } .ui-icon-folder-open { background-position: -16px -96px; } .ui-icon-document { background-position: -32px -96px; } .ui-icon-document-b { background-position: -48px -96px; } .ui-icon-note { background-position: -64px -96px; } .ui-icon-mail-closed { background-position: -80px -96px; } .ui-icon-mail-open { background-position: -96px -96px; } .ui-icon-suitcase { background-position: -112px -96px; } .ui-icon-comment { background-position: -128px -96px; } .ui-icon-person { background-position: -144px -96px; } .ui-icon-print { background-position: -160px -96px; } .ui-icon-trash { background-position: -176px -96px; } .ui-icon-locked { background-position: -192px -96px; } .ui-icon-unlocked { background-position: -208px -96px; } .ui-icon-bookmark { background-position: -224px -96px; } .ui-icon-tag { background-position: -240px -96px; } .ui-icon-home { background-position: 0 -112px; } .ui-icon-flag { background-position: -16px -112px; } .ui-icon-calendar { background-position: -32px -112px; } .ui-icon-cart { background-position: -48px -112px; } .ui-icon-pencil { background-position: -64px -112px; } .ui-icon-clock { background-position: -80px -112px; } .ui-icon-disk { background-position: -96px -112px; } .ui-icon-calculator { background-position: -112px -112px; } .ui-icon-zoomin { background-position: -128px -112px; } .ui-icon-zoomout { background-position: -144px -112px; } .ui-icon-search { background-position: -160px -112px; } .ui-icon-wrench { background-position: -176px -112px; } .ui-icon-gear { background-position: -192px -112px; } .ui-icon-heart { background-position: -208px -112px; } .ui-icon-star { background-position: -224px -112px; } .ui-icon-link { background-position: -240px -112px; } .ui-icon-cancel { background-position: 0 -128px; } .ui-icon-plus { background-position: -16px -128px; } .ui-icon-plusthick { background-position: -32px -128px; } .ui-icon-minus { background-position: -48px -128px; } .ui-icon-minusthick { background-position: -64px -128px; } .ui-icon-close { background-position: -80px -128px; } .ui-icon-closethick { background-position: -96px -128px; } .ui-icon-key { background-position: -112px -128px; } .ui-icon-lightbulb { background-position: -128px -128px; } .ui-icon-scissors { background-position: -144px -128px; } .ui-icon-clipboard { background-position: -160px -128px; } .ui-icon-copy { background-position: -176px -128px; } .ui-icon-contact { background-position: -192px -128px; } .ui-icon-image { background-position: -208px -128px; } .ui-icon-video { background-position: -224px -128px; } .ui-icon-script { background-position: -240px -128px; } .ui-icon-alert { background-position: 0 -144px; } .ui-icon-info { background-position: -16px -144px; } .ui-icon-notice { background-position: -32px -144px; } .ui-icon-help { background-position: -48px -144px; } .ui-icon-check { background-position: -64px -144px; } .ui-icon-bullet { background-position: -80px -144px; } .ui-icon-radio-on { background-position: -96px -144px; } .ui-icon-radio-off { background-position: -112px -144px; } .ui-icon-pin-w { background-position: -128px -144px; } .ui-icon-pin-s { background-position: -144px -144px; } .ui-icon-plttery-0 { background-position: -48px -176px; } .ui-icon-battery-1 { background-position: -64px -176px; } .ui-icon-battery-2 { background-position: -80px -176px; } .ui-icon-battery-3 { background-position: -96px -176px; } .ui-icon-circle-plus { background-position: 0 -192px; } .ui-icon-circle-minus { background-position: -16px -192px; } .ui-icon-circle-close { background-position: -32px -192px; } .ui-icon-circle-triangle-e { background-position: -48px -192px; } .ui-icon-circle-triangle-s { background-position: -64px -192px; } .ui-icon-circle-triangle-w { background-position: -80px -192px; } .ui-icon-circle-triangle-n { background-position: -96px -192px; } .ui-icon-circle-arrow-e { background-position: -112px -192px; } .ui-icon-circle-arrow-s { background-position: -128px -192px; } .ui-icon-circle-arrow-w { background-position: -144px -192px; } .ui-icon-circle-arrow-n { background-position: -160px -192px; } .ui-icon-circle-zoomin { background-position: -176px -192px; } .ui-icon-circle-zoomout { background-position: -192px -192px; } .ui-icon-circle-check { background-position: -208px -192px; } .ui-icon-circlesmall-plus { background-position: 0 -208px; } .ui-icon-circlesmall-minus { background-position: -16px -208px; } .ui-icon-circlesmall-close { background-position: -32px -208px; } .ui-icon-squaresmall-plus { background-position: -48px -208px; } .ui-icon-squaresmall-minus { background-position: -64px -208px; } .ui-icon-squaresmall-close { background-position: -80px -208px; } .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } .ui-icon-grip-solid-vertical { background-position: -32px -224px; } .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } .ui-icon-grip-diagonal-se { background-position: -80px -224px; } /* Misc visuals ----------------------------------*/ /* Corner radius */ .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { /*border-top-left-radius: 2px;*/ } .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { /*border-top-right-radius: 2px;*/ } .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { /*border-bottom-left-radius: 2px;*/ } .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { /*border-bottom-right-radius: 2px;*/ } /* Overlays */ .ui-widget-overlay { /*background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;*/ background: #000000; opacity: .3; filter: Alpha(Opacity=30); /* support: IE8 */ } .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x; opacity: .3; filter: Alpha(Opacity=30); /* support: IE8 */ border-radius: 8px; } .ui-datepicker-calendar thead th{ background:#e6e6e6; } .defaultfont td:nth-child(2), #Personal_Information td:nth-child(2) { position: relative; } /*ul{ width:100%; } li.test{ display: inline-block; float:left; height:2 0px; margin:0 10% 3% 0; width:40%; } li.test:nth-child(even){ margin-right:0; } */ li { margin-bottom:10px; font-size:13px; } select, input { padding: 6px 2px; } /*.other-search { width: 33px; height: auto; background: rgba(0,0,0,0.2); border: 1px solid #aaa; z-index: 2; } .searchable_resultcontainer table { font-size: 12px; } .searchable_resultcontainer td, .searchable_resultcontainer th { border: 1px solid #ccc; } .searchable_resultcontainer td button { padding: 8px 15px; border: none; color: #fff; }*/ .inactive { background: #999; } /* Scrollbar mod works with chrome and opera -josef */ /* Green */ ::-webkit-scrollbar { width: 9px; height: 9px; /*background: rgb(98, 125, 77);*/ /*background: #fa911c;*/ position: absolute; } ::-webkit-scrollbar-track { background: #bfbfbf; -webkit-box-shadow: inset 1px 1px 6px 1px rgba(20, 20, 20, 0.5); } ::-webkit-scrollbar-thumb { /*border-radius: 2px;*/ /*background: rgb(98, 125, 77);*/ /*background: #fa911c;*/ -webkit-box-shadow: inset 1px 1px 6px 1px rgba(20, 20, 20, 0.5), inset 3px 0 6px rgba(97, 97, 97, 0.25); } ::-webkit-scrollbar-thumb:window-inactive { background: rgba(204, 10, 10, 0.2); -webkit-box-shadow: inset 0 0 20px 1px rgba(204, 12, 12, 0.95); } select { padding: 0px; } #pager_article .ui-dialog,#pager_article .ui-dialog .ui-dialog-content { overflow: visible; } .input[readonly]:not(.hasDatepicker) { /*border: 0px !important; background: transparent !important;*/ color: graytext; } .datepicker { width: 120px !important; }.bdate { width: 120px !important; } #menu_panel { display:none; }/* #sidebar { display:none; }*/ #mensub { display:none; } .ui-corner-all { /*box-shadow: 0 1px 2px #666;*/ } #fixd_con { width: 95%; margin: 0 auto; position: relative; } .ui-dialog { box-shadow: 0 0 10px rgba(0,0,0,0.8); } .ui-corner-all { padding: 0; border: none; } .ui-widget-header { /*background: #627d4d;*/ /*background: #fa911c;*/ /*color: #fff;*/ } .ui-dialog .ui-dialog-buttonpane button { /*background: #627d4d;*/ /*background: #fa911c;*/ /*color: #fff;*/ } .alertify .ajs-dimmer { z-index: 1002; } #sidebar h3 i { float: right; padding: 0 15px 0; font-weight: bold; font-size: 18px; color: #999; } #sidebar h3:hover i { float: right; padding: 0 15px 0; font-weight: bold; font-size: 18px; color: #111; animation: move 1.5s 1; -moz-animation: move 1.5s 1; -webkit-animation: move 1.5s 1; } .ui-tooltip { background: rgba(0,0,0,0.5); color: #fff; box-shadow: none; } .ui-tooltip::before { content: ''; border-bottom: 12px solid rgba(0,0,0,0.5); border-left: 10px solid transparent; border-right: 10px solid transparent; position: absolute; top: -12px; left: 0; right: 0; margin: 0 auto; width: 1px; } @keyframes move { 20% { transform: translateX(-10px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-1px); } 80% { transform: translateX(2px); } 100%{ transform: translateX(0px); } } @-moz-keyframes move { 20% { transform: translateX(-10px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-1px); } 80% { transform: translateX(2px); } 100%{ transform: translateX(0px); } } @-webkit-keyframes move { 20% { transform: translateX(-10px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-1px); } 80% { transform: translateX(2px); } 100%{ transform: translateX(0px); } } ._pointer { cursor: pointer; } .cms_content p { font-weight: normal; } #secondary_bar { transition: all 0.3s; } input.require, select.require { padding: 5px; width: 100%; min-width: 220px; border-radius: 3px; border: 1px solid #bbb; } input.class_date { padding: 5px; width: 100%; /*min-width: 220px;*/ } #pager_modal table td:first-child { padding: 10px; white-space: nowrap; } div#ui-datepicker-div { border: 1px solid #bbb; } #main_overlay { width: 100%; height: 100%; position: fixed; top: 0; left: 0; background: rgba(0,0,0,0.8); z-index: 1001; } .ui-datepicker-month { border-top-left-radius: 4px; border-bottom-left-radius: 4px; } .ui-datepicker-year { border-top-right-radius: 4px; border-bottom-right-radius: 4px; } .head_logo{ width: 50px; height: 50px; } .head_title { font-size: 2em; align-self: center; margin-left: 20px; /*color: #fff;*/ } .flex { display: flex; } .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header { /*background: #627d4d;*/ } .dwb_empstatico { color: #000; } .dwc_empstatico { color: #fff; } /*20180404 start gian karlo */ .article_btn_container { display: inline-block; text-align: right; float: right; margin-right: 15px; height: 100% } .article_btn_container .article_btn_child_container { position: relative; top: 50%; transform: translateY(-50%); } article.pager-module.pager-module-lightgray { height:auto; /*border:1px solid black;*/ /*width:75%;*/ margin-left:auto; margin-right:auto; margin-top:0px; border:1px solid #d8d8db; background:#f6f6f8; } article.pager-module.pager-module-lightgray header { /*background:#d8d8db;*/ } article.pager-module.pager-module-darkgray { height:auto; /*border:1px solid black;*/ /*width:75%;*/ margin-left:auto; margin-right:auto; margin-top:0px; border:1px solid #8e8e8e; background:#f6f6f8 } article.pager-module.pager-module-darkgray header { background:#8e8e8e; } article.pager-module.pager-module-darkgray header * { color: white !important; } article.pager-module header { } .defaultfontsize { font-size: 13px !important; } .input_hasErr { border: 1px solid red; background-color: #FFCECE; } #dash_con { width: 100%; height: auto; margin: 0 auto 50px; } .tr_spacer { height: 10px; } .td_spacer { width: 10px; } .td_left_indent { padding-left: 30px; } .hasDatepicker,input[type=time] { width: 120px; } input[type=button].save:disabled, input[type=button].exit:disabled, input[type=button].print:disabled { background-color:#a2a2a2 } input[type=text].required:disabled, select:disabled, textarea:disabled { background-color: rgb(235, 235, 228); } .CalendarClearButtonContainer { display: inline-block; } i.datepicker_clear_btn { margin-left:-20px; color: #00207b; font-size: 15px !important; display: none; cursor: pointer; } i.datepicker_clear_btn:hover { color: #0042ff; } textarea { font-family: unset; } /* ---------- demo ----------- */ .dedemo { position: sticky; /* -- behave like a relative position and fixed position at the same time when it reach a specific distance*/ top: 0; /* -- this is the "specific distance" */ width: 100%; height: 50px; background: #c33434; font-size: 25px; color: #fff; z-index: 9999; display: flex; justify-content: center; align-items: center; } .dedemo span { text-align: center; } .disabled { background-color: rgb(235, 235, 228); color: rgb(84, 84, 84); cursor: default; } |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | PxybLzDl2lWf8y6DDul4S3sDu4074Njwt3ACW1N/xZGXwf4zJAbXvun43pLgY6lYzPdQUSork6JtA0iaGmhu8w== |
| Request Header - size: 543 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:39 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 47,958 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("PxybLzDl2lWf8y6DDul4S3sDu4074Njwt3ACW1N/xZGXwf4zJAbXvun43pLgY6lYzPdQUSork6JtA0iaGmhu8w==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("PxybLzDl2lWf8y6DDul4S3sDu4074Njwt3ACW1N/xZGXwf4zJAbXvun43pLgY6lYzPdQUSork6JtA0iaGmhu8w==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("PxybLzDl2lWf8y6DDul4S3sDu4074Njwt3ACW1N/xZGXwf4zJAbXvun43pLgY6lYzPdQUSork6JtA0iaGmhu8w==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("ChQVM/Ifz6BphDNh1iKmkPFs5QrUnP0vOSf/HCVNFk3+M1vvfKDmV0QShYpOryLTSaNb+GJhNyWXkrE9IH4CGg==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("ChQVM/Ifz6BphDNh1iKmkPFs5QrUnP0vOSf/HCVNFk3+M1vvfKDmV0QShYpOryLTSaNb+GJhNyWXkrE9IH4CGg==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("ChQVM/Ifz6BphDNh1iKmkPFs5QrUnP0vOSf/HCVNFk3+M1vvfKDmV0QShYpOryLTSaNb+GJhNyWXkrE9IH4CGg==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("E7iK0VnE6GOU1LCB/1Tw2j21/Pd/jVQVFiLgdz+qglgo+bVoht8W38IoBHDPiWEXERm7y0X69sYnoAVr90lvLg==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("E7iK0VnE6GOU1LCB/1Tw2j21/Pd/jVQVFiLgdz+qglgo+bVoht8W38IoBHDPiWEXERm7y0X69sYnoAVr90lvLg==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("E7iK0VnE6GOU1LCB/1Tw2j21/Pd/jVQVFiLgdz+qglgo+bVoht8W38IoBHDPiWEXERm7y0X69sYnoAVr90lvLg==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("4ays+1wATgQzGI8RgGSHzz02f81UyBHdguA1j4VNFSIV3+XKpf+c4yvaBf5W6IN6PCTI+hpdaBvgfFZbFzNmBw==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("4ays+1wATgQzGI8RgGSHzz02f81UyBHdguA1j4VNFSIV3+XKpf+c4yvaBf5W6IN6PCTI+hpdaBvgfFZbFzNmBw==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("4ays+1wATgQzGI8RgGSHzz02f81UyBHdguA1j4VNFSIV3+XKpf+c4yvaBf5W6IN6PCTI+hpdaBvgfFZbFzNmBw==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' > <input class='pager_btn' id='pager_prev' type='text' value='Previous' > <input class='pager_btn' id='pager_next' type='text' value='Next' > <input class='pager_btn' id='pager_last' type='text' value='Last' ></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input id='pager_table' name='pager_table' value='positiontypefile'><input id='pager_table_id' value='recid'><input id='pager_xlink' name='pager_xlink' value=''><input id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input id='pager_modsubdry' name='pager_modsubdry' value='0'><input id='pager_xfield' value='postypdsc'><input id='pager_title' name='pager_title' value='Position Type File'><input id='print_flds' name='print_flds' value='Array'><input id='print_header' name='print_header' value='Array'><input id='print_fieldname' name='print_fieldname' value='postypdsc'><input id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input id='usedscascde' name='usedscascde' value='0'><input id='table_code' name='table_code' value=''><input id='table_desc' name='table_desc' value='postypdsc'><input id='modal_width' name='modal_width' value='auto'><input id='modal_height' name='modal_height' value='auto'><input id='hovering_type' name='hovering_type' value='hover'><input id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input id='header_sort' name='header_sort' value=''><input id='header_sort_by' name='header_sort_by' value=''><input id='leave_logs' name='leave_logs' value=''><input id='txt_leavesdesc' name='txt_leavesdesc' value=''><input name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input name="print_fields_arr[subdrycde][type]" value="select"><input name="print_fields_arr[subdrycde][regex]" value=""><input name="print_fields_arr[postypdsc][header]" value="Position Type"><input name="print_fields_arr[postypdsc][type]" value="text"><input name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | aXJFWXbtxoumqjNQ0DXgqlL74ST7dXdmFkYBJnYHkEz2AbS0aK8mUuMVp1SF8s5+VGJgami6DRwyDk5jsgQwIw== |
| Request Header - size: 543 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:04:10 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("aXJFWXbtxoumqjNQ0DXgqlL74ST7dXdmFkYBJnYHkEz2AbS0aK8mUuMVp1SF8s5+VGJgami6DRwyDk5jsgQwIw==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("aXJFWXbtxoumqjNQ0DXgqlL74ST7dXdmFkYBJnYHkEz2AbS0aK8mUuMVp1SF8s5+VGJgami6DRwyDk5jsgQwIw==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("aXJFWXbtxoumqjNQ0DXgqlL74ST7dXdmFkYBJnYHkEz2AbS0aK8mUuMVp1SF8s5+VGJgami6DRwyDk5jsgQwIw==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("PoQWm5lQBK7Oi/fj5v+5pQ4QKCcL3XGX8iHi+CWrmmbH3DbUTTtO4PCa0mfsiY6mlNXOP7cAaHY38JfMTJn1ig==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("PoQWm5lQBK7Oi/fj5v+5pQ4QKCcL3XGX8iHi+CWrmmbH3DbUTTtO4PCa0mfsiY6mlNXOP7cAaHY38JfMTJn1ig==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("PoQWm5lQBK7Oi/fj5v+5pQ4QKCcL3XGX8iHi+CWrmmbH3DbUTTtO4PCa0mfsiY6mlNXOP7cAaHY38JfMTJn1ig==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("cd1Hf7SaT3opOVN7/VTfZQ1voWVqvZyOlBJPyKOiyvws6AnC+S1Y7dGOzVcG5ogNFZQ8xhbGvK1tMK8XUFFsww==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("cd1Hf7SaT3opOVN7/VTfZQ1voWVqvZyOlBJPyKOiyvws6AnC+S1Y7dGOzVcG5ogNFZQ8xhbGvK1tMK8XUFFsww==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("cd1Hf7SaT3opOVN7/VTfZQ1voWVqvZyOlBJPyKOiyvws6AnC+S1Y7dGOzVcG5ogNFZQ8xhbGvK1tMK8XUFFsww==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("pAsPVs83dFn0pfiap0NUe82MTjvKg0g0mqDdw++Bzjii+b8WdjcWCJAwnHG2lt1ogyyx+jhK/PpBjhbSRRqY/g==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("pAsPVs83dFn0pfiap0NUe82MTjvKg0g0mqDdw++Bzjii+b8WdjcWCJAwnHG2lt1ogyyx+jhK/PpBjhbSRRqY/g==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("pAsPVs83dFn0pfiap0NUe82MTjvKg0g0mqDdw++Bzjii+b8WdjcWCJAwnHG2lt1ogyyx+jhK/PpBjhbSRRqY/g==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A== |
| Request Header - size: 347 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php HTTP/1.1
Host: 192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36 Pragma: no-cache Cache-Control: no-cache Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,165 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:03:14 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/html; charset=utf-8 |
| Response Body - size: 48,435 bytes. |
<html>
<head> <title>HRIS</title> <link REL="SHORTCUT ICON" HREF="img/tab_title.ico"> <!-- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="Lee Systems Technology Ventures"> <script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/jquery/jquery.autonumeric.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/sha1.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.blockUI.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/greaterdate_function.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.tablesorter.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.equalHeight.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/searchmodal/searchable.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/webcamjs-master2/webcam.js?v=20220209161346'></script><script type='text/javascript' src='../lib/alertify/alertify.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/tinymce/jquery.tinymce.min.js?v=20220209161346'></script><script type='text/javascript' src='../lib/fullcalendar/moment.min.js?v=20220209161352'></script><script type='text/javascript' src='../lib/fullcalendar/fullcalendar.js?v=20220209161352'></script><script type='text/javascript' src='../javascript/db_field_length_checker/db_field_length_checker.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/jquery.inputmask.bundle.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/regex.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/validation.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/lst_freeze_table/lst_freeze_table.js?v=20220209161346'></script><script type='text/javascript' src='../javascript/custom_modal.js?v=20220209161346'></script><script type='text/javascript' src='../lib/customupload/customupload.js?v=20220209161346'></script><link rel='stylesheet' type='text/css' href='../css/table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_body_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/layout_header_lst.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/modified_layout.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../css/pager.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/searchmodal/searchable.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/alertify.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/fullcalendar/fullcalendar.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../javascript/db_field_length_checker/dbflc.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/alertify/css/themes/bootstrap.min.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352' /><link rel='stylesheet' type='text/css' href='../css/main.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='../javascript/lst_freeze_table/lst_freeze_table.css?v=20220209161346' /><link rel='stylesheet' type='text/css' href='css/global_style.css?v=20220209161346' /> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-1.10.2.min.js"></script> --> <!-- <script type="text/javascript" src="../lib/jquery/1.10.4/js/jquery-ui-1.10.4.custom.min.js"></script> --> <!-- <link type="text/css" rel="stylesheet" href="../lib/jquery/1.8.9/css/green_style/jquery-ui-1.8.21.custom.css"> --> <!--validation--> <!-- <script src="../lib/jquery/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.validationEngine.js" type="text/javascript"></script> <link rel="stylesheet" href="../lib/jquery/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> --> <!--autonumeric--> <!-- <script type="text/javascript" src="../lib/jquery/jquery.autonumeric.js"></script> --> <!--splitter--> <!-- <script src="../lib/jquery/jquery.splitter.js" type="text/javascript"></script> <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script> --> <!--spinner--> <!-- <script type="text/javascript" src="../lib/jquery/ui.spinner.min.js"></script> --> <!--table-hover--> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/table.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_body_lst.css'/> --> <!-- <link rel='stylesheet' type='text/css' media='screen' href='../css/layout_header_lst.css'/> --> <!-- <script type="text/javascript" src="../javascript/sha1.js"></script> --> <!-- <script src = "../javascript/greaterdate_function.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.tablesorter.min.js" type="text/javascript"></script> --> <!-- <script type="text/javascript" src="../javascript/jquery.equalHeight.js"></script> --> <!--pager--> <!-- <link rel="stylesheet" href="../css/modified_layout.css" type="text/css" media="screen" /> --> <!-- <link rel="stylesheet" href="../css/pager.css" type="text/css" media="screen" /> --> <!-- <script src="../javascript/custom_modal.js" type="text/javascript"></script> --> <!-- <script src="../javascript/jquery.blockUI.js" type="text/javascript"></script> --> <!-- karlo 20160805 --> <!-- <script src="../javascript/searchmodal/searchable.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/searchmodal/searchable.css" type="text/css" media="screen" /> --> <!-- added 20160801 -jep --> <!-- <script type="text/javascript" src="../javascript/regex.js"></script> --> <!-- tooltip --> <!-- <link rel="stylesheet" href="../css/tooltip.css" type="text/css" media="screen" /> --> <!-- <script type="text/javascript" src="../javascript/webcamjs-master2/webcam.js"></script> --> <!-- <script type="text/javascript" src="../lib/alertify/alertify.min.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/alertify.min.css" /> --> <!-- <script type="text/javascript" src="../javascript/tinymce/tinymce.min.js"></script> --> <!-- <script type="text/javascript" src="../javascript/tinymce/jquery.tinymce.min.js"></script> --> <!-- <script src="../lib/fullcalendar/moment.min.js"></script> --> <!-- <script src="../lib/fullcalendar/fullcalendar.js"></script> --> <!-- <script src="../lib/fullcalendar.js"></script> --> <!-- <link rel="stylesheet" href="../lib/fullcalendar/fullcalendar.css" /> --> <!-- <script type="text/javascript" src="../javascript/db_field_length_checker/db_field_length_checker.js"></script> --> <!-- <link rel="stylesheet" type="text/css" href="../javascript/db_field_length_checker/dbflc.css" /> --> <!-- <script type='text/javascript' src="../javascript/jquery.inputmask.bundle.js"></script> --> <!-- <script type='text/javascript' src="../javascript/regex.js"></script> --> <!-- <link rel="stylesheet" href="../lib/alertify/css/themes/bootstrap.min.css" /> --> <!-- <link rel="stylesheet" type="text/css" href="../lib/font-awesome-4.6.2/css/font-awesome.min.css"/> --> <!-- <link href='../css/main.css' type='text/css' rel='stylesheet'> --> <!-- <script src="../javascript/validation.js" type="text/javascript"></script> --> <!-- <script src="../javascript/lst_freeze_table/lst_freeze_table.js" type="text/javascript"></script> --> <!-- <link rel="stylesheet" href="../javascript/lst_freeze_table/lst_freeze_table.css" type="text/css" media="screen" /> --> <style type="text/css"> .applist_button, .dash_btn_container figure .img_con, .dash_btn_container figure .img_con_2, .panel-header, header#header, .theme_header, #hris_sub_container ul figure, .dbg_empstatico, ::-webkit-scrollbar, ::-webkit-scrollbar-thumb, .gp, .ui-widget-header, .fc-day-header, .div_border_front2 table:nth-child(2) input[type="button"], .ui-widget-header, .button1{ background: #627d4d !important; } .div_border_front2 table:nth-child(2) input[type="button"], .head_title, .ui-widget-header, /*.ui-dialog .ui-dialog-buttonpane button,*/ ._program li, .button1, ._figure span:first-child , #vc_history_link { color: #fff !important; } .dc_empstatico, #forgot, #hris_sub_container header{ color: ; /* colored */ } .fc-day-header { color : white !important;; } .head_title, .apptitle, .head_title1, .apptitle1 { text-transform: uppercase; } </style><style> input[type=file] { width: 0px !important; height: 0px !important; opacity: 0; } .cstmupldimg { width: 100%; height: 37px; max-width: 200px; background: #627d4d; display: flex; justify-content: flex-start; align-items: center; cursor: pointer; } .cstmupldimg i.fa { color: #fff; padding: 0 15px; } .cstmupldimg span { color: #fff; padding: 0 15px 0 0; display: block; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } </style><input type="hidden" value="" id="server_err_list_user_session_err"> <input type="hidden" value="" id="server_err_list_sql_err"> <input type="hidden" value="05-18-2022" id="pwd_date_expired"> <script type="text/javascript"> var lstv_errorHandlerValidated=0; jQuery(document).ready(function() { if(jQuery('#server_err_list_user_session_err').val()!="") { userSessionErrHandler(jQuery('#server_err_list_user_session_err').val()); } else if( jQuery('#server_err_list_sql_err').val()!="") { sqlErrHandler(jQuery('#server_err_list_sql_err').val()); } }) function userSessionErrHandler(errorcode) { if(lstv_errorHandlerValidated==0) { if(errorcode=="0a46453dc2fb96ac3fe194c788a331d7b7d149c3") //initial login { alertify.alert('Initial Login. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="c8c6cbbef8b1cf3dea3ce00a2dddf1c837f34750") //password has been reset { alertify.alert('Your password has been reset. You are required to change your password.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="cd5ce33cf637740d1feeeced5d5bd30830e545e1") //password near to expired { alertify.alert('Your password will expire on '+jQuery('#pwd_date_expired').val()); } else if(errorcode=="3fa02d249aa151013b03059d2e2490cb9536844c") //password expired { alertify.alert('Password has already expired.',function(){ window.open('util_set_password.php','_self'); }); } else if(errorcode=="e9367cf5c4f4a928b943c0335365afe3411fd753") //session_expired { alertify.alert('The system has been idle for too long, you need to Login again.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="228c66c5495e196abf5e45e6d8c58182b6f0ac80") //someone logged in { alertify.alert('Someone login in this account.',function(){ window.open('../login_view.php','_self'); }); } else if(errorcode=="76cb0c0d6ca6541d727e90fd9fb9b93f2b552c10") //must login { alertify.alert('You must login first.',function(){ window.open('../login_view.php','_self'); }); } } lstv_errorHandlerValidated=1; } function sqlErrHandler(responseText) { alertify.alert(responseText); } $( window ).ajaxError(function( event, jqxhr, settings, thrownError ) { jQuery.unblockUI(); console.log(thrownError); if(jqxhr.responseText!=undefined) { var json_parse = JSON.parse(jqxhr.responseText); if(json_parse.user_session_err!=undefined) { userSessionErrHandler(json_parse.user_session_err); } else if(json_parse.sql_err!=undefined) { sqlErrHandler(json_parse.sql_err); } else { alertify.alert(jqxhr.responseText); } } }) function validatePageDataReq(page) { alertify.alert('Required data for this page are missing. Please try again.',function() { window.location=page; }) } </script> <style> a.link { color:blue; } * { letter-spacing: 0.04em; } ._tolower { text-transform: lowercase; } .ui-dialog-titlebar-close { display: none; } </style> <script type="text/javascript"> //20180820 gian karlo - blockui global settings $.blockUI.defaults.ignoreIfBlocked=true; $.blockUI.defaults.focusInput=true; $.blockUI.defaults.focusableElements=""; $.blockUI.defaults.fadeIn=200; $.blockUI.defaults.baseZ = 4000; //20190226 gian karlo - jquery and blockui fix to disable jquery buttonpane buttons during block $.blockUI.defaults.onBlock=function(obj) { if(jQuery(':focus').hasClass('ui-button')) { var _jQueryUiButton = jQuery('.ui-button:focus'); _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button') .addClass('disabledByBlockUi') .prop('disabled',true); } }; $.blockUI.defaults.onUnblock=function() { if(jQuery('.disabledByBlockUi').length>0) { var _jQueryUiButton = jQuery('.disabledByBlockUi'); _jQueryUiButton.removeClass('disabledByBlockUi') .prop('disabled',false) _jQueryUiButton.parents('.ui-dialog-buttonpane').find('.ui-button').prop('disabled'); } }; function disable_autocomplete() { jQuery("textarea:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","new-password"); }); jQuery("input:not(.disable_autocomplete)").each(function() { jQuery(this).addClass("disable_autocomplete"); jQuery(this).attr("autocomplete","off"); }); } //20180420 gian karlo - alertify global settings alertify.defaults.maintainFocus = false; alertify.defaults.closable = false; alertify.defaults.modal = true; alertify.defaults.maximizable = false; alertify.defaults.resizable = false; alertify.defaults.closableByDimmer = false; alertify.defaults.glossary.title = "Human Resource Information System"; //20180420 - gian karlo - dialog + alertify fix $.ui.dialog.prototype._focusTabbable = function(){}; //20180420 - gian karlo - datepicker defaults jQuery.datepicker.setDefaults({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5" }); var xplaceholder = 'mm-dd-yyyy'; //20180420 - gian karlo - datepicker default placeholder jQuery(document).ready(function () { //20180420 - gian karlo - datepicker default placeholder var pickerFn = jQuery.fn.datepicker; jQuery('.xage').css('text-align','right'); //20191112 donita disallow_tag(); jQuery.fn.datepicker = function () { var datePicker = pickerFn.apply(this, arguments); var self = this; self.attr('placeholder', xplaceholder); // self.prop('readonly', true); // updateCalendarClearButton jQuery('.hasDatepicker').each(function() { if(jQuery(this).next('i.fa-times.datepicker_clear_btn').length==0) { var self = jQuery(this); self.wrap('<div class="CalendarClearButtonContainer"></div>') self.after('<i class="fa fa-times datepicker_clear_btn" aria-hidden="true" title="Clear Date"></i>'); self.next('.datepicker_clear_btn').on('click',function() { $.datepicker._clearDate( self ); }); self.closest('.CalendarClearButtonContainer').hover(function() { if(self.is(':disabled')===false) { self.next('.datepicker_clear_btn').show() } },function() { self.next('.datepicker_clear_btn').hide() }) } }) datePicker.inputmask({ alias: "mm-dd-yyyy", showMaskOnHover: false, clearIncomplete: true}); return datePicker; }; //2019-12-12 Kiel jQuery('.bdate').filter('.datepicker').each(function(i) { jQuery(this).removeClass('datepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); apply_custom_fileinput(); disable_autocomplete(); }); jQuery( window ).resize(function() { // 20180412 gian karlo - readjust #menu width when window is zoomed or resized adjust_menu2_width() }); //20180430 gian karlo - apply all input with datepicker classes on every ajax Sucess event jQuery( document ).ajaxComplete(function() { //2019-12-12 Kiel jQuery('.bdate').filter('.hasDatepicker.datepicker').each(function(i) { jQuery(this).removeClass('hasDatepicker'); jQuery('.bdate').datepicker({ changeYear: true, changeMonth : true, dateFormat:'mm-dd-yy', yearRange: "-100:+5", maxDate: 0 }); }); jQuery('.datepicker').datepicker(); apply_custom_fileinput(); disable_autocomplete(); disallow_tag(); }); jQuery(window).load(function () { jQuery('.datepicker').datepicker(); clean(document); apply_custom_fileinput(); jQuery('body').attr('viewsource','no') jQuery('#main').fadeIn(500); jQuery('footer').fadeIn(500); $.unblockUI(); }); jQuery(function() { blockui(); jQuery("script").removeAttr('src').text('LSTV Property :)'); jQuery("script").remove(); var elementPosition = jQuery('#secondary_bar').offset(); // jQuery(window).scroll(function() // { // if(jQuery(window).scrollTop() > elementPosition.top)// || jQuery(window) == '1099px') // { // jQuery('#secondary_bar').css({ // 'position': 'fixed', // 'z-index': '999999', // 'top': '0', // 'background': '#fa911c' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#fff'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '32px', // 'position': 'fixed' // }); // } // else // { // jQuery('#secondary_bar').css({ // 'position': 'static', // 'z-index': '1', // 'background': '' // }); // jQuery('.menu_label, .breadcrumbs a, .tbl_user p, .tbl_user td').css('color','#000'); // jQuery('._menu2, .sidebar_con').css({ // 'top': '88px', // 'position': 'absolute' // }); // } // }); jQuery('.sidebar_con').hide(); jQuery('#menu2').hide(); }); function clean(node) { for(var n = 0; n < node.childNodes.length; n ++) { var child = node.childNodes[n]; if ( child.nodeType === 8 || (child.nodeType === 3 && !/\S/.test(child.nodeValue)) ) { node.removeChild(child); n --; } else if(child.nodeType === 1) { clean(child); } } } function validateFloatKeyPress(el, evt,dec_number) { var dec_places = dec_number - 1; var charCode = (evt.which) ? evt.which : event.keyCode; var number = el.value.split('.'); if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } //just one dot (thanks ddlab) if(number.length>1 && charCode == 46){ return false; } //get the carat position var caratPos = getSelectionStart(el); var dotPos = el.value.indexOf("."); if( caratPos > dotPos && dotPos>-1 && (number[1].length > dec_places)){ return false; } return true; } function regex(evt,filter) { var regex = ''; if(filter=='symbol') { regex = /[- . a-zA-Z0-9]/; } else if(filter=='number') { regex = /[0-9]/; } else if(filter=='name') { regex = /[- . a-zA-Z]/; } if(evt.keyCode!=8 && evt.keyCode!=32) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); //var regex = /[0-9]|\./; //var regex = /[- . a-zA-Z]/; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(); } } } function getSelectionStart(o) { if (o.createTextRange) { var r = document.selection.createRange().duplicate() r.moveEnd('character', o.value.length) if (r.text == '') return o.value.length return o.value.lastIndexOf(r.text) } else return o.selectionStart } function setMaxMinDate(thisObj,target,fromTo) { if(fromTo == "from") { target.datepicker("option", "minDate", thisObj.value); } if(fromTo == "to") { target.datepicker("option", "maxDate", thisObj.value); } } function vw_msg(msg) { alertify.alert(msg, function(){ window.open('trn_userpassword.php','_self') } ); } function filterSubdryChild(obj, $class) { if(obj.value != '' && obj.value != "ALL") { jQuery('.'+$class).each(function() { var prevSelVal = jQuery(this).val(); jQuery(this).find("optgroup").hide(); jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").show(); var subdry_cnt = 1; //041719 randle if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").attr("data-optgroup_code") != undefined || subdry_cnt == 1) { if (subdry_cnt == 1) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { if(jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').length>0) { jQuery(this).find("optgroup[data-optgroup_code='"+obj.value+"']").find('option[value="'+prevSelVal+'"]').prop('selected',true); } else { jQuery(this).val(''); } } } else { jQuery(this).val(""); } }) } else { jQuery('.'+$class).each(function() { jQuery(this).find("optgroup").show(); }) jQuery('.'+$class).val(''); } } function filterSubsidiary(obj, $id) { // console.log($id); if(obj.value!='') { var selectedindex = jQuery(obj).context.selectedIndex; var subdrycde = jQuery(obj).find("option").eq(selectedindex).closest("optgroup").data("optgroup_code"); jQuery('#'+$id).val(subdrycde); jQuery('#'+$id).change(); } } function lbl_menu_click(xsender) { var sidebarV = jQuery('.sidebar_con'); if(sidebarV.is(':visible')) { jQuery('body').css({ 'overflow-y': 'auto', 'overflow-x': 'hidden' }); } else { jQuery('body').css( 'overflow', 'hidden' ); } jQuery('.sidebar_con').toggle('slide' , {direction : "left"}, 250); jQuery('#menu2').toggle('slide' , {direction : "left"} , 270); jQuery('#menu_panel').hide(); } function logout_click(xpar) { if(xpar==0) { jQuery('#myform').attr({ method:'POST', action:'../login_applist.php', target:'_self', }).submit(); } else { alertify.confirm('Are you sure you want to logout?',function() { blockui(); var xdata= "txt_action=logout"; jQuery.ajax({ type : 'post', data : xdata, url : '../login_proc.php', success : function (xretobj) { window.open('../login_view.php','_self') } }); }); } } function fill_ess_usrname(fname_id,mname_id,lname_id,target_id) { var xtarget = jQuery("#"+target_id); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); fname = fname.split(" "); fname = fname[0].toLowerCase(); mname = mname.split(" "); mname = mname[0].toLowerCase(); lname = lname.replace(" ",""); lname = lname.toLowerCase(); xtarget.val(fname+mname+lname); jQuery(xtarget).change(); } function fill_emp_ess_usrname(fname_id,mname_id,lname_id,ini_fname_id,ini_mname_id,ini_lname_id,ini_target_id,target_id) { var xtarget = jQuery("#"+target_id); var ini_val = jQuery("#"+ini_target_id).val(); var ini_fname = jQuery("#"+ini_fname_id).val(); var ini_mname = jQuery("#"+ini_mname_id).val(); var ini_lname = jQuery("#"+ini_lname_id).val(); var fname = jQuery("#"+fname_id).val(); var mname = jQuery("#"+mname_id).val(); var lname = jQuery("#"+lname_id).val(); var xfname = "",xmname = "",xlname = ""; xfname = fname.split(" "); xfname = xfname[0].toLowerCase(); xmname = mname.split(" "); xmname = xmname[0].toLowerCase(); xlname = lname.replace(" ",""); xlname = xlname.toLowerCase(); if(ini_fname != fname || ini_mname != mname || ini_lname != lname) { xtarget.val(xfname+xmname+xlname); } else { xtarget.val(ini_val); } } </script> <!-- 20190606 gian karlo - validates security code and redirects--> </head> <body style="margin : 0;background-color:white;height:auto"> <div id="main_overlay" style="display:none"></div> <!-- <div class="dedemo"> <span>This is a test program. this is a broadcasting emergency for a zombie outbreak that is currently happening right now. Dont leave your house alone for your own safety</span> </div> --> <div id="preLoader"><p></p></div> <!-- 9-16-14--> <header id="header"> <div class="_blue"></div> <hgroup id="fixd_con" class="flex"> <a href="main.php"><img class="head_logo" src="../img/lst.png" style="width:auto;"></a> <span class="head_title">WEBTKM</span> <div class="_program"> <ul> <li class="apptitle">HRIS EXT.</li> <li> <a href="print_git_version_pdf.php" target="_blank" id="vc_history_link">v2022.02.03.01</a> </li> </ul> </div> </hgroup> </header> <!-- end of header bar --> <section id="secondary_bar"> <div id="fixd_con"> <div class="user" > <p> <label id="toggle" class="menu_label" onclick='lbl_menu_click(this);'>MENU</label> </p> </div> <div class="breadcrumbs_container"> <article class="breadcrumbs" id="breadcrumbs"></article> </div> <div> <table class='tbl_user' width=100% cellspacing=0 cellpadding=0;> <tr> <td width="35%" style='text-align: right;font-size:14px'> ADMIN </td> <td width='5%'> <i style="padding:0 2px 0 15px" class="fa fa-user" aria-hidden="true"></i> </td> <td width="38%" style='text-align: right;'> <p onclick='logout_click(0);' >Back to Applist</p> </td> </tr> </table> </div> </div> </section> <div id = "div_menu"> <div class="sidebar_con" style="display:none"> <aside id="sidebar" class="sidebar column" style=' width:100%; max-width:300px; min-width:300px;'> <script type='text/javascript'> jQuery(document).ready(function() { load_menu(); }); function load_submenu(xsubmenu,xaccordion) { jQuery.ajax({ dataType : 'json', type : 'post', url : 'ajax_menu', data : {menu : xsubmenu , accordion : xaccordion, mentyp : 'submenu'}, success : function (xretobj) { jQuery('#div_menus').html(xretobj); if (xaccordion == 'true') { jQuery('#sidemenu').accordion({ collapsible: true, hideOnStartup: true, active: 0, fillSpace : true }); } } }); } // function load_menu(mensub) // { // jQuery.ajax({ // type : 'post', // url : 'ajax_menu.php', // data : {mentyp : 'menu', mensub2:mensub}, // success : function (xretobj) // { // //~ console.log(xretobj); // jQuery('#sidebar').append(xretobj); // get_function(); // } // }); // } function load_menu() { jQuery.ajax({ type : 'post', url : 'ajax_menu.php', dataType:'json', data : {mentyp : 'menu'}, success : function (xretobj) { jQuery('#sidebar').append(xretobj.form); // get_function(); // console.log('load_menu'); mark_active(xretobj.active_menrecid); } }); } function load_page(xurl,cap,xmensub,menid,xfrom_dashboard = '0',xfilter_app = "") { updateSessRecid(menid,xfrom_dashboard,xfilter_app).done(function(xret) { //20180214 gian karlo - clear back button history // localStorage.clear(); window.location.href=xurl; }) } function updateSessRecid(menid,xfrom_dashboard = '0',xfilter_app = "") { return jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {menid : menid,event_action:'updateSessRecid',from_dashboard:xfrom_dashboard,filter_app:xfilter_app} }); } function mark_active(menid) { if(menid!='') { jQuery("h3#"+menid).css('background-color', "white"); if(jQuery("h3#"+menid).hasClass('menu_has_mensub')==true && jQuery("h3#"+menid).hasClass('active')==true) { jQuery("h3#"+menid).click(); } } } function load_page2(xmensub,menid) { jQuery.ajax({ url:"menu_view_ajax.php", type:"post", dataType:'json', data: {mensub : xmensub,menid:menid}, success:function(response) { jQuery(".menu_has_mensub").css('background-color', ""); jQuery("h3").removeClass("active"); jQuery('#menu2').html(response.form); jQuery('#menu2').css('width', "80%"); mark_active(menid); adjust_menu2_width(); } }); } // 20180412 gian karlo - readjust #menu width when window is zoomed or resized function adjust_menu2_width() { if(jQuery('#menu2').is(':visible')) { jQuery('#menu2').css('width',jQuery(window).outerWidth() - jQuery('.sidebar_con').outerWidth()); jQuery('#menu2').css('height',jQuery('.sidebar_con').outerHeight()); } } function load_bc(url,cap){ var params = "url="+url+"&cap="+cap; //~ alert(url); jQuery.ajax({ url:"cm_bread_ajax.php", type:"post", dataType:'json', data: params, success:function(response) { jQuery('#breadcrumbs').html(response); } }); } function load_sub(mensub) { jQuery('#sidebar').hide(); jQuery.ajax({ type : 'post', dataType:'json', url : 'ajax_mensub.php', data : {xmensub : mensub}, success : function (xretobj) { console.log(xretobj); jQuery('#sidebar2').append(xretobj); //~ jQuery('#sidebar').height('100%'); //~ get_function(); } }); jQuery('#sidebar2').toggle('fast'); } function backtomain() { jQuery('#sidebar2').hide(); jQuery('#sidebar2 h3').remove(); jQuery('#sidebar2 hr').remove(); jQuery('#sidebar').toggle('fast'); } </script> </aside> </div> </div> <!--<style> a{ color:black; } p{ font-size:15px; font-weight:700; } </style> --> <style> a{ color: #131313; } p { font-size:15px; font-weight:700; } ._menu2 { display: none; z-index: 1002; position: absolute; float: left; /*width: 1520px;*/ /*min-width: 920px !important;*/ margin-left: 299px; background: #fff; /*height: 100%;*/ height: 96%; /*height: 580px;*/ border: none !important; overflow-x: hidden; overflow-y: auto; white-space: nowrap; } #menu2_sub { width: 100%; /*min-width: 570px;*/ height: 94%; /*min-height: 580px;*/ overflow: auto; } #menu2_sub .mendiv { display:inline-block; margin-left:30px; vertical-align:top; padding-bottom: 20px; } #menu2_sub .mendiv ul { margin-top:0px; margin-right:10px; list-style-type: none; padding-left:0px; display:inline-block; width:auto; vertical-align:top; } /*._1 { line-height: 0.8; }*/ </style> <div id='menu2' class='_menu2'> <br> <center> <div id='menu2_sub'> </div> <br> </div> <input type='hidden' name='mensub' id='mensub' value=''> <!-- 20190606 gian karlo - reminder for security code status--> <!-- Start Security Code Notifier --> <div id="lbl_bypass_seccode" style="width: 100%;height: 30px; background-color: #fff1c9;margin-top: 1px;text-align: center;font-size: 14px;display: flex;align-items: center;justify-content: center;"> <img src="bridge/images/sign-warning-icon.png" style="width: 20px;height:20px;"> <div> Security code is currently being bypassed for testing purposes. </div> </div> <!-- End Security Code Notifier --> <div id="main" style="height:auto;width:100%;display: none;"> <form name = 'myform' id='myform' autocomplete="off" style='width:100%' method='POST' enctype='multipart/form-data' > <input type="hidden" name="current_menu_caption" id="current_menu_caption" value="Position Type"> <input type="hidden" value="Subsidiary" id="hr_mode"> <div id="dash_con"><script type='text/javascript'> jQuery(document).ready(function(){ var cap='Position Type File'; parent.load_bc('current',cap); }); function edit_item_click(id,desc){ console.log(id,desc); console.log('pass_edit'); } function add_item_click(id,desc){ console.log(id,desc); console.log('pass_add'); } function delete_item_click(id,desc){ console.log(id,desc); console.log('pass_delete'); } </script> <center><div id='mypager' style='width:90%'> <article id='pager_article' class='pager-module tae' style='min-width:60%;max-width:100%;width:70%'> <header> <h3 class='tabs_involved' id='lbl_title'>Position Type File</h3> </header> <div class='tab_container'><div id='div_pager' class='pager tab_content'><table id='pager_container1' class='pager_container1 defaultfontsize'><tr class="pager_tr"><td class='container1-left' ><input type='button' id='pager_default_add' class='add' value='Add' onclick='add_item()'> <input type='button' class='print' id='pager_default_print' value='Print Preview' onclick='print_item()'> <input type='button' class='print' id='pager_default_export' value='Export' onclick='export_item()'></td> <td class='container1-right' style=''><input type='checkbox' style='display:none' id='txtchk' name='txtchk' > <select style="width:auto !important; text-indent:0px !important;" class="input" name="pager_search" id="pager_search" onchange="clear_searchbox();"><option value='postypdsc'>Position Type</option></select><input type='text' style="width:auto !important;" class="input" name='pager_search_input' id='pager_search_input' value=''><input type='button' id='pager_search_btn' class='search' value='Search' onclick='pager_search()'></td> </tr> </table><table id='datatable' class='hoverTable defaultfontsize'><thead class="pager_thead"><tr class="pager_tr"><th class="header header_sort active_header_sort hidden_th" data-header_field_column="" data-header_field_label="Subsidiary" data-header_width="300" style='width:300px'><div class="header_sort_div"><div class="header_label">Subsidiary</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_subdrycde"></div></div></div></th><th class="header header_sort " data-header_field_column="postypdsc" data-header_field_label="Position Type" data-header_width="400" style='width:400px'><div class="header_sort_div"><div class="header_label">Position Type</div><div class="header_order"><div class="header_sort_asc" id="btn_srt_postypdsc"></div></div></div></th><th class='header header_action' data-header_width="230" style='width:230px'>Action</th></tr></thead><tbody style='font-size:12px' class="pager_tbody"><tr id='1' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >MANAGERIAL</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("vX/w7h1m83fBGJtHgt8J5ehfAZF5tw+UcEoJzLmv/5pFzleTGCNfLTwQNvhhX8xmb+bPL6SfkbnLzaVouw0Q0A==")'></td></tr><tr id='4' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >N/A</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("UxrRWsTbB2q6BYGTh8r/WJ+9taLeVdDUlAc0rcU5wFTZUU25uQt9KOz8hOK3r+vbMSve14rkOK2n/kXAsYjhmA==")'></td></tr><tr id='2' class="odd pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >OFFICER</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("POUEr00sArb1Pj+KJaq2IsTjIfx3CcJfHnSZMezLVQ7JwIykXB9tb/9WXplrKHS/KNwfyPy9BoISvZAiQsfzLQ==")'></td></tr><tr id='3' class="even pager_tr"><td class="hidden_td" id="subdrycde" type="select" >WEBTKM</td><td class="" id="postypdsc" type="text" >STAFF</td><td><input type='button' id='pager_default_view' class='print' value='View' onclick='pager_view_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_edit' class='edit' value='Edit' onclick='edit_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'> <input type='button' id='pager_default_delete' class='delete' value='Delete' onclick='delete_item("GbxP/YIu9UIJFCDV3d22A/3SOMkyqwf7JWRfVNVQjaAiuns9k/w3vkULOJWUjbMdi0IaZ6w/ucV6FVaU1lb/hQ==")'></td></tr></tbody></table><table id='pager_container2' class='pager_container2' style='font-size:10px'><tr><td class='container2-left'><div class="pager_selector" id="lbl_pager_selector">Page : <select class="input" id="pager_selector" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='1'>1</option></select> of 1</div></td><td class='container2-center'><div class='pager_navigator'> <input class='pager_btn' id='pager_first' type='text' value='First' readonly> <input class='pager_btn' id='pager_prev' type='text' value='Previous' readonly> <input class='pager_btn' id='pager_next' type='text' value='Next' disabled readonly> <input class='pager_btn' id='pager_last' type='text' value='Last' disabled readonly></div></td><td class='container2-right'><div class='pager_limiter' id="lbl_pager_limiter">Row(s) per Page : <select class="input" id="pager_limiter" style="min-width:50px;width:auto !important;font-size:10px"><option selected value='10'>10</option><option value='20'>20</option><option value='50'>50</option><option value='100'>100</option></select></div></td></tr><tr class="hidden_tr"><td colspan='3'><table><tr><td>total_pages: <input type="text" id="pager_totalpages" value="1"></td></tr><tr><td>current_page: <input type="text" name="pager_page" id="pager_page" value="1"></td></tr><tr><td>current_limit: <input type="text" name="pager_limit" id="pager_limit" value="10"></td></tr><tr><td>active_id: <input type='text' id='pager_active_id' ></td></tr><tr><td><input type='hidden' id='pager_fields' name='pager_fields' value='subdrycde,postypdsc'><input type='hidden' id='pager_headers' name='pager_headers' value='Subsidiary,Position Type'><input type='hidden' id='pager_table' name='pager_table' value='positiontypefile'><input type='hidden' id='pager_table_id' value='recid'><input type='hidden' id='pager_xlink' name='pager_xlink' value=''><input type='hidden' id='pager_link_id_hash' name='pager_link_id_hash' value='cacbfb3087c714af46b11a0fd61b583114ed0376c7a1194f7cce30de9802db85'><input type='hidden' id='pager_modsubdry' name='pager_modsubdry' value='0'><input type='hidden' id='pager_xfield' value='postypdsc'><input type='hidden' id='pager_title' name='pager_title' value='Position Type File'><input type='hidden' id='print_flds' name='print_flds' value='Array'><input type='hidden' id='print_header' name='print_header' value='Array'><input type='hidden' id='print_fieldname' name='print_fieldname' value='postypdsc'><input type="hidden" id="pager_spechar" name="pager_spechar" value="!@#$%^&*()_+-={}[]:"|;'\,./"><input type='hidden' id='usedscascde' name='usedscascde' value='0'><input type='hidden' id='table_code' name='table_code' value=''><input type='hidden' id='table_desc' name='table_desc' value='postypdsc'><input type='hidden' id='modal_width' name='modal_width' value='auto'><input type='hidden' id='modal_height' name='modal_height' value='auto'><input type='hidden' id='hovering_type' name='hovering_type' value='hover'><input type='hidden' id='server' name='server' value='/online_test/web_standard_onedb/webapp/hris/mf_postype.php'><input type='hidden' id='header_sort' name='header_sort' value=''><input type='hidden' id='header_sort_by' name='header_sort_by' value=''><input type='hidden' id='leave_logs' name='leave_logs' value=''><input type='hidden' id='txt_leavesdesc' name='txt_leavesdesc' value=''><input type="hidden" name="print_fields_arr[subdrycde][header]" value="Subsidiary"><input type="hidden" name="print_fields_arr[subdrycde][type]" value="select"><input type="hidden" name="print_fields_arr[subdrycde][regex]" value=""><input type="hidden" name="print_fields_arr[postypdsc][header]" value="Position Type"><input type="hidden" name="print_fields_arr[postypdsc][type]" value="text"><input type="hidden" name="print_fields_arr[postypdsc][regex]" value=""></td></tr><tr><td>Subsidiary : <input type='text' id='pager_subdrycde' ></td></tr><tr><td>Position Type : <input type='text' id='pager_postypdsc' ></td></tr></table></td></tr> </table></div></article><div id='pager_modal' style='display:none;'><table style='font-family:arial;' class="defaultfontsize"><tr hidden><td colspan='2'><input type='hidden' id='modalField_recid' name='modalField[recid]'></td></tr><tr class="hidden_tr"><td hidden id="lbl_subdrycde">Subsidiary </td><td hidden><select class="input required " id='modalField_subdrycde' name='modalField[subdrycde]' ><option value='SUB-0000000000000001'>WEBTKM</option></select></td></tr><tr class=""><td class="" id="lbl_postypdsc">Position Type </td><td class=""><input data-db_col="postypdsc" type='text' data-overwrite_length='30' id='modalField_postypdsc' class="input required pager_class dia_fld" name='modalField[postypdsc]' style=''></td></tr></table></div><div id='pager_copy_diag' style='display:none;'><div class="pager_copy_diag_container" id="pager_container"><div class="pager_copy_diag_sub_container"><table class="defaultfontsize"><tr><td style="width: 150px !important" id="lbl_copy_subdryfrom">Copy From Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryfrom" name="pager_copy_diag_subdrycdefrm"><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td style="width: 150px !important" id="lbl_copy_subdryto">Copy To Subsidiary</td><td><select id="sel_copy_subdryfrom" class="input pager_copy_subdry pager_copy_subdryto" name="pager_copy_diag_subdrycdeto"><option></option><option value="SUB-0000000000000001">WEBTKM</option></select></td></tr><tr><td colspan="100"><hr></td></tr></table><br><table class="defaultfontsize"><tr><td id="lbl_note" colspan="100" valign="middle"><b id="lbl_note">Note:</b><span id="span_note" class="pager_legend_box" style="background-color:#a01313de;"></span> Already Exist in the Designated Subsidiary</td></tr></table><br><div id="pager_freeze_tbl_container"></div></div></div></div><div id='pager_print_export' style='display:none;'><table id="tbl_print_export" class="defaultfontsize hoverTable"><thead><tr><th>Column Name</th><th>From</th><th>To</th><th>Order No.</th></tr></thead><tr ><td id="lbl_postypdsc">Position Type</td><td><input id="txt_from_postypdsc" name="pager_print_from[postypdsc]" class="input pager_print_expt_input_text"></td><td><input id="txt_to_postypdsc" name="pager_print_to[postypdsc]" class="input pager_print_expt_input_text"></td><td><select id="sel_sort_postypdsc" class="input pager_print_expt_col_sort_sel" name="pager_print_col_sort[postypdsc]" style="width:50px;" onchange="checkselval(this);"><option value=""></option><option value="1">1</option></select></td></tr></table><br><div id="print_layout_container" style="width:100%;"><table style="width:100%;" class="defaultfontsize"><tr><td style="width:150px" id="lbl_page_orientation">Page Orientation</td><td id="lbl_print_orientation"><input type="radio" id="rdo_portrait" name="pager_print_orientation" value="portrait" checked>Portrait <input type="radio" id="rdo_landscape" name="pager_print_orientation" value="landscape">Landscape</td></tr><tr><td style="width:150px" id="lbl_page_size">Page Size</td><td id="lbl_print_size"><input type="radio" id="rdo_letter" name="pager_print_paper_size" value="LETTER" checked>Letter <input type="radio" id="rdo_legal" name="pager_print_paper_size" value="LEGAL">Legal</td></tr></table></div><br></div><script type='text/javascript' src='./class/lstv_pager.js?v=20220224185611'></script></div></center> <div style="height: 50px;"></div> </form> </div> <style> footer { } footer p { font-family: Calibri; font-weight: normal; text-align: center; font-size: 16px; padding: 10px 0; color: #111; margin: 0; } .ftr_containers { position: fixed; margin: 0 auto; bottom: 0; left: 0; right: 0; /*background: ;*/ background: #fff; z-index: 2; box-shadow: 0 0 1px rgba(0,0,0,0.2), 0 0 10px rgba(0,0,0,0.08), 0 0 20px rgba(0,0,0,0.05); } .ftr_containers a { color: #586949; text-align: center; } .ftr_containers span { position: absolute; top: 10px; left: 10px; } </style> <footer> <div class="ftr_containers" id="lbl_footer"> <p> Copyright © 2022 LEE Systems Technology Ventures Inc</p> </div> </footer> <script type='text/javascript'> function end_preloader() { jQuery('#preLoader').fadeOut('slow', function() { // Animation complete. }); } function start_preloader() { jQuery('#preLoader').fadeIn('slow', function() { // Animation complete. }); } end_preloader(); </script> </form> </body> </html> |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/tinymce/tinymce.min.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 |
| Request Header - size: 501 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/tinymce/tinymce.min.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 385081 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 385,081 bytes. |
// 4.4.3 (2016-09-01)
!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i<e.length;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;i<r.length;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){var r,i,o,a,l;for(r=0;r<n.length;r++){i=e,o=n[r],a=o.split(/[.\/]/);for(var c=0;c<a.length-1;++c)i[a[c]]===t&&(i[a[c]]={}),i=i[a[c]];i[a[a.length-1]]=s[o]}if(e.AMDLC_TESTS){l=e.privateModules||{};for(o in s)l[o]=s[o];for(r=0;r<n.length;r++)delete l[n[r]];e.privateModules=l}}var s={},l="tinymce/geom/Rect",c="tinymce/util/Promise",u="tinymce/util/Delay",d="tinymce/Env",f="tinymce/dom/EventUtils",h="tinymce/dom/Sizzle",p="tinymce/util/Arr",m="tinymce/util/Tools",g="tinymce/dom/DomQuery",v="tinymce/html/Styles",y="tinymce/dom/TreeWalker",b="tinymce/dom/Range",C="tinymce/html/Entities",x="tinymce/dom/StyleSheetLoader",w="tinymce/dom/DOMUtils",N="tinymce/dom/ScriptLoader",E="tinymce/AddOnManager",_="tinymce/dom/NodeType",S="tinymce/text/Zwsp",k="tinymce/caret/CaretContainer",T="tinymce/dom/RangeUtils",R="tinymce/NodeChange",A="tinymce/html/Node",B="tinymce/html/Schema",D="tinymce/html/SaxParser",L="tinymce/html/DomParser",M="tinymce/html/Writer",P="tinymce/html/Serializer",O="tinymce/dom/Serializer",H="tinymce/dom/TridentSelection",I="tinymce/util/VK",F="tinymce/dom/ControlSelection",z="tinymce/util/Fun",U="tinymce/caret/CaretCandidate",W="tinymce/geom/ClientRect",V="tinymce/text/ExtendingChar",$="tinymce/caret/CaretPosition",q="tinymce/caret/CaretBookmark",j="tinymce/dom/BookmarkManager",Y="tinymce/dom/Selection",X="tinymce/dom/ElementUtils",K="tinymce/fmt/Preview",G="tinymce/fmt/Hooks",J="tinymce/Formatter",Q="tinymce/UndoManager",Z="tinymce/EnterKey",ee="tinymce/ForceBlocks",te="tinymce/caret/CaretUtils",ne="tinymce/caret/CaretWalker",re="tinymce/InsertList",ie="tinymce/InsertContent",oe="tinymce/EditorCommands",ae="tinymce/util/URI",se="tinymce/util/Class",le="tinymce/util/EventDispatcher",ce="tinymce/data/Binding",ue="tinymce/util/Observable",de="tinymce/data/ObservableObject",fe="tinymce/ui/Selector",he="tinymce/ui/Collection",pe="tinymce/ui/DomUtils",me="tinymce/ui/BoxUtils",ge="tinymce/ui/ClassList",ve="tinymce/ui/ReflowQueue",ye="tinymce/ui/Control",be="tinymce/ui/Factory",Ce="tinymce/ui/KeyboardNavigation",xe="tinymce/ui/Container",we="tinymce/ui/DragHelper",Ne="tinymce/ui/Scrollable",Ee="tinymce/ui/Panel",_e="tinymce/ui/Movable",Se="tinymce/ui/Resizable",ke="tinymce/ui/FloatPanel",Te="tinymce/ui/Window",Re="tinymce/ui/MessageBox",Ae="tinymce/WindowManager",Be="tinymce/ui/Tooltip",De="tinymce/ui/Widget",Le="tinymce/ui/Progress",Me="tinymce/ui/Notification",Pe="tinymce/NotificationManager",Oe="tinymce/dom/NodePath",He="tinymce/util/Quirks",Ie="tinymce/EditorObservable",Fe="tinymce/Mode",ze="tinymce/Shortcuts",Ue="tinymce/file/Uploader",We="tinymce/file/Conversions",Ve="tinymce/file/ImageScanner",$e="tinymce/file/BlobCache",qe="tinymce/file/UploadStatus",je="tinymce/EditorUpload",Ye="tinymce/caret/FakeCaret",Xe="tinymce/dom/Dimensions",Ke="tinymce/caret/LineWalker",Ge="tinymce/caret/LineUtils",Je="tinymce/dom/MousePosition",Qe="tinymce/DragDropOverrides",Ze="tinymce/SelectionOverrides",et="tinymce/util/Uuid",tt="tinymce/Editor",nt="tinymce/util/I18n",rt="tinymce/FocusManager",it="tinymce/EditorManager",ot="tinymce/LegacyInput",at="tinymce/util/XHR",st="tinymce/util/JSON",lt="tinymce/util/JSONRequest",ct="tinymce/util/JSONP",ut="tinymce/util/LocalStorage",dt="tinymce/Compat",ft="tinymce/ui/Layout",ht="tinymce/ui/AbsoluteLayout",pt="tinymce/ui/Button",mt="tinymce/ui/ButtonGroup",gt="tinymce/ui/Checkbox",vt="tinymce/ui/ComboBox",yt="tinymce/ui/ColorBox",bt="tinymce/ui/PanelButton",Ct="tinymce/ui/ColorButton",xt="tinymce/util/Color",wt="tinymce/ui/ColorPicker",Nt="tinymce/ui/Path",Et="tinymce/ui/ElementPath",_t="tinymce/ui/FormItem",St="tinymce/ui/Form",kt="tinymce/ui/FieldSet",Tt="tinymce/ui/FilePicker",Rt="tinymce/ui/FitLayout",At="tinymce/ui/FlexLayout",Bt="tinymce/ui/FlowLayout",Dt="tinymce/ui/FormatControls",Lt="tinymce/ui/GridLayout",Mt="tinymce/ui/Iframe",Pt="tinymce/ui/InfoBox",Ot="tinymce/ui/Label",Ht="tinymce/ui/Toolbar",It="tinymce/ui/MenuBar",Ft="tinymce/ui/MenuButton",zt="tinymce/ui/MenuItem",Ut="tinymce/ui/Throbber",Wt="tinymce/ui/Menu",Vt="tinymce/ui/ListBox",$t="tinymce/ui/Radio",qt="tinymce/ui/ResizeHandle",jt="tinymce/ui/SelectBox",Yt="tinymce/ui/Slider",Xt="tinymce/ui/Spacer",Kt="tinymce/ui/SplitButton",Gt="tinymce/ui/StackLayout",Jt="tinymce/ui/TabPanel",Qt="tinymce/ui/TextBox",Zt="tinymce/Register";r(l,[],function(){function e(e,t,n){var r,i,a,s,l,u;return r=t.x,i=t.y,a=e.w,s=e.h,l=t.w,u=t.h,n=(n||"").split(""),"b"===n[0]&&(i+=u),"r"===n[1]&&(r+=l),"c"===n[0]&&(i+=c(u/2)),"c"===n[1]&&(r+=c(l/2)),"b"===n[3]&&(i-=s),"r"===n[4]&&(r-=a),"c"===n[3]&&(i-=c(s/2)),"c"===n[4]&&(r-=c(a/2)),o(r,i,a,s)}function t(t,n,r,i){var o,a;for(a=0;a<i.length;a++)if(o=e(t,n,i[a]),o.x>=r.x&&o.x+o.w<=r.w+r.x&&o.y>=r.y&&o.y+o.h<=r.h+r.y)return i[a];return null}function n(e,t,n){return o(e.x-t,e.y-n,e.w+2*t,e.h+2*n)}function r(e,t){var n,r,i,a;return n=l(e.x,t.x),r=l(e.y,t.y),i=s(e.x+e.w,t.x+t.w),a=s(e.y+e.h,t.y+t.h),0>i-n||0>a-r?null:o(n,r,i-n,a-r)}function i(e,t,n){var r,i,a,s,c,u,d,f,h,p;return c=e.x,u=e.y,d=e.x+e.w,f=e.y+e.h,h=t.x+t.w,p=t.y+t.h,r=l(0,t.x-c),i=l(0,t.y-u),a=l(0,d-h),s=l(0,f-p),c+=r,u+=i,n&&(d+=r,f+=i,c-=a,u-=s),d-=a,f-=s,o(c,u,d-c,f-u)}function o(e,t,n,r){return{x:e,y:t,w:n,h:r}}function a(e){return o(e.left,e.top,e.width,e.height)}var s=Math.min,l=Math.max,c=Math.round;return{inflate:n,relativePosition:e,findBestRelativePosition:t,intersect:r,clamp:i,create:o,fromClientRect:a}}),r(c,[],function(){function e(e,t){return function(){e.apply(t,arguments)}}function t(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(t,e(r,this),e(i,this))}function n(e){var t=this;return null===this._state?void this._deferreds.push(e):void l(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=n(t._value)}catch(i){return void e.reject(i)}e.resolve(r)})}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void s(e(n,t),e(r,this),e(i,this))}this._state=!0,this._value=t,o.call(this)}catch(a){i.call(this,a)}}function i(e){this._state=!1,this._value=e,o.call(this)}function o(){for(var e=0,t=this._deferreds.length;t>e;e++)n.call(this,this._deferreds[e]);this._deferreds=null}function a(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function s(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(i){if(r)return;r=!0,n(i)}}if(window.Promise)return window.Promise;var l=t.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)},c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return t.prototype["catch"]=function(e){return this.then(null,e)},t.prototype.then=function(e,r){var i=this;return new t(function(t,o){n.call(i,new a(e,r,t,o))})},t.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&c(arguments[0])?arguments[0]:arguments);return new t(function(t,n){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},n)}e[o]=a,0===--i&&t(e)}catch(l){n(l)}}if(0===e.length)return t([]);for(var i=e.length,o=0;o<e.length;o++)r(o,e[o])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(t){t(e)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.race=function(e){return new t(function(t,n){for(var r=0,i=e.length;i>r;r++)e[r].then(t,n)})},t}),r(u,[c],function(e){function t(e,t){function n(e){window.setTimeout(e,0)}var r,i=window.requestAnimationFrame,o=["ms","moz","webkit"];for(r=0;r<o.length&&!i;r++)i=window[o[r]+"RequestAnimationFrame"];i||(i=n),i(e,t)}function n(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)}function r(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)}function i(e){return clearTimeout(e)}function o(e){return clearInterval(e)}var a;return{requestAnimationFrame:function(n,r){return a?void a.then(n):void(a=new e(function(e){r||(r=document.body),t(e,r)}).then(n))},setTimeout:n,setInterval:r,setEditorTimeout:function(e,t,r){return n(function(){e.removed||t()},r)},setEditorInterval:function(e,t,n){var i;return i=r(function(){e.removed?clearInterval(i):t()},n)},throttle:function(e,t){var r,i;return i=function(){var i=arguments;clearTimeout(r),r=n(function(){e.apply(this,i)},t)},i.stop=function(){clearTimeout(r)},i},clearInterval:o,clearTimeout:i}}),r(d,[],function(){function e(e){return"matchMedia"in window?matchMedia(e).matches:!1}var t=navigator,n=t.userAgent,r,i,o,a,s,l,c,u,d,f,h,p,m;r=window.opera&&window.opera.buildNumber,d=/Android/.test(n),i=/WebKit/.test(n),o=!i&&!r&&/MSIE/gi.test(n)&&/Explorer/gi.test(t.appName),o=o&&/MSIE (\w+)\./.exec(n)[1],a=-1==n.indexOf("Trident/")||-1==n.indexOf("rv:")&&-1==t.appName.indexOf("Netscape")?!1:11,s=-1==n.indexOf("Edge/")||o||a?!1:12,o=o||a||s,l=!i&&!a&&/Gecko/.test(n),c=-1!=n.indexOf("Mac"),u=/(iPad|iPhone)/.test(n),f="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,h=e("only screen and (max-device-width: 480px)")&&(d||u),p=e("only screen and (min-width: 800px)")&&(d||u),m=-1!=n.indexOf("Windows Phone"),s&&(i=!1);var g=!u||f||n.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:r,webkit:i,ie:o,gecko:l,mac:c,iOS:u,android:d,contentEditable:g,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=o,range:window.getSelection&&"Range"in window,documentMode:o&&!s?document.documentMode||7:10,fileApi:f,ceFalse:o===!1||o>8,canHaveCSP:o===!1||o>11,desktop:!h&&!p,windowsPhone:m}}),r(f,[u,d],function(e,t){function n(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function r(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function i(e,t){var n,r=t;return n=e.path,n&&n.length>0&&(r=n[0]),e.deepPath&&(n=e.deepPath(),n&&n.length>0&&(r=n[0])),r}function o(e,n){function r(){return!1}function o(){return!0}var a,s=n||{},l;for(a in e)u[a]||(s[a]=e[a]);if(s.target||(s.target=s.srcElement||document),t.experimentalShadowDom&&(s.target=i(e,s.target)),e&&c.test(e.type)&&e.pageX===l&&e.clientX!==l){var d=s.target.ownerDocument||document,f=d.documentElement,h=d.body;s.pageX=e.clientX+(f&&f.scrollLeft||h&&h.scrollLeft||0)-(f&&f.clientLeft||h&&h.clientLeft||0),s.pageY=e.clientY+(f&&f.scrollTop||h&&h.scrollTop||0)-(f&&f.clientTop||h&&h.clientTop||0)}return s.preventDefault=function(){s.isDefaultPrevented=o,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},s.stopPropagation=function(){s.isPropagationStopped=o,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},s.stopImmediatePropagation=function(){s.isImmediatePropagationStopped=o,s.stopPropagation()},s.isDefaultPrevented||(s.isDefaultPrevented=r,s.isPropagationStopped=r,s.isImmediatePropagationStopped=r),"undefined"==typeof s.metaKey&&(s.metaKey=!1),s}function a(t,i,o){function a(){o.domLoaded||(o.domLoaded=!0,i(u))}function s(){("complete"===c.readyState||"interactive"===c.readyState&&c.body)&&(r(c,"readystatechange",s),a())}function l(){try{c.documentElement.doScroll("left")}catch(t){return void e.setTimeout(l)}a()}var c=t.document,u={type:"ready"};return o.domLoaded?void i(u):(c.addEventListener?"complete"===c.readyState?a():n(t,"DOMContentLoaded",a):(n(c,"readystatechange",s),c.documentElement.doScroll&&t.self===t.top&&l()),void n(t,"load",a))}function s(){function e(e,t){var n,r,o,a,s=i[t];if(n=s&&s[e.type])for(r=0,o=n.length;o>r;r++)if(a=n[r],a&&a.func.call(a.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var t=this,i={},s,c,u,d,f;c=l+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},s=1,t.domLoaded=!1,t.events=i,t.bind=function(r,l,h,p){function m(t){e(o(t||N.event),g)}var g,v,y,b,C,x,w,N=window;if(r&&3!==r.nodeType&&8!==r.nodeType){for(r[c]?g=r[c]:(g=s++,r[c]=g,i[g]={}),p=p||r,l=l.split(" "),y=l.length;y--;)b=l[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),t.domLoaded&&"ready"===b&&"complete"==r.readyState?h.call(p,o({type:b})):(d||(C=f[b],C&&(x=function(t){var n,r;if(n=t.currentTarget,r=t.relatedTarget,r&&n.contains)r=n.contains(r);else for(;r&&r!==n;)r=r.parentNode;r||(t=o(t||N.event),t.type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=n,e(t,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(t){t=o(t||N.event),t.type="focus"===t.type?"focusin":"focusout",e(t,g)}),v=i[g][b],v?"ready"===b&&t.domLoaded?h({type:b}):v.push({func:h,scope:p}):(i[g][b]=v=[{func:h,scope:p}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?a(r,x,t):n(r,C||b,x,w)));return r=v=0,h}},t.unbind=function(e,n,o){var a,s,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return t;if(a=e[c]){if(f=i[a],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],s=f[d]){if(o)for(u=s.length;u--;)if(s[u].func===o){var h=s.nativeHandler,p=s.fakeName,m=s.capture;s=s.slice(0,u).concat(s.slice(u+1)),s.nativeHandler=h,s.fakeName=p,s.capture=m,f[d]=s}o&&0!==s.length||(delete f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture))}}else{for(d in f)s=f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture);f={}}for(d in f)return t;delete i[a];try{delete e[c]}catch(g){e[c]=null}}return t},t.fire=function(n,r,i){var a;if(!n||3===n.nodeType||8===n.nodeType)return t;i=o(null,i),i.type=r,i.target=n;do a=n[c],a&&e(i,a),n=n.parentNode||n.ownerDocument||n.defaultView||n.parentWindow;while(n&&!i.isPropagationStopped());return t},t.clean=function(e){var n,r,i=t.unbind;if(!e||3===e.nodeType||8===e.nodeType)return t;if(e[c]&&i(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(i(e),r=e.getElementsByTagName("*"),n=r.length;n--;)e=r[n],e[c]&&i(e);return t},t.destroy=function(){i={}},t.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var l="mce-data-",c=/^(?:mouse|contextmenu)|click/,u={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1};return s.Event=new s,s.Event.bind(window,"ready",function(){}),s}),r(h,[],function(){function e(e,t,n,r){var i,o,a,s,l,c,d,h,p,m;if((t?t.ownerDocument||t:z)!==D&&B(t),t=t||D,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(M&&!r){if(i=ve.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&I(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&x.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(x.qsa&&(!P||!P.test(e))){if(h=d=F,p=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=_(e),(d=t.getAttribute("id"))?h=d.replace(be,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=c.length;l--;)c[l]=h+f(c[l]);p=ye.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return Z.apply(n,p.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return k(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>w.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[F]=!0,e}function i(e){var t=D.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||X)-(~e.sourceIndex||X);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&typeof e.getElementsByTagName!==Y&&e}function d(){}function f(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[U,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[F]||(t[F]={}),(s=l[r])&&s[0]===U&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),c&&t.push(s)));return a}function v(e,t,n,i,o,a){return i&&!i[F]&&(i=v(i)),o&&!o[F]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,f=[],h=[],p=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,f,e,s,l),b=n?o||(r?e:p||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[h[u]]=!(y[h[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?te.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(p,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return te.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==T)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=w.relative[e[s].type])u=[h(p(u),n)];else{if(n=w.filter[e[s].type].apply(null,e[s].matches),n[F]){for(r=++s;i>r&&!w.relative[e[r].type];r++);return v(s>1&&p(u),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&f(e))}u.push(n)}return p(u)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,s,l,c){var u,d,f,h=0,p="0",m=r&&[],v=[],y=T,b=r||o&&w.find.TAG("*",c),C=U+=null==y?1:Math.random()||.1,x=b.length;for(c&&(T=a!==D&&a);p!==x&&null!=(u=b[p]);p++){if(o&&u){for(d=0;f=t[d++];)if(f(u,a,s)){l.push(u);break}c&&(U=C)}i&&((u=!f&&u)&&h--,r&&m.push(u))}if(h+=p,i&&p!==h){for(d=0;f=n[d++];)f(m,v,a,s);if(r){if(h>0)for(;p--;)m[p]||v[p]||(v[p]=J.call(l));v=g(v)}Z.apply(l,v),c&&!r&&v.length>0&&h+n.length>1&&e.uniqueSort(l)}return c&&(U=C,T=y),m};return i?r(a):a}var C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F="sizzle"+-new Date,z=window.document,U=0,W=0,V=n(),$=n(),q=n(),j=function(e,t){return e===t&&(A=!0),0},Y=typeof t,X=1<<31,K={}.hasOwnProperty,G=[],J=G.pop,Q=G.push,Z=G.push,ee=G.slice,te=G.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},ne="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",re="[\\x20\\t\\r\\n\\f]",ie="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",oe="\\["+re+"*("+ie+")(?:"+re+"*([*^$|!~]?=)"+re+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+re+"*\\]",ae=":("+ie+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp("^"+re+"+|((?:^|[^\\\\])(?:\\\\.)*)"+re+"+$","g"),le=new RegExp("^"+re+"*,"+re+"*"),ce=new RegExp("^"+re+"*([>+~]|"+re+")"+re+"*"),ue=new RegExp("="+re+"*([^\\]'\"]*?)"+re+"*\\]","g"),de=new RegExp(ae),fe=new RegExp("^"+ie+"$"),he={ID:new RegExp("^#("+ie+")"),CLASS:new RegExp("^\\.("+ie+")"),TAG:new RegExp("^("+ie+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+re+"*(even|odd|(([+-]|)(\\d*)n|)"+re+"*(?:([+-]|)"+re+"*(\\d+)|))"+re+"*\\)|)","i"),bool:new RegExp("^(?:"+ne+")$","i"),needsContext:new RegExp("^"+re+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+re+"*((?:-\\d)?\\d*)"+re+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ge=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,be=/'|\\/g,Ce=new RegExp("\\\\([\\da-f]{1,6}"+re+"?|("+re+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Z.apply(G=ee.call(z.childNodes),z.childNodes),G[z.childNodes.length].nodeType}catch(we){Z={apply:G.length?function(e,t){Q.apply(e,ee.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}x=e.support={},E=e.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},B=e.setDocument=function(e){function t(e){try{return e.top}catch(t){}return null}var n,r=e?e.ownerDocument||e:z,o=r.defaultView;return r!==D&&9===r.nodeType&&r.documentElement?(D=r,L=r.documentElement,M=!E(r),o&&o!==t(o)&&(o.addEventListener?o.addEventListener("unload",function(){B()},!1):o.attachEvent&&o.attachEvent("onunload",function(){B()})),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=ge.test(r.getElementsByClassName),x.getById=i(function(e){return L.appendChild(e).id=F,!r.getElementsByName||!r.getElementsByName(F).length}),x.getById?(w.find.ID=function(e,t){if(typeof t.getElementById!==Y&&M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){return e.getAttribute("id")===t}}):(delete w.find.ID,w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),w.find.TAG=x.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Y?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=x.getElementsByClassName&&function(e,t){return M?t.getElementsByClassName(e):void 0},O=[],P=[],(x.qsa=ge.test(r.querySelectorAll))&&(i(function(e){e.innerHTML="<select msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+re+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||P.push("\\["+re+"*(?:value|"+ne+")"),e.querySelectorAll(":checked").length||P.push(":checked")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&P.push("name"+re+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||P.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),P.push(",.*:")})),(x.matchesSelector=ge.test(H=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){x.disconnectedMatch=H.call(e,"div"),H.call(e,"[s!='']:x"),O.push("!=",ae)}),P=P.length&&new RegExp(P.join("|")),O=O.length&&new RegExp(O.join("|")),n=ge.test(L.compareDocumentPosition),I=n||ge.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},j=n?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===z&&I(z,e)?-1:t===r||t.ownerDocument===z&&I(z,t)?1:R?te.call(R,e)-te.call(R,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:R?te.call(R,e)-te.call(R,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===z?-1:c[i]===z?1:0},r):D},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==D&&B(t),n=n.replace(ue,"='$1']"),x.matchesSelector&&M&&(!O||!O.test(n))&&(!P||!P.test(n)))try{var r=H.call(t,n);if(r||x.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,D,null,[t]).length>0},e.contains=function(e,t){return(e.ownerDocument||e)!==D&&B(e),I(e,t)},e.attr=function(e,n){(e.ownerDocument||e)!==D&&B(e);var r=w.attrHandle[n.toLowerCase()],i=r&&K.call(w.attrHandle,n.toLowerCase())?r(e,n,!M):t;return i!==t?i:x.attributes||!M?e.getAttribute(n):(i=e.getAttributeNode(n))&&i.specified?i.value:null},e.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},e.uniqueSort=function(e){var t,n=[],r=0,i=0;if(A=!x.detectDuplicates,R=!x.sortStable&&e.slice(0),e.sort(j),A){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return R=null,e},N=e.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=N(t);return n},w=e.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ce,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(Ce,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=_(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ce,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+re+")"+e+"("+re+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,h,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(u=g[F]||(g[F]={}),c=u[e]||[],h=c[0]===U&&c[1],f=c[0]===U&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(f=h=0)||p.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[U,h,f];break}}else if(y&&(c=(t[F]||(t[F]={}))[e])&&c[0]===U)f=c[1];else for(;(d=++h&&d&&d[m]||(f=h=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[F]||(d[F]={}))[e]=[U,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(t,n){var i,o=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[F]?o(n):o.length>1?(i=[t,t,"",n],w.setFilters.hasOwnProperty(t.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=te.call(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=S(e.replace(se,"$1"));return i[F]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(e){return e=e.replace(Ce,xe),function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(t){return fe.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(Ce,xe).toLowerCase(),function(e){var n;do if(n=M?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}},w.pseudos.nth=w.pseudos.eq;for(C in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})w.pseudos[C]=s(C);for(C in{submit:!0,reset:!0})w.pseudos[C]=l(C);return d.prototype=w.filters=w.pseudos,w.setFilters=new d,_=e.tokenize=function(t,n){var r,i,o,a,s,l,c,u=$[t+" "];if(u)return n?0:u.slice(0);for(s=t,l=[],c=w.preFilter;s;){r&&!(i=le.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=ce.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(se," ")}),s=s.slice(r.length));for(a in w.filter)!(i=he[a].exec(s))||c[a]&&!(i=c[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?e.error(t):$(t,l).slice(0)},S=e.compile=function(e,t){var n,r=[],i=[],o=q[e+" "];if(!o){for(t||(t=_(e)),n=t.length;n--;)o=y(t[n]),o[F]?r.push(o):i.push(o);o=q(e,b(i,r)),o.selector=e}return o},k=e.select=function(e,t,n,r){var i,o,a,s,l,c="function"==typeof e&&e,d=!r&&_(e=c.selector||e);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&x.getById&&9===t.nodeType&&M&&w.relative[o[1].type]){if(t=(w.find.ID(a.matches[0].replace(Ce,xe),t)||[])[0], !t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=he.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((l=w.find[s])&&(r=l(a.matches[0].replace(Ce,xe),ye.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&f(o),!e)return Z.apply(n,r),n;break}}return(c||S(e,d))(r,t,!M,n,ye.test(e)&&u(t.parentNode)||t),n},x.sortStable=F.split("").sort(j).join("")===F,x.detectDuplicates=!!A,B(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(ne,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),e}),r(p,[],function(){function e(e){var t=e,n,r;if(!u(e))for(t=[],n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function n(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function r(e,t){var r=[];return n(e,function(n,i){r.push(t(n,i,e))}),r}function i(e,t){var r=[];return n(e,function(n,i){t&&!t(n,i,e)||r.push(n)}),r}function o(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function a(e,t,n,r){var i=0;for(arguments.length<3&&(n=e[0]);i<e.length;i++)n=t.call(r,n,e[i],i);return n}function s(e,t,n){var r,i;for(r=0,i=e.length;i>r;r++)if(t.call(n,e[r],r,e))return r;return-1}function l(e,n,r){var i=s(e,n,r);return-1!==i?e[i]:t}function c(e){return e[e.length-1]}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{isArray:u,toArray:e,each:n,map:r,filter:i,indexOf:o,reduce:a,findIndex:s,find:l,last:c}}),r(m,[d,p],function(e,n){function r(e){return null===e||e===t?"":(""+e).replace(h,"")}function i(e,r){return r?"array"==r&&n.isArray(e)?!0:typeof e==r:e!==t}function o(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function a(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],c?o[a]=function(){return i[s].apply(this,arguments)}:o[a]=function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function s(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function l(e,t,r,i){i=i||this,e&&(r&&(e=e[r]),n.each(e,function(e,n){return t.call(i,e,n,r)===!1?!1:void l(e,t,r,i)}))}function c(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)r=e[n],t[r]||(t[r]={}),t=t[r];return t}function u(e,t){var n,r;for(t=t||window,e=e.split("."),n=0,r=e.length;r>n&&(t=t[e[n]],t);n++);return t}function d(e,t){return!e||i(e,"array")?e:n.map(e.split(t||","),r)}function f(t){var n=e.cacheSuffix;return n&&(t+=(-1===t.indexOf("?")?"?":"&")+n),t}var h=/^\s*|\s*$/g;return{trim:r,isArray:n.isArray,is:i,toArray:n.toArray,makeMap:o,each:n.each,map:n.map,grep:n.filter,inArray:n.indexOf,extend:s,create:a,walk:l,createNS:c,resolve:u,explode:d,_addCacheSuffix:f}}),r(g,[f,h,m,d],function(e,n,r,i){function o(e){return"undefined"!=typeof e}function a(e){return"string"==typeof e}function s(e){return e&&e==e.window}function l(e,t){var n,r,i;for(t=t||w,i=t.createElement("div"),n=t.createDocumentFragment(),i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return n}function c(e,t,n,r){var i;if(a(t))t=l(t,v(e[0]));else if(t.length&&!t.nodeType){if(t=f.makeArray(t),r)for(i=t.length-1;i>=0;i--)c(e,t[i],n,r);else for(i=0;i<t.length;i++)c(e,t[i],n,r);return e}if(t.nodeType)for(i=e.length;i--;)n.call(e[i],t);return e}function u(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")}function d(e,t,n){var r,i;return t=f(t)[0],e.each(function(){var e=this;n&&r==e.parentNode?i.appendChild(e):(r=e.parentNode,i=t.cloneNode(!1),e.parentNode.insertBefore(i,e),i.appendChild(e))}),e}function f(e,t){return new f.fn.init(e,t)}function h(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1}function p(e){return null===e||e===k?"":(""+e).replace(P,"")}function m(e,t){var n,r,i,o,a;if(e)if(n=e.length,n===o){for(r in e)if(e.hasOwnProperty(r)&&(a=e[r],t.call(a,r,a)===!1))break}else for(i=0;n>i&&(a=e[i],t.call(a,i,a)!==!1);i++);return e}function g(e,t){var n=[];return m(e,function(e,r){t(r,e)&&n.push(r)}),n}function v(e){return e?9==e.nodeType?e:e.ownerDocument:w}function y(e,n,r){var i=[],o=e[n];for("string"!=typeof r&&r instanceof f&&(r=r[0]);o&&9!==o.nodeType;){if(r!==t){if(o===r)break;if("string"==typeof r&&f(o).is(r))break}1===o.nodeType&&i.push(o),o=o[n]}return i}function b(e,n,r,i){var o=[];for(i instanceof f&&(i=i[0]);e;e=e[n])if(!r||e.nodeType===r){if(i!==t){if(e===i)break;if("string"==typeof i&&f(e).is(i))break}o.push(e)}return o}function C(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType==n)return e;return null}function x(e,t,n){m(n,function(n,r){e[n]=e[n]||{},e[n][t]=r})}var w=document,N=Array.prototype.push,E=Array.prototype.slice,_=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,S=e.Event,k,T=r.makeMap("children,contents,next,prev"),R=r.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),A=r.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),B={"for":"htmlFor","class":"className",readonly:"readOnly"},D={"float":"cssFloat"},L={},M={},P=/^\s*|\s*$/g;return f.fn=f.prototype={constructor:f,selector:"",context:null,length:0,init:function(e,t){var n=this,r,i;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(t&&t.nodeType)n.context=t;else{if(t)return f(e).attr(t);n.context=t=document}if(a(e)){if(n.selector=e,r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:_.exec(e),!r)return f(t).find(e);if(r[1])for(i=l(e,v(t)).firstChild;i;)N.call(n,i),i=i.nextSibling;else{if(i=v(t).getElementById(r[2]),!i)return n;if(i.id!==r[2])return n.find(e);n.length=1,n[0]=i}}else this.add(e,!1);return n},toArray:function(){return r.toArray(this)},add:function(e,t){var n=this,r,i;if(a(e))return n.add(f(e));if(t!==!1)for(r=f.unique(n.toArray().concat(f.makeArray(e))),n.length=r.length,i=0;i<r.length;i++)n[i]=r[i];else N.apply(n,f.makeArray(e));return n},attr:function(e,t){var n=this,r;if("object"==typeof e)m(e,function(e,t){n.attr(e,t)});else{if(!o(t)){if(n[0]&&1===n[0].nodeType){if(r=L[e],r&&r.get)return r.get(n[0],e);if(A[e])return n.prop(e)?e:k;t=n[0].getAttribute(e,2),null===t&&(t=k)}return t}this.each(function(){var n;if(1===this.nodeType){if(n=L[e],n&&n.set)return void n.set(this,t);null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2)}})}return n},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if(e=B[e]||e,"object"==typeof e)m(e,function(e,t){n.prop(e,t)});else{if(!o(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1==this.nodeType&&(this[e]=t)})}return n},css:function(e,t){function n(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})}function r(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})}var i=this,a,s;if("object"==typeof e)m(e,function(e,t){i.css(e,t)});else if(o(t))e=n(e),"number"!=typeof t||R[e]||(t+="px"),i.each(function(){var n=this.style;if(s=M[e],s&&s.set)return void s.set(this,t);try{this.style[D[e]||e]=t}catch(i){}null!==t&&""!==t||(n.removeProperty?n.removeProperty(r(e)):n.removeAttribute(e))});else{if(a=i[0],s=M[e],s&&s.get)return s.get(a);if(a.ownerDocument.defaultView)try{return a.ownerDocument.defaultView.getComputedStyle(a,null).getPropertyValue(r(e))}catch(l){return k}else if(a.currentStyle)return a.currentStyle[n(e)]}return i},remove:function(){for(var e=this,t,n=this.length;n--;)t=e[n],S.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var e=this,t,n=this.length;n--;)for(t=e[n];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(e){var t=this,n;if(o(e)){n=t.length;try{for(;n--;)t[n].innerHTML=e}catch(r){f(t[n]).empty().append(e)}return t}return t[0]?t[0].innerHTML:""},text:function(e){var t=this,n;if(o(e)){for(n=t.length;n--;)"innerText"in t[n]?t[n].innerText=e:t[0].textContent=e;return t}return t[0]?t[0].innerText||t[0].textContent:""},append:function(){return c(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return c(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){var e=this;return e[0]&&e[0].parentNode?c(e,arguments,function(e){this.parentNode.insertBefore(e,this)}):e},after:function(){var e=this;return e[0]&&e[0].parentNode?c(e,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):e},appendTo:function(e){return f(e).append(this),this},prependTo:function(e){return f(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return d(this,e)},wrapAll:function(e){return d(this,e,!0)},wrapInner:function(e){return this.each(function(){f(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){f(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),f(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return"string"!=typeof e?n:(-1!==e.indexOf(" ")?m(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(n,r){var i,o;o=u(r,e),o!==t&&(i=r.className,o?r.className=p((" "+i+" ").replace(" "+e+" "," ")):r.className+=i?" "+e:e)}),n)},hasClass:function(e){return u(this[0],e)},each:function(e){return m(this,e)},on:function(e,t){return this.each(function(){S.bind(this,e,t)})},off:function(e,t){return this.each(function(){S.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?S.fire(this,e.type,e):S.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new f(E.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;n>t;t++)f.find(e,this[t],r);return f(r)},filter:function(e){return f("function"==typeof e?g(this.toArray(),function(t,n){return e(n,t)}):f.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof f&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&f(r).is(e)){t.push(r);break}if(r==e){t.push(r);break}r=r.parentNode}}),f(t)},offset:function(e){var t,n,r,i=0,o=0,a;return e?this.css(e):(t=this[0],t&&(n=t.ownerDocument,r=n.documentElement,t.getBoundingClientRect&&(a=t.getBoundingClientRect(),i=a.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,o=a.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:o})},push:N,sort:[].sort,splice:[].splice},r.extend(f,{extend:r.extend,makeArray:function(e){return s(e)||e.nodeType?[e]:r.toArray(e)},inArray:h,isArray:r.isArray,each:m,trim:p,grep:g,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,contains:n.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!=t[r].nodeType&&t.splice(r,1);return t=1===t.length?f.find.matchesSelector(t[0],e)?[t[0]]:[]:f.find.matches(e,t)}}),m({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return y(e,"parentNode")},next:function(e){return C(e,"nextSibling",1)},prev:function(e){return C(e,"previousSibling",1)},children:function(e){return b(e.firstChild,"nextSibling",1)},contents:function(e){return r.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){f.fn[e]=function(n){var r=this,i=[];return r.each(function(){var e=t.call(i,this,n,i);e&&(f.isArray(e)?i.push.apply(i,e):i.push(e))}),this.length>1&&(T[e]||(i=f.unique(i)),0===e.indexOf("parents")&&(i=i.reverse())),i=f(i),n?i.filter(n):i}}),m({parentsUntil:function(e,t){return y(e,"parentNode",t)},nextUntil:function(e,t){return b(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return b(e,"previousSibling",1,t).slice(1)}},function(e,t){f.fn[e]=function(n,r){var i=this,o=[];return i.each(function(){var e=t.call(o,this,n,o);e&&(f.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=f.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse())),o=f(o),r?o.filter(r):o}}),f.fn.is=function(e){return!!e&&this.filter(e).length>0},f.fn.init.prototype=f.fn,f.overrideDefaults=function(e){function t(r,i){return n=n||e(),0===arguments.length&&(r=n.element),i||(i=n.context),new t.fn.init(r,i)}var n;return f.extend(t,this),t},i.ie&&i.ie<8&&(x(L,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?k:t},size:function(e){var t=e.size;return 20===t?k:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?k:t}}),x(L,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),i.ie&&i.ie<9&&(D["float"]="styleFloat",x(M,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),f.attrHooks=L,f.cssHooks=M,f}),r(v,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d,f,h="\ufeff";for(e=e||{},t&&(d=t.getValidStyles(),f=t.getInvalidStyles()),u=("\\\" \\' \\; \\: ; : "+h).split(" "),l=0;l<u.length;l++)c[u[l]]=h+l,c[h+l]=u[l];return{toHex:function(e){return e.replace(r,n)},parse:function(t){function s(e,t,n){var r,i,o,a;if(r=m[e+"-top"+t],r&&(i=m[e+"-right"+t],i&&(o=m[e+"-bottom"+t],o&&(a=m[e+"-left"+t])))){var s=[r,i,o,a];for(l=s.length-1;l--&&s[l]===s[l+1];);l>-1&&n||(m[e+t]=-1==l?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}}function u(e){var t=m[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return m[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}function f(e){return b=!0,c[e]}function h(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function p(t,n,r,i,o,a){if(o=o||a)return o=h(o),"'"+o.replace(/\'/g,"\\'")+"'";if(n=h(n||r||i),!e.allow_script_urls){var s=n.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(s))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"}var m={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),y=y.replace(/\\[0-9a-f]+/g,function(e){return String.fromCharCode(parseInt(e.substr(1),16))}),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(|\/\*|\*\//.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":"color"!==v&&"background-color"!==v||(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,p),m[v]=b?h(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(e,t){function n(t){var n,r,o,a;if(n=d[t])for(r=0,o=n.length;o>r;r++)t=n[r],a=e[t],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+t+": "+a+";")}function r(e,t){var n;return n=f["*"],n&&n[e]?!1:(n=f[t],!n||!n[e])}var i="",o,a;if(t&&d)n("*"),n(t);else for(o in e)a=e[o],a!==s&&a.length>0&&(f&&!r(o,t)||(i+=(i.length>0?" ":"")+o+": "+a+";"));return i}}}}),r(y,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}function r(e,n,r,i){var o,a,s;if(e){if(o=e[r],t&&o===t)return;if(o){if(!i)for(s=o[n];s;s=s[n])if(!s[n])return s;return o}if(a=e.parentNode,a&&a!==t)return a}}var i=e;this.current=function(){return i},this.next=function(e){return i=n(i,"firstChild","nextSibling",e)},this.prev=function(e){return i=n(i,"lastChild","previousSibling",e)},this.prev2=function(e){return i=r(i,"lastChild","previousSibling",e)}}}),r(b,[m],function(e){function t(n){function r(){return P.createDocumentFragment()}function i(e,t){N(F,e,t)}function o(e,t){N(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(M[V]=M[W],M[$]=M[U]):(M[W]=M[V],M[U]=M[$]),M.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function h(e,t){var n=M[W],r=M[U],i=M[V],o=M[$],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function p(){E(I)}function m(){return E(O)}function g(){return E(H)}function v(e){var t=this[W],r=this[U],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=M.extractContents();M.insertNode(e),e.appendChild(t),M.selectNode(e)}function b(){return q(new t(n),{startContainer:M[W],startOffset:M[U],endContainer:M[V],endOffset:M[$],collapsed:M.collapsed,commonAncestorContainer:M.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return M[W]==M[V]&&M[U]==M[$]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function N(e,t,r){var i,o;for(e?(M[W]=t,M[U]=r):(M[V]=t,M[$]=r),i=M[V];i.parentNode;)i=i.parentNode;for(o=M[W];o.parentNode;)o=o.parentNode;o==i?w(M[W],M[U],M[V],M[$])>0&&M.collapse(e):M.collapse(e),M.collapsed=x(),M.commonAncestorContainer=n.findCommonAncestor(M[W],M[V])}function E(e){var t,n=0,r=0,i,o,a,s,l,c;if(M[W]==M[V])return _(e);for(t=M[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[W])return S(t,e);++n}for(t=M[W],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[V])return k(t,e);++r}for(o=r-n,a=M[W];o>0;)a=a.parentNode,o--;for(s=M[V];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function _(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),M[U]==M[$])return t;if(3==M[W].nodeType){if(n=M[W].nodeValue,i=n.substring(M[U],M[$]),e!=H&&(o=M[W],c=M[U],u=M[$]-M[U],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),M.collapse(F)),e==I)return;return i.length>0&&t.appendChild(P.createTextNode(i)),t}for(o=C(M[W],M[U]),a=M[$]-M[U];o&&a>0;)s=o.nextSibling,l=D(o,e),t&&t.appendChild(l),--a,o=s;return e!=H&&M.collapse(F),t}function S(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-M[U],0>=a)return t!=H&&(M.setEndBefore(e),M.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=D(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=H&&(M.setEndBefore(e),M.collapse(z)),n}function k(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=M[$]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=D(o,t),n&&n.appendChild(l),--a,o=s;return t!=H&&(M.setStartAfter(e),M.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=D(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=H&&(M.setStartAfter(e),M.collapse(F)),o}function R(e,t){var n=C(M[V],M[$]-1),r,i,o,a,s,l=n!=M[V];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(M[W],M[U]),r=n!=M[W],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return D(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=M[U],a=o.substring(l),s=o.substring(0,l)):(l=M[$],a=o.substring(0,l),s=o.substring(l)),i!=H&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function D(e,t){return t!=I?t==H?n.clone(e,F):e:void e.parentNode.removeChild(e)}function L(){return n.create("body",null,g()).outerText}var M=this,P=n.doc,O=0,H=1,I=2,F=!0,z=!1,U="startOffset",W="startContainer",V="endContainer",$="endOffset",q=e.extend,j=n.nodeIndex;return q(M,{startContainer:P,startOffset:0,endContainer:P,endOffset:0,collapsed:F,commonAncestorContainer:P,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:h,deleteContents:p,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:L}),M}return t.prototype.toString=function(){return this.toStringIE()},t}),r(C,[m],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),o[r]||(i="&"+e[n+1]+";",a[r]=i,a[i]=r);return a}}var r=e.makeMap,i,o,a,s=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n){return n?(n="x"===n.charAt(0).toLowerCase()?parseInt(n.substr(1),16):parseInt(n,10),n>65535?(n-=65536,String.fromCharCode(55296+(n>>10),56320+(1023&n))):d[n]||String.fromCharCode(n)):a[e]||i[e]||t(e)})}};return f}),r(x,[m,u],function(e,t){return function(n,r){function i(e){n.getElementsByTagName("head")[0].appendChild(e)}function o(r,o,c){function u(){for(var e=b.passed,t=e.length;t--;)e[t]();b.status=2,b.passed=[],b.failed=[]}function d(){for(var e=b.failed,t=e.length;t--;)e[t]();b.status=3,b.passed=[],b.failed=[]}function f(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function h(e,n){e()||((new Date).getTime()-y<l?t.setTimeout(n):d())}function p(){h(function(){for(var e=n.styleSheets,t,r=e.length,i;r--;)if(t=e[r],i=t.ownerNode?t.ownerNode:t.owningElement,i&&i.id===g.id)return u(),!0},p)}function m(){h(function(){try{var e=v.sheet.cssRules;return u(),!!e}catch(t){}},m)}var g,v,y,b;if(r=e._addCacheSuffix(r),s[r]?b=s[r]:(b={passed:[],failed:[]},s[r]=b),o&&b.passed.push(o),c&&b.failed.push(c),1!=b.status){if(2==b.status)return void u();if(3==b.status)return void d();if(b.status=1,g=n.createElement("link"),g.rel="stylesheet",g.type="text/css",g.id="u"+a++,g.async=!1,g.defer=!1,y=(new Date).getTime(),"onload"in g&&!f())g.onload=p,g.onerror=d;else{if(navigator.userAgent.indexOf("Firefox")>0)return v=n.createElement("style"),v.textContent='@import "'+r+'"',m(),void i(v);p()}i(g),g.href=r}}var a=0,s={},l;r=r||{},l=r.maxLoadTime||5e3,this.load=o}}),r(w,[h,g,v,f,y,b,C,d,m,x],function(e,n,r,i,o,a,s,l,c,u){function d(e,t){var n={},r=t.keep_values,i;return i={set:function(n,r,i){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||e,r,i,n[0])),n.attr("data-mce-"+i,r).attr(i,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},n={style:{set:function(e,t){return null!==t&&"object"==typeof t?void e.css(t):(r&&e.attr("data-mce-style",t),void e.attr("style",t))},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serializeStyle(e.parseStyle(n),t[0].nodeName)}}},r&&(n.href=n.src=i),n}function f(e,t){var n=t.attr("style");n=e.serializeStyle(e.parseStyle(n),t[0].nodeName),n||(n=null),t.attr("data-mce-style",n)}function h(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n}function p(e,t){var o=this,a;o.doc=e,o.win=window,o.files={},o.counter=0,o.stdMode=!b||e.documentMode>=8,o.boxModel=!b||"CSS1Compat"==e.compatMode||o.stdMode,o.styleSheetLoader=new u(e),o.boundEvents=[],o.settings=t=t||{},o.schema=t.schema,o.styles=new r({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),o.fixDoc(e),o.events=t.ownEvents?new i(t.proxy):i.Event,o.attrHooks=d(o,t),a=t.schema?t.schema.getBlockElements():{},o.$=n.overrideDefaults(function(){return{context:e,element:o.getRoot()}}),o.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!a[e.nodeName]):!!a[e]}}var m=c.each,g=c.is,v=c.grep,y=c.trim,b=l.ie,C=/^([a-z0-9],?)+$/i,x=/^[ \t\r\n]*$/;return p.prototype={$$:function(e){return"string"==typeof e&&(e=this.get(e)),this.$(e)},root:null,fixDoc:function(e){var t=this.settings,n;if(b&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!b||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.settings.root_element||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),g(n,"string")&&(a=n, n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.settings.root_element||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(C.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=g(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&"undefined"!=typeof t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"</"+e+">":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return e=this.$$(e),t?e.each(function(){for(var e;e=this.firstChild;)3==e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():e.remove(),e.length>1?e.toArray():e[0]},setStyle:function(e,t,n){e=this.$$(e).css(t,n),this.settings.update_styles&&f(this,e)},getStyle:function(e,n,r){return e=this.$$(e),r?e.css(n):(n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=l.ie&&l.ie<12?"styleFloat":"cssFloat"),e[0]&&e[0].style?e[0].style[n]:t)},setStyles:function(e,t){e=this.$$(e).css(t),this.settings.update_styles&&f(this,e)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this,i,o,a=r.settings;""===n&&(n=null),e=r.$$(e),i=e.attr(t),e.length&&(o=r.attrHooks[t],o&&o.set?o.set(e,n,t):e.attr(t,n),i!=n&&a.onSetAttrib&&a.onSetAttrib({attrElm:e,attrName:t,attrValue:n}))},setAttribs:function(e,t){var n=this;n.$$(e).each(function(e,r){m(t,function(e,t){n.setAttrib(r,t,e)})})},getAttrib:function(e,t,n){var r=this,i,o;return e=r.$$(e),e.length&&(i=r.attrHooks[t],o=i&&i.get?i.get(e,t):e.attr(t)),"undefined"==typeof o&&(o=n||""),o},getPos:function(e,t){var r=this,i=0,o=0,a,s=r.doc,l=s.body,c;if(e=r.get(e),t=t||l,e){if(t===l&&e.getBoundingClientRect&&"static"===n(l).css("position"))return c=e.getBoundingClientRect(),t=r.boxModel?s.documentElement:l,i=c.left+(s.documentElement.scrollLeft||l.scrollLeft)-t.clientLeft,o=c.top+(s.documentElement.scrollTop||l.scrollTop)-t.clientTop,{x:i,y:o};for(a=e;a&&a!=t&&a.nodeType;)i+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=e.parentNode;a&&a!=t&&a.nodeType;)i-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode}return{x:i,y:o}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==p.DOM&&n===document){var o=p.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,p.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==p.DOM&&n===document?void p.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void m(e.split(","),function(e){var i;e=c._addCacheSuffix(e),t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),b&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){this.$$(e).addClass(t)},removeClass:function(e,t){this.toggleClass(e,t,!1)},hasClass:function(e,t){return this.$$(e).hasClass(t)},toggleClass:function(e,t,r){this.$$(e).toggleClass(t,r).each(function(){""===this.className&&n(this).attr("class",null)})},show:function(e){this.$$(e).show()},hide:function(e){this.$$(e).hide()},isHidden:function(e){return"none"==this.$$(e).css("display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){e=this.$$(e),b?e.each(function(e,r){if(r.canHaveHTML!==!1){for(;r.firstChild;)r.removeChild(r.firstChild);try{r.innerHTML="<br>"+t,r.removeChild(r.firstChild)}catch(i){n("<div>").html("<br>"+t).contents().slice(1).appendTo(r)}return t}}):e.html(t)},getOuterHTML:function(e){return e=this.get(e),1==e.nodeType&&"outerHTML"in e?e.outerHTML:n("<div>").append(n(e).clone()).html()},setOuterHTML:function(e,t){var r=this;r.$$(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}r.remove(n(this).html(t),!0)})},decode:s.decode,encode:s.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return g(t,"array")&&(e=e.cloneNode(!0)),n&&m(v(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(c.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],m(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(b){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,i,a,s,l,c=0;if(e=e.firstChild){s=new o(e,e.parentNode),t=t||(n.schema?n.schema.getNonEmptyElements():null);do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(i=n.getAttribs(e),r=i.length;r--;)if(l=i[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!x.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new a(this)},nodeIndex:h,split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=y(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.insertBefore(n,e):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(c.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(c.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return e&&1==e.nodeType?(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null):null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&(n=this.getContentEditable(e),null===n);e=e.parentNode);return n},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},p.DOM=new p(document),p.nodeIndex=h,p}),r(N,[w,m],function(e,t){function n(){function e(e,n){function i(){a.remove(l),s&&(s.onreadystatechange=s.onload=s=null),n()}function o(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var a=r,s,l;l=a.uniqueId(),s=document.createElement("script"),s.id=l,s.type="text/javascript",s.src=t._addCacheSuffix(e),"onreadystatechange"in s?s.onreadystatechange=function(){/loaded|complete/.test(s.readyState)&&i()}:s.onload=i,s.onerror=o,(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}var n=0,a=1,s=2,l={},c=[],u={},d=[],f=0,h;this.isDone=function(e){return l[e]==s},this.markDone=function(e){l[e]=s},this.add=this.load=function(e,t,r){var i=l[e];i==h&&(c.push(e),l[e]=n),t&&(u[e]||(u[e]=[]),u[e].push({func:t,scope:r||this}))},this.remove=function(e){delete l[e],delete u[e]},this.loadQueue=function(e,t){this.loadScripts(c,e,t)},this.loadScripts=function(t,n,r){function c(e){i(u[e],function(e){e.func.call(e.scope)}),u[e]=h}var p;d.push({func:n,scope:r||this}),(p=function(){var n=o(t);t.length=0,i(n,function(t){return l[t]==s?void c(t):void(l[t]!=a&&(l[t]=a,f++,e(t,function(){l[t]=s,f--,c(t),p()})))}),f||(i(d,function(e){e.func.call(e.scope)}),d.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(E,[N,m],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){var i=r.language;if(i&&r.languageLoad!==!1){if(n)if(n=","+n+",",-1!=n.indexOf(","+i.substr(0,2)+","))i=i.substr(0,2);else if(-1==n.indexOf(","+i+","))return;e.ScriptLoader.add(this.urls[t]+"/langs/"+i+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},remove:function(e){delete this.urls[e],delete this.lookup[e]},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&(s?a.call(s):a.call(e))}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(_,[],function(){function e(e){return function(t){return!!t&&t.nodeType==e}}function t(e){return e=e.toLowerCase().split(" "),function(t){var n,r;if(t&&t.nodeType)for(r=t.nodeName.toLowerCase(),n=0;n<e.length;n++)if(r===e[n])return!0;return!1}}function n(e,t){return t=t.toLowerCase().split(" "),function(n){var r,i;if(s(n))for(r=0;r<t.length;r++)if(i=getComputedStyle(n,null).getPropertyValue(e),i===t[r])return!0;return!1}}function r(e,t){return function(n){return s(n)&&n[e]===t}}function i(e,t){return function(n){return s(n)&&n.getAttribute(e)===t}}function o(e){return s(e)&&e.hasAttribute("data-mce-bogus")}function a(e){return function(t){if(s(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}}var s=e(1);return{isText:e(3),isElement:s,isComment:e(8),isBr:t("br"),isContentEditableTrue:a("true"),isContentEditableFalse:a("false"),matchNodeNames:t,hasPropValue:r,hasAttributeValue:i,matchStyleValues:n,isBogus:o}}),r(S,[],function(){function e(e){return e==n}function t(e){return e.replace(new RegExp(n,"g"),"")}var n="\ufeff";return{isZwsp:e,ZWSP:n,trim:t}}),r(k,[_,S],function(e,t){function n(e){return p(e)&&(e=e.parentNode),h(e)&&e.hasAttribute("data-mce-caret")}function r(e){return p(e)&&t.isZwsp(e.data)}function i(e){return n(e)||r(e)}function o(e){var t=e.parentNode;t&&t.removeChild(e)}function a(e){try{return e.nodeValue}catch(t){return""}}function s(e,t){0===t.length?o(e):e.nodeValue=t}function l(e,n){var r,o,a,s;if(r=e.ownerDocument,a=r.createTextNode(t.ZWSP),s=e.parentNode,n){if(o=e.previousSibling,p(o)){if(i(o))return o;if(f(o))return o.splitText(o.data.length-1)}s.insertBefore(a,e)}else{if(o=e.nextSibling,p(o)){if(i(o))return o;if(d(o))return o.splitText(1),o}e.nextSibling?s.insertBefore(a,e.nextSibling):s.appendChild(a)}return a}function c(e,t,n){var r,i,o;return r=t.ownerDocument,i=r.createElement(e),i.setAttribute("data-mce-caret",n?"before":"after"),i.setAttribute("data-mce-bogus","all"),i.appendChild(r.createTextNode("\xa0")),o=t.parentNode,n?o.insertBefore(i,t):t.nextSibling?o.insertBefore(i,t.nextSibling):o.appendChild(i),i}function u(e){if(h(e)&&i(e)&&(" "!=e.innerHTML?e.removeAttribute("data-mce-caret"):o(e)),p(e)){var n=t.trim(a(e));s(e,n)}}function d(e){return p(e)&&e.data[0]==t.ZWSP}function f(e){return p(e)&&e.data[e.data.length-1]==t.ZWSP}var h=e.isElement,p=e.isText;return{isCaretContainer:i,isCaretContainerBlock:n,isCaretContainerInline:r,insertInline:l,insertBlock:c,remove:u,startsWithCaretContainer:d,endsWithCaretContainer:f}}),r(T,[m,y,_,b,k],function(e,t,n,r,i){function o(e,t){var n=e.childNodes;return t--,t>n.length-1?t=n.length-1:0>t&&(t=0),n[t]||e}function a(e){this.walk=function(t,n){function r(e){var t;return t=e[0],3===t.nodeType&&t===c&&u>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===f&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function i(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,o){var a=o?"nextSibling":"previousSibling";for(g=e,v=g.parentNode;g&&g!=t;g=v)v=g.parentNode,y=i(g==e?g:g[a],a),y.length&&(o||y.reverse(),n(r(y)))}var c=t.startContainer,u=t.startOffset,d=t.endContainer,f=t.endOffset,h,p,m,g,v,y,b;if(b=e.select("td[data-mce-selected],th[data-mce-selected]"),b.length>0)return void l(b,function(e){n([e])});if(1==c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[u]),1==d.nodeType&&d.hasChildNodes()&&(d=o(d,f)),c==d)return n(r([c]));for(h=e.findCommonAncestor(c,d),g=c;g;g=g.parentNode){if(g===d)return s(c,h,!0);if(g===h)break}for(g=d;g;g=g.parentNode){if(g===c)return s(d,h);if(g===h)break}p=a(c,h)||c,m=a(d,h)||d,s(c,p,!0),y=i(p==c?p:p.nextSibling,"nextSibling",m==d?m.nextSibling:m),y.length&&n(r(y)),s(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&r<n.nodeValue.length&&(i=t(n,r),n=i.previousSibling,o>r?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r<n.nodeValue.length&&(n=t(n,r),r=0),3==i.nodeType&&o>0&&o<i.nodeValue.length&&(i=t(i,o).previousSibling,o=i.nodeValue.length)),{startContainer:n,startOffset:r,endContainer:i,endOffset:o}},this.normalize=function(n){function r(r){function a(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}function s(n,r){for(var i=new t(n,e.getParent(n.parentNode,e.isBlock)||g);n=i[r?"prev":"next"]();)if("BR"===n.nodeName)return!0}function l(e){for(;e&&e!=g;){if(c(e))return!0;e=e.parentNode}return!1}function d(e,t){return e.previousSibling&&e.previousSibling.nodeName==t}function f(n,r){var a,s,l;if(r=r||h,l=e.getParent(r.parentNode,e.isBlock)||g,n&&"BR"==r.nodeName&&C&&e.isEmpty(l))return h=r.parentNode,p=e.nodeIndex(r),void(i=!0);for(a=new t(r,l);v=a[n?"prev":"next"]();){if("false"===e.getContentEditableParent(v)||u(v))return;if(3===v.nodeType&&v.nodeValue.length>0)return h=v,p=n?v.nodeValue.length:0,void(i=!0);if(e.isBlock(v)||y[v.nodeName.toLowerCase()])return;s=v}o&&s&&(h=s,i=!0,p=0)}var h,p,m,g=e.getRoot(),v,y,b,C;if(h=n[(r?"start":"end")+"Container"],p=n[(r?"start":"end")+"Offset"],C=1==h.nodeType&&p===h.childNodes.length,y=e.schema.getNonEmptyElements(),b=r,!u(h)){if(1==h.nodeType&&p>h.childNodes.length-1&&(b=!1),9===h.nodeType&&(h=e.getRoot(),p=0),h===g){if(b&&(v=h.childNodes[p>0?p-1:0])){if(u(v))return;if(y[v.nodeName]||"TABLE"==v.nodeName)return}if(h.hasChildNodes()){if(p=Math.min(!b&&p>0?p-1:p,h.childNodes.length-1),h=h.childNodes[p],p=0,!o&&h===g.lastChild&&"TABLE"===h.nodeName)return;if(l(h)||u(h))return;if(h.hasChildNodes()&&!/TABLE/.test(h.nodeName)){v=h,m=new t(h,g);do{if(c(v)||u(v)){i=!1;break}if(3===v.nodeType&&v.nodeValue.length>0){p=b?0:v.nodeValue.length,h=v,i=!0;break}if(y[v.nodeName.toLowerCase()]&&!a(v)){p=e.nodeIndex(v),h=v.parentNode,"IMG"!=v.nodeName||b||p++,i=!0;break}}while(v=b?m.next():m.prev())}}}o&&(3===h.nodeType&&0===p&&f(!0),1===h.nodeType&&(v=h.childNodes[p],v||(v=h.childNodes[p-1]),!v||"BR"!==v.nodeName||d(v,"A")||s(v)||s(v,!0)||f(!0,v))),b&&!o&&3===h.nodeType&&p===h.nodeValue.length&&f(!1),i&&n["set"+(r?"Start":"End")](h,p)}}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}function s(t,n,r){var i,o,a;if(i=r.elementFromPoint(t,n),o=r.body.createTextRange(),i&&"HTML"!=i.tagName||(i=r.body),o.moveToElementText(i),a=e.toArray(o.getClientRects()),a=a.sort(function(e,t){return e=Math.abs(Math.max(e.top-n,e.bottom-n)),t=Math.abs(Math.max(t.top-n,t.bottom-n)),e-t}),a.length>0){n=(a[0].bottom+a[0].top)/2;try{return o.moveToPoint(t,n),o.collapse(!0),o}catch(s){}}return null}var l=e.each,c=n.isContentEditableFalse,u=i.isCaretContainer;return a.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},a.getCaretRangeFromPoint=function(e,t,n){var r,i;if(n.caretPositionFromPoint)i=n.caretPositionFromPoint(e,t),r=n.createRange(),r.setStart(i.offsetNode,i.offset),r.collapse(!0);else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r=s(e,t,n)}}return r},a.getSelectedNode=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset==n+1?t.childNodes[n]:null},a.getNode=function(e,t){return 1==e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},a}),r(R,[T,d,u],function(e,t,n){return function(r){function i(e){var t,n;if(n=r.$(e).parentsUntil(r.getBody()).add(e),n.length===a.length){for(t=n.length;t>=0&&n[t]===a[t];t--);if(-1===t)return a=n,!0}return a=n,!1}var o,a=[];"onselectionchange"in r.getDoc()||r.on("NodeChange Click MouseUp KeyUp Focus",function(t){var n,i;n=r.selection.getRng(),i={startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset},"nodechange"!=t.type&&e.compareRanges(i,o)||r.fire("SelectionChange"),o=i}),r.on("contextmenu",function(){r.fire("SelectionChange")}),r.on("SelectionChange",function(){var e=r.selection.getStart(!0);!t.range&&r.selection.isCollapsed()||!i(e)&&r.dom.isChildOf(e,r.getBody())&&r.nodeChanged({selectionChange:!0})}),r.on("MouseUp",function(e){e.isDefaultPrevented()||("IMG"==r.selection.getNode().nodeName?n.setEditorTimeout(r,function(){r.nodeChanged()}):r.nodeChanged())}),this.nodeChanged=function(e){var t=r.selection,n,i,o;r.initialized&&t&&!r.settings.disable_nodechange&&!r.readonly&&(o=r.getBody(),n=t.getStart()||o,n.ownerDocument==r.getDoc()&&r.dom.isChildOf(n,o)||(n=o),"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),i=[],r.dom.getParent(n,function(e){return e===o?!0:void i.push(e)}),e=e||{},e.element=n,e.parents=i,r.fire("NodeChange",e))}}}),r(A,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(B,[m],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e,t){var n={},r,i;for(r=0,i=e.length;i>r;r++)n[e[r]]=t||{};return n}var s,c,u,d=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),c=3;c<d.length;c++)"string"==typeof d[c]&&(d[c]=t(d[c])),r.push.apply(r,d[c]);for(e=t(e),s=e.length;s--;)u=[].concat(l,t(n)),a[e[s]]={attributes:i(u),attributesOrder:u,children:i(r,o)}}function r(e,n){var r,i,o,s;for(e=t(e),r=e.length,n=t(n);r--;)for(i=a[e[r]],o=0,s=n.length;s>o;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},l,c,u,d,f,h;return i[e]?i[e]:(l=t("id accesskey class dir lang style tabindex title"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),u=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(l.push.apply(l,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),u.push.apply(u,t("audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(l.push("xml:lang"),h=t("acronym applet basefont big font strike tt"),u.push.apply(u,h),s(h,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),s(f,function(e){n(e,"",d)})),d=d||[].concat(c,u),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),n("address dt dd div caption","",d),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",u),n("blockquote","cite",d),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",d),n("dl","","dt dd"),n("a","href target rel media hreflang type",u),n("q","cite",u),n("ins del","cite datetime",d),n("img","src sizes srcset alt usemap ismap width height"),n("iframe","src name width height",d),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",d,"param"),n("param","name value"),n("map","name",d,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",d),n("th","colspan rowspan headers scope abbr",d),n("form","accept-charset action autocomplete enctype method name novalidate target",d),n("fieldset","disabled form name",d,"legend"),n("label","form for",u),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?d:u),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",d,"li"),n("noscript","",d),"html4"!=e&&(n("wbr"),n("ruby","",u,"rt rp"),n("figcaption","",d),n("mark rt rp summary bdi","",u),n("canvas","width height",d),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",d,"track source"),n("picture","","img source"),n("source","src srcset type media sizes"),n("track","kind src srclang label default"),n("datalist","",u,"option"),n("article section nav aside header footer","",d),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",d,"figcaption"),n("time","datetime",u),n("dialog","open",d),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",u),n("progress","value max",u),n("meter","value min max low high optimum",u),n("details","open",d,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(r("script","language xml:space"),r("style","xml:space"),r("object","declare classid code codebase codetype archive standby align border hspace vspace"),r("embed","align name hspace vspace"),r("param","valuetype type"),r("a","charset name rev shape coords"),r("br","clear"),r("applet","codebase archive code object alt name width height align hspace vspace"),r("img","name longdesc align border hspace vspace"),r("iframe","longdesc frameborder marginwidth marginheight scrolling align"),r("font basefont","size color face"),r("input","usemap align"),r("select","onchange"),r("textarea"),r("h1 h2 h3 h4 h5 h6 div p legend caption","align"),r("ul","type compact"),r("li","type"),r("ol dl menu dir","compact"),r("pre","width xml:space"),r("hr","align noshade size width"),r("isindex","prompt"),r("table","summary width frame rules cellspacing cellpadding align bgcolor"),r("col","width align char charoff valign"),r("colgroup","width align char charoff valign"),r("thead","align char charoff valign"),r("tr","align char charoff valign bgcolor"),r("th","axis align char charoff valign nowrap bgcolor width height"),r("form","accept"),r("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),r("tfoot","align char charoff valign"),r("tbody","align char charoff valign"),r("area","nohref"),r("body","background bgcolor text link vlink alink")),"html4"!=e&&(r("input button select textarea","autofocus"),r("input textarea","placeholder"),r("a","download"),r("link script img","crossorigin"),r("iframe","sandbox seamless allowfullscreen")),s(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,delete a.script,i[e]=a,a)}function r(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),s(e,function(e,r){n[r]=n[r.toUpperCase()]="map"==t?a(e,/[, ]/):c(e,/[, ]/)})),n}var i={},o={},a=e.makeMap,s=e.each,l=e.extend,c=e.explode,u=e.inArray;return function(e){function o(t,n,r){var o=e[t];return o?o=a(o,/[, ]/,a(o.toUpperCase(),/[, ]/)):(o=i[t],o||(o=a(n," ",a(n.toUpperCase()," ")),o=l(o,r),i[t]=o)),o}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function f(e){var n,r,i,o,s,l,c,f,h,p,m,g,v,b,x,w,N,E,_,S=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,k=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),y["@"]&&(w=y["@"].attributes,N=y["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=S.exec(e[n])){if(b=s[1],h=s[2],x=s[3],f=s[5],g={},v=[],l={attributes:g,attributesOrder:v},"#"===b&&(l.paddEmpty=!0),"-"===b&&(l.removeEmpty=!0),"!"===s[4]&&(l.removeEmptyAttrs=!0),w){for(E in w)g[E]=w[E];v.push.apply(v,N)}if(f)for(f=t(f,"|"),i=0,o=f.length;o>i;i++)if(s=k.exec(f[i])){if(c={},m=s[1],p=s[2].replace(/::/g,":"),b=s[3],_=s[4],"!"===m&&(l.attributesRequired=l.attributesRequired||[],l.attributesRequired.push(p),c.required=!0),"-"===m){delete g[p],v.splice(u(v,p),1);continue}b&&("="===b&&(l.attributesDefault=l.attributesDefault||[],l.attributesDefault.push({name:p,value:_}),c.defaultValue=_),":"===b&&(l.attributesForced=l.attributesForced||[],l.attributesForced.push({name:p,value:_}),c.forcedValue=_),"<"===b&&(c.validValues=a(_,"?"))), T.test(p)?(l.attributePatterns=l.attributePatterns||[],c.pattern=d(p),l.attributePatterns.push(c)):(g[p]||v.push(p),g[p]=c)}w||"@"!=h||(w=g,N=v),x&&(l.outputName=h,y[x]=l),T.test(h)?(l.pattern=d(h),C.push(l)):y[h]=l}}function h(e){y={},C=[],f(e),s(N,function(e,t){b[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&(i.text_block_elements=i.block_elements=null,s(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",o=t[2];if(b[o]=b[i],M[o]=i,r||(R[o.toUpperCase()]={},R[o]={}),!y[o]){var a=y[i];a=l({},a),delete a.removeEmptyAttrs,delete a.removeEmpty,y[o]=a}s(b,function(e,t){e[i]&&(b[t]=e=l({},b[t]),e[o]=e[i])})}))}function m(n){var r=/^([+\-]?)(\w+)\[([^\]]+)\]$/;i[e.schema]=null,n&&s(t(n,","),function(e){var n=r.exec(e),i,o;n&&(o=n[1],i=o?b[n[2]]:b[n[2]]={"#comment":{}},i=b[n[2]],s(t(n[3],"|"),function(e){"-"===o?delete i[e]:i[e]={}}))})}function g(e){var t=y[e],n;if(t)return t;for(n=C.length;n--;)if(t=C[n],t.pattern.test(e))return t}var v=this,y={},b={},C=[],x,w,N,E,_,S,k,T,R,A,B,D,L,M={},P={};e=e||{},N=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),x=r(e.valid_styles),w=r(e.invalid_styles,"map"),T=r(e.valid_classes,"map"),E=o("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=o("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),S=o("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),k=o("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),A=o("non_empty_elements","td th iframe video audio object script",S),B=o("move_caret_before_on_enter_elements","table",A),D=o("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),R=o("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption",D),L=o("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),s((e.special||"script noscript style textarea").split(" "),function(e){P[e]=new RegExp("</"+e+"[^>]*>","gi")}),e.valid_elements?h(e.valid_elements):(s(N,function(e,t){y[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},b[t]=e.children}),"html5"!=e.schema&&s(t("strong/b em/i"),function(e){e=t(e,"/"),y[e[1]].outputName=e[0]}),s(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){y[e]&&(y[e].removeEmpty=!0)}),s(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){y[e].paddEmpty=!0}),s(t("span"),function(e){y[e].removeEmptyAttrs=!0})),p(e.custom_elements),m(e.valid_children),f(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&s(c(e.invalid_elements),function(e){y[e]&&delete y[e]}),g("span")||f("span[!data-mce-type|*]"),v.children=b,v.getValidStyles=function(){return x},v.getInvalidStyles=function(){return w},v.getValidClasses=function(){return T},v.getBoolAttrs=function(){return k},v.getBlockElements=function(){return R},v.getTextBlockElements=function(){return D},v.getTextInlineElements=function(){return L},v.getShortEndedElements=function(){return S},v.getSelfClosingElements=function(){return _},v.getNonEmptyElements=function(){return A},v.getMoveCaretBeforeOnEnterElements=function(){return B},v.getWhiteSpaceElements=function(){return E},v.getSpecialElements=function(){return P},v.isValidChild=function(e,t){var n=b[e];return!(!n||!n[t])},v.isValid=function(e,t){var n,r,i=g(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},v.getElementRule=g,v.getCustomElements=function(){return M},v.addValidElements=f,v.setValidElements=h,v.addCustomElements=p,v.addValidChildren=m,v.elements=y}}),r(D,[B,C,m],function(e,t,n){function r(e,t,n){var r=1,i,o,a,s;for(s=e.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g,a.lastIndex=i=n;o=a.exec(t);){if(i=a.lastIndex,"/"===o[1])r--;else if(!o[1]){if(o[2]in s)continue;r++}if(0===r)break}return i}function i(i,a){function s(){}var l=this;i=i||{},l.schema=a=a||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),o("comment cdata text start end pi doctype".split(" "),function(e){e&&(l[e]=i[e]||s)}),l.parse=function(e){function o(e){var t,n;for(t=h.length;t--&&h[t].name!==e;);if(t>=0){for(n=h.length-1;n>=t;n--)e=h[n],e.valid&&l.end(e.name);h.length=t}}function s(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in x?t:z(n||r||o||""),N&&!y&&0!==t.indexOf("data-")){if(a=T[t],!a&&R){for(s=R.length;s--&&(a=R[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(W[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{c=decodeURIComponent(c)}catch(u){c=unescape(c)}if(V.test(c))return;if(!i.allow_html_data_urls&&$.test(c)&&!/^data:image\//i.test(c))return}p.map[t]=n,p.push({name:t,value:n})}var l=this,c,u=0,d,f,h=[],p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F=0,z=t.decode,U,W=n.makeMap("src,href,data,background,formaction,poster"),V=/((java|vb)script|mhtml):/i,$=/^data:/i;for(P=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),O=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,C=a.getShortEndedElements(),M=i.self_closing_elements||a.getSelfClosingElements(),x=a.getBoolAttrs(),N=i.validate,b=i.remove_internals,U=i.fix_self_closing,H=a.getSpecialElements();c=P.exec(e);){if(u<c.index&&l.text(z(e.substr(u,c.index-u))),d=c[6])d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),o(d);else if(d=c[7]){if(d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),w=d in C,U&&M[d]&&h.length>0&&h[h.length-1].name===d&&o(d),!N||(E=a.getElementRule(d))){if(_=!0,N&&(T=E.attributes,R=E.attributePatterns),(k=c[8])?(y=-1!==k.indexOf("data-mce-type"),y&&b&&(_=!1),p=[],p.map={},k.replace(O,s)):(p=[],p.map={}),N&&!y){if(A=E.attributesRequired,B=E.attributesDefault,D=E.attributesForced,L=E.removeEmptyAttrs,L&&!p.length&&(_=!1),D)for(m=D.length;m--;)S=D[m],v=S.name,I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I});if(B)for(m=B.length;m--;)S=B[m],v=S.name,v in p.map||(I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I}));if(A){for(m=A.length;m--&&!(A[m]in p.map););-1===m&&(_=!1)}if(S=p.map["data-mce-bogus"]){if("all"===S){u=r(a,e,P.lastIndex),P.lastIndex=u;continue}_=!1}}_&&l.start(d,p,w)}else _=!1;if(f=H[d]){f.lastIndex=u=c.index+c[0].length,(c=f.exec(e))?(_&&(g=e.substr(u,c.index-u)),u=c.index+c[0].length):(g=e.substr(u),u=e.length),_&&(g.length>0&&l.text(g,!0),l.end(d)),P.lastIndex=u;continue}w||(k&&k.indexOf("/")==k.length-1?_&&l.end(d):h.push({name:d,valid:_}))}else(d=c[1])?(">"===d.charAt(0)&&(d=" "+d),i.allow_conditional_comments||"[if"!==d.substr(0,3)||(d=" "+d),l.comment(d)):(d=c[2])?l.cdata(d):(d=c[3])?l.doctype(d):(d=c[4])&&l.pi(d,c[5]);u=c.index+c[0].length}for(u<e.length&&l.text(z(e.substr(u))),m=h.length-1;m>=0;m--)d=h[m],d.valid&&l.end(d.name)}}var o=n.each;return i.findEndTag=r,i}),r(L,[A,B,D,m],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,h,p,m,g,v,y,b;for(m=i("tr,td,th,tbody,thead,tfoot,table"),p=l.getNonEmptyElements(),g=l.getTextBlockElements(),v=l.getSpecialElements(),n=0;n<t.length;n++)if(r=t[n],r.parent&&!r.fixed)if(g[r.name]&&"li"==r.parent.name){for(y=r.next;y&&g[y.name];)y.name="li",y.fixed=!0,r.parent.insert(y,r.parent),y=y.next;r.unwrap(r)}else{for(a=[r],o=r.parent;o&&!l.isValidChild(o.name,r.name)&&!m[o.name];o=o.parent)a.push(o);if(o&&a.length>1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),h=0;h<a.length-1;h++){for(l.isValidChild(c.name,a[h].name)?(d=u.filterNode(a[h].clone()),c.append(d)):d=c,f=a[h].firstChild;f&&f!=a[h+1];)b=f.next,d.append(f),f=b;c=d}s.isEmpty(p)?o.insert(r,a[0],!0):(o.insert(s,a[0],!0),o.insert(r,s)),o=a[0],(o.isEmpty(p)||o.firstChild===o.lastChild&&"br"===o.firstChild.name)&&o.empty().remove()}else if(r.parent){if("li"===r.name){if(y=r.prev,y&&("ul"===y.name||"ul"===y.name)){y.append(r);continue}if(y=r.next,y&&("ul"===y.name||"ul"===y.name)){y.insert(r,y.firstChild,!0);continue}r.wrap(u.filterNode(new e("ul",1)));continue}l.isValidChild(r.parent.name,"div")&&l.isValidChild("div",r.name)?r.wrap(u.filterNode(new e("div",1))):v[r.name]?r.empty().remove():r.unwrap()}}}var u=this,d={},f=[],h={},p={};r=r||{},r.validate="validate"in r?r.validate:!0,r.root_name=r.root_name||"body",u.schema=l=l||new t,u.filterNode=function(e){var t,n,r;n in d&&(r=h[n],r?r.push(e):h[n]=[e]),t=f.length;for(;t--;)n=f[t].name,n in e.attributes.map&&(r=p[n],r?r.push(e):p[n]=[e]);return e},u.addNodeFilter=function(e,t){o(a(e),function(e){var n=d[e];n||(d[e]=n=[]),n.push(t)})},u.addAttributeFilter=function(e,t){o(a(e),function(e){var n;for(n=0;n<f.length;n++)if(f[n].name===e)return void f[n].callbacks.push(t);f.push({name:e,callbacks:[t]})})},u.parse=function(t,o){function a(){function e(e){e&&(t=e.firstChild,t&&3==t.type&&(t.value=t.value.replace(R,"")),t=e.lastChild,t&&3==t.type&&(t.value=t.value.replace(D,"")))}var t=y.firstChild,n,i;if(l.isValidChild(y.name,I.toLowerCase())){for(;t;)n=t.next,3==t.type||1==t.type&&"p"!==t.name&&!T[t.name]&&!t.attr("data-mce-type")?i?i.append(t):(i=u(I,1),i.attr(r.forced_root_block_attrs),y.insert(i,t),i.append(t)):(e(i),i=null),t=n;e(i)}}function u(t,n){var r=new e(t,n),i;return t in d&&(i=h[t],i?i.push(r):h[t]=[r]),r}function m(e){var t,n,r,i,o=l.getBlockElements();for(t=e.prev;t&&3===t.type;){if(r=t.value.replace(D,""),r.length>0)return void(t.value=r);if(n=t.next){if(3==n.type&&n.value.length){t=t.prev;continue}if(!o[n.name]&&"script"!=n.name&&"style"!=n.name){t=t.prev;continue}}i=t.prev,t.remove(),t=i}}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,N,E,_,S,k,T,R,A=[],B,D,L,M,P,O,H,I;if(o=o||{},h={},p={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),H=l.getNonEmptyElements(),O=l.children,k=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,P=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,L=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,v=new n({validate:k,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(L," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=k?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=O[b.name],s&&O[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(_=p[a],_?_.push(r):p[a]=[r]);T[e]&&m(r),n||(b=r),!B&&P[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=k?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(D,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o}if(B&&P[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(H))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,T[b.name]?b.empty().remove():b.unwrap(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),k&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(S in h){for(_=d[S],C=h[S],N=C.length;N--;)C[N].parent||C.splice(N,1);for(x=0,w=_.length;w>x;x++)_[x](C,S,o)}for(x=0,w=f.length;w>x;x++)if(_=f[x],_.name in p){for(C=p[_.name],N=C.length;N--;)C[N].parent||C.splice(N,1);for(N=0,E=_.callbacks.length;E>N;N++)_.callbacks[N](C,_.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,h,p;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(h=l.getElementRule(c.name),h&&(h.removeEmpty?c.remove():h.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(p=new e("#text",3),p.value="\xa0",i.replace(p))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}}),r.validate&&l.getValidClasses()&&u.addAttributeFilter("class",function(e){for(var t=e.length,n,r,i,o,a,s=l.getValidClasses(),c,u;t--;){for(n=e[t],r=n.attr("class").split(" "),a="",i=0;i<r.length;i++)o=r[i],u=!1,c=s["*"],c&&c[o]&&(u=!0),c=s[n.name],!u&&c&&c[o]&&(u=!0),u&&(a&&(a+=" "),a+=o);a.length||(a=null),n.attr("class",a)}})}}),r(M,[C,m],function(e,t){var n=t.makeMap;return function(t){var r=[],i,o,a,s,l;return t=t||{},i=t.indent,o=n(t.indent_before||""),a=n(t.indent_after||""),s=e.getEncodeFunc(t.entity_encoding||"raw",t.entities),l="html"==t.element_format,{start:function(e,t,n){var c,u,d,f;if(i&&o[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');!n||l?r[r.length]=">":r[r.length]=" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push("</",e,">"),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("<![CDATA[",e,"]]>")},comment:function(e){r.push("<!--",e,"-->")},pi:function(e,t){t?r.push("<?",e," ",s(t),"?>"):r.push("<?",e,"?>"),i&&r.push("\n")},doctype:function(e){r.push("<!DOCTYPE",e,">",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(P,[M,B],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,h,p,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1&&(f=[],f.map={},m=r.getElementRule(e.name))){for(h=0,p=m.attributesOrder.length;p>h;h++)u=m.attributesOrder[h],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(h=0,p=c.length;p>h;h++)u=c[h].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(O,[w,L,D,C,P,A,B,d,m,S],function(e,t,n,r,i,o,a,s,l,c){function u(e){function t(e){return e&&"br"===e.name}var n,r;n=e.lastChild,t(n)&&(r=n.prev,t(r)&&(n.remove(),r.remove()))}var d=l.each,f=l.trim,h=e.DOM,p=["data-mce-selected"];return function(e,o){function m(e){var t=new RegExp(["<span[^>]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","\\s?("+p.join("|")+')="[^"]+"'].join("|"),"gi");return e=c.trim(e.replace(t,""))}function g(){var e=o.getBody().innerHTML,t=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,r,i,a,s,l,c=o.schema;for(e=m(e),l=c.getShortEndedElements();s=t.exec(e);)i=t.lastIndex,a=s[0].length,r=l[s[1]]?i:n.findEndTag(c,e,i),e=e.substring(0,i-a)+e.substring(r),t.lastIndex=i-a;return f(e)}function v(e){-1===l.inArray(p,e)&&(C.addAttributeFilter(e,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),p.push(e))}var y,b,C;return o&&(y=o.dom,b=o.schema),y=y||h,b=b||new a(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,C=new t(e,b),C.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n=e.length,r;n--;)r=e[n],r.attr("tabindex",r.attributes.map["data-mce-tabindex"]),r.attr(t,null)}),C.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,s=e.url_converter,l=e.url_converter_scope,c;r--;)i=t[r],o=i.attributes.map[a],o!==c?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=y.serializeStyle(y.parseStyle(o),i.name):s&&(o=s.call(l,o,n,i.name)),i.attr(n,o.length>0?o:null))}),C.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class"),r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}),C.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),C.addNodeFilter("noscript",function(e){for(var t=e.length,n;t--;)n=e[t].firstChild,n&&(n.value=r.decode(n.value))}),C.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o,a;r--;)i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t?(a=i.attr("type"),a&&i.attr("type","mce-no/type"==a?null:a.replace(/^mce\-/,"")),o.length>0&&(i.firstChild.value="// <![CDATA[\n"+n(o)+"\n// ]]>")):o.length>0&&(i.firstChild.value="<!--\n"+n(o)+"\n-->")}),C.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),C.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&C.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,"ul"!==r.name&&"ol"!==r.name||n.prev&&"li"===n.prev.name&&n.prev.append(n)}),C.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:b,addNodeFilter:C.addNodeFilter,addAttributeFilter:C.addAttributeFilter,serialize:function(t,n){var r=this,o,a,l,h,p,m;return s.ie&&y.select("script,style,select,map").length>0?(p=t.innerHTML,t=t.cloneNode(!1),y.setHTML(t,p)):t=t.cloneNode(!0),o=document.implementation,o.createHTMLDocument&&(a=o.createHTMLDocument(""),d("BODY"==t.nodeName?t.childNodes:[t],function(e){a.body.appendChild(a.importNode(e,!0))}),t="BODY"!=t.nodeName?a.body.firstChild:a.body,l=y.doc,y.doc=a),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,r.onPreProcess(n)),m=C.parse(f(n.getInner?t.innerHTML:y.getOuterHTML(t)),n),u(m),h=new i(e,b),n.content=h.serialize(m),n.cleanup||(n.content=c.trim(n.content),n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||r.onPostProcess(n),l&&(y.doc=l),n.node=null,n.content},addRules:function(e){b.addValidElements(e)},setRules:function(e){b.setValidElements(e)},onPreProcess:function(e){o&&o.fire("PreProcess",e)},onPostProcess:function(e){o&&o.fire("PostProcess",e)},addTempAttr:v,trimHtml:m,getTrimmedContent:g}}}),r(H,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(3==l.nodeType&&(u=l.nodeValue,s+=u.length,s>=i)){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(3==l.nodeType&&(s+=l.nodeValue.length,s>=i)){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,p;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),t!=f&&t!=f.documentElement||(t=h,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(p=t.childNodes,p.length?(n>=p.length?i.insertAfter(a,p[p.length-1]):t.insertBefore(a,p[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="<span></span>",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,h=f.body,p,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=h.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="<span></span><span></span>",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=h.createControlRange(),a.addElement(m),a.select(),p=e.getRng(),p.item&&m===p.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(I,[d],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(t){return e.mac?t.metaKey:t.ctrlKey&&!t.altKey}}}),r(F,[I,m,u,d,_],function(e,t,n,r,i){function o(e,t){for(;t&&t!=e;){if(s(t)||a(t))return t;t=t.parentNode}return null}var a=i.isContentEditableFalse,s=i.isContentEditableTrue;return function(i,s){function l(e){var t=s.settings.object_resizing;return t===!1||r.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:e==s.getBody()?!1:s.dom.is(e,t))}function c(t){var n,r,i,o,a;n=t.screenX-L,r=t.screenY-M,U=n*B[2]+H,W=r*B[3]+I,U=5>U?5:U,W=5>W?5:W,i="IMG"==k.nodeName&&s.settings.resize_img_proportional!==!1?!e.modifierPressed(t):e.modifierPressed(t)||"IMG"==k.nodeName&&B[2]*B[3]!==0,i&&(j(n)>j(r)?(W=Y(U*F),U=Y(W/F)):(U=Y(W/F),W=Y(U*F))),_.setStyles(T,{width:U,height:W}),o=B.startPos.x+n,a=B.startPos.y+r,o=o>0?o:0,a=a>0?a:0,_.setStyles(R,{left:o,top:a,display:"block"}),R.innerHTML=U+" × "+W,B[2]<0&&T.clientWidth<=U&&_.setStyle(T,"left",P+(H-U)),B[3]<0&&T.clientHeight<=W&&_.setStyle(T,"top",O+(I-W)),n=X.scrollWidth-K,r=X.scrollHeight-G,n+r!==0&&_.setStyles(R,{left:o-n,top:a-r}),z||(s.fire("ObjectResizeStart",{target:k,width:H,height:I}),z=!0)}function u(){function e(e,t){t&&(k.style[e]||!s.schema.isValid(k.nodeName.toLowerCase(),e)?_.setStyle(k,e,t):_.setAttrib(k,e,t))}z=!1,e("width",U),e("height",W),_.unbind(V,"mousemove",c),_.unbind(V,"mouseup",u),$!=V&&(_.unbind($,"mousemove",c),_.unbind($,"mouseup",u)),_.remove(T),_.remove(R),q&&"TABLE"!=k.nodeName||d(k),s.fire("ObjectResized",{target:k,width:U,height:W}),_.setAttrib(k,"style",_.getAttrib(k,"style")),s.nodeChanged()}function d(e,t,n){var i,o,a,d,h;f(),x(),i=_.getPos(e,X),P=i.x,O=i.y,h=e.getBoundingClientRect(),o=h.width||h.right-h.left,a=h.height||h.bottom-h.top,k!=e&&(C(),k=e,U=W=0),d=s.fire("ObjectSelected",{target:e}),l(e)&&!d.isDefaultPrevented()?S(A,function(e,i){function s(t){L=t.screenX,M=t.screenY,H=k.clientWidth,I=k.clientHeight,F=I/H,B=e,e.startPos={x:o*e[0]+P,y:a*e[1]+O},K=X.scrollWidth,G=X.scrollHeight,T=k.cloneNode(!0),_.addClass(T,"mce-clonedresizable"),_.setAttrib(T,"data-mce-bogus","all"),T.contentEditable=!1,T.unSelectabe=!0,_.setStyles(T,{left:P,top:O,margin:0}),T.removeAttribute("data-mce-selected"),X.appendChild(T),_.bind(V,"mousemove",c),_.bind(V,"mouseup",u),$!=V&&(_.bind($,"mousemove",c),_.bind($,"mouseup",u)),R=_.add(X,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},H+" × "+I)}var l;return t?void(i==t&&s(n)):(l=_.get("mceResizeHandle"+i),l&&_.remove(l),l=_.add(X,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),r.ie&&(l.contentEditable=!1),_.bind(l,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),s(e)}),e.elm=l,void _.setStyles(l,{left:o*e[0]+P-l.offsetWidth/2,top:a*e[1]+O-l.offsetHeight/2}))}):f(),k.setAttribute("data-mce-selected","1")}function f(){var e,t;x(),k&&k.removeAttribute("data-mce-selected");for(e in A)t=_.get("mceResizeHandle"+e),t&&(_.unbind(t),_.remove(t))}function h(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n,r;if(!z&&!s.removed)return S(_.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),r="mousedown"==e.type?e.target:i.getNode(),r=_.$(r).closest(q?"table":"table,img,hr")[0],t(r,X)&&(w(),n=i.getStart(!0),t(n,r)&&t(i.getEnd(!0),r)&&(!q||r!=n&&"IMG"!==n.nodeName))?void d(r):void f()}function p(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function m(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function g(e){var t=e.srcElement,n,r,i,o,a,l,c;n=t.getBoundingClientRect(),l=D.clientX-n.left,c=D.clientY-n.top;for(r in A)if(i=A[r],o=t.offsetWidth*i[0],a=t.offsetHeight*i[1],j(o-l)<8&&j(a-c)<8){B=i;break}z=!0,s.fire("ObjectResizeStart",{target:k,width:k.clientWidth,height:k.clientHeight}),s.getDoc().selection.empty(),d(t,r,D)}function v(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function y(e){return a(o(s.getBody(),e))}function b(e){var t=e.srcElement;if(y(t))return void v(e);if(t!=k){if(s.fire("ObjectSelected",{target:t}),C(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);"IMG"!=t.nodeName&&"TABLE"!=t.nodeName||(f(),k=t,p(t,"resizestart",g))}}function C(){m(k,"resizestart",g)}function x(){for(var e in A){var t=A[e];t.elm&&(_.unbind(t.elm),delete t.elm)}}function w(){try{s.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function N(e){var t;if(q){t=V.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function E(){k=T=null,q&&(C(),m(X,"controlselect",b))}var _=s.dom,S=t.each,k,T,R,A,B,D,L,M,P,O,H,I,F,z,U,W,V=s.getDoc(),$=document,q=r.ie&&r.ie<11,j=Math.abs,Y=Math.round,X=s.getBody(),K,G;A={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var J=".mce-content-body";return s.contentStyles.push(J+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: box-sizing;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+J+" .mce-resizehandle:hover {background: #000}"+J+" img[data-mce-selected],"+J+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+J+" .mce-clonedresizable {position: absolute;"+(r.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+J+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}"),s.on("init",function(){q?(s.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(f(),N(e.target))}),p(X,"controlselect",b),s.on("mousedown",function(e){D=e})):(w(),r.ie>=11&&(s.on("mousedown click",function(e){var t=e.target,n=t.nodeName;z||!/^(TABLE|IMG|HR)$/.test(n)||y(t)||(s.selection.select(t,"TABLE"==n),"mousedown"==e.type&&s.nodeChanged())}),s.dom.bind(X,"mscontrolselect",function(e){function t(e){n.setEditorTimeout(s,function(){s.selection.select(e)})}return y(e.target)?(e.preventDefault(),void t(e.target)):void(/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&t(e.target)))})));var e=n.throttle(function(e){s.composing||h(e)});s.on("nodechange ResizeEditor ResizeWindow drop",e),s.on("keyup compositionend",function(t){k&&"TABLE"==k.nodeName&&e(t)}),s.on("hide blur",f)}),s.on("remove",x),{isResizable:l,showResizeRect:d,hideResizeRect:f,updateResizeRect:h,controlSelect:N,destroy:E}}}),r(z,[],function(){function e(e){return function(){return e}}function t(e){return function(t){return!e(t)}}function n(e,t){return function(n){return e(t(n))}}function r(){var e=a.call(arguments);return function(t){for(var n=0;n<e.length;n++)if(e[n](t))return!0;return!1}}function i(){var e=a.call(arguments); return function(t){for(var n=0;n<e.length;n++)if(!e[n](t))return!1;return!0}}function o(e){var t=a.call(arguments);return t.length-1>=e.length?e.apply(this,t.slice(1)):function(){var e=t.concat([].slice.call(arguments));return o.apply(this,e)}}var a=[].slice;return{constant:e,negate:t,and:i,or:r,curry:o,compose:n}}),r(U,[_,p,k],function(e,t,n){function r(e){return m(e)?!1:d(e)?!f(e.parentNode):h(e)||u(e)||p(e)||c(e)}function i(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode){if(c(e))return!1;if(l(e))return!0}return!0}function o(e){return c(e)?t.reduce(e.getElementsByTagName("*"),function(e,t){return e||l(t)},!1)!==!0:!1}function a(e){return h(e)||o(e)}function s(e,t){return r(e)&&i(e,t)}var l=e.isContentEditableTrue,c=e.isContentEditableFalse,u=e.isBr,d=e.isText,f=e.matchNodeNames("script style textarea"),h=e.matchNodeNames("img input textarea hr iframe video audio object"),p=e.matchNodeNames("table"),m=n.isCaretContainer;return{isCaretCandidate:r,isInEditable:i,isAtomic:a,isEditableCaretCandidate:s}}),r(W,[],function(){function e(e){return e?{left:u(e.left),top:u(e.top),bottom:u(e.bottom),right:u(e.right),width:u(e.width),height:u(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}}function t(t,n){return t=e(t),n?t.right=t.left:(t.left=t.left+t.width,t.right=t.left),t.width=0,t}function n(e,t){return e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right}function r(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2}function i(e,t){return e.bottom<t.top?!0:e.top>t.bottom?!1:r(t.top-e.bottom,e,t)}function o(e,t){return e.top>t.bottom?!0:e.bottom<t.top?!1:r(t.bottom-e.top,e,t)}function a(e,t){return e.left<t.left}function s(e,t){return e.right>t.right}function l(e,t){return i(e,t)?-1:o(e,t)?1:a(e,t)?-1:s(e,t)?1:0}function c(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom}var u=Math.round;return{clone:e,collapse:t,isEqual:n,isAbove:i,isBelow:o,isLeft:a,isRight:s,compare:l,containsXY:c}}),r(V,[],function(){function e(e){return"string"==typeof e&&e.charCodeAt(0)>=768&&t.test(e)}var t=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]");return{isExtendingChar:e}}),r($,[z,_,w,T,U,W,V],function(e,t,n,r,i,o,a){function s(e){return"createRange"in e?e.createRange():n.DOM.createRng()}function l(e){return e&&/[\r\n\t ]/.test(e)}function c(e){var t=e.startContainer,n=e.startOffset,r;return!!(l(e.toString())&&v(t.parentNode)&&(r=t.data,l(r[n-1])||l(r[n+1])))}function u(e){function t(e){var t=e.ownerDocument,n=s(t),r=t.createTextNode("\xa0"),i=e.parentNode,a;return i.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1),a=o.clone(n.getBoundingClientRect()),i.removeChild(r),a}function n(e){var n,r;return r=e.getClientRects(),n=r.length>0?o.clone(r[0]):o.clone(e.getBoundingClientRect()),b(e)&&0===n.left?t(e):n}function r(e,t){return e=o.collapse(e,t),e.width=1,e.right=e.left+1,e}function i(e){0!==e.height&&(u.length>0&&o.isEqual(e,u[u.length-1])||u.push(e))}function l(e,t){var o=s(e.ownerDocument);if(t<e.data.length){if(a.isExtendingChar(e.data[t]))return u;if(a.isExtendingChar(e.data[t-1])&&(o.setStart(e,t),o.setEnd(e,t+1),!c(o)))return i(r(n(o),!1)),u}t>0&&(o.setStart(e,t-1),o.setEnd(e,t),c(o)||i(r(n(o),!1))),t<e.data.length&&(o.setStart(e,t),o.setEnd(e,t+1),c(o)||i(r(n(o),!0)))}var u=[],d,h;if(y(e.container()))return l(e.container(),e.offset()),u;if(f(e.container()))if(e.isAtEnd())h=x(e.container(),e.offset()),y(h)&&l(h,h.data.length),g(h)&&!b(h)&&i(r(n(h),!1));else{if(h=x(e.container(),e.offset()),y(h)&&l(h,0),g(h)&&e.isAtEnd())return i(r(n(h),!1)),u;d=x(e.container(),e.offset()-1),g(d)&&!b(d)&&(p(d)||p(h)||!g(h))&&i(r(n(d),!1)),g(h)&&i(r(n(h),!0))}return u}function d(t,n,r){function i(){return y(t)?0===n:0===n}function o(){return y(t)?n>=t.data.length:n>=t.childNodes.length}function a(){var e;return e=s(t.ownerDocument),e.setStart(t,n),e.setEnd(t,n),e}function l(){return r||(r=u(new d(t,n))),r}function c(){return l().length>0}function f(e){return e&&t===e.container()&&n===e.offset()}function h(e){return x(t,e?n-1:n)}return{container:e.constant(t),offset:e.constant(n),toRange:a,getClientRects:l,isVisible:c,isAtStart:i,isAtEnd:o,isEqual:f,getNode:h}}var f=t.isElement,h=i.isCaretCandidate,p=t.matchStyleValues("display","block table"),m=t.matchStyleValues("float","left right"),g=e.and(f,h,e.negate(m)),v=e.negate(t.matchStyleValues("white-space","pre pre-line pre-wrap")),y=t.isText,b=t.isBr,C=n.nodeIndex,x=r.getNode;return d.fromRangeStart=function(e){return new d(e.startContainer,e.startOffset)},d.fromRangeEnd=function(e){return new d(e.endContainer,e.endOffset)},d.after=function(e){return new d(e.parentNode,C(e)+1)},d.before=function(e){return new d(e.parentNode,C(e))},d}),r(q,[_,w,z,p,$],function(e,t,n,r,i){function o(e){var t=e.parentNode;return v(t)?o(t):t}function a(e){return e?r.reduce(e.childNodes,function(e,t){return v(t)&&"BR"!=t.nodeName?e=e.concat(a(t)):e.push(t),e},[]):[]}function s(e,t){for(;(e=e.previousSibling)&&g(e);)t+=e.data.length;return t}function l(e){return function(t){return e===t}}function c(t){var n,i,s;return n=a(o(t)),i=r.findIndex(n,l(t),t),n=n.slice(0,i+1),s=r.reduce(n,function(e,t,r){return g(t)&&g(n[r-1])&&e++,e},0),n=r.filter(n,e.matchNodeNames(t.nodeName)),i=r.findIndex(n,l(t),t),i-s}function u(e){var t;return t=g(e)?"text()":e.nodeName.toLowerCase(),t+"["+c(e)+"]"}function d(e,t,n){var r=[];for(t=t.parentNode;t!=e&&(!n||!n(t));t=t.parentNode)r.push(t);return r}function f(t,i){var o,a,l=[],c,f,h;return o=i.container(),a=i.offset(),g(o)?c=s(o,a):(f=o.childNodes,a>=f.length?(c="after",a=f.length-1):c="before",o=f[a]),l.push(u(o)),h=d(t,o),h=r.filter(h,n.negate(e.isBogus)),l=l.concat(r.map(h,function(e){return u(e)})),l.reverse().join("/")+","+c}function h(t,n,i){var o=a(t);return o=r.filter(o,function(e,t){return!g(e)||!g(o[t-1])}),o=r.filter(o,e.matchNodeNames(n)),o[i]}function p(e,t){for(var n=e,r=0,o;g(n);){if(o=n.data.length,t>=r&&r+o>=t){e=n,t-=r;break}if(!g(n.nextSibling)){e=n,t=o;break}r+=o,n=n.nextSibling}return t>e.data.length&&(t=e.data.length),new i(e,t)}function m(e,t){var n,o,a;return t?(n=t.split(","),t=n[0].split("/"),a=n.length>1?n[1]:"before",o=r.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),h(e,t[1],parseInt(t[2],10))):null},e),o?g(o)?p(o,parseInt(a,10)):(a="after"===a?y(o)+1:y(o),new i(o.parentNode,a)):null):null}var g=e.isText,v=e.isBogus,y=t.nodeIndex;return{create:f,resolve:m}}),r(j,[d,m,k,q,$,_],function(e,t,n,r,i,o){function a(a){var l=a.dom;this.getBookmark=function(e,c){function u(e,n){var r=0;return t.each(l.select(e),function(e){return"all"!==e.getAttribute("data-mce-bogus")?e==n?!1:void r++:void 0}),r}function d(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function f(e){function t(e,t){var r=e[t?"startContainer":"endContainer"],i=e[t?"startOffset":"endOffset"],o=[],a,s,u=0;if(3==r.nodeType){if(c)for(a=r.previousSibling;a&&3==a.nodeType;a=a.previousSibling)i+=a.nodeValue.length;o.push(i)}else s=r.childNodes,i>=s.length&&s.length&&(u=1,i=Math.max(0,s.length-1)),o.push(l.nodeIndex(s[i],c)+u);for(;r&&r!=n;r=r.parentNode)o.push(l.nodeIndex(r,c));return o}var n=l.getRoot(),r={};return r.start=t(e,!0),a.isCollapsed()||(r.end=t(e)),r}function h(e){function t(e){var t;if(n.isCaretContainer(e)){if(o.isText(e)&&n.isCaretContainerBlock(e)&&(e=e.parentNode),t=e.previousSibling,s(t))return t;if(t=e.nextSibling,s(t))return t}}return t(e.startContainer)||t(e.endContainer)}var p,m,g,v,y,b,C="",x;if(2==e)return b=a.getNode(),y=b?b.nodeName:null,p=a.getRng(),s(b)||"IMG"==y?{name:y,index:u(y,b)}:a.tridentSel?a.tridentSel.getBookmark(e):(b=h(p),b?(y=b.tagName,{name:y,index:u(y,b)}):f(p));if(3==e)return p=a.getRng(),{start:r.create(l.getRoot(),i.fromRangeStart(p)),end:r.create(l.getRoot(),i.fromRangeEnd(p))};if(e)return{rng:a.getRng()};if(p=a.getRng(),g=l.uniqueId(),v=a.isCollapsed(),x="overflow:hidden;line-height:0px",p.duplicate||p.item){if(p.item)return b=p.item(0),y=b.nodeName,{name:y,index:u(y,b)};m=p.duplicate();try{p.collapse(),p.pasteHTML('<span data-mce-type="bookmark" id="'+g+'_start" style="'+x+'">'+C+"</span>"),v||(m.collapse(!1),p.moveToElementText(m.parentElement()),0===p.compareEndPoints("StartToEnd",m)&&m.move("character",-1),m.pasteHTML('<span data-mce-type="bookmark" id="'+g+'_end" style="'+x+'">'+C+"</span>"))}catch(w){return null}}else{if(b=a.getNode(),y=b.nodeName,"IMG"==y)return{name:y,index:u(y,b)};m=d(p.cloneRange()),v||(m.collapse(!1),m.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_end",style:x},C))),p=d(p),p.collapse(!0),p.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_start",style:x},C))}return a.moveToBookmark({id:g,keep:1}),{id:g}},this.moveToBookmark=function(n){function i(e){var t=n[e?"start":"end"],r,i,o,a;if(t){for(o=t[0],i=d,r=t.length-1;r>=1;r--){if(a=i.childNodes,t[r]>a.length-1)return;i=a[t[r]]}3===i.nodeType&&(o=Math.min(t[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(t[0],i.childNodes.length)),e?u.setStart(i,o):u.setEnd(i,o)}return!0}function o(r){var i=l.get(n.id+"_"+r),o,a,s,c,u=n.keep;if(i&&(o=i.parentNode,"start"==r?(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),f=h=o,p=m=a):(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),h=o,m=a),!u)){for(c=i.previousSibling,s=i.nextSibling,t.each(t.grep(i.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});i=l.get(n.id+"_"+r);)l.remove(i,1);c&&s&&c.nodeType==s.nodeType&&3==c.nodeType&&!e.opera&&(a=c.nodeValue.length,c.appendData(s.nodeValue),l.remove(s),"start"==r?(f=h=c,p=m=a):(h=c,m=a))}}function s(t){return!l.isBlock(t)||t.innerHTML||e.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t}function c(){var e,t;return e=l.createRng(),t=r.resolve(l.getRoot(),n.start),e.setStart(t.container(),t.offset()),t=r.resolve(l.getRoot(),n.end),e.setEnd(t.container(),t.offset()),e}var u,d,f,h,p,m;if(n)if(t.isArray(n.start)){if(u=l.createRng(),d=l.getRoot(),a.tridentSel)return a.tridentSel.moveToBookmark(n);i(!0)&&i()&&a.setRng(u)}else"string"==typeof n.start?a.setRng(c(n)):n.id?(o("start"),o("end"),f&&(u=l.createRng(),u.setStart(s(f),p),u.setEnd(s(h),m),a.setRng(u))):n.name?a.select(l.select(n.name)[n.index]):n.rng&&a.setRng(n.rng)}}var s=o.isContentEditableFalse;return a.isBookmarkNode=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},a}),r(Y,[y,H,F,T,j,_,d,m,$],function(e,n,r,i,o,a,s,l,c){function u(e,t,i,a){var s=this;s.dom=e,s.win=t,s.serializer=i,s.editor=a,s.bookmarkManager=new o(s),s.controlSelection=new r(s,a),s.win.getSelection||(s.tridentSel=new n(s))}var d=l.each,f=l.trim,h=s.ie;return u.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='<span id="__caret">_</span>',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('<span id="__mce_tmp">_</span>'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(e){var t=this,n=t.getRng(),r,i,o,a;if(n.duplicate||n.item){if(n.item)return n.item(0);for(o=n.duplicate(),o.collapse(1),r=o.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),i=a=n.parentElement();a=a.parentNode;)if(a==r){r=i;break}return r}return r=n.startContainer,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[Math.min(r.childNodes.length-1,n.startOffset)])),r&&3==r.nodeType?r.parentNode:r},getEnd:function(e){var t=this,n=t.getRng(),r,i;return n.duplicate||n.item?n.item?n.item(0):(n=n.duplicate(),n.collapse(0),r=n.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),r&&"BODY"==r.nodeName?r.lastChild||r:r):(r=n.endContainer,i=n.endOffset,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[i>0?i-1:i])),r&&3==r.nodeType?r.parentNode:r)},getBookmark:function(e,t){return this.bookmarkManager.getBookmark(e,t)},moveToBookmark:function(e){return this.bookmarkManager.moveToBookmark(e)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a,s,l;if(!n.win)return null;if(a=n.win.document,!e&&n.lastFocusBookmark){var c=n.lastFocusBookmark;return c.startContainer?(i=a.createRange(),i.setStart(c.startContainer,c.startOffset),i.setEnd(c.endContainer,c.endOffset)):i=c,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(u){}if(l=n.editor.fire("GetSelectionRange",{range:i}),l.range!==i)return l.range;if(h&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(u){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r,i,o;if(e)if(e.select){n.explicitRange=null;try{e.select()}catch(a){}}else if(n.tridentSel){if(e.cloneRange)try{n.tridentSel.addRange(e)}catch(a){}}else{if(r=n.getSel(),o=n.editor.fire("SetSelectionRange",{range:e}),e=o.range,r){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(a){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}e.collapsed||e.startContainer!=e.endContainer||!r.setBaseAndExtent||s.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(i=e.startContainer.childNodes[e.startOffset],i&&"IMG"==i.tagName&&n.getSel().setBaseAndExtent(i,0,i,1))}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i,o,a,s,l=t.dom.getRoot();return n?(i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r)):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return s.range&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};d(n.selectorChangedData,function(e,t){d(o,function(n){return i.is(n,t)?(r[t]||(d(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),d(r,function(e,n){a[n]||(delete r[n],d(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){function n(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var r,i,o=this,s=o.dom,l=s.getRoot(),c,u,d=0;if(a.isElement(e)){if(t===!1&&(d=e.offsetHeight),"BODY"!=l.nodeName){var f=o.getScrollContainer();if(f)return r=n(e).y-n(f).y+d,u=f.clientHeight,c=f.scrollTop,void((c>r||r+25>c+u)&&(f.scrollTop=c>r?r:r-u+25))}i=s.getViewPort(o.editor.getWin()),r=s.getPos(e).y+d,c=i.y,u=i.h,(r<i.y||r+25>c+u)&&o.editor.getWin().scrollTo(0,c>r?r:r-u+25)}},placeCaretAt:function(e,t){this.setRng(i.getCaretRangeFromPoint(e,t,this.editor.getDoc()))},_moveEndPoint:function(t,n,r){var i=n,o=new e(n,i),a=this.dom.schema.getNonEmptyElements();do{if(3==n.nodeType&&0!==f(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"==n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(s.ie&&s.ie<11&&this.dom.isBlock(n)&&this.dom.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?o.next():o.prev());"BODY"==i.nodeName&&(r?t.setStart(i,0):t.setEnd(i,i.childNodes.length))},getBoundingClientRect:function(){var e=this.getRng();return e.collapsed?c.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){this.win=null,this.controlSelection.destroy()}},u}),r(X,[j,m],function(e,t){function n(t){this.compare=function(n,i){function o(e){var n={};return r(t.getAttribs(e),function(r){var i=r.nodeName.toLowerCase();0!==i.indexOf("_")&&"style"!==i&&0!==i.indexOf("data-")&&(n[i]=t.getAttrib(e,i))}),n}function a(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(n=t[r],"undefined"==typeof n)return!1;if(e[r]!=n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0}return n.nodeName!=i.nodeName?!1:a(o(n),o(i))&&a(t.parseStyle(t.getAttrib(n,"style")),t.parseStyle(t.getAttrib(i,"style")))?!e.isBookmarkNode(n)&&!e.isBookmarkNode(i):!1}}var r=t.each;return n}),r(K,[m],function(e){function t(e,t){function r(e){return e.replace(/%(\w+)/g,"")}var i,o,a=e.dom,s="",l,c;if(c=e.settings.preview_styles,c===!1)return"";if(c||(c="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),"string"==typeof t){if(t=e.formatter.get(t),!t)return;t=t[0]}return i=t.block||t.inline||"span",o=a.create(i),n(t.styles,function(e,t){e=r(e),e&&a.setStyle(o,t,e)}),n(t.attributes,function(e,t){e=r(e),e&&a.setAttrib(o,t,e)}),n(t.classes,function(e){e=r(e),a.hasClass(o,e)||a.addClass(o,e)}),e.fire("PreviewFormats"),a.setStyles(o,{position:"absolute",left:-65535}),e.getBody().appendChild(o),l=a.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,n(c.split(" "),function(t){var n=a.getStyle(o,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=a.getStyle(e.getBody(),t,!0),"#ffffff"==a.toHex(n).toLowerCase())||"color"==t&&"#000000"==a.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(s+="padding:0 2px;"),s+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),a.remove(o),s}var n=e.each;return{getCssText:t}}),r(G,[p,_,g],function(e,t,n){function r(e,t){var n=o[e];n||(o[e]=n=[]),o[e].push(t)}function i(e,t){s(o[e],function(e){e(t)})}var o=[],a=e.filter,s=e.each;return r("pre",function(r){function i(t){return c(t.previousSibling)&&-1!=e.indexOf(u,t.previousSibling)}function o(e,t){n(t).remove(),n(e).append("<br><br>").append(t.childNodes)}var l=r.selection.getRng(),c,u;c=t.matchNodeNames("pre"),l.collapsed||(u=r.selection.getSelectedBlocks(),s(a(a(u,c),i),function(e){o(e.previousSibling,e)}))}),{postProcess:i}}),r(J,[y,T,j,X,m,K,G],function(e,t,n,r,i,o,a){return function(s){function l(e){return e.nodeType&&(e=e.nodeName),!!s.schema.getTextBlockElements()[e.toLowerCase()]}function c(e){return/^(TH|TD)$/.test(e.nodeName)}function u(e){return e&&/^(IMG)$/.test(e.nodeName)}function d(e,t){return Y.getParents(e,t,Y.getRoot())}function f(e){return 1===e.nodeType&&"_mce_caret"===e.id}function h(){g({valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,t,n){ue(n,function(t,n){Y.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),ue("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){g(e,{block:e,remove:"all"})}),g(s.settings.formats)}function p(){s.addShortcut("meta+b","bold_desc","Bold"),s.addShortcut("meta+i","italic_desc","Italic"),s.addShortcut("meta+u","underline_desc","Underline");for(var e=1;6>=e;e++)s.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);s.addShortcut("access+7","",["FormatBlock",!1,"p"]),s.addShortcut("access+8","",["FormatBlock",!1,"div"]),s.addShortcut("access+9","",["FormatBlock",!1,"address"])}function m(e){return e?j[e]:j}function g(e,t){e&&("string"!=typeof e?ue(e,function(e,t){g(t,e)}):(t=t.length?t:[t],ue(t,function(e){e.deep===oe&&(e.deep=!e.selector),e.split===oe&&(e.split=!e.selector||e.inline),e.remove===oe&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),j[e]=t))}function v(e){return e&&j[e]&&delete j[e],j}function y(e,t){var n=m(t);if(n)for(var r=0;r<n.length;r++)if(n[r].inherit===!1&&Y.is(e,n[r].selector))return!0;return!1}function b(e){var t;return s.dom.getParent(e,function(e){return t=s.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function C(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=b(e.parentNode),s.dom.getStyle(e,"color")&&t?s.dom.setStyle(e,"text-decoration",t):s.dom.getStyle(e,"text-decoration")===t&&s.dom.setStyle(e,"text-decoration",null))}function x(t,n,r){function i(e,t){if(t=t||d,e){if(t.onformat&&t.onformat(e,t,n,r),ue(t.styles,function(t,r){Y.setStyle(e,r,M(t,n))}),t.styles){var i=Y.getAttrib(e,"style");i&&e.setAttribute("data-mce-style",i)}ue(t.attributes,function(t,r){Y.setAttrib(e,r,M(t,n))}),ue(t.classes,function(t){t=M(t,n),Y.hasClass(e,t)||Y.addClass(e,t)})}}function o(){function t(t,n){var i=new e(n);for(r=i.prev2();r;r=i.prev2()){if(3==r.nodeType&&r.data.length>0)return r;if(r.childNodes.length>1||r==t||"BR"==r.tagName)return r}}var n=s.selection.getRng(),i=n.startContainer,o=n.endContainer;if(i!=o&&0===n.endOffset){var a=t(i,o),l=3==a.nodeType?a.data.length:a.childNodes.length;n.setEnd(a,l)}return n}function c(e,r,o){var a=[],s,c,h=!0;s=d.inline||d.block,c=Y.create(s),i(c),K.walk(e,function(e){function r(e){var m,v,y,b,C;return C=h,m=e.nodeName.toLowerCase(),v=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&ae(e)&&(C=h,h="true"===ae(e),b=!0),B(m,"br")?(p=0,void(d.block&&Y.remove(e))):d.wrapper&&E(e,t,n)?void(p=0):h&&!b&&d.block&&!d.wrapper&&l(m)&&G(v,s)?(e=Y.rename(e,s),i(e),a.push(e),void(p=0)):d.selector&&(ue(u,function(t){return"collapsed"in t&&t.collapsed!==g?void 0:Y.is(e,t.selector)&&!f(e)?(i(e,t),y=!0,!1):void 0}),!d.inline||y)?void(p=0):void(!h||b||!G(s,m)||!G(v,s)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||f(e)||d.inline&&J(e)?(p=0,ue(de(e.childNodes),r),b&&(h=C),p=0):(p||(p=Y.clone(c,ne),e.parentNode.insertBefore(p,e),a.push(p)),p.appendChild(e)))}var p;ue(e,r)}),d.links===!0&&ue(a,function(e){function t(e){"A"===e.nodeName&&i(e,d),ue(de(e.childNodes),t)}t(e)}),ue(a,function(e){function r(e){var t=0;return ue(e.childNodes,function(e){P(e)||ce(e)||t++}),t}function o(e){var t,n;return ue(e.childNodes,function(e){return 1!=e.nodeType||ce(e)||f(e)?void 0:(t=e,ne)}),t&&!ce(t)&&A(t,d)&&(n=Y.clone(t,ne),i(n),Y.replace(n,e,re),Y.remove(t,1)),n||e}var s;if(s=r(e),(a.length>1||!J(e))&&0===s)return void Y.remove(e,1);if(d.inline||d.wrapper){if(d.exact||1!==s||(e=o(e)),ue(u,function(t){ue(Y.select(t.inline,e),function(e){ce(e)||F(t,n,e,t.exact?e:null)})}),E(e.parentNode,t,n))return Y.remove(e,1),e=0,re;d.merge_with_parents&&Y.getParent(e.parentNode,function(r){return E(r,t,n)?(Y.remove(e,1),e=0,re):void 0}),e&&d.merge_siblings!==!1&&(e=W(U(e),e),e=W(e,U(e,re)))}})}var u=m(t),d=u[0],h,p,g=!r&&X.isCollapsed();if("false"!==ae(X.getNode())){if(d){if(r)r.nodeType?(p=Y.createRng(),p.setStartBefore(r),p.setEndAfter(r),c(H(p,u),null,!0)):c(r,null,!0);else if(g&&d.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length)$("apply",t,n);else{var v=s.selection.getNode();Q||!u[0].defaultBlock||Y.getParent(v,Y.isBlock)||x(u[0].defaultBlock),s.selection.setRng(o()),h=X.getBookmark(),c(H(X.getRng(re),u),h),d.styles&&(d.styles.color||d.styles.textDecoration)&&(fe(v,C,"childNodes"),C(v)),X.moveToBookmark(h),q(X.getRng(re)),s.nodeChanged()}a.postProcess(t,s)}}else{r=X.getNode();for(var y=0,b=u.length;b>y;y++)if(u[y].ceFalseOverride&&Y.is(r,u[y].selector))return void i(r,u[y])}}function w(e,t,n,r){function i(e){var n,r,o,a,s;if(1===e.nodeType&&ae(e)&&(a=y,y="true"===ae(e),s=!0),n=de(e.childNodes),y&&!s)for(r=0,o=h.length;o>r&&!F(h[r],t,e,e);r++);if(p.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(y=a)}}function o(n){var i;return ue(d(n.parentNode).reverse(),function(n){var o;i||"_start"==n.id||"_end"==n.id||(o=E(n,e,t,r),o&&o.split!==!1&&(i=n))}),i}function a(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode, o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=Y.clone(o,ne),c=0;c<h.length;c++)if(F(h[c],t,a,a)){a=0;break}a&&(s&&a.appendChild(s),l||(l=a),s=a)}!i||p.mixed&&J(e)||(n=Y.split(e,n)),s&&(r.parentNode.insertBefore(s,r),l.appendChild(r))}return n}function l(e){return a(o(e),e,e,!0)}function u(e){var t=Y.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return ce(n)&&(n=n[e?"firstChild":"lastChild"]),3==n.nodeType&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),Y.remove(t,!0),n}function f(e){var t,n,r=e.commonAncestorContainer;if(e=H(e,h,re),p.split){if(t=V(e,re),n=V(e),t!=n){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"==t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&c(n)&&n.firstChild&&(n=n.firstChild||n),Y.isChildOf(t,n)&&!J(n)&&!c(t)&&!c(n))return t=O(t,"span",{id:"_start","data-mce-type":"bookmark"}),l(t),void(t=u(re));t=O(t,"span",{id:"_start","data-mce-type":"bookmark"}),n=O(n,"span",{id:"_end","data-mce-type":"bookmark"}),l(t),l(n),t=u(re),n=u()}else t=n=l(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=Z(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=Z(n)+1}K.walk(e,function(e){ue(e,function(e){i(e),1===e.nodeType&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===b(e.parentNode)&&F({deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})}var h=m(e),p=h[0],g,v,y=!0;if(n)return void(n.nodeType?(v=Y.createRng(),v.setStartBefore(n),v.setEndAfter(n),f(v)):f(n));if("false"!==ae(X.getNode()))X.isCollapsed()&&p.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length?$("remove",e,t,r):(g=X.getBookmark(),f(X.getRng(re)),X.moveToBookmark(g),p.inline&&_(e,t,X.getStart())&&q(X.getRng(!0)),s.nodeChanged());else{n=X.getNode();for(var C=0,x=h.length;x>C&&(!h[C].ceFalseOverride||!F(h[C],t,n,n));C++);}}function N(e,t,n){var r=m(e);!_(e,t,n)||"toggle"in r[0]&&!r[0].toggle?x(e,t,n):w(e,t,n)}function E(e,t,n,r){function i(e,t,i){var o,a,s=t[i],l;if(t.onmatch)return t.onmatch(e,t,i);if(s)if(s.length===oe){for(o in s)if(s.hasOwnProperty(o)){if(a="attributes"===i?Y.getAttrib(e,o):D(e,o),r&&!a&&!t.exact)return;if((!r||t.exact)&&!B(a,L(M(s[o],n),o)))return}}else for(l=0;l<s.length;l++)if("attributes"===i?Y.getAttrib(e,s[l]):D(e,s[l]))return t;return t}var o=m(t),a,s,l;if(o&&e)for(s=0;s<o.length;s++)if(a=o[s],A(e,a)&&i(e,a,"attributes")&&i(e,a,"styles")){if(l=a.classes)for(s=0;s<l.length;s++)if(!Y.hasClass(e,l[s]))return;return a}}function _(e,t,n){function r(n){var r=Y.getRoot();return n===r?!1:(n=Y.getParent(n,function(n){return y(n,e)?!0:n.parentNode===r||!!E(n,e,t,!0)}),E(n,e,t))}var i;return n?r(n):(n=X.getNode(),r(n)?re:(i=X.getStart(),i!=n&&r(i)?re:ne))}function S(e,t){var n,r=[],i={};return n=X.getStart(),Y.getParent(n,function(n){var o,a;for(o=0;o<e.length;o++)a=e[o],!i[a]&&E(n,a,t)&&(i[a]=!0,r.push(a))},Y.getRoot()),r}function k(e){var t=m(e),n,r,i,o,a;if(t)for(n=X.getStart(),r=d(n),o=t.length-1;o>=0;o--){if(a=t[o].selector,!a||t[o].defaultBlock)return re;for(i=r.length-1;i>=0;i--)if(Y.is(r[i],a))return re}return ne}function T(e,t,n){var r;return ie||(ie={},r={},s.on("NodeChange",function(e){var t=d(e.element),n={};t=i.grep(t,function(e){return 1==e.nodeType&&!e.getAttribute("data-mce-bogus")}),ue(ie,function(e,i){ue(t,function(o){return E(o,i,{},e.similar)?(r[i]||(ue(e,function(e){e(!0,{node:o,format:i,parents:t})}),r[i]=e),n[i]=e,!1):y(o,i)?!1:void 0})}),ue(r,function(i,o){n[o]||(delete r[o],ue(i,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),ue(e.split(","),function(e){ie[e]||(ie[e]=[],ie[e].similar=n),ie[e].push(t)}),this}function R(e){return o.getCssText(s,e)}function A(e,t){return B(e,t.inline)?re:B(e,t.block)?re:t.selector?1==e.nodeType&&Y.is(e,t.selector):void 0}function B(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function D(e,t){return L(Y.getStyle(e,t),t)}function L(e,t){return"color"!=t&&"backgroundColor"!=t||(e=Y.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function M(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function P(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function O(e,t,n){var r=Y.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function H(t,n,r){function i(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=Y.getRoot(),3==r.nodeType&&!P(r)&&(e?v>0:b<r.nodeValue.length))return r;for(;;){if(!n[0].block_expand&&J(i))return i;for(o=i[a];o;o=o[a])if(!ce(o)&&!P(o)&&!t(o))return i;if(i==s||i.parentNode==s){r=i;break}i=i.parentNode}return r}function o(e,t){for(t===oe&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)e=e.childNodes[t],e&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}}function a(e){for(var t=e;t;){if(1===t.nodeType&&ae(t))return"false"===ae(t)?t:e;t=t.parentNode}return e}function c(t,n,i){function o(e,t){var n,o,a=e.nodeValue;return"undefined"==typeof t&&(t=i?a.length:0),i?(n=a.lastIndexOf(" ",t),o=a.lastIndexOf("\xa0",t),n=n>o?n:o,-1===n||r||n++):(n=a.indexOf(" ",t),o=a.indexOf("\xa0",t),n=-1!==n&&(-1===o||o>n)?n:o),n}var a,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(a=new e(t,Y.getParent(t,J)||s.getBody());l=a[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(J(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function u(e,r){var i,o,a,s;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=d(e),o=0;o<i.length;o++)for(a=0;a<n.length;a++)if(s=n[a],!("collapsed"in s&&s.collapsed!==t.collapsed)&&Y.is(i[o],s.selector))return i[o];return e}function f(e,t){var r,i=Y.getRoot();if(n[0].wrapper||(r=Y.getParent(e,n[0].block,i)),r||(r=Y.getParent(3==e.nodeType?e.parentNode:e,function(e){return e!=i&&l(e)})),r&&n[0].wrapper&&(r=d(r,"ul,ol").reverse()[0]||r),!r)for(r=e;r[t]&&!J(r[t])&&(r=r[t],!B(r,"br")););return r||e}var h,p,m,g=t.startContainer,v=t.startOffset,y=t.endContainer,b=t.endOffset;if(1==g.nodeType&&g.hasChildNodes()&&(h=g.childNodes.length-1,g=g.childNodes[v>h?h:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(h=y.childNodes.length-1,y=y.childNodes[b>h?h:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=a(g),y=a(y),(ce(g.parentNode)||ce(g))&&(g=ce(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(ce(y.parentNode)||ce(y))&&(y=ce(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=c(g,v,!0),m&&(g=m.container,v=m.offset),m=c(y,b),m&&(y=m.container,b=m.offset)),p=o(y,b),p.node)){for(;p.node&&0===p.offset&&p.node.previousSibling;)p=o(p.node.previousSibling);p.node&&p.offset>0&&3===p.node.nodeType&&" "===p.node.nodeValue.charAt(p.offset-1)&&p.offset>1&&(y=p.node,y.splitText(p.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=i(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=i())),n[0].selector&&n[0].expand!==ne&&!n[0].inline&&(g=u(g,"previousSibling"),y=u(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(J(g)||(g=i(!0)),J(y)||(y=i()))),1==g.nodeType&&(v=Z(g),g=g.parentNode),1==y.nodeType&&(b=Z(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function I(e,t){return t.links&&"A"==e.tagName}function F(e,t,n,r){var i,o,a;if(!A(n,e)&&!I(n,e))return ne;if("all"!=e.remove)for(ue(e.styles,function(i,o){i=L(M(i,t),o),"number"==typeof o&&(o=i,r=0),(e.remove_similar||!r||B(D(r,o),i))&&Y.setStyle(n,o,""),a=1}),a&&""===Y.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),ue(e.attributes,function(e,i){var o;if(e=M(e,t),"number"==typeof i&&(i=e,r=0),!r||B(Y.getAttrib(r,i),e)){if("class"==i&&(e=Y.getAttrib(n,i),e&&(o="",ue(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void Y.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),te.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),ue(e.classes,function(e){e=M(e,t),r&&!Y.hasClass(r,e)||Y.removeClass(n,e)}),o=Y.getAttribs(n),i=0;i<o.length;i++){var s=o[i].nodeName;if(0!==s.indexOf("_")&&0!==s.indexOf("data-"))return ne}return"none"!=e.remove?(z(n,e),re):void 0}function z(e,t){function n(e,t,n){return e=U(e,t,n),!e||"BR"==e.nodeName||J(e)}var r=e.parentNode,i;t.block&&(Q?r==Y.getRoot()&&(t.list_block&&B(e,t.list_block)||ue(de(e.childNodes),function(e){G(Q,e.nodeName.toLowerCase())?i?i.appendChild(e):(i=O(e,Q),Y.setAttribs(i,s.settings.forced_root_block_attrs)):i=0})):J(e)&&!J(r)&&(n(e,ne)||n(e.firstChild,re,1)||e.insertBefore(Y.create("br"),e.firstChild),n(e,re)||n(e.lastChild,ne,1)||e.appendChild(Y.create("br")))),t.selector&&t.inline&&!B(t.inline,e)||Y.remove(e,1)}function U(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1==e.nodeType||!P(e))return e}function W(e,t){function n(e,t){for(i=e;i;i=i[t]){if(3==i.nodeType&&0!==i.nodeValue.length)return e;if(1==i.nodeType&&!ce(i))return i}return e}var i,o,a=new r(Y);if(e&&t&&(e=n(e,"previousSibling"),t=n(t,"nextSibling"),a.compare(e,t))){for(i=e.nextSibling;i&&i!=t;)o=i,i=i.nextSibling,e.appendChild(o);return Y.remove(t),ue(de(t.childNodes),function(t){e.appendChild(t)}),e}return t}function V(t,n){var r,i,o;return r=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1==r.nodeType&&(o=r.childNodes.length-1,!n&&i&&i--,r=r.childNodes[i>o?o:i]),3===r.nodeType&&n&&i>=r.nodeValue.length&&(r=new e(r,s.getBody()).next()||r),3!==r.nodeType||n||0!==i||(r=new e(r,s.getBody()).prev()||r),r}function $(t,n,r,i){function o(e){var t=Y.create("span",{id:g,"data-mce-bogus":!0,style:v?"color:red":""});return e&&t.appendChild(s.getDoc().createTextNode(ee)),t}function a(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==ee||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function c(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=X.getRng(!0),a(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),Y.remove(e)):(n=u(e),n.nodeValue.charAt(0)===ee&&(n.deleteData(0,1),r.startContainer==n&&r.startOffset>0&&r.setStart(n,r.startOffset-1),r.endContainer==n&&r.endOffset>0&&r.setEnd(n,r.endOffset-1)),Y.remove(e,1)),X.setRng(r);else if(e=c(X.getStart()),!e)for(;e=Y.get(g);)d(e,!1)}function f(){var e,t,i,a,s,l,d;e=X.getRng(!0),a=e.startOffset,l=e.startContainer,d=l.nodeValue,t=c(X.getStart()),t&&(i=u(t)),d&&a>0&&a<d.length&&/\w/.test(d.charAt(a))&&/\w/.test(d.charAt(a-1))?(s=X.getBookmark(),e.collapse(!0),e=H(e,m(n)),e=K.split(e),x(n,r,e),X.moveToBookmark(s)):(t&&i.nodeValue===ee?x(n,r,t):(t=o(!0),i=t.firstChild,e.insertNode(t),a=1,x(n,r,t)),X.setCursorLocation(i,a))}function h(){var e=X.getRng(!0),t,a,s,c,u,d,f=[],h,p;for(t=e.startContainer,a=e.startOffset,u=t,3==t.nodeType&&(a!=t.nodeValue.length&&(c=!0),u=u.parentNode);u;){if(E(u,n,r,i)){d=u;break}u.nextSibling&&(c=!0),f.push(u),u=u.parentNode}if(d)if(c)s=X.getBookmark(),e.collapse(!0),e=H(e,m(n),!0),e=K.split(e),w(n,r,e),X.moveToBookmark(s);else{for(p=o(),u=p,h=f.length-1;h>=0;h--)u.appendChild(Y.clone(f[h],!1)),u=u.firstChild;u.appendChild(Y.doc.createTextNode(ee)),u=u.firstChild;var g=Y.getParent(d,l);g&&Y.isEmpty(g)?d.parentNode.replaceChild(p,d):Y.insertAfter(p,d),X.setCursorLocation(u,1),Y.isEmpty(d)&&Y.remove(d)}}function p(){var e;e=c(X.getStart()),e&&!Y.isEmpty(e)&&fe(e,function(e){1!=e.nodeType||e.id===g||Y.isEmpty(e)||Y.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var g="_mce_caret",v=s.settings.caret_debug;s._hasCaretEvents||(le=function(){var e=[],t;if(a(c(X.getStart()),e))for(t=e.length;t--;)Y.setAttrib(e[t],"data-mce-bogus","1")},se=function(e){var t=e.keyCode;d(),8==t&&X.isCollapsed()&&X.getStart().innerHTML==ee&&d(c(X.getStart())),37!=t&&39!=t||d(c(X.getStart())),p()},s.on("SetContent",function(e){e.selection&&p()}),s._hasCaretEvents=!0),"apply"==t?f():h()}function q(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if((t.startContainer!=t.endContainer||!u(t.startContainer.childNodes[t.startOffset]))&&(3==n.nodeType&&r>=n.nodeValue.length&&(r=Z(n),n=n.parentNode,i=!0),1==n.nodeType))for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,Y.getParent(n,Y.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!P(a))return l=Y.create("a",{"data-mce-bogus":"all"},ee),a.parentNode.insertBefore(l,a),t.setStart(a,0),X.setRng(t),void Y.remove(l)}var j={},Y=s.dom,X=s.selection,K=new t(Y),G=s.schema.isValidChild,J=Y.isBlock,Q=s.settings.forced_root_block,Z=Y.nodeIndex,ee="\ufeff",te=/^(src|href|style)$/,ne=!1,re=!0,ie,oe,ae=Y.getContentEditable,se,le,ce=n.isBookmarkNode,ue=i.each,de=i.grep,fe=i.walk,he=i.extend;he(this,{get:m,register:g,unregister:v,apply:x,remove:w,toggle:N,match:_,matchAll:S,matchNode:E,canApply:k,formatChanged:T,getCssText:R}),h(),p(),s.on("BeforeGetContent",function(e){le&&"raw"!=e.format&&le()}),s.on("mouseup keydown",function(e){se&&se(e)})}}),r(Q,[I,d],function(e,t){return function(e){function n(){return e.serializer.getTrimmedContent()}function r(t){e.setDirty(t)}function i(e){o.typing=!1,o.add({},e)}var o=this,a=0,s=[],l,c,u=0;return e.on("init",function(){o.add()}),e.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&o.beforeChange()}),e.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&i(e)}),e.on("ObjectResizeStart Cut",function(){o.beforeChange()}),e.on("SaveContent ObjectResized blur",i),e.on("DragEnd",i),e.on("KeyUp",function(a){var l=a.keyCode;a.isDefaultPrevented()||((l>=33&&36>=l||l>=37&&40>=l||45==l||13==l||a.ctrlKey)&&(i(),e.nodeChanged()),(46==l||8==l||t.mac&&(91==l||93==l))&&e.nodeChanged(),c&&o.typing&&(e.isDirty()||(r(s[0]&&n()!=s[0].content),e.isDirty()&&e.fire("change",{level:s[0],lastLevel:null})),e.fire("TypingUndo"),c=!1,e.nodeChanged()))}),e.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented()){if(t>=33&&36>=t||t>=37&&40>=t||45==t)return void(o.typing&&i(e));var n=e.ctrlKey&&!e.altKey||e.metaKey;!(16>t||t>20)||224==t||91==t||o.typing||n||(o.beforeChange(),o.typing=!0,o.add({},e),c=!0)}}),e.on("MouseDown",function(e){o.typing&&i(e)}),e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),e.on("AddUndo Undo Redo ClearUndos",function(t){t.isDefaultPrevented()||e.nodeChanged()}),o={data:s,typing:!1,beforeChange:function(){u||(l=e.selection.getBookmark(2,!0))},add:function(t,i){var o,c=e.settings,d;if(t=t||{},t.content=n(),u||e.removed)return null;if(d=s[a],e.fire("BeforeAddUndo",{level:t,lastLevel:d,originalEvent:i}).isDefaultPrevented())return null;if(d&&d.content==t.content)return null;if(s[a]&&(s[a].beforeBookmark=l),c.custom_undo_redo_levels&&s.length>c.custom_undo_redo_levels){for(o=0;o<s.length-1;o++)s[o]=s[o+1];s.length--,a=s.length}t.bookmark=e.selection.getBookmark(2,!0),a<s.length-1&&(s.length=a+1),s.push(t),a=s.length-1;var f={level:t,lastLevel:d,originalEvent:i};return e.fire("AddUndo",f),a>0&&(r(!0),e.fire("change",f)),t},undo:function(){var t;return o.typing&&(o.add(),o.typing=!1),a>0&&(t=s[--a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.beforeBookmark),r(!0),e.fire("undo",{level:t})),t},redo:function(){var t;return a<s.length-1&&(t=s[++a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.bookmark),r(!0),e.fire("redo",{level:t})),t},clear:function(){s=[],a=0,o.typing=!1,o.data=s,e.fire("ClearUndos")},hasUndo:function(){return a>0||o.typing&&s[0]&&n()!=s[0].content},hasRedo:function(){return a<s.length-1&&!this.typing},transact:function(e){o.beforeChange();try{u++,e()}finally{u--}return o.add()},extra:function(t,n){var r,i;o.transact(t)&&(i=s[a].bookmark,r=s[a-1],e.setContent(r.content,{format:"raw"}),e.selection.moveToBookmark(r.beforeBookmark),o.transact(n)&&(s[a-1].beforeBookmark=i))}}}}),r(Z,[y,T,d],function(e,t,n){var r=n.ie&&n.ie<11;return function(i){function o(o){function h(e){return e&&a.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==a.getContentEditable(e)}function p(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}function m(e){var t;a.isBlock(e)&&(t=s.getRng(),e.appendChild(a.create("span",null,"\xa0")),s.select(e),e.lastChild.outerHTML="",s.setRng(t))}function g(e){var t=e,n=[],r;if(t){for(;t=t.firstChild;){if(a.isBlock(t))return;1!=t.nodeType||d[t.nodeName.toLowerCase()]||n.push(t)}for(r=n.length;r--;)t=n[r],!t.hasChildNodes()||t.firstChild==t.lastChild&&""===t.firstChild.nodeValue?a.remove(t):"A"==t.nodeName&&" "===(t.innerText||t.textContent)&&a.remove(t)}}function v(t){function r(e){for(;e;){if(1==e.nodeType||3==e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}var i,o,l,c=t,u;if(t){if(n.ie&&n.ie<9&&M&&M.firstChild&&M.firstChild==M.lastChild&&"BR"==M.firstChild.tagName&&a.remove(M.firstChild),/^(LI|DT|DD)$/.test(t.nodeName)){var d=r(t.firstChild);d&&/^(UL|OL|DL)$/.test(d.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(l=a.createRng(),n.ie||t.normalize(),t.hasChildNodes()){for(i=new e(t,t);o=i.current();){if(3==o.nodeType){l.setStart(o,0),l.setEnd(o,0);break}if(f[o.nodeName.toLowerCase()]){l.setStartBefore(o),l.setEndBefore(o);break}c=o,o=i.next()}o||(l.setStart(c,0),l.setEnd(c,0))}else"BR"==t.nodeName?t.nextSibling&&a.isBlock(t.nextSibling)?((!P||9>P)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}}function y(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function b(e){e.innerHTML=r?"":'<br data-mce-bogus="1">'}function C(e){var t=D,n,i,o,s=u.getTextInlineElements();if(e||"TABLE"==z?(n=a.create(e||W),y(n)):n=M.cloneNode(!1),o=n,l.keep_styles!==!1)do if(s[t.nodeName]){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while((t=t.parentNode)&&t!=B);return r||(o.innerHTML='<br data-mce-bogus="1">'),n}function x(t){var n,r,i;if(3==D.nodeType&&(t?L>0:L<D.nodeValue.length))return!1;if(D.parentNode==M&&V&&!t)return!0;if(t&&1==D.nodeType&&D==M.firstChild)return!0;if("TABLE"===D.nodeName||D.previousSibling&&"TABLE"==D.previousSibling.nodeName)return V&&!t||!V&&t;for(n=new e(D,M),3==D.nodeType&&(t&&0===L?n.prev():t||L!=D.nodeValue.length||n.next());r=n.current();){if(1===r.nodeType){if(!r.getAttribute("data-mce-bogus")&&(i=r.nodeName.toLowerCase(),d[i]&&"br"!==i))return!1}else if(3===r.nodeType&&!/^[ \t\r\n]*$/.test(r.nodeValue))return!1;t?n.prev():n.next()}return!0}function w(e,t){var n,r,o,s,l,c,d=W||"P";if(r=a.getParent(e,a.isBlock),!r||!h(r)){if(r=r||B,c=r==i.getBody()||p(r)?r.nodeName.toLowerCase():r.parentNode.nodeName.toLowerCase(),!r.hasChildNodes())return n=a.create(d),y(n),r.appendChild(n),R.setStart(n,0),R.setEnd(n,0),n;for(s=e;s.parentNode!=r;)s=s.parentNode;for(;s&&!a.isBlock(s);)o=s,s=s.previousSibling;if(o&&u.isValidChild(c,d.toLowerCase())){for(n=a.create(d),y(n),o.parentNode.insertBefore(n,o),s=o;s&&!a.isBlock(s);)l=s.nextSibling,n.appendChild(s),s=l;R.setStart(e,t),R.setEnd(e,t)}}return e}function N(){function e(e){for(var t=F[e?"firstChild":"lastChild"];t&&1!=t.nodeType;)t=t[e?"nextSibling":"previousSibling"];return t===M}function t(){var e=F.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:F}if(F!=i.getBody()){var n=F.parentNode.nodeName;/^(OL|UL|LI)$/.test(n)&&(W="LI"),H=W?C(W):a.create("BR"),e(!0)&&e()?"LI"==n?a.insertAfter(H,t()):a.replace(H,F):e(!0)?"LI"==n?(a.insertAfter(H,t()),H.appendChild(a.doc.createTextNode(" ")),H.appendChild(F)):F.parentNode.insertBefore(H,F):e()?(a.insertAfter(H,t()),m(H)):(F=t(),A=R.cloneRange(),A.setStartAfter(M),A.setEndAfter(F),I=A.extractContents(),"LI"==W&&"LI"==I.firstChild.nodeName?(H=I.firstChild,a.insertAfter(I,F)):(a.insertAfter(I,F),a.insertAfter(H,F))),a.remove(M),v(H),c.add()}}function E(){i.execCommand("InsertLineBreak",!1,o)}function _(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function S(e){var t=a.getRoot(),n,r;for(n=e;n!==t&&"false"!==a.getContentEditable(n);)"true"===a.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function k(e){var t;r||(e.normalize(),t=e.lastChild,t&&!/^(left|right)$/gi.test(a.getStyle(t,"float",!0))||a.add(e,"br"))}function T(){H=/^(H[1-6]|PRE|FIGURE)$/.test(z)&&"HGROUP"!=U?C(W):C(),l.end_container_on_empty_block&&h(F)&&a.isEmpty(M)?H=a.split(F,M):a.insertAfter(H,M),v(H)}var R,A,B,D,L,M,P,O,H,I,F,z,U,W,V;if(R=s.getRng(!0),!o.isDefaultPrevented()){if(!R.collapsed)return void i.execCommand("Delete");if(new t(a).normalize(R),D=R.startContainer,L=R.startOffset,W=(l.force_p_newlines?"p":"")||l.forced_root_block,W=W?W.toUpperCase():"",P=a.doc.documentMode,O=o.shiftKey,1==D.nodeType&&D.hasChildNodes()&&(V=L>D.childNodes.length-1,D=D.childNodes[Math.min(L,D.childNodes.length-1)]||D,L=V&&3==D.nodeType?D.nodeValue.length:0),B=S(D)){if(c.beforeChange(),!a.isBlock(B)&&B!=a.getRoot())return void(W&&!O||E());if((W&&!O||!W&&O)&&(D=w(D,L)),M=a.getParent(D,a.isBlock),F=M?a.getParent(M.parentNode,a.isBlock):null,z=M?M.nodeName.toUpperCase():"",U=F?F.nodeName.toUpperCase():"","LI"!=U||o.ctrlKey||(M=F,z=U),/^(LI|DT|DD)$/.test(z)){if(!W&&O)return void E();if(a.isEmpty(M))return void N()}if("PRE"==z&&l.br_in_pre!==!1){if(!O)return void E()}else if(!W&&!O&&"LI"!=z||W&&O)return void E();W&&M===i.getBody()||(W=W||"P",x()?T():x(!0)?(H=M.parentNode.insertBefore(C(),M),m(H),v(M)):(A=R.cloneRange(),A.setEndAfter(M),I=A.extractContents(),_(I),H=I.firstChild,a.insertAfter(I,M),g(H),k(M),a.isEmpty(M)&&b(M),H.normalize(),a.isEmpty(H)?(a.remove(H),T()):v(H)),a.setAttrib(H,"id",""),i.fire("NewBlock",{newBlock:H}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements(),f=u.getMoveCaretBeforeOnEnterElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(ee,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,h,p,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){p=t,t=t.nextSibling,r.remove(p);continue}h||(h=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(h,t),g=!0),p=t,t=t.nextSibling,h.appendChild(p)}else h=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(te,[z,y,_,$,k,U],function(e,t,n,r,i,o){function a(e){return e>0}function s(e){return 0>e}function l(e,n,r,i,o){var l=new t(e,i);if(s(n)){if(C(e)&&(e=l.prev(!0),r(e)))return e;for(;e=l.prev(o);)if(r(e))return e}if(a(n)){if(C(e)&&(e=l.next(!0),r(e)))return e;for(;e=l.next(o);)if(r(e))return e}return null}function c(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode)if(b(e))return e;return t}function u(e,t){for(;e&&e!=t;){if(x(e))return e;e=e.parentNode}return null}function d(e,t,n){return u(e.container(),n)==u(t.container(),n)}function f(e,t,n){return c(e.container(),n)==c(t.container(),n)}function h(e,t){var n,r;return t?(n=t.container(),r=t.offset(),E(n)?n.childNodes[r+e]:null):null}function p(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n}function m(e,t,n){return u(t,e)==u(n,e)}function g(e,t,n){var r,i;for(i=e?"previousSibling":"nextSibling";n&&n!=t;){if(r=n[i],w(r)&&(r=r[i]),C(r)){if(m(t,r,n))return r;break}if(_(r))break;n=n.parentNode}return null}function v(e,t,r){var o,a,s,l,c=N(g,!0,t),u=N(g,!1,t);if(a=r.startContainer,s=r.startOffset,i.isCaretContainerBlock(a)){if(E(a)||(a=a.parentNode),l=a.getAttribute("data-mce-caret"),"before"==l&&(o=a.nextSibling,C(o)))return S(o);if("after"==l&&(o=a.previousSibling,C(o)))return k(o)}if(!r.collapsed)return r;if(n.isText(a)){if(w(a)){if(1===e){if(o=u(a))return S(o);if(o=c(a))return k(o)}if(-1===e){if(o=c(a))return k(o);if(o=u(a))return S(o)}return r}if(i.endsWithCaretContainer(a)&&s>=a.data.length-1)return 1===e&&(o=u(a))?S(o):r;if(i.startsWithCaretContainer(a)&&1>=s)return-1===e&&(o=c(a))?k(o):r;if(s===a.data.length)return o=u(a),o?S(o):r;if(0===s)return o=c(a),o?k(o):r}return r}function y(e,t){return C(h(e,t))}var b=n.isContentEditableTrue,C=n.isContentEditableFalse,x=n.matchStyleValues("display","block table table-cell table-caption"),w=i.isCaretContainer,N=e.curry,E=n.isElement,_=o.isCaretCandidate,S=N(p,!0),k=N(p,!1);return{isForwards:a,isBackwards:s,findNode:l,getEditingHost:c,getParentBlock:u,isInSameBlock:d,isInSameEditingHost:f,isBeforeContentEditableFalse:N(y,0),isAfterContentEditableFalse:N(y,-1),normalizeRange:v}}),r(ne,[_,U,$,te,p,z],function(e,t,n,r,i,o){function a(e,t){for(var n=[];e&&e!=t;)n.push(e),e=e.parentNode;return n}function s(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null}function l(e,t){if(m(e)){if(v(t.previousSibling)&&!f(t.previousSibling))return n.before(t);if(f(t))return n(t,0)}if(g(e)){if(v(t.nextSibling)&&!f(t.nextSibling))return n.after(t);if(f(t))return n(t,t.data.length)}return g(e)?p(t)?n.before(t):n.after(t):n.before(t)}function c(t,i){var o;return e.isBr(t)?(o=u(1,n.after(t),i),o?!r.isInSameBlock(n.before(t),n.before(o),i):!1):!1}function u(e,t,p){var C,x,w,N,E,_,S;if(!h(p)||!t)return null;if(S=t,C=S.container(),x=S.offset(),f(C)){if(g(e)&&x>0)return n(C,--x);if(m(e)&&x<C.length)return n(C,++x);w=C}else{if(g(e)&&x>0&&(N=s(C,x-1),v(N)))return!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,E.data.length):n.after(E):f(N)?n(N,N.data.length):n.before(N);if(m(e)&&x<C.childNodes.length&&(N=s(C,x),v(N)))return c(N,p)?u(e,n.after(N),p):!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,0):n.before(E):f(N)?n(N,0):n.after(N);w=S.getNode()}return(m(e)&&S.isAtEnd()||g(e)&&S.isAtStart())&&(w=r.findNode(w,e,o.constant(!0),p,!0),b(w))?l(e,w):(N=r.findNode(w,e,b,p),_=i.last(i.filter(a(C,p),d)),!_||N&&_.contains(N)?N?l(e,N):null:S=m(e)?n.after(_):n.before(_))}var d=e.isContentEditableFalse,f=e.isText,h=e.isElement,p=e.isBr,m=r.isForwards,g=r.isBackwards,v=t.isCaretCandidate,y=t.isAtomic,b=t.isEditableCaretCandidate;return function(e){return{next:function(t){return u(1,t,e)},prev:function(t){return u(-1,t,e)}}}}),r(re,[m,ne,$],function(e,t,n){var r=function(e){var t=e.firstChild,n=e.lastChild;return t&&"meta"===t.name&&(t=t.next),n&&"mce_marker"===n.attr("id")&&(n=n.prev),t&&t===n?"ul"===t.name||"ol"===t.name:!1},i=function(e){var t=e.firstChild,n=e.lastChild;return t&&"META"===t.nodeName&&t.parentNode.removeChild(t),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),e},o=function(e,t,n){var r=t.serialize(n),o=e.createFragment(r);return i(o)},a=function(t){return e.grep(t.childNodes,function(e){return"LI"===e.nodeName})},s=function(e){return!e.firstChild},l=function(e){return e.length>0&&s(e[e.length-1])?e.slice(0,-1):e},c=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},u=function(e,t){return!!c(e,t)},d=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]},f=function(e,r){var i=n.before(e),o=new t(r),a=o.next(i);return a?a.toRange():null},h=function(e,r){var i=n.after(e),o=new t(r),a=o.prev(i);return a?a.toRange():null},p=function(t,n,r,i){var o=d(t,i),a=t.parentNode;return a.insertBefore(o[0],t),e.each(n,function(e){a.insertBefore(e,t)}),a.insertBefore(o[1],t),a.removeChild(t),h(n[n.length-1],r)},m=function(t,n,r){var i=t.parentNode;return e.each(n,function(e){i.insertBefore(e,t)}),f(t,r)},g=function(e,t,n,r){return r.insertAfter(t.reverse(),e),h(t[0],n)},v=function(e,r,i,s){var u=o(r,e,s),d=c(r,i.startContainer),f=l(a(u.firstChild)),h=1,v=2,y=r.getRoot(),b=function(e){var o=n.fromRangeStart(i),a=new t(r.getRoot()),s=e===h?a.prev(o):a.next(o);return s?c(r,s.getNode())!==d:!0};return b(h)?m(d,f,y):b(v)?g(d,f,y,r):p(d,f,y,i)};return{isListFragment:r,insertAtCaret:v,isParentBlockLi:u,trimListItems:l,listItems:a}}),r(ie,[d,m,P,ne,$,X,_,re],function(e,t,n,r,i,o,a,s){var l=a.matchNodeNames("td th"),c=function(a,c,u){function d(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=D.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i<r.length?e=e.replace(/ (<br>|)$/," "):t("nextSibling")||(e=e.replace(/( | )(<br>|)$/," "))),e}function f(){var e,t,n;e=D.getRng(!0),t=e.startContainer,n=e.startOffset,3==t.nodeType&&e.collapsed&&("\xa0"===t.data[n]?(t.deleteData(n,1),/[\u00a0| ]$/.test(c)||(c+=" ")):"\xa0"===t.data[n-1]&&(t.deleteData(n-1,1),/[\u00a0| ]$/.test(c)||(c=" "+c)))}function h(){if(A){var e=a.getBody(),n=new o(L);t.each(L.select("*[data-mce-fragment]"),function(t){for(var r=t.parentNode;r&&r!=e;r=r.parentNode)B[t.nodeName.toLowerCase()]&&n.compare(r,t)&&L.remove(t,!0)})}}function p(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}function m(e){t.each(e.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")})}function g(e){return!!e.getAttribute("data-mce-fragment")}function v(e){return e&&!a.schema.getShortEndedElements()[e.nodeName]}function y(t){function n(e){for(var t=a.getBody();e&&e!==t;e=e.parentNode)if("false"===a.dom.getContentEditable(e))return e;return null}function o(e){var t=i.fromRangeStart(e),n=new r(a.getBody());return t=n.next(t),t?t.toRange():void 0}var s,c,u;if(t){if(D.scrollIntoView(t),s=n(t))return L.remove(t),void D.select(s);S=L.createRng(),k=t.previousSibling,k&&3==k.nodeType?(S.setStart(k,k.nodeValue.length),e.ie||(T=t.nextSibling,T&&3==T.nodeType&&(k.appendData(T.data),T.parentNode.removeChild(T)))):(S.setStartBefore(t),S.setEndBefore(t)),c=L.getParent(t,L.isBlock),L.remove(t),c&&L.isEmpty(c)&&(a.$(c).empty(),S.setStart(c,0),S.setEnd(c,0),l(c)||g(c)||!(u=o(S))?L.add(c,L.create("br",{"data-mce-bogus":"1"})):(S=u,L.remove(c))),D.setRng(S)}}var b,C,x,w,N,E,_,S,k,T,R,A,B=a.schema.getTextInlineElements(),D=a.selection,L=a.dom;/^ | $/.test(c)&&(c=d(c)),b=a.parser,A=u.merge,C=new n({validate:a.settings.validate},a.schema),R='<span id="mce_marker" data-mce-type="bookmark">​</span>',E={content:c,format:"html",selection:!0},a.fire("BeforeSetContent",E),c=E.content,-1==c.indexOf("{$caret}")&&(c+="{$caret}"),c=c.replace(/\{\$caret\}/,R),S=D.getRng();var M=S.startContainer||(S.parentElement?S.parentElement():null),P=a.getBody();M===P&&D.isCollapsed()&&L.isBlock(P.firstChild)&&v(P.firstChild)&&L.isEmpty(P.firstChild)&&(S=L.createRng(),S.setStart(P.firstChild,0),S.setEnd(P.firstChild,0),D.setRng(S)),D.isCollapsed()||(a.selection.setRng(a.selection.getRng()),a.getDoc().execCommand("Delete",!1,null), f()),x=D.getNode();var O={context:x.nodeName.toLowerCase(),data:u.data};if(N=b.parse(c,O),u.paste===!0&&s.isListFragment(N)&&s.isParentBlockLi(L,x))return S=s.insertAtCaret(C,L,a.selection.getRng(!0),N),a.selection.setRng(S),void a.fire("SetContent",E);if(p(N),k=N.lastChild,"mce_marker"==k.attr("id"))for(_=k,k=k.prev;k;k=k.walk(!0))if(3==k.type||!L.isBlock(k.name)){a.schema.isValidChild(k.parent.name,"span")&&k.parent.insert(_,k,"br"===k.name);break}if(a._selectionOverrides.showBlockCaretContainer(x),O.invalid){for(D.setContent(R),x=D.getNode(),w=a.getBody(),9==x.nodeType?x=k=w:k=x;k!==w;)x=k,k=k.parentNode;c=x==w?w.innerHTML:L.getOuterHTML(x),c=C.serialize(b.parse(c.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return C.serialize(N)}))),x==w?L.setHTML(w,c):L.setOuterHTML(x,c)}else c=C.serialize(N),k=x.firstChild,T=x.lastChild,!k||k===T&&"BR"===k.nodeName?L.setHTML(x,c):D.setContent(c);h(),y(L.get("mce_marker")),m(a.getBody()),a.fire("SetContent",E),a.addVisual()},u=function(e){var n;return"string"!=typeof e?(n=t.extend({paste:e.paste,data:{paste:e.paste}},e),{content:e.content,details:n}):{content:e,details:{}}},d=function(e,t){var n=u(t);c(e,n.content,n.details)};return{insertAtCaret:d}}),r(oe,[d,m,T,y,ie],function(e,n,r,i,o){var a=n.each,s=n.extend,l=n.map,c=n.inArray,u=n.explode,d=e.ie&&e.ie<11,f=!0,h=!1;return function(n){function p(e,t,r,i){var o,s,l=0;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||i&&i.skip_focus||n.focus(),i=n.fire("BeforeExecCommand",{command:e,ui:t,value:r}),i.isDefaultPrevented())return!1;if(s=e.toLowerCase(),o=B.exec[s])return o(s,t,r),n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;if(a(n.plugins,function(i){return i.execCommand&&i.execCommand(e,t,r)?(n.fire("ExecCommand",{command:e,ui:t,value:r}),l=!0,!1):void 0}),l)return l;if(n.theme&&n.theme.execCommand&&n.theme.execCommand(e,t,r))return n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;try{l=n.getDoc().execCommand(e,t,r)}catch(c){}return l?(n.fire("ExecCommand",{command:e,ui:t,value:r}),!0):!1}function m(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.state[e])return t(e);try{return n.getDoc().queryCommandState(e)}catch(r){}return!1}}function g(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.value[e])return t(e);try{return n.getDoc().queryCommandValue(e)}catch(r){}}}function v(e,t){t=t||"exec",a(e,function(e,n){a(n.toLowerCase().split(","),function(n){B[t][n]=e})})}function y(e,t,r){e=e.toLowerCase(),B.exec[e]=function(e,i,o,a){return t.call(r||n,i,o,a)}}function b(e){if(e=e.toLowerCase(),B.exec[e])return!0;try{return n.getDoc().queryCommandSupported(e)}catch(t){}return!1}function C(e,t,r){e=e.toLowerCase(),B.state[e]=function(){return t.call(r||n)}}function x(e,t,r){e=e.toLowerCase(),B.value[e]=function(){return t.call(r||n)}}function w(e){return e=e.toLowerCase(),!!B.exec[e]}function N(e,r,i){return r===t&&(r=h),i===t&&(i=null),n.getDoc().execCommand(e,r,i)}function E(e){return A.match(e)}function _(e,r){A.toggle(e,r?{value:r}:t),n.nodeChanged()}function S(e){L=R.getBookmark(e)}function k(){R.moveToBookmark(L)}var T,R,A,B={state:{},exec:{},value:{}},D=n.settings,L;n.on("PreInit",function(){T=n.dom,R=n.selection,D=n.settings,A=n.formatter}),s(this,{execCommand:p,queryCommandState:m,queryCommandValue:g,queryCommandSupported:b,addCommands:v,addCommand:y,addQueryStateHandler:C,addQueryValueHandler:x,hasCustomCommand:w}),v({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(t){var r=n.getDoc(),i;try{N(t)}catch(o){i=f}if("paste"!==t||r.queryCommandEnabled(t)||(i=!0),i||!r.queryCommandSupported(t)){var a=n.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");e.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),n.notificationManager.open({text:a,type:"error"})}},unlink:function(){if(R.isCollapsed()){var e=R.getNode();return void("A"==e.tagName&&n.dom.remove(e,!0))}A.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"==t&&(t="justify"),a("left,center,right,justify".split(","),function(e){t!=e&&A.remove("align"+e)}),"none"!=t&&_("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;N(e),t=T.getParent(R.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(S(),T.split(n,t),k()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){_(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){_(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=u(D.font_size_style_values),r=u(D.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),_(e,n)},RemoveFormat:function(e){A.remove(e)},mceBlockQuote:function(){_("blockquote")},FormatBlock:function(e,t,n){return _(n||"p")},mceCleanup:function(){var e=R.getBookmark();n.setContent(n.getContent({cleanup:f}),{cleanup:f}),R.moveToBookmark(e)},mceRemoveNode:function(e,t,r){var i=r||R.getNode();i!=n.getBody()&&(S(),n.dom.remove(i,f),k())},mceSelectNodeDepth:function(e,t,r){var i=0;T.getParent(R.getNode(),function(e){return 1==e.nodeType&&i++==r?(R.select(e),h):void 0},n.getBody())},mceSelectNode:function(e,t,n){R.select(n)},mceInsertContent:function(e,t,r){o.insertAtCaret(n,r)},mceInsertRawHTML:function(e,t,r){R.setContent("tiny_mce_marker"),n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return r}))},mceToggleFormat:function(e,t,n){_(n)},mceSetContent:function(e,t,r){n.setContent(r)},"Indent,Outdent":function(e){var t,r,i;t=D.indentation,r=/[a-z%]+$/i.exec(t),t=parseInt(t,10),m("InsertUnorderedList")||m("InsertOrderedList")?N(e):(D.forced_root_block||T.getParent(R.getNode(),T.isBlock)||A.apply("div"),a(R.getSelectedBlocks(),function(o){if("false"!==T.getContentEditable(o)&&"LI"!=o.nodeName){var a=n.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==T.getStyle(o,"direction",!0)?"Right":"Left","outdent"==e?(i=Math.max(0,parseInt(o.style[a]||0,10)-t),T.setStyle(o,a,i?i+r:"")):(i=parseInt(o.style[a]||0,10)+t+r,T.setStyle(o,a,i))}}))},mceRepaint:function(){},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual,n.addVisual()},mceReplaceContent:function(e,t,r){n.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,R.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=T.getParent(R.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||A.remove("link"),n.href&&A.apply("link",n,r)},selectAll:function(){var e=T.getRoot(),t;R.getRng().setStart?(t=T.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),R.setRng(t)):(t=R.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){N("Delete");var e=n.getBody();T.isEmpty(e)&&(n.setContent(""),e.firstChild&&T.isBlock(e.firstChild)?n.selection.setCursorLocation(e.firstChild,0):n.selection.setCursorLocation(e,0))},mceNewDocument:function(){n.setContent("")},InsertLineBreak:function(e,t,o){function a(){for(var e=new i(m,v),t,r=n.schema.getNonEmptyElements();t=e.next();)if(r[t.nodeName.toLowerCase()]||t.length>0)return!0}var s=o,l,c,u,h=R.getRng(!0);new r(T).normalize(h);var p=h.startOffset,m=h.startContainer;if(1==m.nodeType&&m.hasChildNodes()){var g=p>m.childNodes.length-1;m=m.childNodes[Math.min(p,m.childNodes.length-1)]||m,p=g&&3==m.nodeType?m.nodeValue.length:0}var v=T.getParent(m,T.isBlock),y=v?v.nodeName.toUpperCase():"",b=v?T.getParent(v.parentNode,T.isBlock):null,C=b?b.nodeName.toUpperCase():"",x=s&&s.ctrlKey;"LI"!=C||x||(v=b,y=C),m&&3==m.nodeType&&p>=m.nodeValue.length&&(d||a()||(l=T.create("br"),h.insertNode(l),h.setStartAfter(l),h.setEndAfter(l),c=!0)),l=T.create("br"),h.insertNode(l);var w=T.doc.documentMode;return d&&"PRE"==y&&(!w||8>w)&&l.parentNode.insertBefore(T.doc.createTextNode("\r"),l),u=T.create("span",{}," "),l.parentNode.insertBefore(u,l),R.scrollIntoView(u),T.remove(u),c?(h.setStartBefore(l),h.setEndBefore(l)):(h.setStartAfter(l),h.setEndAfter(l)),R.setRng(h),n.undoManager.add(),f}}),v({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=R.isCollapsed()?[T.getParent(R.getNode(),T.isBlock)]:R.getSelectedBlocks(),r=l(n,function(e){return!!A.matchNode(e,t)});return-1!==c(r,f)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return E(e)},mceBlockQuote:function(){return E("blockquote")},Outdent:function(){var e;if(D.inline_styles){if((e=T.getParent(R.getStart(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f;if((e=T.getParent(R.getEnd(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f}return m("InsertUnorderedList")||m("InsertOrderedList")||!D.inline_styles&&!!T.getParent(R.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=T.getParent(R.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),v({"FontSize,FontName":function(e){var t=0,n;return(n=T.getParent(R.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),v({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}),r(ae,[m],function(e){function t(e,o){var a=this,s,l;if(e=r(e),o=a.settings=o||{},s=o.base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(a.source=e);var c=0===e.indexOf("//");0!==e.indexOf("/")||c||(e=(s?s.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(l=o.base_uri?o.base_uri.path:new t(location.href).directory,""===o.base_uri.protocol?e="//mce_host"+a.toAbsPath(l,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(s&&s.protocol||"http")+"://mce_host"+a.toAbsPath(l,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(i,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),a[t]=r}),s&&(a.protocol||(a.protocol=s.protocol),a.userInfo||(a.userInfo=s.userInfo),a.port||"mce_host"!==a.host||(a.port=s.port),a.host&&"mce_host"!==a.host||(a.host=s.host),a.source=""),c&&(a.protocol="")}var n=e.each,r=e.trim,i="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),o={ftp:21,http:80,https:443,mailto:25};return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(n&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=o[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.length<n.length)for(o=0,a=n.length;a>o;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}},t.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},t}),r(se,[m],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r=this;if(!o&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],"function"==typeof f&&c[d]?u[d]=s(d,f):u[d]=f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(le,[m],function(e){function t(t){function n(){return!1}function r(){return!0}function i(e,i){var o,s,l,c;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=u),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=r},i.stopPropagation=function(){i.isPropagationStopped=r},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=r},i.isDefaultPrevented=n,i.isPropagationStopped=n,i.isImmediatePropagationStopped=n),t.beforeFire&&t.beforeFire(i),o=d[e])for(s=0,l=o.length;l>s;s++){if(c=o[s],c.once&&a(e,c.func),i.isImmediatePropagationStopped())return i.stopPropagation(),i;if(c.func.call(u,i)===!1)return i.preventDefault(),i}return i}function o(t,r,i,o){var a,s,l;if(r===!1&&(r=n),r)for(r={func:r},o&&e.extend(r,o),s=t.toLowerCase().split(" "),l=s.length;l--;)t=s[l],a=d[t],a||(a=d[t]=[],f(t,!0)),i?a.unshift(r):a.push(r);return c}function a(e,t){var n,r,i,o,a;if(e)for(o=e.toLowerCase().split(" "),n=o.length;n--;){if(e=o[n],r=d[e],!e){for(i in d)f(i,!1),delete d[i];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),d[e]=r);else r.length=0;r.length||(f(e,!1),delete d[e])}}else{for(e in d)f(e,!1);d={}}return c}function s(e,t,n){return o(e,t,n,{once:!0})}function l(e){return e=e.toLowerCase(),!(!d[e]||0===d[e].length)}var c=this,u,d={},f;t=t||{},u=t.scope||c,f=t.toggleEvent||n,c.fire=i,c.on=o,c.off=a,c.once=s,c.has=l}var n=e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," ");return t.isNative=function(e){return!!n[e.toLowerCase()]},t}),r(ce,[],function(){function e(e){this.create=e.create}return e.create=function(t,n){return new e({create:function(e,r){function i(t){e.set(r,t.value)}function o(e){t.set(n,e.value)}var a;return e.on("change:"+r,o),t.on("change:"+n,i),a=e._bindings,a||(a=e._bindings=[],e.on("destroy",function(){for(var e=a.length;e--;)a[e]()})),a.push(function(){t.off("change:"+n,i)}),t.get(n)}})},e}),r(ue,[le],function(e){function t(t){return t._eventDispatcher||(t._eventDispatcher=new e({scope:t,toggleEvent:function(n,r){e.isNative(n)&&t.toggleNativeEvent&&t.toggleNativeEvent(n,r)}})),t._eventDispatcher}return{fire:function(e,n,r){var i=this;if(i.removed&&"remove"!==e)return n;if(n=t(i).fire(e,n,r),r!==!1&&i.parent)for(var o=i.parent();o&&!n.isPropagationStopped();)o.fire(e,n,!1),o=o.parent();return n},on:function(e,n,r){return t(this).on(e,n,r)},off:function(e,n){return t(this).off(e,n)},once:function(e,n){return t(this).once(e,n)},hasEventListeners:function(e){return t(this).has(e)}}}),r(de,[ce,ue,se,m],function(e,t,n,r){function i(e){return e.nodeType>0}function o(e,t){var n,a;if(e===t)return!0;if(null===e||null===t)return e===t;if("object"!=typeof e||"object"!=typeof t)return e===t;if(r.isArray(t)){if(e.length!==t.length)return!1;for(n=e.length;n--;)if(!o(e[n],t[n]))return!1}if(i(e)||i(t))return e===t;a={};for(n in t){if(!o(e[n],t[n]))return!1;a[n]=!0}for(n in e)if(!a[n]&&!o(e[n],t[n]))return!1;return!0}return n.extend({Mixins:[t],init:function(t){var n,r;t=t||{};for(n in t)r=t[n],r instanceof e&&(t[n]=r.create(this,n));this.data=t},set:function(t,n){var r,i,a=this.data[t];if(n instanceof e&&(n=n.create(this,t)),"object"==typeof t){for(r in t)this.set(r,t[r]);return this}return o(a,n)||(this.data[t]=n,i={target:this,name:t,value:n,oldValue:a},this.fire("change:"+t,i),this.fire("change",i)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(t){return e.create(this,t)},destroy:function(){this.fire("destroy")}})}),r(fe,[se],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.classes.contains(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.pseudo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a<n.length;a++)">"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,h,p;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,p=e,h=0,i=o-1;i>=0;i--)for(c=a[i];p;){if(c.pseudo)for(f=p.parent().items(),u=d=f.length;u--&&f[u]!==p;);for(s=0,l=c.length;l>s;s++)if(!c[s](p,u,d)){s=l+1;break}if(s===l){h++;break}if(i===o-1)break;p=p.parent()}if(h===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(he,[m,fe,se],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].classes.contains(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(e){return this.each(function(t){t.classes.add(e)})},removeClass:function(e){return this.each(function(t){t.classes.remove(e)})}},e.each("fire on off show hide append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(pe,[d,m,w],function(e,t,n){var r=0,i={id:function(){return"mceu_"+r++},create:function(e,r,i){var o=document.createElement(e);return n.DOM.setAttribs(o,r),"string"==typeof i?o.innerHTML=i:t.each(i,function(e){e.nodeType&&o.appendChild(e)}),o},createFragment:function(e){return n.DOM.createFragment(e)},getWindowSize:function(){return n.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return n.DOM.getPos(e,t||i.getContainer())},getContainer:function(){return e.container?e.container:document.body},getViewPort:function(e){return n.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return n.DOM.addClass(e,t)},removeClass:function(e,t){return n.DOM.removeClass(e,t)},hasClass:function(e,t){return n.DOM.hasClass(e,t)},toggleClass:function(e,t,r){return n.DOM.toggleClass(e,t,r)},css:function(e,t,r){return n.DOM.setStyle(e,t,r)},getRuntimeStyle:function(e,t){return n.DOM.getStyle(e,t,!0)},on:function(e,t,r,i){return n.DOM.bind(e,t,r,i)},off:function(e,t,r){return n.DOM.unbind(e,t,r)},fire:function(e,t,r){return n.DOM.fire(e,t,r)},innerHtml:function(e,t){n.DOM.setHTML(e,t)}};return i}),r(me,[],function(){return{parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}}}}),r(ge,[m],function(e){function t(){}function n(e){this.cls=[],this.cls._map={},this.onchange=e||t,this.prefix=""}return e.extend(n.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){for(var t=0;t<this.cls.length&&this.cls[t]!==e;t++);this.cls.splice(t,1),delete this.cls._map[e],this._change()}return this},toggle:function(e,t){var n=this.contains(e);return n!==t&&(n?this.remove(e):this.add(e),this._change()),this},contains:function(e){return!!this.cls._map[e]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),n.prototype.toString=function(){var e;if(this.clsValue)return this.clsValue;e="";for(var t=0;t<this.cls.length;t++)t>0&&(e+=" "),e+=this.prefix+this.cls[t];return e},n}),r(ve,[u],function(e){var t={},n;return{add:function(r){var i=r.parent();if(i){if(!i._layout||i._layout.isNative())return;t[i._id]||(t[i._id]=i),n||(n=!0,e.requestAnimationFrame(function(){var e,r;n=!1;for(e in t)r=t[e],r.state.get("rendered")&&r.reflow();t={}},document.body))}},remove:function(e){t[e._id]&&delete t[e._id]}}}),r(ye,[se,m,le,de,he,pe,g,me,ge,ve],function(e,t,n,r,i,o,a,s,l,c){function u(e){return e._eventDispatcher||(e._eventDispatcher=new n({scope:e,toggleEvent:function(t,r){r&&n.isNative(t)&&(e._nativeEvents||(e._nativeEvents={}),e._nativeEvents[t]=!0,e.state.get("rendered")&&d(e))}})),e._eventDispatcher}function d(e){function t(t){var n=e.getParentCtrl(t.target);n&&n.fire(t.type,t)}function n(){var e=c._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),c._lastHoverCtrl=null)}function r(t){var n=e.getParentCtrl(t.target),r=c._lastHoverCtrl,i=0,o,a,s;if(n!==r){if(c._lastHoverCtrl=n,a=n.parents().toArray().reverse(),a.push(n),r){for(s=r.parents().toArray().reverse(),s.push(r),i=0;i<s.length&&a[i]===s[i];i++);for(o=s.length-1;o>=i;o--)r=s[o],r.fire("mouseleave",{target:r.getEl()})}for(o=i;o<a.length;o++)n=a[o],n.fire("mouseenter",{target:n.getEl()})}}function i(t){t.preventDefault(),"mousewheel"==t.type?(t.deltaY=-1/40*t.wheelDelta,t.wheelDeltaX&&(t.deltaX=-1/40*t.wheelDeltaX)):(t.deltaX=0,t.deltaY=t.detail),t=e.fire("wheel",t)}var o,s,l,c,u,d;if(u=e._nativeEvents){for(l=e.parents().toArray(),l.unshift(e),o=0,s=l.length;!c&&s>o;o++)c=l[o]._eventsRoot;for(c||(c=l[l.length-1]||e),e._eventsRoot=c,s=o,o=0;s>o;o++)l[o]._eventsRoot=c;var p=c._delegates;p||(p=c._delegates={});for(d in u){if(!u)return!1;"wheel"!==d||h?("mouseenter"===d||"mouseleave"===d?c._hasMouseEnter||(a(c.getEl()).on("mouseleave",n).on("mouseover",r),c._hasMouseEnter=1):p[d]||(a(c.getEl()).on(d,t),p[d]=!0),u[d]=!1):f?a(e.getEl()).on("mousewheel",i):a(e.getEl()).on("DOMMouseScroll",i)}}}var f="onmousewheel"in document,h=!1,p="mce-",m,g=0,v={Statics:{classPrefix:p},isRtl:function(){return m.rtl},classPrefix:p,init:function(e){function n(e){var t;for(e=e.split(" "),t=0;t<e.length;t++)i.classes.add(e[t])}var i=this,o,c;i.settings=e=t.extend({},i.Defaults,e),i._id=e.id||"mceu_"+g++,i._aria={role:e.role},i._elmCache={},i.$=a,i.state=new r({visible:!0,active:!1,disabled:!1,value:""}),i.data=new r(e.data),i.classes=new l(function(){i.state.get("rendered")&&(i.getEl().className=this.toString())}),i.classes.prefix=i.classPrefix,o=e.classes,o&&(i.Defaults&&(c=i.Defaults.classes,c&&o!=c&&n(c)),n(o)),t.each("title text name visible disabled active value".split(" "),function(t){t in e&&i[t](e[t])}),i.on("click",function(){return i.disabled()?!1:void 0}),i.settings=e,i.borderBox=s.parseBox(e.border),i.paddingBox=s.parseBox(e.padding),i.marginBox=s.parseBox(e.margin),e.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){return o.getContainer()},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},initLayoutRect:function(){var e=this,t=e.settings,n,r,i=e.getEl(),a,l,c,u,d,f,h,p;n=e.borderBox=e.borderBox||s.measureBox(i,"border"),e.paddingBox=e.paddingBox||s.measureBox(i,"padding"),e.marginBox=e.marginBox||s.measureBox(i,"margin"),p=o.getSize(i),f=t.minWidth,h=t.minHeight,c=f||p.width,u=h||p.height,a=t.width,l=t.height,d=t.autoResize,d="undefined"!=typeof d?d:!a&&!l,a=a||c,l=l||u;var m=n.left+n.right,g=n.top+n.bottom,v=t.maxWidth||65535,y=t.maxHeight||65535;return e._layoutRect=r={x:t.x||0,y:t.y||0,w:a,h:l,deltaW:m,deltaH:g,contentW:a-m,contentH:l-g,innerW:a-m,innerH:l-g,startMinWidth:f||0,startMinHeight:h||0,minW:Math.min(c,v),minH:Math.min(u,y),maxW:v,maxH:y,autoResize:d,scrollW:0},e._lastLayoutRect={},r},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,l;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=i<n.minW?n.minW:i,i=i>n.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=i<n.minH?n.minH:i,i=i>n.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=i<n.minW-o?n.minW-o:i,i=i>n.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=i<n.minH-a?n.minH-a:i,i=i>n.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,r.x===n.x&&r.y===n.y&&r.w===n.w&&r.h===n.h||(l=m.repaintControls,l&&l.map&&!l.map[t._id]&&(l.push(t),l.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o,a,s,l,c,u;c=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,i=e._layoutRect,l=e._lastRepaintRect||{},o=e.borderBox,a=o.left+o.right,s=o.top+o.bottom,i.x!==l.x&&(t.left=c(i.x)+"px",l.x=i.x),i.y!==l.y&&(t.top=c(i.y)+"px",l.y=i.y),i.w!==l.w&&(u=c(i.w-a),t.width=(u>=0?u:0)+"px",l.w=i.w),i.h!==l.h&&(u=c(i.h-s),t.height=(u>=0?u:0)+"px",l.h=i.h),e._hasBody&&i.innerW!==l.innerW&&(u=c(i.innerW),r=e.getEl("body"),r&&(n=r.style,n.width=(u>=0?u:0)+"px"),l.innerW=i.innerW),e._hasBody&&i.innerH!==l.innerH&&(u=c(i.innerH),r=r||e.getEl("body"),r&&(n=n||r.style,n.height=(u>=0?u:0)+"px"),l.innerH=i.innerH),e._lastRepaintRect=l,e.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,o.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){function n(e){var t,n;return"string"!=typeof e?e:function(i){return t||r.parentsAndSelf().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t?t.call(n,i):(i.action=e,void this.fire("execute",i))}}var r=this;return u(r).on(e,n(t)),r},off:function(e,t){return u(this).off(e,t),this},fire:function(e,t,n){var r=this;if(t=t||{},t.control||(t.control=r),t=u(r).fire(e,t),n!==!1&&r.parent)for(var i=r.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return u(this).has(e)},parents:function(e){var t=this,n,r=new i;for(n=t.parent();n;n=n.parent())r.add(n);return e&&(r=r.filter(e)),r},parentsAndSelf:function(e){return new i(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=a("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return m.translate?m.translate(e):e},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),r,i; if(e.items){var o=e.items().toArray();for(i=o.length;i--;)o[i].remove()}n&&n.items&&(r=[],n.items().each(function(t){t!==e&&r.push(t)}),n.items().set(r),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&a(t).off();var s=e.getRoot().controlIdLookup;return s&&delete s[e._id],t&&t.parentNode&&t.parentNode.removeChild(t),e.state.set("rendered",!1),e.state.destroy(),e.fire("remove"),e},renderBefore:function(e){return a(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return a(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var e=this,t=e.settings,n,r,i,o,s;e.$el=a(e.getEl()),e.state.set("rendered",!0);for(o in t)0===o.indexOf("on")&&e.on(o.substr(2),t[o]);if(e._eventsRoot){for(i=e.parent();!s&&i;i=i.parent())s=i._eventsRoot;if(s)for(o in s._nativeEvents)e._nativeEvents[o]=!0}d(e),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e.settings.border&&(r=e.borderBox,e.$el.css({"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var u in e._aria)e.aria(u,e._aria[u]);e.state.get("visible")===!1&&(e.getEl().style.display="none"),e.bindStates(),e.state.on("change:visible",function(t){var n=t.value,r;e.state.get("rendered")&&(e.getEl().style.display=n===!1?"none":"",e.getEl().getBoundingClientRect()),r=e.parent(),r&&(r._lastRect=null),e.fire(n?"show":"hide"),c.add(e)}),e.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){c.remove(this);var e=this.parent();return e._layout&&!e._layout.isNative()&&e.reflow(),this}};return t.each("text title visible disabled active value".split(" "),function(e){v[e]=function(t){return 0===arguments.length?this.state.get(e):("undefined"!=typeof t&&this.state.set(e,t),this)}}),m=e.extend(v)}),r(be,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(Ce,[],function(){return function(e){function t(e){return e&&1===e.nodeType}function n(e){return e=e||C,t(e)?e.getAttribute("role"):null}function r(e){for(var t,r=e||C;r=r.parentNode;)if(t=n(r))return t}function i(e){var n=C;return t(n)?n.getAttribute("aria-"+e):void 0}function o(e){var t=e.tagName.toUpperCase();return"INPUT"==t||"TEXTAREA"==t||"SELECT"==t}function a(e){return o(e)&&!e.hidden?!0:!!/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(n(e))}function s(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){a(e)&&n.push(e);for(var r=0;r<e.childNodes.length;r++)t(e.childNodes[r])}}var n=[];return t(e||b.getEl()),n}function l(e){var t,n;e=e||x,n=e.parents().toArray(),n.unshift(e);for(var r=0;r<n.length&&(t=n[r],!t.settings.ariaRoot);r++);return t}function c(e){var t=l(e),n=s(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?u(t.lastAriaIndex,n):u(0,n)}function u(e,t){return 0>e?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function d(e,t){var n=-1,r=l();t=t||s(r.getEl());for(var i=0;i<t.length;i++)t[i]===C&&(n=i);n+=e,r.lastAriaIndex=u(n,t)}function f(){var e=r();"tablist"==e?d(-1,s(C.parentNode)):x.parent().submenu?v():d(-1)}function h(){var e=n(),t=r();"tablist"==t?d(1,s(C.parentNode)):"menuitem"==e&&"menu"==t&&i("haspopup")?y():d(1)}function p(){d(-1)}function m(){var e=n(),t=r();"menuitem"==e&&"menubar"==t?y():"button"==e&&i("haspopup")?y({key:"down"}):d(1)}function g(e){var t=r();if("tablist"==t){var n=s(x.getEl("body"))[0];n&&n.focus()}else d(e.shiftKey?-1:1)}function v(){x.fire("cancel")}function y(e){e=e||{},x.fire("click",{target:C,aria:e})}var b=e.root,C,x;try{C=document.activeElement}catch(w){C=document.body}return x=b.getParentCtrl(C),b.on("keydown",function(e){function t(e,t){o(C)||"slider"!==n(C)&&t(e)!==!1&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,f);break;case 39:t(e,h);break;case 38:t(e,p);break;case 40:t(e,m);break;case 27:v();break;case 14:case 13:case 32:t(e,y);break;case 9:g(e)!==!1&&e.preventDefault()}}),b.on("focusin",function(e){C=e.target,x=e.control}),{focusFirst:c}}}),r(xe,[ye,he,fe,be,Ce,m,g,ge,ve],function(e,t,n,r,i,o,a,s,l){var c={};return e.extend({init:function(e){var n=this;n._super(e),e=n.settings,e.fixed&&n.state.set("fixed",!0),n._items=new t,n.isRtl()&&n.classes.add("rtl"),n.bodyClasses=new s(function(){n.state.get("rendered")&&(n.getEl("body").className=this.toString())}),n.bodyClasses.prefix=n.classPrefix,n.classes.add("container"),n.bodyClasses.add("container-body"),e.containerCls&&n.classes.add(e.containerCls),n._layout=r.create((e.layout||"")+"layout"),n.settings.items?n.add(n.settings.items):n.add(n.render()),n._hasBody=!0},items:function(){return this._items},find:function(e){return e=c[e]=c[e]||new n(e),e.find(this)},add:function(e){var t=this;return t.items().add(t.create(e)).parent(t),t},focus:function(e){var t=this,n,r,i;return e&&(r=t.keyboardNav||t.parents().eq(-1)[0].keyboardNav)?void r.focusFirst(t):(i=t.find("*"),t.statusbar&&i.add(t.statusbar.items()),i.each(function(e){return e.settings.autofocus?(n=null,!1):void(e.canFocus&&(n=n||e))}),n&&n.focus(),t)},replace:function(e,t){for(var n,r=this.items(),i=r.length;i--;)if(r[i]===e){r[i]=t;break}i>=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,i,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r;t.parent(e),t.state.get("rendered")||(r=e.getEl("body"),r.hasChildNodes()&&n<=r.childNodes.length-1?a(r.childNodes[n]).before(t.renderHtml()):a(r).append(t.renderHtml()),t.postRender(),l.add(t))}),e._layout.applyClasses(e.items().filter(":visible")),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t<i.length-1&&(t+=1),t>=0&&t<i.length&&(o=i.slice(0,t).toArray(),a=i.slice(t).toArray(),i.set(o.concat(e,a))),r.renderNew()},fromJSON:function(e){var t=this;for(var n in e)t.find("#"+n).value(e[n]);return t},toJSON:function(){var e=this,t={};return e.find("*").each(function(e){var n=e.name(),r=e.value();n&&"undefined"!=typeof r&&(t[n]=r)}),t},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e.state.set("rendered",!0),e.settings.style&&e.$el.css(e.settings.style),e.settings.border&&(t=e.borderBox,e.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(l.remove(this),this.visible()){for(e.repaintControls=[],e.repaintControls.map={},this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(we,[g],function(e){function t(e){var t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}function n(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}return function(r,i){function o(){return s.getElementById(i.handle||r)}var a,s=i.document||document,l,c,u,d,f,h;i=i||{},c=function(r){var c=t(s),p,m;n(r),r.preventDefault(),l=r.button,p=o(),f=r.screenX,h=r.screenY,m=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,a=e("<div>").css({position:"absolute",top:0,left:0,width:c.width,height:c.height,zIndex:2147483647,opacity:1e-4,cursor:m}).appendTo(s.body),e(s).on("mousemove touchmove",d).on("mouseup touchend",u),i.start(r)},d=function(e){return n(e),e.button!==l?u(e):(e.deltaX=e.screenX-f,e.deltaY=e.screenY-h,e.preventDefault(),void i.drag(e))},u=function(t){n(t),e(s).off("mousemove touchmove",d).off("mouseup touchend",u),a.remove(),i.stop&&i.stop(t)},this.destroy=function(){e(o()).off()},e(o()).on("mousedown touchstart",c)}}),r(Ne,[g,we],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,h,p,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),e(i.getEl("absend")).css(y,i.layoutRect()[l]-1),!c)return void e(f).css("display","none");e(f).css("display","block"),d=i.getEl("body"),h=i.getEl("scroll"+t+"t"),p=d["client"+s]-2*o,p-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=p/m,v={},v[y]=d["offset"+a]+o,v[b]=p,e(f).css(v),v={},v[y]=d["scroll"+a]*g,v[b]=p*g,e(h).css(v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;e(i.getEl()).append('<div id="'+u+'" class="'+d+"scrollbar "+d+"scrollbar-"+n+'"><div id="'+u+'t" class="'+d+'scrollbar-thumb"></div></div>'),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e("#"+u).addClass(d+"active")},drag:function(e){var t,u,d,f,h=i.layoutRect();u=h.contentW>h.innerW,d=h.contentH>h.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e("#"+u).removeClass(d+"active")}})}i.classes.add("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e(i.getEl("body")).on("scroll",n)),n())}}}),r(Ee,[xe,Ne],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}})}),r(_e,[pe],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,h;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t.state.get("fixed")&&"static"==e.getRuntimeStyle(document.body,"position")&&(a-=f.x,s-=f.y),i=t.getEl(),h=e.getSize(i),l=h.width,c=h.height,h=e.getSize(n),u=h.width,d=h.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o<r.length;o++){var a=t(this,n,r[o]);if(this.state.get("fixed")){if(a.x>0&&a.x+a.w<i.w&&a.y>0&&a.y+a.h<i.h)return r[o]}else if(a.x>i.x&&a.x+a.w<i.w+i.x&&a.y>i.y&&a.y+a.h<i.h+i.y)return r[o]}return r[0]},moveRel:function(e,n){"string"!=typeof n&&(n=this.testMoveRel(e,n));var r=t(this,e,n);return this.moveTo(r.x,r.y)},moveBy:function(e,t){var n=this,r=n.layoutRect();return n.moveTo(r.x+e,r.y+t),n},moveTo:function(t,n){function r(e,t,n){return 0>e?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i.state.get("rendered")?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(Se,[pe],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(ke,[Ee,_e,Se,pe,g,u],function(e,t,n,r,i,o){function a(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}function s(e){for(var t=v.length;t--;){var n=v[t],r=n.getParentCtrl(e.target);if(n.settings.autohide){if(r&&(a(r,n)||n.parent()===r))continue;e=n.fire("autohide",{target:e.target}),e.isDefaultPrevented()||n.hide()}}}function l(){p||(p=function(e){2!=e.button&&s(e)},i(document).on("click touchstart",p))}function c(){m||(m=function(){var e;for(e=v.length;e--;)d(v[e])},i(window).on("scroll",m))}function u(){if(!g){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;g=function(){document.all&&t==e.clientWidth&&n==e.clientHeight||(t=e.clientWidth,n=e.clientHeight,C.hideAll())},i(window).on("resize",g)}}function d(e){function t(t,n){for(var r,i=0;i<v.length;i++)if(v[i]!=e)for(r=v[i].parent();r&&(r=r.parent());)r==e&&v[i].fixed(t).moveBy(0,n).repaint()}var n=r.getViewPort().y;e.settings.autofix&&(e.state.get("fixed")?e._autoFixY>n&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY<n&&(e.fixed(!0).layoutRect({y:0}).repaint(),t(!0,n-e._autoFixY))))}function f(e,t){var n,r=C.zIndex||65535,o;if(e)y.push(t);else for(n=y.length;n--;)y[n]===t&&y.splice(n,1);if(y.length)for(n=0;n<y.length;n++)y[n].modal&&(r++,o=y[n]),y[n].getEl().style.zIndex=r,y[n].zIndex=r,r++;var a=i("#"+t.classPrefix+"modal-block",t.getContainerElm())[0];o?i(a).css("z-index",o.zIndex-1):a&&(a.parentNode.removeChild(a),b=!1),C.currentZIndex=r}function h(e){var t;for(t=v.length;t--;)v[t]===e&&v.splice(t,1);for(t=y.length;t--;)y[t]===e&&y.splice(t,1)}var p,m,g,v=[],y=[],b,C=e.extend({Mixins:[t,n],init:function(e){var t=this;t._super(e),t._eventsRoot=t,t.classes.add("floatpanel"),e.autohide&&(l(),u(),v.push(t)),e.autofix&&(c(),t.on("move",function(){d(this)})),t.on("postrender show",function(e){if(e.control==t){var n,r=t.classPrefix;t.modal&&!b&&(n=i("#"+r+"modal-block",t.getContainerElm()),n[0]||(n=i('<div id="'+r+'modal-block" class="'+r+"reset "+r+'fade"></div>').appendTo(t.getContainerElm())),o.setTimeout(function(){n.addClass(r+"in"),i(t.getEl()).addClass(r+"in")}),b=!0),f(!0,t)}}),t.on("show",function(){t.parents().each(function(e){return e.state.get("fixed")?(t.fixed(!0),!1):void 0})}),e.popover&&(t._preBodyHtml='<div class="'+t.classPrefix+'arrow"></div>',t.classes.add("popover").add("bottom").add(t.isRtl()?"end":"start")),t.aria("label",e.ariaLabel),t.aria("labelledby",t._id),t.aria("describedby",t.describedBy||t._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!=e){if(t.state.get("rendered")){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e=this,t,n=e._super();for(t=v.length;t--&&v[t]!==e;);return-1===t&&v.push(e),n},hide:function(){return h(this),f(!1,this),this._super()},hideAll:function(){C.hideAll()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||(e.remove(),f(!1,e)),e},remove:function(){h(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return C.hideAll=function(){for(var e=v.length;e--;){var t=v[e];t&&t.settings.autohide&&(t.hide(),v.splice(e,1))}},C}),r(Te,[ke,Ee,pe,g,we,me,d,u],function(e,t,n,r,i,o,a,s){function l(e){var t="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0",n=r("meta[name=viewport]")[0],i;a.overrideViewPort!==!1&&(n||(n=document.createElement("meta"),n.setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),i=n.getAttribute("content"),i&&"undefined"!=typeof f&&(f=i),n.setAttribute("content",e?t:f))}function c(e){for(var t=0;t<d.length;t++)if(d[t]._fullscreen)return;r([document.documentElement,document.body]).removeClass(e+"fullscreen")}function u(){function e(){var e,t=n.getWindowSize(),r;for(e=0;e<d.length;e++)r=d[e].layoutRect(),d[e].moveTo(d[e].settings.x||Math.max(0,t.w/2-r.w/2),d[e].settings.y||Math.max(0,t.h/2-r.h/2))}if(!a.desktop){var t={w:window.innerWidth,h:window.innerHeight};s.setInterval(function(){var e=window.innerWidth,n=window.innerHeight;t.w==e&&t.h==n||(t={w:e,h:n},r(window).trigger("resize"))},100)}r(window).on("resize",e)}var d=[],f="",h=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var r=this;r._super(e),r.isRtl()&&r.classes.add("rtl"),r.classes.add("window"),r.bodyClasses.add("window-body"),r.state.set("fixed",!0),e.buttons&&(r.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:r.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),r.statusbar.classes.add("foot"),r.statusbar.parent(r)),r.on("click",function(e){var t=r.classPrefix+"close";(n.hasClass(e.target,t)||n.hasClass(e.target.parentNode,t))&&r.close()}),r.on("cancel",function(){r.close()}),r.aria("describedby",r.describedBy||r._id+"-none"),r.aria("label",e.title),r._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=e.settings.x||Math.max(0,a.w/2-t.w/2),t.y=e.settings.y||Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='<div id="'+n+'-head" class="'+r+'window-head"><div id="'+n+'-title" class="'+r+'title">'+e.encode(i.title)+'</div><div id="'+n+'-dragh" class="'+r+'dragh"></div><button type="button" class="'+r+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),i.url&&(s='<iframe src="'+i.url+'" tabindex="-1"></iframe>'),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.bodyClasses+'">'+s+"</div>"+a+"</div></div>"},fullscreen:function(e){var t=this,i=document.documentElement,a,l=t.classPrefix,c;if(e!=t._fullscreen)if(r(window).on("resize",function(){var e;if(t._fullscreen)if(a)t._timer||(t._timer=s.setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(a=!0)}}),c=t.layoutRect(),t._fullscreen=e,e){t._initial={x:c.x,y:c.y,w:c.w,h:c.h},t.borderBox=o.parseBox("0"),t.getEl("head").style.display="none",c.deltaH-=c.headerH+2,r([i,document.body]).addClass(l+"fullscreen"),t.classes.add("fullscreen");var u=n.getWindowSize();t.moveTo(0,0).resizeTo(u.w,u.h)}else t.borderBox=o.parseBox(t.settings.border),t.getEl("head").style.display="",c.deltaH+=c.headerH,r([i,document.body]).removeClass(l+"fullscreen"),t.classes.remove("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.classes.add("in"),e.fire("open")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()}),d.push(e),l(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t;for(e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),t=d.length;t--;)d[t]===e&&d.splice(t,1);l(d.length>0),c(e.classPrefix)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});return u(),h}),r(Re,[Te],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){function r(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),o(t)}}}var i,o=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:i=[r("Ok",!0,!0),r("Cancel",!1)];break;case t.YES_NO:case t.YES_NO_CANCEL:i=[r("Yes",1,!0),r("No",0)],n.buttons==t.YES_NO_CANCEL&&i.push(r("Cancel",-1));break;default:i=[r("Ok",!0,!0)]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:i,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){o(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(Ae,[Te,Re],function(e,t){return function(n){function r(){return s.length?s[s.length-1]:void 0}function i(e){n.fire("OpenWindow",{win:e})}function o(e){n.fire("CloseWindow",{win:e})}var a=this,s=[];a.windows=s,n.on("remove",function(){for(var e=s.length;e--;)s[e].close()}),a.open=function(t,r){var a;return n.editorManager.setActive(n),t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body,data:t.data,callbacks:t.commands}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){a.find("form")[0].submit()}},{text:"Cancel",onclick:function(){a.close()}}]),a=new e(t),s.push(a),a.on("close",function(){for(var e=s.length;e--;)s[e]===a&&s.splice(e,1);s.length||n.focus(),o(a)}),t.data&&a.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),a.features=t||{},a.params=r||{},1===s.length&&n.nodeChanged(),a=a.renderTo().reflow(),i(a),a},a.alert=function(e,r,a){var s;s=t.alert(e,function(){r?r.call(a||this):n.focus()}),s.on("close",function(){o(s)}),i(s)},a.confirm=function(e,n,r){var a;a=t.confirm(e,function(e){n.call(r||this,e)}),a.on("close",function(){o(a)}),i(a)},a.close=function(){r()&&r().close()},a.getParams=function(){return r()?r().params:null},a.setParams=function(e){r()&&(r().params=e)},a.getWindows=function(){return s}}}),r(Be,[ye,_e],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'" role="presentation"><div class="'+t+'tooltip-arrow"></div><div class="'+t+'tooltip-inner">'+e.encode(e.state.get("text"))+"</div></div>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)}),e._super()},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(De,[ye,Be],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.classes.toggle("tooltip-n","bc-tc"==i),r.classes.toggle("tooltip-nw","bc-tl"==i),r.classes.toggle("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){function e(e){n.aria("disabled",e),n.classes.toggle("disabled",e)}function t(e){n.aria("pressed",e),n.classes.toggle("active",e)}var n=this;return n.state.on("change:disabled",function(t){e(t.value)}),n.state.on("change:active",function(e){t(e.value)}),n.state.get("disabled")&&e(!0),n.state.get("active")&&t(!0),n._super()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(Le,[De],function(e){return e.extend({Defaults:{value:0},init:function(e){var t=this;t._super(e),t.classes.add("progress"),t.settings.filter||(t.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this,t=e._id,n=this.classPrefix;return'<div id="'+t+'" class="'+e.classes+'"><div class="'+n+'bar-container"><div class="'+n+'bar"></div></div><div class="'+n+'text">0%</div></div>'},postRender:function(){var e=this;return e._super(),e.value(e.settings.value),e},bindStates:function(){function e(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}var t=this;return t.state.on("change:value",function(t){e(t.value)}),e(t.state.get("value")),t._super()}})}),r(Me,[ye,_e,Le,u],function(e,t,n,r){return e.extend({Mixins:[t],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||e.timeout>0)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new n),t.on("click",function(e){-1!=e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e=this,t=e.classPrefix,n="",r="",i="",o="";return e.icon&&(n='<i class="'+t+"ico "+t+"i-"+e.icon+'"></i>'),e.color&&(o=' style="background-color: '+e.color+'"'),e.closeButton&&(r='<button type="button" class="'+t+'close" aria-hidden="true">\xd7</button>'),e.progressBar&&(i=e.progressBar.renderHtml()),'<div id="'+e._id+'" class="'+e.classes+'"'+o+' role="presentation">'+n+'<div class="'+t+'notification-inner">'+e.state.get("text")+"</div>"+i+r+"</div>"},postRender:function(){var e=this;return r.setTimeout(function(){e.$el.addClass(e.classPrefix+"in")}),e._super()},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().childNodes[1].innerHTML=t.value}),e.progressBar&&e.progressBar.bindStates(),e._super()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||e.remove(),e},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(Pe,[Me,u],function(e,t){return function(n){function r(){return l.length?l[l.length-1]:void 0}function i(){t.requestAnimationFrame(function(){o(),a()})}function o(){for(var e=0;e<l.length;e++)l[e].moveTo(0,0)}function a(){if(l.length>0){var e=l.slice(0,1)[0],t=n.inline?n.getElement():n.getContentAreaContainer();if(e.moveRel(t,"tc-tc"),l.length>1)for(var r=1;r<l.length;r++)l[r].moveRel(l[r-1].getEl(),"bc-tc")}}var s=this,l=[];s.notifications=l,n.on("remove",function(){for(var e=l.length;e--;)l[e].close()}),n.on("ResizeEditor",a),n.on("ResizeWindow",i),s.open=function(t){var r;return n.editorManager.setActive(n),r=new e(t),l.push(r),t.timeout>0&&(r.timer=setTimeout(function(){r.close()},t.timeout)),r.on("close",function(){var e=l.length;for(r.timer&&n.getWin().clearTimeout(r.timer);e--;)l[e]===r&&l.splice(e,1);a()}),r.renderTo(),a(),r},s.close=function(){r()&&r().close()},s.getNotifications=function(){return l},n.on("SkinLoaded",function(){var e=n.settings.service_message;e&&n.notificationManager.open({text:e,type:"warning",timeout:0,icon:""})})}}),r(Oe,[w],function(e){function t(t,n,r){for(var i=[];n&&n!=t;n=n.parentNode)i.push(e.nodeIndex(n,r));return i}function n(e,t){var n,r,i;for(r=e,n=t.length-1;n>=0;n--){if(i=r.childNodes,t[n]>i.length-1)return null;r=i[t[n]]}return r}return{create:t,resolve:n}}),r(He,[I,T,y,Oe,A,C,d,m,u,k,$,ne],function(e,t,n,r,i,o,a,s,l,c,u,d){return function(f){function h(e,t){try{f.getDoc().execCommand(e,!1,t)}catch(n){}}function p(){var e=f.getDoc().documentMode;return e?e:6}function m(e){return e.isDefaultPrevented()}function g(e){var t,n;e.dataTransfer&&(f.selection.isCollapsed()&&"IMG"==e.target.tagName&&re.select(e.target),t=f.selection.getContent(),t.length>0&&(n=ue+escape(f.id)+","+escape(t),e.dataTransfer.setData(de,n)))}function v(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(de),t&&t.indexOf(ue)>=0)?(t=t.substr(ue.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}function y(e){f.queryCommandSupported("mceInsertClipboardContent")?f.execCommand("mceInsertClipboardContent",!1,{content:e}):f.execCommand("mceInsertContent",!1,e)}function b(){function i(e){var t=C.schema.getBlockElements(),n=f.getBody();if("BR"!=e.nodeName)return!1;for(;e!=n&&!t[e.nodeName];e=e.parentNode)if(e.nextSibling)return!1;return!0}function o(e,t){var n;for(n=e.nextSibling;n&&n!=t;n=n.nextSibling)if((3!=n.nodeType||0!==Z.trim(n.data).length)&&n!==t)return!1;return n===t}function a(e,t,r){var o,a,s;for(s=C.schema.getNonEmptyElements(),o=new n(r||e,e);a=o[t?"next":"prev"]();){if(s[a.nodeName]&&!i(a))return a;if(3==a.nodeType&&a.data.length>0)return a}}function c(e){var n,r,i,o,s;if(!e.collapsed&&(n=C.getParent(t.getNode(e.startContainer,e.startOffset),C.isBlock), r=C.getParent(t.getNode(e.endContainer,e.endOffset),C.isBlock),s=f.schema.getTextBlockElements(),n!=r&&s[n.nodeName]&&s[r.nodeName]&&"false"!==C.getContentEditable(n)&&"false"!==C.getContentEditable(r)))return e.deleteContents(),i=a(n,!1),o=a(r,!0),C.isEmpty(r)||Z(n).append(r.childNodes),Z(r).remove(),i?1==i.nodeType?"BR"==i.nodeName?(e.setStartBefore(i),e.setEndBefore(i)):(e.setStartAfter(i),e.setEndAfter(i)):(e.setStart(i,i.data.length),e.setEnd(i,i.data.length)):o&&(1==o.nodeType?(e.setStartBefore(o),e.setEndBefore(o)):(e.setStart(o,0),e.setEnd(o,0))),x.setRng(e),!0}function u(e,n){var r,i,s,l,c,u;if(!e.collapsed)return e;if(c=e.startContainer,u=e.startOffset,3==c.nodeType)if(n){if(u<c.data.length)return e}else if(u>0)return e;if(r=t.getNode(e.startContainer,e.startOffset),s=C.getParent(r,C.isBlock),i=a(f.getBody(),n,r),l=C.getParent(i,C.isBlock),!r||!i)return e;if(l&&s!=l)if(n){if(!o(s,l))return e;1==r.nodeType?"BR"==r.nodeName?e.setStartBefore(r):e.setStartAfter(r):e.setStart(r,r.data.length),1==i.nodeType?e.setEnd(i,0):e.setEndBefore(i)}else{if(!o(l,s))return e;1==i.nodeType?"BR"==i.nodeName?e.setStartBefore(i):e.setStartAfter(i):e.setStart(i,i.data.length),1==r.nodeType?e.setEnd(r,0):e.setEndBefore(r)}return e}function d(e){var t=x.getRng();return t=u(t,e),c(t)?!0:void 0}function h(e,t){function n(e,n){return m=Z(n).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),l=e.cloneNode(!1),m=s.map(m,function(e){return e=e.cloneNode(!1),l.hasChildNodes()?(e.appendChild(l.firstChild),l.appendChild(e)):l.appendChild(e),l.appendChild(e),e}),m.length?(p=C.create("br"),m[0].appendChild(p),C.replace(l,e),t.setStartBefore(p),t.setEndBefore(p),f.selection.setRng(t),p):null}function i(e){return e&&f.schema.getTextBlockElements()[e.tagName]}var o,a,l,c,u,d,h,p,m;if(t.collapsed&&(d=t.startContainer,h=t.startOffset,a=C.getParent(d,C.isBlock),i(a)))if(1==d.nodeType){if(d=d.childNodes[h],d&&"BR"!=d.tagName)return;if(u=e?a.nextSibling:a.previousSibling,C.isEmpty(a)&&i(u)&&C.isEmpty(u)&&n(a,d))return C.remove(u),!0}else if(3==d.nodeType){if(o=r.create(a,d),c=a.cloneNode(!0),d=r.resolve(c,o),e){if(h>=d.data.length)return;d.deleteData(h,1)}else{if(0>=h)return;d.deleteData(h-1,1)}if(C.isEmpty(c))return n(a,d)}}function p(e){var t,n,r;d(e)||(s.each(f.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&f.dom.setAttrib(e,"style",f.dom.getAttrib(e,"style"))}),t=new w(function(){}),t.observe(f.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),f.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),n=f.selection.getRng(),r=n.startContainer.parentNode,s.each(t.takeRecords(),function(e){if(C.isChildOf(e.target,f.getBody())){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}s.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),C.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),f.selection.setRng(n))}})}}),t.disconnect(),s.each(f.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")}))}var b=f.getDoc(),C=f.dom,x=f.selection,w=window.MutationObserver,N,E;w||(N=!0,w=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMSubtreeModified",e,!1),r.removeEventListener("DOMNodeInsertedIntoDocument",e,!1),r.removeEventListener("DOMNodeInserted",e,!1),r.removeEventListener("DOMAttrModified",t,!1)},this.takeRecords=function(){return n}}),f.on("keydown",function(e){var t=e.keyCode==te,n=e.ctrlKey||e.metaKey;if(!m(e)&&(t||e.keyCode==ee)){var r=f.selection.getRng(),i=r.startContainer,o=r.startOffset;if(t&&e.shiftKey)return;if(h(t,r))return void e.preventDefault();if(!n&&r.collapsed&&3==i.nodeType&&(t?o<i.data.length:o>0))return;e.preventDefault(),n&&f.selection.getSel().modify("extend",t?"forward":"backward",e.metaKey?"lineboundary":"word"),p(t)}}),f.on("keypress",function(t){if(!m(t)&&!x.isCollapsed()&&t.charCode>31&&!e.metaKeyPressed(t)){var n,r,i,o,a,s;n=f.selection.getRng(),s=String.fromCharCode(t.charCode),t.preventDefault(),r=Z(n.startContainer).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),p(!0),r=r.filter(function(e,t){return!Z.contains(f.getBody(),t)}),r.length?(i=C.createFragment(),r.each(function(e,t){t=t.cloneNode(!1),i.hasChildNodes()?(t.appendChild(i.firstChild),i.appendChild(t)):(a=t,i.appendChild(t)),i.appendChild(t)}),a.appendChild(f.getDoc().createTextNode(s)),o=C.getParent(n.startContainer,C.isBlock),C.isEmpty(o)?Z(o).empty().append(i):n.insertNode(i),n.setStart(a.firstChild,1),n.setEnd(a.firstChild,1),f.selection.setRng(n)):f.selection.setContent(s)}}),f.addCommand("Delete",function(){p()}),f.addCommand("ForwardDelete",function(){p(!0)}),N||(f.on("dragstart",function(e){E=x.getRng(),g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);n&&(e.preventDefault(),l.setEditorTimeout(f,function(){var r=t.getCaretRangeFromPoint(e.x,e.y,b);E&&(x.setRng(E),E=null),p(),x.setRng(r),y(n.html)}))}}),f.on("cut",function(e){m(e)||!e.clipboardData||f.selection.isCollapsed()||(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",f.selection.getContent()),e.clipboardData.setData("text/plain",f.selection.getContent({format:"text"})),l.setEditorTimeout(f,function(){p(!0)}))}))}function C(){function e(e){var t=ne.create("body"),n=e.cloneContents();return t.appendChild(n),re.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(f.getBody()),t.compareRanges(n,r)}var i=e(n),o=ne.createRng();o.selectNode(f.getBody());var a=e(o);return i===a}f.on("keydown",function(e){var t=e.keyCode,r,i;if(!m(e)&&(t==te||t==ee)){if(r=f.selection.isCollapsed(),i=f.getBody(),r&&!ne.isEmpty(i))return;if(!r&&!n(f.selection.getRng()))return;e.preventDefault(),f.setContent(""),i.firstChild&&ne.isBlock(i.firstChild)?f.selection.setCursorLocation(i.firstChild,0):f.selection.setCursorLocation(i,0),f.nodeChanged()}})}function x(){f.shortcuts.add("meta+a",null,"SelectAll")}function w(){f.settings.content_editable||ne.bind(f.getDoc(),"mousedown mouseup",function(e){var t;if(e.target==f.getDoc().documentElement)if(t=re.getRng(),f.getBody().focus(),"mousedown"==e.type){if(c.isCaretContainer(t.startContainer))return;re.placeCaretAt(e.clientX,e.clientY)}else re.setRng(t)})}function N(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee){if(!f.getBody().getElementsByTagName("hr").length)return;if(re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return ne.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(ne.remove(n),e.preventDefault())}}})}function E(){window.Range.prototype.getClientRects||f.on("mousedown",function(e){if(!m(e)&&"HTML"===e.target.nodeName){var t=f.getBody();t.blur(),l.setEditorTimeout(f,function(){t.focus()})}})}function _(){f.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==ne.getContentEditableParent(t)&&(e.preventDefault(),re.getSel().setBaseAndExtent(t,0,t,1),f.nodeChanged()),"A"==t.nodeName&&ne.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),re.select(t))})}function S(){function e(){var e=ne.getAttribs(re.getStart().cloneNode(!1));return function(){var t=re.getStart();t!==f.getBody()&&(ne.setAttrib(t,"style",null),Q(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!re.isCollapsed()&&ne.getParent(re.getStart(),ne.isBlock)!=ne.getParent(re.getEnd(),ne.isBlock)}f.on("keypress",function(n){var r;return m(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),f.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),ne.bind(f.getDoc(),"cut",function(n){var r;!m(n)&&t()&&(r=e(),l.setEditorTimeout(f,function(){r()}))})}function k(){document.body.setAttribute("role","application")}function T(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee&&re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function R(){p()>7||(h("RespectVisibilityInDesign",!0),f.contentStyles.push(".mceHideBrInPre pre br {display: none}"),ne.addClass(f.getBody(),"mceHideBrInPre"),oe.addNodeFilter("pre",function(e){for(var t=e.length,n,r,o,a;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)o=n[r],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new i("#text",3),o,!0).value="\n"}),ae.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function A(){ne.bind(f.getBody(),"mouseup",function(){var e,t=re.getNode();"IMG"==t.nodeName&&((e=ne.getStyle(t,"width"))&&(ne.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"width","")),(e=ne.getStyle(t,"height"))&&(ne.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"height","")))})}function B(){f.on("keydown",function(t){var n,r,i,o,a;if(!m(t)&&t.keyCode==e.BACKSPACE&&(n=re.getRng(),r=n.startContainer,i=n.startOffset,o=ne.getRoot(),a=r,n.collapsed&&0===i)){for(;a&&a.parentNode&&a.parentNode.firstChild==a&&a.parentNode!=o;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(f.formatter.toggle("blockquote",null,a),n=ne.createRng(),n.setStart(r,0),n.setEnd(r,0),re.setRng(n))}})}function D(){function e(){K(),h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),ie.object_resizing||h("enableObjectResizing",!1)}ie.readonly||f.on("BeforeExecCommand MouseDown",e)}function L(){function e(){Q(ne.select("a"),function(e){var t=e.parentNode,n=ne.getRoot();if(t.lastChild===e){for(;t&&!ne.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}ne.add(t,"br",{"data-mce-bogus":1})}})}f.on("SetContent ExecCommand",function(t){"setcontent"!=t.type&&"mceInsertLink"!==t.command||e()})}function M(){ie.forced_root_block&&f.on("init",function(){h("DefaultParagraphSeparator",ie.forced_root_block)})}function P(){f.on("keydown",function(e){var t;m(e)||e.keyCode!=ee||(t=f.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),f.undoManager.beforeChange(),ne.remove(t.item(0)),f.undoManager.add()))})}function O(){var e;p()>=10&&(e="",Q("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),f.contentStyles.push(e+"{padding-right: 1px !important}"))}function H(){p()<9&&(oe.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),ae.addNodeFilter("noscript",function(e){for(var t=e.length,n,r,a;t--;)n=e[t],r=e[t].firstChild,r?r.value=o.decode(r.value):(a=n.attributes.map["data-mce-innertext"],a&&(n.attr("data-mce-innertext",null),r=new i("#text",3),r.value=a,r.raw=!0,n.append(r)))}))}function I(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),ne.unbind(r,"mouseup",n),ne.unbind(r,"mousemove",t),a=o=0}var r=ne.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,ne.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(ne.bind(r,"mouseup",n),ne.bind(r,"mousemove",t),ne.getRoot().focus(),a.select())}})}function F(){f.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||re.normalize()},!0)}function z(){f.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function U(){f.inline||f.on("keydown",function(){document.activeElement==document.body&&f.getWin().focus()})}function W(){f.inline||(f.contentStyles.push("body {min-height: 150px}"),f.on("click",function(e){var t;if("HTML"==e.target.nodeName){if(a.ie>11)return void f.getBody().focus();t=f.selection.getRng(),f.getBody().focus(),f.selection.setRng(t),f.selection.normalize(),f.nodeChanged()}}))}function V(){a.mac&&f.on("keydown",function(t){!e.metaKeyPressed(t)||t.shiftKey||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),f.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","lineboundary"))})}function $(){h("AutoUrlDetect",!1)}function q(){f.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),f.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function j(){f.on("init",function(){f.dom.bind(f.getBody(),"submit",function(e){e.preventDefault()})})}function Y(){oe.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}function X(){f.on("dragstart",function(e){g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);if(n&&n.id!=f.id){e.preventDefault();var r=t.getCaretRangeFromPoint(e.x,e.y,f.getDoc());re.setRng(r),y(n.html)}}})}function K(){var e,t;G()&&(e=f.getBody(),t=e.parentNode,t.removeChild(e),t.appendChild(e),e.focus())}function G(){var e;return se?(e=f.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}function J(){function t(e){var t=new d(e.getBody()),n=e.selection.getRng(),r=u.fromRangeStart(n),i=u.fromRangeEnd(n);return!e.selection.isCollapsed()&&!t.prev(r)&&!t.next(i)}f.on("keypress",function(n){!m(n)&&!re.isCollapsed()&&n.charCode>31&&!e.metaKeyPressed(n)&&t(f)&&(n.preventDefault(),f.setContent(String.fromCharCode(n.charCode)),f.selection.select(f.getBody(),!0),f.selection.collapse(!1),f.nodeChanged())}),f.on("keydown",function(e){var n=e.keyCode;m(e)||n!=te&&n!=ee||t(f)&&(e.preventDefault(),f.setContent(""),f.nodeChanged())})}var Q=s.each,Z=f.$,ee=e.BACKSPACE,te=e.DELETE,ne=f.dom,re=f.selection,ie=f.settings,oe=f.parser,ae=f.serializer,se=a.gecko,le=a.ie,ce=a.webkit,ue="data:text/mce-internal,",de=le?"Text":"URL";return B(),C(),a.windowsPhone||F(),ce&&(J(),b(),w(),_(),M(),j(),T(),Y(),a.iOS?(U(),W(),q()):x()),le&&a.ie<11&&(N(),k(),R(),A(),P(),O(),H(),I()),a.ie>=11&&(W(),T()),a.ie&&(x(),$(),X()),se&&(J(),N(),E(),S(),D(),L(),z(),V(),T()),{refreshContentEditable:K,isHidden:G}}}),r(Ie,[ue,w,m],function(e,t,n){function r(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=o.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()}function i(e,t){function n(e){return!e.hidden&&!e.readonly}var i=r(e,t),s;if(e.delegates||(e.delegates={}),!e.delegates[t])if(e.settings.event_root){if(a||(a={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&a){for(t in a)e.dom.unbind(r(e,t));a=null}})),a[t])return;s=function(r){for(var i=r.target,a=e.editorManager.editors,s=a.length;s--;){var l=a[s].getBody();(l===i||o.isChildOf(i,l))&&n(a[s])&&a[s].fire(t,r)}},a[t]=s,o.bind(i,t,s)}else s=function(r){n(e)&&e.fire(t,r)},o.bind(i,t,s),e.delegates[t]=s}var o=t.DOM,a,s={bindPendingEventDelegates:function(){var e=this;n.each(e._pendingNativeEvents,function(t){i(e,t)})},toggleNativeEvent:function(e,t){var n=this;"focus"!=e&&"blur"!=e&&(t?n.initialized?i(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(r(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e=this,t;if(e.delegates){for(t in e.delegates)e.dom.unbind(r(e,t),t,e.delegates[t]);delete e.delegates}e.inline||(e.getBody().onload=null,e.dom.unbind(e.getWin()),e.dom.unbind(e.getDoc())),e.dom.unbind(e.getBody()),e.dom.unbind(e.getContainer())}};return s=n.extend({},e,s)}),r(Fe,[],function(){function e(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}}function t(e){var t,n;return t=e.getBody(),n=function(t){e.dom.getParents(t.target,"a").length>0&&t.preventDefault()},e.dom.bind(t,"click",n),{unbind:function(){e.dom.unbind(t,"click",n)}}}function n(n,r){n._clickBlocker&&(n._clickBlocker.unbind(),n._clickBlocker=null),r?(n._clickBlocker=t(n),n.selection.controlSelection.hideResizeRect(),n.readonly=!0,n.getBody().contentEditable=!1):(n.readonly=!1,n.getBody().contentEditable=!0,e(n,"StyleWithCSS",!1),e(n,"enableInlineTableEditing",!1),e(n,"enableObjectResizing",!1),n.focus(),n.nodeChanged())}function r(e,t){var r=e.readonly?"readonly":"design";t!=r&&(e.initialized?n(e,"readonly"==t):e.on("init",function(){n(e,"readonly"==t)}),e.fire("SwitchMode",{mode:t}))}return{setMode:r}}),r(ze,[m,d],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122},o=e.makeMap("alt,ctrl,shift,meta,access");return function(a){function s(e){var a,s,l={};n(r(e,"+"),function(e){e in o?l[e]=!0:/^[0-9]{2,}$/.test(e)?l.keyCode=parseInt(e,10):(l.charCode=e.charCodeAt(0),l.keyCode=i[e]||e.toUpperCase().charCodeAt(0))}),a=[l.keyCode];for(s in o)l[s]?a.push(s):l[s]=!1;return l.id=a.join(","),l.access&&(l.alt=!0,t.mac?l.ctrl=!0:l.shift=!0),l.meta&&(t.mac?l.meta=!0:(l.ctrl=!0,l.meta=!1)),l}function l(t,n,i,o){var l;return l=e.map(r(t,">"),s),l[l.length-1]=e.extend(l[l.length-1],{func:i,scope:o||a}),e.extend(l[0],{desc:a.translate(n),subpatterns:l.slice(1)})}function c(e){return e.altKey||e.ctrlKey||e.metaKey}function u(e){return e.keyCode>=112&&e.keyCode<=123}function d(e,t){return t?t.ctrl!=e.ctrlKey||t.meta!=e.metaKey?!1:t.alt!=e.altKey||t.shift!=e.shiftKey?!1:e.keyCode==t.keyCode||e.charCode&&e.charCode==t.charCode?(e.preventDefault(),!0):!1:!1}function f(e){return e.func?e.func.call(e.scope):null}var h=this,p={},m=[];a.on("keyup keypress keydown",function(e){!c(e)&&!u(e)||e.isDefaultPrevented()||(n(p,function(t){return d(e,t)?(m=t.subpatterns.slice(0),"keydown"==e.type&&f(t),!0):void 0}),d(e,m[0])&&(1===m.length&&"keydown"==e.type&&f(m[0]),m.shift()))}),h.add=function(t,i,o,s){var c;return c=o,"string"==typeof o?o=function(){a.execCommand(c,!1,null)}:e.isArray(c)&&(o=function(){a.execCommand(c[0],c[1],c[2])}),n(r(e.trim(t.toLowerCase())),function(e){var t=l(e,i,o,s);p[t.id]=t}),!0},h.remove=function(e){var t=l(e);return p[t.id]?(delete p[t.id],!0):!1}}}),r(Ue,[c,m,z],function(e,t,n){return function(r,i){function o(e){var t,n;return n={"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"},t=n[e.blob().type.toLowerCase()]||"dat",e.id()+"."+t}function a(e,t){return e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t}function s(e){return{id:e.id,blob:e.blob,base64:e.base64,filename:n.constant(o(e))}}function l(e,t,n,r){var s,l;s=new XMLHttpRequest,s.open("POST",i.url),s.withCredentials=i.credentials,s.upload.onprogress=function(e){r(e.loaded/e.total*100)},s.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+s.status)},s.onload=function(){var e;return 200!=s.status?void n("HTTP Error: "+s.status):(e=JSON.parse(s.responseText),e&&"string"==typeof e.location?void t(a(i.basePath,e.location)):void n("Invalid JSON: "+s.responseText))},l=new FormData,l.append("file",e.blob(),o(e)),s.send(l)}function c(){return new e(function(e){e([])})}function u(e,t){return{url:t,blobInfo:e,status:!0}}function d(e,t){return{url:"",blobInfo:e,status:!1,error:t}}function f(e,n){t.each(y[e],function(e){e(n)}),delete y[e]}function h(t,n,i){return r.markPending(t.blobUri()),new e(function(e){var o,a,l=function(){};try{var c=function(){o&&(o.close(),a=l)},h=function(n){c(),r.markUploaded(t.blobUri(),n),f(t.blobUri(),u(t,n)),e(u(t,n))},p=function(){c(),r.removeFailed(t.blobUri()),f(t.blobUri(),d(t,p)),e(d(t,p))};a=function(e){0>e||e>100||(o||(o=i()),o.progressBar.value(e))},n(s(t),h,p,a)}catch(m){e(d(t,m.message))}})}function p(e){return e===l}function m(t){var n=t.blobUri();return new e(function(e){y[n]=y[n]||[],y[n].push(e)})}function g(n,o){return n=t.grep(n,function(e){return!r.isUploaded(e.blobUri())}),e.all(t.map(n,function(e){return r.isPending(e.blobUri())?m(e):h(e,i.handler,o)}))}function v(e,t){return!i.url&&p(i.handler)?c():g(e,t)}var y={};return i=t.extend({credentials:!1,handler:l},i),{upload:v}}}),r(We,[c],function(e){function t(t){return new e(function(e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="blob",n.onload=function(){200==this.status&&e(this.response)},n.send()})}function n(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}}function r(t){return new e(function(e){var r,i,o;t=n(t);try{r=atob(t.data)}catch(a){return void e(new Blob([]))}for(i=new Uint8Array(r.length),o=0;o<i.length;o++)i[o]=r.charCodeAt(o);e(new Blob([i],{type:t.type}))})}function i(e){return 0===e.indexOf("blob:")?t(e):0===e.indexOf("data:")?r(e):null}function o(t){return new e(function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)})}return{uriToBlob:i,blobToDataUri:o,parseDataUri:n}}),r(Ve,[c,p,z,We,d],function(e,t,n,r,i){var o=0;return function(a,s){function l(l,u){function d(e,t){var n,i;return 0===e.src.indexOf("blob:")?(i=s.getByUri(e.src),void(i&&t({image:e,blobInfo:i}))):(n=r.parseDataUri(e.src).data,i=s.findFirst(function(e){return e.base64()===n}),void(i?t({image:e,blobInfo:i}):r.uriToBlob(e.src).then(function(r){var i="blobid"+o++,a=s.create(i,r,n);s.add(a),t({image:e,blobInfo:a})})))}var f,h;return u||(u=n.constant(!0)),f=t.filter(l.getElementsByTagName("img"),function(e){var t=e.src;return i.fileApi?e.hasAttribute("data-mce-bogus")?!1:e.hasAttribute("data-mce-placeholder")?!1:t&&t!=i.transparentSrc?0===t.indexOf("blob:")?!a.isUploaded(t):0===t.indexOf("data:")?u(e):!1:!1:!1}),h=t.map(f,function(t){var n;return c[t.src]?new e(function(e){c[t.src].then(function(n){e({image:t,blobInfo:n.blobInfo})})}):(n=new e(function(e){d(t,e)}).then(function(e){return delete c[e.image.src],e})["catch"](function(e){return delete c[t.src],e}),c[t.src]=n,n)}),e.all(h)}var c={};return{findAll:l}}}),r($e,[p,z],function(e,t){return function(){function n(e,t,n){return{id:u(e),blob:u(t),base64:u(n),blobUri:u(URL.createObjectURL(t))}}function r(e){i(e.id())||c.push(e)}function i(e){return o(function(t){return t.id()===e})}function o(t){return e.filter(c,t)[0]}function a(e){return o(function(t){return t.blobUri()==e})}function s(t){c=e.filter(c,function(e){return e.blobUri()===t?(URL.revokeObjectURL(e.blobUri()),!1):!0})}function l(){e.each(c,function(e){URL.revokeObjectURL(e.blobUri())}),c=[]}var c=[],u=t.constant;return{create:n,add:r,get:i,getByUri:a,findFirst:o,removeByUri:s,destroy:l}}}),r(qe,[],function(){return function(){function e(e,t){return{status:e,resultUri:t}}function t(e){return e in d}function n(e){var t=d[e];return t?t.resultUri:null}function r(e){return t(e)?d[e].status===c:!1}function i(e){return t(e)?d[e].status===u:!1}function o(t){d[t]=e(c,null)}function a(t,n){d[t]=e(u,n)}function s(e){delete d[e]}function l(){d={}}var c=1,u=2,d={};return{hasBlobUri:t,getResultUri:n,isPending:r,isUploaded:i,markPending:o,markUploaded:a,removeFailed:s,destroy:l}}}),r(je,[p,Ue,Ve,$e,qe],function(e,t,n,r,i){return function(o){function a(e){return function(t){return o.selection?e(t):[]}}function s(e,t,n){var r=0;do r=e.indexOf(t,r),-1!==r&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1);while(-1!==r);return e}function l(e,t,n){return e=s(e,'src="'+t+'"','src="'+n+'"'),e=s(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')}function c(t,n){e.each(o.undoManager.data,function(e){e.content=l(e.content,t,n)})}function u(){return o.notificationManager.open({text:o.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}function d(e,t){y.removeByUri(e.src),c(e.src,t),o.$(e).attr({src:t,"data-mce-src":o.convertURL(t,"src")})}function f(n){return b||(b=new t(w,{url:x.images_upload_url,basePath:x.images_upload_base_path,credentials:x.images_upload_credentials,handler:x.images_upload_handler})),m().then(a(function(t){var r;return r=e.map(t,function(e){return e.blobInfo}),b.upload(r,u).then(a(function(r){return r=e.map(r,function(e,n){var r=t[n].image;return e.status&&o.settings.images_replace_blob_uris!==!1&&d(r,e.url),{element:r,status:e.status}}),n&&n(r),r}))}))}function h(e){return x.automatic_uploads!==!1?f(e):void 0}function p(e){return x.images_dataimg_filter?x.images_dataimg_filter(e):!0}function m(){return C||(C=new n(w,y)),C.findAll(o.getBody(),p).then(a(function(t){return e.each(t,function(e){c(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),t}))}function g(){y.destroy(),w.destroy(),C=b=null}function v(t){return t.replace(/src="(blob:[^"]+)"/g,function(t,n){var r=w.getResultUri(n);if(r)return'src="'+r+'"';var i=y.getByUri(n);return i||(i=e.reduce(o.editorManager.editors,function(e,t){return e||t.editorUpload.blobCache.getByUri(n)},null)),i?'src="data:'+i.blob().type+";base64,"+i.base64()+'"':t})}var y=new r,b,C,x=o.settings,w=new i;return o.on("setContent",function(){o.settings.automatic_uploads!==!1?h():m()}),o.on("RawSaveContent",function(e){e.content=v(e.content)}),o.on("getContent",function(e){e.source_view||"raw"==e.format||(e.content=v(e.content))}),o.on("PostRender",function(){o.parser.addNodeFilter("img",function(t){e.each(t,function(e){var t=e.attr("src");if(!y.getByUri(t)){var n=w.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:y,uploadImages:f,uploadImagesAuto:h,scanForImages:m,destroy:g}}}),r(Ye,[k,$,_,T,g,W,u],function(e,t,n,r,i,o,a){var s=n.isContentEditableFalse;return function(t,n){function r(e,n){var r=o.collapse(e.getBoundingClientRect(),n),i,a,s,l,c;return"BODY"==t.tagName?(i=t.ownerDocument.documentElement,a=t.scrollLeft||i.scrollLeft,s=t.scrollTop||i.scrollTop):(c=t.getBoundingClientRect(),a=t.scrollLeft-c.left,s=t.scrollTop-c.top),r.left+=a,r.right+=a,r.top+=s,r.bottom+=s,r.width=1,l=e.offsetWidth-e.clientWidth,l>0&&(n&&(l*=-1),r.left+=l,r.right+=l),r}function l(){var n,r,o,a,s;for(n=i("*[contentEditable=false]",t),a=0;a<n.length;a++)r=n[a],o=r.previousSibling,e.endsWithCaretContainer(o)&&(s=o.data,1==s.length?o.parentNode.removeChild(o):o.deleteData(s.length-1,1)),o=r.nextSibling,e.startsWithCaretContainer(o)&&(s=o.data,1==s.length?o.parentNode.removeChild(o):o.deleteData(0,1));return null}function c(o,a){var l,c,f;return u(),n(a)?(g=e.insertBlock("p",a,o),l=r(a,o),i(g).css("top",l.top),m=i('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(l).appendTo(t),o&&m.addClass("mce-visual-caret-before"),d(),c=a.ownerDocument.createRange(),f=g.firstChild,c.setStart(f,0),c.setEnd(f,1),c):(g=e.insertInline(a,o),c=a.ownerDocument.createRange(),s(g.nextSibling)?(c.setStart(g,0),c.setEnd(g,0)):(c.setStart(g,1),c.setEnd(g,1)),c)}function u(){l(),g&&(e.remove(g),g=null),m&&(m.remove(),m=null),clearInterval(p)}function d(){p=a.setInterval(function(){i("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden")},500)}function f(){a.clearInterval(p)}function h(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"}var p,m,g;return{show:c,hide:u,getCss:h,destroy:f}}}),r(Xe,[p,_,W],function(e,t,n){function r(i){function o(t){return e.map(t,function(e){return e=n.clone(e),e.node=i,e})}if(e.isArray(i))return e.reduce(i,function(e,t){return e.concat(r(t))},[]);if(t.isElement(i))return o(i.getClientRects());if(t.isText(i)){var a=i.ownerDocument.createRange();return a.setStart(i,0),a.setEnd(i,i.data.length),o(a.getClientRects())}}return{getClientRects:r}}),r(Ke,[z,p,Xe,U,te,ne,$,W],function(e,t,n,r,i,o,a,s){function l(e,t,n,o){for(;o=i.findNode(o,e,r.isEditableCaretCandidate,t);)if(n(o))return}function c(e,r,i,o,a,s){function c(o){var s,l,c;for(c=n.getClientRects(o),-1==e&&(c=c.reverse()),s=0;s<c.length;s++)if(l=c[s],!i(l,h)){if(f.length>0&&r(l,t.last(f))&&u++,l.line=u,a(l))return!0;f.push(l)}}var u=0,d,f=[],h;return(h=t.last(s.getClientRects()))?(d=s.getNode(),c(d),l(e,o,c,d),f):f}function u(e,t){return t.line>e}function d(e,t){return t.line===e}function f(e,n,r,i){function l(n){return 1==e?t.last(n.getClientRects()):t.last(n.getClientRects())}var c=new o(n),u,d,f,h,p=[],m=0,g,v;1==e?(u=c.next,d=s.isBelow,f=s.isAbove,h=a.after(i)):(u=c.prev,d=s.isAbove,f=s.isBelow,h=a.before(i)),v=l(h);do if(h.isVisible()&&(g=l(h),!f(g,v))){if(p.length>0&&d(g,t.last(p))&&m++,g=s.clone(g),g.position=h,g.line=m,r(g))return p;p.push(g)}while(h=u(h));return p}var h=e.curry,p=h(c,-1,s.isAbove,s.isBelow),m=h(c,1,s.isBelow,s.isAbove);return{upUntil:p,downUntil:m,positionsUntil:f,isAboveLine:h(u),isLine:h(d)}}),r(Ge,[z,p,_,Xe,W,te,U],function(e,t,n,r,i,o,a){function s(e,t){return Math.abs(e.left-t)}function l(e,t){return Math.abs(e.right-t)}function c(e,n){function r(e,t){return e>=t.left&&e<=t.right}return t.reduce(e,function(e,t){var i,o;return i=Math.min(s(e,n),l(e,n)),o=Math.min(s(t,n),l(t,n)),r(n,t)?t:r(n,e)?e:o==i&&m(t.node)?t:i>o?t:e})}function u(e,t,n,r){for(;r=g(r,e,a.isEditableCaretCandidate,t);)if(n(r))return}function d(e,n){function o(e,i){var o;return o=t.filter(r.getClientRects(i),function(t){return!e(t,n)}),a=a.concat(o),0===o.length}var a=[];return a.push(n),u(-1,e,v(o,i.isAbove),n.node),u(1,e,v(o,i.isBelow),n.node),a}function f(e){return t.filter(t.toArray(e.getElementsByTagName("*")),m)}function h(e,t){return{node:e.node,before:s(e,t)<l(e,t)}}function p(e,n,i){var o,a;return o=r.getClientRects(f(e)),o=t.filter(o,function(e){return i>=e.top&&i<=e.bottom}),a=c(o,n),a&&(a=c(d(e,a),n),a&&m(a.node))?h(a,n):null}var m=n.isContentEditableFalse,g=o.findNode,v=e.curry;return{findClosestClientRect:c,findLineNodeRects:d,closestCaret:p}}),r(Je,[],function(){var e=function(e){var t,n,r,i;return i=e.getBoundingClientRect(),t=e.ownerDocument,n=t.documentElement,r=t.defaultView,{top:i.top+r.pageYOffset-n.clientTop,left:i.left+r.pageXOffset-n.clientLeft}},t=function(t){return t.inline?e(t.getBody()):{left:0,top:0}},n=function(e){var t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}},r=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},i={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:i},i=function(t,n){if(n.target.ownerDocument!==t.getDoc()){var i=e(t.getContentAreaContainer()),o=r(t);return{left:n.pageX-i.left+o.left,top:n.pageY-i.top+o.top}}return{left:n.pageX,top:n.pageY}},o=function(e,t,n){return{pageX:n.left-e.left+t.left,pageY:n.top-e.top+t.top}},a=function(e,r){return o(t(e),n(e),i(e,r))};return{calc:a}}),r(Qe,[_,p,z,u,w,Je],function(e,t,n,r,i,o){var a=e.isContentEditableFalse,s=e.isContentEditableTrue,l=function(e){return a(e)},c=function(e,t,n){return t===n||e.dom.isChildOf(t,n)?!1:!a(t)},u=function(e){var t=e.cloneNode(!0);return t.removeAttribute("data-mce-selected"),t},d=function(e,t,n,r){var i=t.cloneNode(!0);e.dom.setStyles(i,{width:n,height:r}),e.dom.setAttrib(i,"data-mce-selected",null);var o=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(o,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(i,{margin:0,boxSizing:"border-box"}),o.appendChild(i),o},f=function(e,t){e.parentNode!==t&&t.appendChild(e)},h=function(e,t,n,r,i,o){var a=0,s=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>i&&(a=t.pageX+n-i), t.pageY+r>o&&(s=t.pageY+r-o),e.style.width=n-a+"px",e.style.height=r-s+"px"},p=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},m=function(e){return 0===e.button},g=function(e){return e.element},v=function(e,t){return{pageX:t.pageX-e.relX,pageY:t.pageY+5}},y=function(e,r){return function(i){if(m(i)){var o=t.find(r.dom.getParents(i.target),n.or(a,s));if(l(o)){var c=r.dom.getPos(o),u=r.getBody(),f=r.getDoc().documentElement;e.element=o,e.screenX=i.screenX,e.screenY=i.screenY,e.maxX=(r.inline?u.scrollWidth:f.offsetWidth)-2,e.maxY=(r.inline?u.scrollHeight:f.offsetHeight)-2,e.relX=i.pageX-c.x,e.relY=i.pageY-c.y,e.width=o.offsetWidth,e.height=o.offsetHeight,e.ghost=d(r,o,e.width,e.height)}}}},b=function(e,t){var n=r.throttle(function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n)},0);return function(r){var i=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(g(e)&&!e.dragging&&i>10){var a=t.fire("dragstart",{target:e.element});if(a.isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){var s=v(e,o.calc(t,r));f(e.ghost,t.getBody()),h(e.ghost,s,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY)}}},C=function(e,t){return function(n){if(e.dragging&&c(t,t.selection.getNode(),e.element)){var r=u(e.element),i=t.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});i.isDefaultPrevented()||(r=i.targetClone,t.undoManager.transact(function(){p(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret()}))}w(e)}},x=function(e,t){return function(){w(e),e.dragging&&t.fire("dragend")}},w=function(e){e.dragging=!1,e.element=null,p(e.ghost)},N=function(e){var t={},n,r,o,a,s,l;n=i.DOM,l=document,r=y(t,e),o=b(t,e),a=C(t,e),s=x(t,e),e.on("mousedown",r),e.on("mousemove",o),e.on("mouseup",a),n.bind(l,"mousemove",o),n.bind(l,"mouseup",s),e.on("remove",function(){n.unbind(l,"mousemove",o),n.unbind(l,"mouseup",s)})},E=function(e){e.on("drop",function(t){var n="undefined"!=typeof t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(a(n)||a(e.dom.getContentEditableParent(n)))&&t.preventDefault()})},_=function(e){N(e),E(e)};return{init:_}}),r(Ze,[d,ne,$,k,te,Ye,Ke,Ge,_,T,W,I,z,p,u,Qe,S],function(e,t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g){function v(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function y(c){function y(){var e=c.dom.get(le);return e?e.getElementsByTagName("*")[0]:e}function S(e){return c.dom.isBlock(e)}function k(e){e&&c.selection.setRng(e)}function T(){return c.selection.getRng()}function R(e,t){c.selection.scrollIntoView(e,t)}function A(e,t,n){var r;return r=c.fire("ShowCaret",{target:t,direction:e,before:n}),r.isDefaultPrevented()?null:(R(t,-1===e),se.show(n,t))}function B(e){var t;return se.hide(),t=c.fire("BeforeObjectSelected",{target:e}),t.isDefaultPrevented()?null:D(e)}function D(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}function L(e,t){var n=i.isInSameBlock(e,t);return!n&&l.isBr(e.getNode())?!0:n}function M(e,t){return t=i.normalizeRange(e,re,t),-1==e?n.fromRangeStart(t):n.fromRangeEnd(t)}function P(e){return r.isCaretContainerBlock(e.startContainer)}function O(e,t,n,r){var i,o,a,s;return!r.collapsed&&(i=_(r),x(i))?A(e,i,-1==e):(s=P(r),o=M(e,r),n(o)?B(o.getNode(-1==e)):(o=t(o))?n(o)?A(e,o.getNode(-1==e),1==e):(a=t(o),n(a)&&L(o,a)?A(e,a.getNode(-1==e),1==e):s?$(o.toRange()):null):s?r:null)}function H(e,t,n){var r,i,o,l,c,u,d,f,p;if(p=_(n),r=M(e,n),i=t(re,a.isAboveLine(1),r),o=h.filter(i,a.isLine(1)),c=h.last(r.getClientRects()),E(r)&&(p=r.getNode()),N(r)&&(p=r.getNode(!0)),!c)return null;if(u=c.left,l=s.findClosestClientRect(o,u),l&&x(l.node))return d=Math.abs(u-l.left),f=Math.abs(u-l.right),A(e,l.node,f>d);if(p){var m=a.positionsUntil(e,re,a.isAboveLine(1),p);if(l=s.findClosestClientRect(h.filter(m,a.isLine(1)),u))return $(l.position.toRange());if(l=h.last(h.filter(m,a.isLine(0))))return $(l.position.toRange())}}function I(t,r){function i(){var t=c.dom.create(c.settings.forced_root_block);return(!e.ie||e.ie>=11)&&(t.innerHTML='<br data-mce-bogus="1">'),t}var o,a,s;if(r.collapsed&&c.settings.forced_root_block){if(o=c.dom.getParent(r.startContainer,"PRE"),!o)return;a=1==t?oe(n.fromRangeStart(r)):ae(n.fromRangeStart(r)),a||(s=i(),1==t?c.$(o).after(s):c.$(o).before(s),c.selection.select(s,!0),c.selection.collapse())}}function F(e,t,n,r){var i;return(i=O(e,t,n,r))?i:(i=I(e,r),i?i:null)}function z(e,t,n){var r;return(r=H(e,t,n))?r:(r=I(e,n),r?r:null)}function U(){return ue("*[data-mce-caret]")[0]}function W(e){e=ue(e),e.attr("data-mce-caret")&&(se.hide(),e.removeAttr("data-mce-caret"),e.removeAttr("data-mce-bogus"),e.removeAttr("style"),k(T()),R(e[0]))}function V(e){var t,r;return e=i.normalizeRange(1,re,e),t=n.fromRangeStart(e),x(t.getNode())?A(1,t.getNode(),!t.isAtEnd()):x(t.getNode(!0))?A(1,t.getNode(!0),!1):(r=c.dom.getParent(t.getNode(),f.or(x,C)),x(r)?A(1,r,!1):(se.hide(),null))}function $(e){var t;return e&&e.collapsed?(t=V(e),t?t:e):e}function q(e){var t,i,o,a;return x(e)?(x(e.previousSibling)&&(o=e.previousSibling),i=ae(n.before(e)),i||(t=oe(n.after(e))),t&&w(t.getNode())&&(a=t.getNode()),r.remove(e.previousSibling),r.remove(e.nextSibling),c.dom.remove(e),ee(),c.dom.isEmpty(c.getBody())?(c.setContent(""),void c.focus()):o?n.after(o).toRange():a?n.before(a).toRange():i?i.toRange():t?t.toRange():null):null}function j(e){var t=c.schema.getTextBlockElements();return e.nodeName in t}function Y(e){return c.dom.isEmpty(e)}function X(e,t,r){var i=c.dom,o,a,s,l;if(o=i.getParent(t.getNode(),i.isBlock),a=i.getParent(r.getNode(),i.isBlock),-1===e){if(l=r.getNode(!0),N(r)&&S(l))return j(o)?(Y(o)&&i.remove(o),n.after(l).toRange()):q(r.getNode(!0))}else if(l=t.getNode(),E(t)&&S(l))return j(a)?(Y(a)&&i.remove(a),n.before(l).toRange()):q(t.getNode());if(o===a||!j(o)||!j(a))return null;for(;s=o.firstChild;)a.appendChild(s);return c.dom.remove(o),r.toRange()}function K(e,t,n,i){var o,a,s,l;return!i.collapsed&&(o=_(i),x(o))?$(q(o)):(a=M(e,i),n(a)&&r.isCaretContainerBlock(i.startContainer)?(l=-1==e?ie.prev(a):ie.next(a),l?$(l.toRange()):i):t(a)?$(q(a.getNode(-1==e))):(s=-1==e?ie.prev(a):ie.next(a),t(s)?-1===e?X(e,a,s):X(e,s,a):void 0))}function G(){function r(e,t){var n=t(T());n&&!e.isDefaultPrevented()&&(e.preventDefault(),k(n))}function i(e){for(var t=c.getBody();e&&e!=t;){if(C(e)||x(e))return e;e=e.parentNode}return null}function o(e,t,n){return n.collapsed?!1:h.reduce(n.getClientRects(),function(n,r){return n||u.containsXY(r,e,t)},!1)}function l(e){var t=!1;e.on("touchstart",function(){t=!1}),e.on("touchmove",function(){t=!0}),e.on("touchend",function(e){var n=i(e.target);x(n)?t||(e.preventDefault(),Z(B(n))):ee()})}function f(){var e,t=i(c.selection.getNode());C(t)&&S(t)&&c.dom.isEmpty(t)&&(e=c.dom.create("br",{"data-mce-bogus":"1"}),c.$(t).empty().append(e),c.selection.setRng(n.before(e).toRange()))}function g(e){var t=U();if(t)return"compositionstart"==e.type?(e.preventDefault(),e.stopPropagation(),void W(t)):void(" "!=t.innerHTML&&W(t))}function v(e){var t;switch(e.keyCode){case d.DELETE:t=f();break;case d.BACKSPACE:t=f()}t&&e.preventDefault()}var w=b(F,1,oe,E),_=b(F,-1,ae,N),R=b(K,1,E,N),D=b(K,-1,N,E),L=b(z,-1,a.upUntil),M=b(z,1,a.downUntil);c.on("mouseup",function(){var e=T();e.collapsed&&k(V(e))}),c.on("click",function(e){var t;t=i(e.target),t&&x(t)&&(e.preventDefault(),c.focus())});var P=function(e){var r=new t(e);if(!e.firstChild)return!1;var i=n.before(e.firstChild),o=r.next(i);return o&&!E(o)&&!N(o)},O=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n===r},H=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n&&!O(n,r)&&P(n)};l(c),c.on("mousedown",function(e){var t;if(t=i(e.target))x(t)?(e.preventDefault(),Z(B(t))):(ee(),o(e.clientX,e.clientY,c.selection.getRng())||c.selection.placeCaretAt(e.clientX,e.clientY));else{ee(),se.hide();var n=s.closestCaret(re,e.clientX,e.clientY);n&&(H(e.target,n.node)||(e.preventDefault(),c.getBody().focus(),k(A(1,n.node,n.before))))}}),c.on("keydown",function(e){if(!d.modifierPressed(e))switch(e.keyCode){case d.RIGHT:r(e,w);break;case d.DOWN:r(e,M);break;case d.LEFT:r(e,_);break;case d.UP:r(e,L);break;case d.DELETE:r(e,R);break;case d.BACKSPACE:r(e,D);break;default:x(c.selection.getNode())&&e.preventDefault()}}),c.on("keyup compositionstart",function(e){g(e),v(e)},!0),c.on("cut",function(){var e=c.selection.getNode();x(e)&&p.setEditorTimeout(c,function(){k($(q(e)))})}),c.on("getSelectionRange",function(e){var t=e.range;if(ce){if(!ce.parentNode)return void(ce=null);t=t.cloneRange(),t.selectNode(ce),e.range=t}}),c.on("setSelectionRange",function(e){var t;t=Z(e.range),t&&(e.range=t)}),c.on("focus",function(){p.setEditorTimeout(c,function(){c.selection.setRng($(c.selection.getRng()))},0)}),c.on("copy",function(t){var n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!e.ie){var r=y();r&&(t.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),m.init(c)}function J(){var e=c.contentStyles,t=".mce-content-body";e.push(se.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")}function Q(e){return r.isCaretContainer(e.startContainer)||r.isCaretContainer(e.endContainer)}function Z(t){var n,r=c.$,i=c.dom,o,a,s,l,u,d,f,h,p;if(!t)return ee(),null;if(t.collapsed){if(ee(),!Q(t)){if(f=M(1,t),x(f.getNode()))return A(1,f.getNode(),!f.isAtEnd());if(x(f.getNode(!0)))return A(1,f.getNode(!0),!1)}return null}return s=t.startContainer,l=t.startOffset,u=t.endOffset,3==s.nodeType&&0==l&&x(s.parentNode)&&(s=s.parentNode,l=i.nodeIndex(s),s=s.parentNode),1!=s.nodeType?(ee(),null):(u==l+1&&(n=s.childNodes[l]),x(n)?(h=p=n.cloneNode(!0),d=c.fire("ObjectSelected",{target:n,targetClone:h}),d.isDefaultPrevented()?(ee(),null):(h=d.targetClone,o=r("#"+le),0===o.length&&(o=r('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",le),o.appendTo(c.getBody())),t=c.dom.createRng(),h===p&&e.ie?(o.empty().append(g.ZWSP).append(h).append(g.ZWSP),t.setStart(o[0].firstChild,0),t.setEnd(o[0].lastChild,1)):(o.empty().append("\xa0").append(h).append("\xa0"),t.setStart(o[0].firstChild,1),t.setEnd(o[0].lastChild,0)),o.css({top:i.getPos(n,c.getBody()).y}),o[0].focus(),a=c.selection.getSel(),a.removeAllRanges(),a.addRange(t),c.$("*[data-mce-selected]").removeAttr("data-mce-selected"),n.setAttribute("data-mce-selected",1),ce=n,t)):(ee(),null))}function ee(){ce&&(ce.removeAttribute("data-mce-selected"),c.$("#"+le).remove(),ce=null)}function te(){se.destroy(),ce=null}function ne(){se.hide()}var re=c.getBody(),ie=new t(re),oe=b(v,ie.next),ae=b(v,ie.prev),se=new o(c.getBody(),S),le="sel-"+c.dom.uniqueId(),ce,ue=c.$;return e.ceFalse&&(G(),J()),{showBlockCaretContainer:W,hideFakeCaret:ne,destroy:te}}var b=f.curry,C=l.isContentEditableTrue,x=l.isContentEditableFalse,w=l.isElement,N=i.isAfterContentEditableFalse,E=i.isBeforeContentEditableFalse,_=c.getSelectedNode;return y}),r(et,[],function(){var e=0,t=function(){var e=function(){return Math.round(4294967295*Math.random()).toString(36)},t=(new Date).getTime();return"s"+t.toString(36)+e()+e()+e()},n=function(n){return n+e++ +t()};return{uuid:n}}),r(tt,[w,g,E,R,A,O,P,Y,J,Q,Z,ee,oe,ae,N,f,Ae,Pe,B,L,He,d,m,u,Ie,Fe,ze,je,Ze,et],function(e,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A){function B(e,t,i){var o=this,a,s,l;a=o.documentBaseUrl=i.documentBaseURL,s=i.baseURI,l=i.defaultSettings,t=P({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:a,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o,ie7_compat:!0},l,t),l&&l.external_plugins&&t.external_plugins&&(t.external_plugins=P({},l.external_plugins,t.external_plugins)),o.settings=t,r.language=t.language||"en",r.languageLoad=t.language_load,r.baseURL=i.baseURL,o.id=t.id=e,o.setDirty(!1),o.plugins={},o.documentBaseURI=new p(t.document_base_url||a,{base_uri:s}),o.baseURI=s,o.contentCSS=[],o.contentStyles=[],o.shortcuts=new k(o),o.loadedCSS={},o.editorCommands=new h(o),t.target&&(o.targetElm=t.target),o.suffix=i.suffix,o.editorManager=i,o.inline=t.inline,o.settings.content_editable=o.inline,t.cache_suffix&&(w.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),t.override_viewport===!1&&(w.overrideViewPort=!1),i.fire("SetupEditor",o),o.execCallback("setup",o),o.$=n.overrideDefaults(function(){return{context:o.inline?o.getBody():o.getDoc(),element:o.getBody()}})}var D=e.DOM,L=r.ThemeManager,M=r.PluginManager,P=N.extend,O=N.each,H=N.explode,I=N.inArray,F=N.trim,z=N.resolve,U=g.Event,W=w.gecko,V=w.ie;return B.prototype={render:function(){function e(){D.unbind(window,"ready",e),n.render()}function t(){var e=m.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!L.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",L.load(r.theme,t)}N.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),O(r.external_plugins,function(e,t){M.load(t,e),r.plugins+=" "+t}),O(r.plugins.split(/[ ,]/),function(e){if(e=F(e),e&&!M.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=M.dependencies(e);O(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=M.createUrl(t,e),M.load(e.resource,e)})}else M.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!U.domLoaded)return void D.bind(window,"ready",e);if(n.getElement()&&w.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||D.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(D.insertAfter(D.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},D.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.setDirty(!1),a._mceOldSubmit(a)})),n.windowManager=new v(n),n.notificationManager=new y(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=D.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),n.editorManager.add(n),t()}},init:function(){function e(n){var r=M.get(n),i,o;if(i=M.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=F(n),r&&-1===I(m,n)){if(O(M.dependencies(n),function(t){e(t)}),t.plugins[n])return;o=new r(t,i,t.$),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n))}}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,h,p,m=[];if(t.rtl=n.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(n.language),n.aria_label=n.aria_label||D.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=L.get(n.theme),t.theme=new c(t,L.urls[n.theme]),t.theme.init&&t.theme.init(t,L.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""),t.$)):t.theme=n.theme),O(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,h=/^[0-9\.]+(|px)$/i,h.test(""+i)&&(i=Math.max(parseInt(i,10),100)),h.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&O(H(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();if(t.iframeHTML=n.doctype+"<html><head>",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+='<base href="'+t.documentBaseURI.getURI()+'" />'),!w.caretAfter&&n.ie7_compat&&(t.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'),t.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',!/#$/.test(document.location.href))for(p=0;p<t.contentCSS.length;p++){var g=t.contentCSS[p];t.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+N._addCacheSuffix(g)+'" />',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),n.content_security_policy&&(t.iframeHTML+='<meta http-equiv="Content-Security-Policy" content="'+n.content_security_policy+'" />'),t.iframeHTML+='</head><body id="'+d+'" class="mce-content-body '+f+'" data-id="'+t.id+'"><br></body></html>';var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';document.domain!=location.hostname&&w.ie&&w.ie<12&&(u=v);var y=D.create("iframe",{id:t.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}});if(y.onload=function(){y.onload=null,t.fire("load")},D.setAttrib(y,"src",u||'javascript:""'),t.contentAreaContainer=l.iframeContainer,t.iframeElement=y,s=D.add(l.iframeContainer,y),V)try{t.getDoc()}catch(b){s.src=u=v}l.editorContainer&&(D.get(l.editorContainer).style.display=t.orgDisplay,t.hidden=D.isHidden(l.editorContainer)),t.getElement().style.display="none",D.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,r=n.settings,s=n.getElement(),h=n.getDoc(),p,m;r.inline||(n.getElement().style.visibility=n.orgVisibility),t||r.content_editable||(h.open(),h.write(n.iframeHTML),h.close()),r.content_editable&&(n.on("remove",function(){var e=this.getBody();D.removeClass(e,"mce-content-body"),D.removeClass(e,"mce-edit-focus"),D.setAttrib(e,"contentEditable",null)}),D.addClass(s,"mce-content-body"),n.contentDocument=h=r.content_document||document,n.contentWindow=r.content_window||window,n.bodyElement=s,r.content_document=r.content_window=null,r.root_name=s.nodeName.toLowerCase()),p=n.getBody(),p.disabled=!0,n.readonly=r.readonly,n.readonly||(n.inline&&"static"==D.getStyle(p,"position",!0)&&(p.style.position="relative"),p.contentEditable=n.getParam("content_editable_state",!0)),p.disabled=!1,n.editorUpload=new T(n),n.schema=new b(r),n.dom=new e(h,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:n.inline?n.getBody():null,collect:r.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new C(r,n.schema),n.parser.addAttributeFilter("src,href,style,tabindex",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)if(i=e[r],a=i.attr(t),s="data-mce-"+t,!i.attributes.map[s]){if(0===a.indexOf("data:")||0===a.indexOf("blob:"))continue;"style"===t?(a=o.serializeStyle(o.parseStyle(a),i.name),a.length||(a=null),i.attr(s,a),i.attr(t,a)):"tabindex"===t?(i.attr(s,a),i.attr(t,null)):i.attr(s,n.convertURL(a,t,i.name))}}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("type")||"no/type",0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,r,i=n.schema.getNonEmptyElements();t--;)r=e[t],r.isEmpty(i)&&(r.append(new o("br",1)).shortEnded=!0)}),n.serializer=new a(r,n),n.selection=new l(n.dom,n.getWin(),n.serializer,n),n.formatter=new c(n),n.undoManager=new u(n),n.forceBlocks=new f(n),n.enterKey=new d(n),n._nodeChangeDispatcher=new i(n),n._selectionOverrides=new R(n),n.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(h.body.spellcheck=!1,D.setAttrib(p,"spellcheck","false")),n.quirks=new x(n),n.fire("PostRender"),r.directionality&&(p.dir=r.directionality),r.nowrap&&(p.style.whiteSpace="nowrap"),r.protect&&n.on("BeforeSetContent",function(e){O(r.protect,function(t){e.content=e.content.replace(t,function(e){return"<!--mce:protected "+escape(e)+"-->"})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),r.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,n.bindPendingEventDelegates(),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.on("compositionstart compositionend",function(e){n.composing="compositionstart"===e.type}),n.contentStyles.length>0&&(m="",O(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),O(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),r.auto_focus&&E.setEditorTimeout(n,function(){var e;e=r.auto_focus===!0?n:n.editorManager.get(r.auto_focus),e.destroyed||e.focus()},100),s=h=p=null},focus:function(e){function t(e){return n.dom.getParent(e,function(e){return"true"===n.dom.getContentEditable(e)})}var n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l=n.getBody(),c;if(!e){if(o=r.getRng(),o.item&&(a=o.item(0)),n.quirks.refreshContentEditable(),c=t(r.getNode()),n.$.contains(l,c))return c.focus(),r.normalize(),void n.editorManager.setActive(n);if(i||(w.opera||n.getBody().focus(),n.getWin().focus()),W||i){if(l.setActive)try{l.setActive()}catch(u){l.focus()}else l.focus();i&&r.normalize()}a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())}n.editorManager.setActive(n)},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?z(r):0,n=z(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?(e=n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}),this.editorManager.translate(e)):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?O(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(e){e=e.split("="),e.length>1?i[F(e[0])]=F(e[1]):i[F(e[0])]=F(e)}):i=r,i):r},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addContextToolbar:function(e,t){var n=this,r;n.contextToolbars=n.contextToolbars||[],"string"==typeof e&&(r=e,e=function(e){return n.dom.is(e,r)}),n.contextToolbars.push({id:A.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable=!0:(D.show(e.getContainer()),D.hide(e.id)),e.load(),e.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(V&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e==e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(D.hide(e.getContainer()),D.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),"raw"==e.format&&t.fire("RawSaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=D.getParent(t.id,"form"))&&O(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&t.setDirty(!1),r},setContent:function(e,t){var n=this,r=n.getBody(),i,o;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(o=V&&11>V?"":'<br data-mce-bogus="1">',"TABLE"==r.nodeName?e="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(r.nodeName)&&(e="<li>"+o+"</li>"),i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=o,e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):V||e||(e='<br data-mce-bogus="1">'),n.dom.setHTML(r,e),n.fire("SetContent",t)):("raw"!==t.format&&(e=new s({validate:n.validate},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=F(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?t.serializer.getTrimmedContent():"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),"text"!=e.format?e.content=F(n):e.content=n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=P({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!=t&&this.fire("dirty")},setMode:function(e){S.setMode(this,e)},getContainer:function(){var e=this;return e.container||(e.container=D.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=D.get(this.id)),this.targetElm},getWin:function(){var e=this,t;return e.contentWindow||(t=e.iframeElement,t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),O(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||!n.hasVisual?i.removeClass(e,o):i.addClass(e,o));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&n.hasVisual?i.addClass(e,o):i.removeClass(e,o)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&D.remove(e.getElement().nextSibling),e.inline||(V&&10>V&&e.getDoc().execCommand("SelectAll",!1,null),D.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),D.remove(e.getContainer()),e._selectionOverrides.destroy(),e.editorUpload.destroy(),e.destroy())},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),D.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},P(B.prototype,_),B}),r(nt,[],function(){var e={},t="en";return{setCode:function(e){e&&(t=e,this.rtl=this.data[e]?"rtl"===this.data[e]._dir:!1)},getCode:function(){return t},rtl:!1,add:function(t,n){var r=e[t];r||(e[t]=r={});for(var i in n)r[i]=n[i];this.setCode(t)},translate:function(n){var r;if(r=e[t],r||(r={}),"undefined"==typeof n)return n;if("string"!=typeof n&&n.raw)return n.raw;if(n.push){var i=n.slice(1);n=(r[n[0]]||n[0]).replace(/\{([0-9]+)\}/g,function(e,t){return i[t]})}return(r[n]||n).replace(/{context:\w+}$/,"")},data:e}}),r(rt,[w,u,d],function(e,t,n){function r(e){function l(){try{return document.activeElement}catch(e){return document.body}}function c(e,t){if(t&&t.startContainer){if(!e.isChildOf(t.startContainer,e.getRoot())||!e.isChildOf(t.endContainer,e.getRoot()))return;return{startContainer:t.startContainer, startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset}}return t}function u(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function d(e){return!!s.getParent(e,r.isEditorUIElement)}function f(r){var f=r.editor;f.on("init",function(){(f.inline||n.ie)&&("onbeforedeactivate"in document&&n.ie<9?f.dom.bind(f.getBody(),"beforedeactivate",function(e){if(e.target==f.getBody())try{f.lastRng=f.selection.getRng()}catch(t){}}):f.on("nodechange mouseup keyup",function(e){var t=l();"nodechange"==e.type&&e.selectionChange||(t&&t.id==f.id+"_ifr"&&(t=f.getBody()),f.dom.isChildOf(t,f.getBody())&&(f.lastRng=f.selection.getRng()))}),n.webkit&&!i&&(i=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(f.lastRng=n)}},s.bind(document,"selectionchange",i)))}),f.on("setcontent",function(){f.lastRng=null}),f.on("mousedown",function(){f.selection.lastFocusBookmark=null}),f.on("focusin",function(){var t=e.focusedEditor,n;f.selection.lastFocusBookmark&&(n=u(f,f.selection.lastFocusBookmark),f.selection.lastFocusBookmark=null,f.selection.setRng(n)),t!=f&&(t&&t.fire("blur",{focusedEditor:f}),e.setActive(f),e.focusedEditor=f,f.fire("focus",{blurredEditor:t}),f.focus(!0)),f.lastRng=null}),f.on("focusout",function(){t.setEditorTimeout(f,function(){var t=e.focusedEditor;d(l())||t!=f||(f.fire("blur",{focusedEditor:null}),e.focusedEditor=null,f.selection&&(f.selection.lastFocusBookmark=null))})}),o||(o=function(t){var n=e.activeEditor,r;r=t.target,n&&r.ownerDocument==document&&(n.selection&&r!=n.getBody()&&(n.selection.lastFocusBookmark=c(n.dom,n.lastRng)),r==document.body||d(r)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},s.bind(document,"focusin",o)),f.inline&&!a&&(a=function(t){var n=e.activeEditor,r=n.dom;if(n.inline&&r&&!r.isChildOf(t.target,n.getBody())){var i=n.selection.getRng();i.collapsed||(n.lastRng=i)}},s.bind(document,"mouseup",a))}function h(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(s.unbind(document,"selectionchange",i),s.unbind(document,"focusin",o),s.unbind(document,"mouseup",a),i=o=a=null)}e.on("AddEditor",f),e.on("RemoveEditor",h)}var i,o,a,s=e.DOM;return r.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},r}),r(it,[tt,g,w,ae,d,m,c,ue,nt,rt],function(e,t,n,r,i,o,a,s,l,c){function u(e){g(C.editors,function(t){"scroll"===e.type?t.fire("ScrollWindow",e):t.fire("ResizeWindow",e)})}function d(e,n){n!==x&&(n?t(window).on("resize scroll",u):t(window).off("resize scroll",u),x=n)}function f(e){var t=C.editors,n;delete t[e.id];for(var r=0;r<t.length;r++)if(t[r]==e){t.splice(r,1),n=!0;break}return C.activeEditor==e&&(C.activeEditor=t[0]),C.focusedEditor==e&&(C.focusedEditor=null),n}function h(e){return e&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(f(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null),e}var p=n.DOM,m=o.explode,g=o.each,v=o.extend,y=0,b,C,x=!1;return C={$:t,majorVersion:"4",minorVersion:"4.3",releaseDate:"2016-09-01",editors:[],i18n:l,activeEditor:null,setup:function(){var e=this,t,n,i="",o,a;if(n=r.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/")),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else{for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){a=s[l].src;var u=a.substring(a.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(a)){-1!=u.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/"));break}}!t&&document.currentScript&&(a=document.currentScript.src,-1!=a.indexOf(".min")&&(i=".min"),t=a.substring(0,a.lastIndexOf("/")))}e.baseURL=new r(n).toAbsolute(t),e.documentBaseURL=n,e.baseURI=new r(e.baseURL),e.suffix=i,e.focusManager=new c(e)},overrideDefaults:function(e){var t,n;t=e.base_url,t&&(this.baseURL=new r(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new r(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n),this.defaultSettings=e},init:function(n){function r(e,t){return e.inline&&t.tagName.toLowerCase()in C}function i(e,t){window.console&&!window.test&&window.console.log(e,t)}function s(e){var t=e.id;return t||(t=e.name,t=t&&!p.get(t)?e.name:p.uniqueId(),e.setAttribute("id",t)),t}function l(e){var t=n[e];if(t)return t.apply(f,Array.prototype.slice.call(arguments,2))}function c(e,t){return t.constructor===RegExp?t.test(e.className):p.hasClass(e,t)}function u(e){var t,n=[];if(e.types)return g(e.types,function(e){n=n.concat(p.select(e.selector))}),n;if(e.selector)return p.select(e.selector);if(e.target)return[e.target];switch(e.mode){case"exact":t=e.elements||"",t.length>0&&g(m(t),function(e){var t;(t=p.get(e))?n.push(t):g(document.forms,function(t){g(t.elements,function(t){t.name===e&&(e="mce_editor_"+y++,p.setAttrib(t,"id",e),n.push(t))})})});break;case"textareas":case"specific_textareas":g(p.select("textarea"),function(t){e.editor_deselector&&c(t,e.editor_deselector)||e.editor_selector&&!c(t,e.editor_selector)||n.push(t)})}return n}function d(){function a(t,n,r){var i=new e(t,n,f);m.push(i),i.on("init",function(){++c===y.length&&x(m)}),i.targetElm=i.targetElm||r,i.render()}var c=0,m=[],y;return p.unbind(window,"ready",d),l("onpageload"),y=t.unique(u(n)),n.types?void g(n.types,function(e){o.each(y,function(t){return p.is(t,e.selector)?(a(s(t),v({},n,e),t),!1):!0})}):(o.each(y,function(e){h(f.get(e.id))}),y=o.grep(y,function(e){return!f.get(e.id)}),void g(y,function(e){r(n,e)?i("Could not initialize inline editor on invalid inline target element",e):a(s(e),n,e)}))}var f=this,b,C;C=o.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var x=function(e){b=e};return f.settings=n,p.bind(window,"ready",d),new a(function(e){b?e(b):x=function(t){e(t)}})},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),d(n,!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),b||(b=function(){t.fire("BeforeUnload")},p.bind(window,"beforeunload",b)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void g(p.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(f(i)&&t.fire("RemoveEditor",{editor:i}),r.length||p.unbind(window,"beforeunload",b),i.remove(),d(r,r.length>0),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){g(this.editors,function(e){e.save()})},addI18n:function(e,t){l.add(e,t)},translate:function(e){return l.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},v(C,s),C.setup(),window.tinymce=window.tinyMCE=C,C}),r(ot,[it,m],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(n,r){"html4"===t.settings.schema&&e(r,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(at,[ue,m],function(e,t){var n={send:function(e){function r(){!e.async||4==i.readyState||o++>1e4?(e.success&&1e4>o&&200==i.status?e.success.call(e.success_scope,""+i.responseText,i,e):e.error&&e.error.call(e.error_scope,o>1e4?"TIMED_OUT":"GENERAL",i,e),i=null):setTimeout(r,10)}var i,o=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async!==!1,e.data=e.data||"",n.fire("beforeInitialize",{settings:e}),i=new XMLHttpRequest){if(i.overrideMimeType&&i.overrideMimeType(e.content_type),i.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(i.withCredentials=!0),e.content_type&&i.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&t.each(e.requestheaders,function(e){i.setRequestHeader(e.key,e.value)}),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i=n.fire("beforeSend",{xhr:i,settings:e}).xhr,i.send(e.data),!e.async)return r();setTimeout(r,10)}}};return t.extend(n,e),n}),r(st,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r<t.length;r++)i+=(r>0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(lt,[st,at,m],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(ct,[w],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(ut,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(dt,[w,f,N,E,m,d],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(ft,[se,m],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t=this,n=t.settings,r,i,o,a;r=n.firstControlClass,i=n.lastControlClass,e.each(function(e){e.classes.remove(r).remove(i).add(n.controlClass),e.visible()&&(o||(o=e),a=e)}),o&&o.classes.add(r),a&&a.classes.add(i)},renderHtml:function(e){var t=this,n="";return t.applyClasses(e.items()),e.items().each(function(e){n+=e.renderHtml()}),n},recalc:function(){},postRender:function(){},isNative:function(){return!1}})}),r(ht,[ft],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}})}),r(pt,[De],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t._super(e),e=t.settings,n=t.settings.size,t.on("click mousedown",function(e){e.preventDefault()}),t.on("touchstart",function(e){t.fire("click",e),e.preventDefault()}),e.subtype&&t.classes.add(e.subtype),n&&t.classes.add("btn-"+n),e.icon&&t.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e=this.getEl().firstChild,t;e&&(t=e.style,t.width=t.height="100%"),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("icon"),i,o=e.state.get("text"),a="";return i=e.settings.image,i?(r="none","string"!=typeof i&&(i=window.getSelection?i[0]:i[1]),i=" style=\"background-image: url('"+i+"')\""):i="",o&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(o)+"</span>"),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'<div id="'+t+'" class="'+e.classes+'" tabindex="-1" aria-labelledby="'+t+'"><button role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+i+"></i>":"")+a+"</button></div>"},bindStates:function(){function e(e){var i=n("span."+r,t.getEl());e?(i[0]||(n("button:first",t.getEl()).append('<span class="'+r+'"></span>'),i=n("span."+r,t.getEl())),i.html(t.encode(e))):i.remove(),t.classes.toggle("btn-has-text",!!e)}var t=this,n=t.$,r=t.classPrefix+"txt";return t.state.on("change:text",function(t){e(t.value)}),t.state.on("change:icon",function(n){var r=n.value,i=t.classPrefix;t.settings.icon=r,r=r?i+"ico "+i+"i-"+t.settings.icon:"";var o=t.getEl().firstChild,a=o.getElementsByTagName("i")[0];r?(a&&a==o.firstChild||(a=document.createElement("i"),o.insertBefore(a,o.firstChild)),a.className=r):a&&o.removeChild(a),e(t.state.get("text"))}),t._super()}})}),r(mt,[xe],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(gt,[De],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'" unselectable="on" aria-labelledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'label">'+e.encode(e.state.get("text"))+"</span></div>"},bindStates:function(){function e(e){t.classes.toggle("checked",e),t.aria("checked",e)}var t=this;return t.state.on("change:text",function(e){t.getEl("al").firstChild.data=t.translate(e.value)}),t.state.on("change:checked change:value",function(n){t.fire("change"),e(n.value)}),t.state.on("change:icon",function(e){var n=e.value,r=t.classPrefix;if("undefined"==typeof n)return t.settings.icon;t.settings.icon=n,n=n?r+"ico "+r+"i-"+t.settings.icon:"";var i=t.getEl().firstChild,o=i.getElementsByTagName("i")[0];n?(o&&o==i.firstChild||(o=document.createElement("i"),i.insertBefore(o,i.firstChild)),o.className=n):o&&i.removeChild(o)}),t.state.get("checked")&&e(!0),t._super()}})}),r(vt,[De,be,pe,g],function(e,t,n,r){return e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.classes.add("combobox"),t.subinput=!0,t.ariaTarget="inp",e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){var i=n.target,o=t.getEl();if(r.contains(o,i)||i==o)for(;i&&i!=o;)i.id&&-1!=i.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),i=i.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){var r=t.state.get("value"),i=t.getEl("inp").value;return e.preventDefault(),t.state.set("value",i),r!=i&&t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),t.on("keyup",function(e){"INPUT"==e.target.nodeName&&t.state.set("value",e.target.value)})},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),i=e.getEl("open"),o=e.layoutRect(),a,s;a=i?o.w-n.getSize(i).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(s=e.layoutRect().h-2+"px"),r(t.firstChild).css({width:a,lineHeight:s}),e._super(),e},postRender:function(){var e=this;return r(this.getEl("inp")).on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)}),e._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=e.state.get("value")||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e.state.get("text"),(o||a)&&(s='<div id="'+t+'-open" class="'+r+"btn "+r+'open" tabIndex="-1" role="button"><button id="'+t+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!=o?'<i class="'+o+'"></i>':'<i class="'+r+'caret"></i>')+(a?(o?" ":"")+a:"")+"</button></div>",e.classes.add("has-open")),'<div id="'+t+'" class="'+e.classes+'"><input id="'+t+'-inp" class="'+r+'textbox" value="'+e.encode(i,!1)+'" hidefocus="1"'+l+' placeholder="'+e.encode(n.placeholder)+'" />'+s+"</div>"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl("inp").value!=t.value&&(e.getEl("inp").value=t.value)}),e.state.on("change:disabled",function(t){e.getEl("inp").disabled=t.value}),e._super()},remove:function(){r(this.getEl("inp")).off(),this._super()}})}),r(yt,[vt],function(e){return e.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl().getElementsByTagName("i")[0];if(t)try{t.style.background=e}catch(n){}},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.state.get("rendered")&&e.repaintColor(t.value)}),e._super()}})}),r(bt,[pt,ke],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),r(Ct,[bt,w],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("text"),i=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",a="";return r&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(r)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(i?'<i class="'+i+'"'+o+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+a+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(xt,[],function(){function e(e){function i(e,i,o){var a,s,l,c,u,d;return a=0,s=0,l=0,e/=255,i/=255,o/=255,u=t(e,t(i,o)),d=n(e,n(i,o)),u==d?(l=u,{h:0,s:0,v:100*l}):(c=e==u?i-o:o==u?e-i:o-e,a=e==u?3:o==u?1:5,a=60*(a-c/(d-u)),s=(d-u)/d,l=d,{h:r(a),s:r(100*s),v:r(100*l)})}function o(e,i,o){var a,s,l,c;if(e=(parseInt(e,10)||0)%360,i=parseInt(i,10)/100,o=parseInt(o,10)/100,i=n(0,t(i,1)),o=n(0,t(o,1)),0===i)return void(d=f=h=r(255*o));switch(a=e/60,s=o*i,l=s*(1-Math.abs(a%2-1)),c=o-s,Math.floor(a)){case 0:d=s,f=l,h=0;break;case 1:d=l,f=s,h=0;break;case 2:d=0,f=s,h=l;break;case 3:d=0,f=l,h=s;break;case 4:d=l,f=0,h=s;break;case 5:d=s,f=0,h=l;break;default:d=f=h=0}d=r(255*(d+c)),f=r(255*(f+c)),h=r(255*(h+c))}function a(){function e(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+e(d)+e(f)+e(h)}function s(){return{r:d,g:f,b:h}}function l(){return i(d,f,h)}function c(e){var t;return"object"==typeof e?"r"in e?(d=e.r,f=e.g,h=e.b):"v"in e&&o(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(d=parseInt(t[1],10),f=parseInt(t[2],10),h=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(d=parseInt(t[1],16),f=parseInt(t[2],16),h=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(d=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16),h=parseInt(t[3]+t[3],16)),d=0>d?0:d>255?255:d,f=0>f?0:f>255?255:f,h=0>h?0:h>255?255:h,u}var u=this,d=0,f=0,h=0;e&&c(e),u.toRgb=s,u.toHsv=l,u.toHex=a,u.parse=c}var t=Math.min,n=Math.max,r=Math.round;return e}),r(wt,[De,we,pe,xt],function(e,t,n,r){return e.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){function e(e,t){var r=n.getPos(e),i,o;return i=t.pageX-r.x,o=t.pageY-r.y,i=Math.max(0,Math.min(i/e.clientWidth,1)),o=Math.max(0,Math.min(o/e.clientHeight,1)),{x:i,y:o}}function i(e,t){var i=(360-e.h)/360;n.css(d,{top:100*i+"%"}),t||n.css(h,{left:e.s+"%",top:100-e.v+"%"}),f.style.background=new r({s:100,v:100,h:e.h}).toHex(),s.color().parse({s:e.s,v:e.v,h:e.h})}function o(t){var n;n=e(f,t),c.s=100*n.x,c.v=100*(1-n.y),i(c),s.fire("change")}function a(t){var n;n=e(u,t),c=l.toHsv(),c.h=360*(1-n.y),i(c,!0),s.fire("change")}var s=this,l=s.color(),c,u,d,f,h;u=s.getEl("h"),d=s.getEl("hp"),f=s.getEl("sv"),h=s.getEl("svp"),s._repaint=function(){c=l.toHsv(),i(c)},s._super(),s._svdraghelper=new t(s._id+"-sv",{start:o,drag:o}),s._hdraghelper=new t(s._id+"-h",{start:a,drag:a}),s._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;return arguments.length?(t.color().parse(e),void(t._rendered&&t._repaint())):t.color().toHex()},color:function(){return this._color||(this._color=new r),this._color},renderHtml:function(){function e(){var e,t,n="",i,a;for(i="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",a=o.split(","),e=0,t=a.length-1;t>e;e++)n+='<div class="'+r+'colorpicker-h-chunk" style="height:'+100/t+"%;"+i+a[e]+",endColorstr="+a[e+1]+");-ms-"+i+a[e]+",endColorstr="+a[e+1]+')"></div>';return n}var t=this,n=t._id,r=t.classPrefix,i,o="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",a="background: -ms-linear-gradient(top,"+o+");background: linear-gradient(to bottom,"+o+");";return i='<div id="'+n+'-h" class="'+r+'colorpicker-h" style="'+a+'">'+e()+'<div id="'+n+'-hp" class="'+r+'colorpicker-h-marker"></div></div>','<div id="'+n+'" class="'+t.classes+'"><div id="'+n+'-sv" class="'+r+'colorpicker-sv"><div class="'+r+'colorpicker-overlay1"><div class="'+r+'colorpicker-overlay2"><div id="'+n+'-svp" class="'+r+'colorpicker-selector1"><div class="'+r+'colorpicker-selector2"></div></div></div></div></div>'+i+"</div>"}})}),r(Nt,[De],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.classes.add("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.row()[n],index:n})}),t.row(t.settings.row)},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){var e=this;return'<div id="'+e._id+'" class="'+e.classes+'">'+e._getDataPathHtml(e.state.get("row"))+"</div>"},bindStates:function(){var e=this;return e.state.on("change:row",function(t){e.innerHtml(e._getDataPathHtml(t.value))}),e._super()},_getDataPathHtml:function(e){var t=this,n=e||[],r,i,o="",a=t.classPrefix;for(r=0,i=n.length;i>r;r++)o+=(r>0?'<div class="'+a+'divider" aria-hidden="true"> '+t.settings.delimiter+" </div>":"")+'<div role="button" class="'+a+"path-item"+(r==i-1?" "+a+"last":"")+'" data-index="'+r+'" tabindex="-1" id="'+t._id+"-"+r+'" aria-level="'+r+'">'+n[r].name+"</div>";return o||(o='<div class="'+a+'path-item">\xa0</div>'),o}})}),r(Et,[Nt],function(e){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var t=this,n=t.settings.editor;return n.settings.elementpath!==!1&&(t.on("select",function(e){n.focus(),n.selection.select(this.row()[e.index].element),n.nodeChanged()}),n.on("nodeChange",function(r){for(var i=[],o=r.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=n.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});if(s.isDefaultPrevented()||i.push({name:s.name,element:o[a]}),s.isPropagationStopped())break}t.row(i)})),t._super()}})}),r(_t,[xe],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}})}),r(St,[xe,_t,m],function(e,t,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,r=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),r.each(function(r){var i,o=r.settings.label;o&&(i=new t(n.extend({items:{type:"label",id:r._id+"-l",text:o,flex:0,forId:r._id,disabled:r.disabled()}},e.settings.formItemDefaults)),i.type="formitem",r.aria("labelledby",r._id+"-l"),"undefined"==typeof r.settings.flex&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.fromJSON(e.settings.data)},bindStates:function(){function e(){var e=0,n=[],r,i,o;if(t.settings.labelGapCalc!==!1)for(o="children"==t.settings.labelGapCalc?t.find("formitem"):t.items(),o.filter("formitem").each(function(t){var r=t.items()[0],i=r.getEl().clientWidth;e=i>e?i:e,n.push(r)}),i=t.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=e+i}var t=this;t._super(),t.on("show",e),e()}})}),r(kt,[St],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}})}),r(Tt,[vt,m],function(e,t){return e.extend({init:function(e){var n=this,r=tinymce.activeEditor,i=r.settings,o,a,s;e.spellcheck=!1,s=i.file_picker_types||i.file_browser_callback_types,s&&(s=t.makeMap(s,/[, ]/)),s&&!s[e.filetype]||(a=i.file_picker_callback,!a||s&&!s[e.filetype]?(a=i.file_browser_callback,!a||s&&!s[e.filetype]||(o=function(){a(n.getEl("inp").id,n.value(),e.filetype,window)})):o=function(){var i=n.fire("beforecall").meta;i=t.extend({filetype:e.filetype},i),a.call(r,function(e,t){n.value(e).fire("change",{meta:t})},n.value(),i)}),o&&(e.icon="browse",e.onaction=o),n._super(e)}})}),r(Rt,[ht],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(At,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v=[],y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F,z=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e.paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,"row-reversed"!=f&&"column-reverse"!=f||(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(S="y",E="h",_="minH",k="maxH",R="innerH",T="top",A="deltaH",B="contentH",O="left",M="w",D="x",L="innerW", P="minW",H="right",I="deltaW",F="contentW"):(S="x",E="w",_="minW",k="maxW",R="innerW",T="left",A="deltaW",B="contentW",O="top",M="h",D="y",L="innerH",P="minH",H="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],N=u=0,t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),m=h.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,p[k]&&v.push(h),p.flex=g),d-=p[_],y=o[O]+p[P]+o[H],y>N&&(N=y);if(x={},0>d?x[_]=i[_]-d+i[A]:x[_]=i[R]-d+i[A],x[P]=N+i[I],x[B]=i[R]-d,x[F]=N,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)h=v[t],p=h.layoutRect(),b=p[k],y=p[_]+p.flex*C,y>b?(d-=p[k]-p[_],u-=p.flex,p.flex=0,p.maxFlexSize=b):p.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[D]=o[O],t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),y=p.maxFlexSize||p[_],"center"===s?x[D]=Math.round(i[L]/2-p[M]/2):"stretch"===s?(x[M]=z(p[P]||0,i[L]-o[O]-o[H]),x[D]=o[O]):"end"===s&&(x[D]=i[L]-p[M]-o.top),p.flex>0&&(y+=p.flex*C),x[E]=y,x[S]=w,h.layoutRect(x),h.recalc&&h.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var W=e.parent();W&&(W._lastRect=null,W.recalc())}}})}),r(Bt,[ft],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}})}),r(Dt,[ye,De,ke,m,w,it,d],function(e,t,n,r,i,o,a){function s(e){e.settings.ui_container&&(a.container=i.DOM.select(e.settings.ui_container)[0])}function l(t){t.on("ScriptsLoaded",function(){t.rtl&&(e.rtl=!0)})}function c(e){function t(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;u(i.parents,function(e){return u(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function r(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function i(){function t(e){var n=[];if(e)return u(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=t(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a,o.cmd=e.cmd}n.push(o)}),n}function n(){var n;return n=t(e.settings.style_formats_merge?e.settings.style_formats?o.concat(e.settings.style_formats):o:e.settings.style_formats||o)}var r=0,i=[],o=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){u(i,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:n(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?e.formatter.getCssText(this.settings.format):void 0},onPostRender:function(){var t=this;t.parent().on("show",function(){var n,r;n=t.settings.format,n&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),r=t.settings.cmd,r&&t.active(e.queryCommandState(r))})},onclick:function(){this.settings.format&&l(this.settings.format),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}function o(t){return function(){var n=this;e.formatter?e.formatter.formatChanged(t,function(e){n.active(e)}):e.on("init",function(){e.formatter.formatChanged(t,function(e){n.active(e)})})}}function a(t){return function(){function n(){return e.undoManager?e.undoManager[t]():!1}var r=this;t="redo"==t?"hasRedo":"hasUndo",r.disabled(!n()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){r.disabled(e.readonly||!n())})}}function s(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function l(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var c;c=i(),u({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:o(n),onclick:function(){l(n)}})}),u({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),u({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:o(n)})}),e.addButton("undo",{tooltip:"Undo",onPostRender:a("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:a("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:s,cmd:"mceToggleVisualAid"}),e.addButton("remove",{tooltip:"Remove",icon:"remove",cmd:"Delete"}),u({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return u(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return u(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return u(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var u=r.each;o.on("AddEditor",function(e){var t=e.editor;l(t),c(t),s(t)}),e.translate=function(e){return o.translate(e)},t.tooltips=!a.iOS}),r(Lt,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E=[],_=[],S,k,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e.paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)_.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),S=c.minW,k=c.minH,E[d]=S>E[d]?S:E[d],_[f]=k>_[f]?k:_[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,N=0,f=0;n>f;f++)N+=_[f]+(f>0?b:0),R-=(f>0?b:0)+_[f];if(w+=g.left+g.right,N+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=N+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var D;D="start"==t.packV?0:R>0?Math.floor(R/n):0;var L=0,M=t.flexWidths;if(M)for(d=0;d<M.length;d++)L+=M[d];else L=r;var P=T/L;for(d=0;r>d;d++)E[d]+=M?M[d]*P:P;for(p=g.top,f=0;n>f;f++){for(h=g.left,s=_[f]+D,d=0;r>d&&(B=A?f*r+r-1-d:f*r+d,u=i[B],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(E[d],c.startMinWidth),c.x=h,c.y=p,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=h+a/2-c.w/2:"right"==v?c.x=h+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=p+s/2-c.h/2:"bottom"==v?c.y=p+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),h+=a+y,u.recalc&&u.recalc();p+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var O=e.parent();O&&(O._lastRect=null,O.recalc())}}})}),r(Mt,[De,u],function(e,t){return e.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,n){var r=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,n&&n()):t.setTimeout(function(){r.html(e)}),this}})}),r(Pt,[De],function(e){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("infobox"),t.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+e.encode(e.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+t+"ico "+t+'i-help"></i></button></div></div>'},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl("body").firstChild.data=e.encode(t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e.state.on("change:help",function(t){e.classes.toggle("has-help",t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ot,[De,pe],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.classes.add("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e=this,t,n,r=e.settings.forId;return!r&&(n=e.settings.forName)&&(t=e.getRoot().find("#"+n)[0],t&&(r=t._id)),r?'<label id="'+e._id+'" class="'+e.classes+'"'+(r?' for="'+r+'"':"")+">"+e.encode(e.state.get("text"))+"</label>":'<span id="'+e._id+'" class="'+e.classes+'">'+e.encode(e.state.get("text"))+"</span>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.innerHtml(e.encode(t.value)),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ht,[xe],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.classes.add("toolbar")},postRender:function(){var e=this;return e.items().each(function(e){e.classes.add("toolbar-item")}),e._super()}})}),r(It,[Ht],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(Ft,[pt,be,It],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(){var e=this,n;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(n=e.state.get("menu")||[],n.length?n={type:"menu",items:n}:n.type=n.type||"menu",n.renderTo?e.menu=n.parent(e).show().renderTo():e.menu=t.create(n).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon,o,a=e.state.get("text"),s="";return o=e.settings.image,o?(i="none","string"!=typeof o&&(o=window.getSelection?o[0]:o[1]),o=" style=\"background-image: url('"+o+"')\""):o="",a&&(e.classes.add("btn-has-text"),s='<span class="'+r+'txt">'+e.encode(a)+"</span>"),i=e.settings.icon?r+"ico "+r+"i-"+i:"",e.aria("role",e.parent()instanceof n?"menuitem":"button"),'<div id="'+t+'" class="'+e.classes+'" tabindex="-1" aria-labelledby="'+t+'"><button id="'+t+'-open" role="presentation" type="button" tabindex="-1">'+(i?'<i class="'+i+'"'+o+"></i>":"")+s+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});return i}),r(zt,[De,be,d,u],function(e,t,n,r){return e.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t=this,n;t._super(e),e=t.settings,t.classes.add("menu-item"),e.menu&&t.classes.add("menu-item-expand"),e.preview&&t.classes.add("menu-item-preview"),n=t.state.get("text"),"-"!==n&&"|"!==n||(t.classes.add("menu-item-sep"),t.aria("role","separator"),t.state.set("text","-")),e.selectable&&(t.aria("role","menuitemcheckbox"),t.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||t.classes.add("menu-item-normal"),t.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&t.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r,i=e.parent();if(i.items().each(function(t){t!==e&&t.hideMenu()}),n.menu){r=e.menu,r?r.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",i.settings.itemDefaults&&(r.itemDefaults=i.settings.itemDefaults),r=e.menu=t.create(r).parent(e).renderTo(),r.reflow(),r.on("cancel",function(t){t.stopPropagation(),e.focus(),r.hide()}),r.on("show hide",function(e){e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),r.on("hide",function(t){t.control===r&&e.classes.remove("selected")}),r.submenu=!0),r._parentMenu=i,r.classes.add("menu-sub");var o=r.testMoveRel(e.getEl(),e.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);r.moveRel(e.getEl(),o),r.rel=o,o="menu-sub-"+o,r.classes.remove(r._lastRel).add(o),r._lastRel=o,e.classes.add("selected"),e.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){function e(e){var t,r,i={};for(i=n.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)r=i[e[t].toLowerCase()],r&&(e[t]=r);return e.join("+")}var t=this,r=t._id,i=t.settings,o=t.classPrefix,a=t.encode(t.state.get("text")),s=t.settings.icon,l="",c=i.shortcut;return s&&t.parent().classes.add("menu-has-icons"),i.image&&(l=" style=\"background-image: url('"+i.image+"')\""),c&&(c=e(c)),s=o+"ico "+o+"i-"+(t.settings.icon||"none"),'<div id="'+r+'" class="'+t.classes+'" tabindex="-1">'+("-"!==a?'<i class="'+s+'"'+l+"></i>\xa0":"")+("-"!==a?'<span id="'+r+'-text" class="'+o+'text">'+a+"</span>":"")+(c?'<div id="'+r+'-shortcut" class="'+o+'menu-shortcut">'+c+"</div>":"")+(i.menu?'<div class="'+o+'caret"></div>':"")+"</div>"},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var i=e.getEl("text");i&&i.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),r.requestAnimationFrame(function(){e.parent().hideAll()})))}),e._super(),e},hover:function(){var e=this;return e.parent().items().each(function(e){e.classes.remove("selected")}),e.classes.toggle("selected",!0),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ut,[g,ye,u],function(e,t,n){return function(r,i){var o=this,a,s=t.classPrefix,l;o.show=function(t,c){function u(){a&&(e(r).append('<div class="'+s+"throbber"+(i?" "+s+"throbber-inline":"")+'"></div>'),c&&c())}return o.hide(),a=!0,t?l=n.setTimeout(u,t):u(),o},o.hide=function(){var e=r.lastChild;return n.clearTimeout(l),e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),a=!1,o}}}),r(Wt,[ke,zt,Ut,m],function(e,t,n,r){return e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var n=e.items,i=n.length;i--;)n[i]=r.extend({},e.itemDefaults,n[i]);t._super(e),t.classes.add("menu")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},load:function(){function e(){t.throbber&&(t.throbber.hide(),t.throbber=null)}var t=this,r,i;i=t.settings.itemsFactory,i&&(t.throbber||(t.throbber=new n(t.getEl("body"),!0),0===t.items().length?(t.throbber.show(),t.fire("loading")):t.throbber.show(100,function(){t.items().remove(),t.fire("loading")}),t.on("hide close",e)),t.requestTime=r=(new Date).getTime(),t.settings.itemsFactory(function(n){return 0===n.length?void t.hide():void(t.requestTime===r&&(t.getEl().style.width="",t.getEl("body").style.width="",e(),t.items().remove(),t.getEl("body").innerHTML="",t.add(n),t.renderNew(),t.fire("loaded")))}))},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.image||n.selectable?(e._hasIcons=!0,!1):void 0}),e.settings.itemsFactory&&e.on("postrender",function(){e.settings.itemsFactory&&e.load()}),e._super()}})}),r(Vt,[Ft,Wt],function(e,t){return e.extend({init:function(e){function t(r){for(var a=0;a<r.length;a++){if(i=r[a].selected||e.value===r[a].value)return o=o||r[a].text,n.state.set("value",r[a].value),!0;if(r[a].menu&&t(r[a].menu))return!0}}var n=this,r,i,o,a;n._super(e),e=n.settings,n._values=r=e.values,r&&("undefined"!=typeof e.value&&t(r),!i&&r.length>0&&(o=r[0].text,n.state.set("value",r[0].value)),n.state.set("menu",r)),n.state.set("text",e.text||o),n.classes.add("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.value()),a=r})},bindStates:function(){function e(e,n){e instanceof t&&e.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}function n(e,t){var r;if(e)for(var i=0;i<e.length;i++){if(e[i].value===t)return e[i];if(e[i].menu&&(r=n(e[i].menu,t)))return r}}var r=this;return r.on("show",function(t){e(t.control,r.value())}),r.state.on("change:value",function(e){var t=n(r.state.get("menu"),e.value);t?r.text(t.text):r.text(r.settings.text)}),r._super()}})}),r($t,[gt],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(qt,[De,we],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"==e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(jt,[De],function(e){function t(e){var t="";if(e)for(var n=0;n<e.length;n++)t+='<option value="'+e[n]+'">'+e[n]+"</option>";return t}return e.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var t=this;t._super(e),t.settings.size&&(t.size=t.settings.size),t.settings.options&&(t._options=t.settings.options),t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e=this,n,r="";return n=t(e._options),e.size&&(r=' size = "'+e.size+'"'),'<select id="'+e._id+'" class="'+e.classes+'"'+r+">"+n+"</select>"},bindStates:function(){var e=this;return e.state.on("change:options",function(n){e.getEl().innerHTML=t(n.value)}),e._super()}})}),r(Yt,[De,we,pe],function(e,t,n){function r(e,t,n){return t>e&&(e=t),e>n&&(e=n),e}function i(e,t,n){e.setAttribute("aria-"+t,n)}function o(e,t){var r,o,a,s,l,c;"v"==e.settings.orientation?(s="top",a="height",o="h"):(s="left",a="width",o="w"),c=e.getEl("handle"),r=(e.layoutRect()[o]||100)-n.getSize(c)[a],l=r*((t-e._minValue)/(e._maxValue-e._minValue))+"px",c.style[s]=l,c.style.height=e.layoutRect().h+"px",i(c,"valuenow",t),i(c,"valuetext",""+e.settings.previewFilter(t)),i(c,"valuemin",e._minValue),i(c,"valuemax",e._maxValue)}return e.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"==e.orientation&&t.classes.add("vertical"),t._minValue=e.minValue||0,t._maxValue=e.maxValue||100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'"><div id="'+t+'-handle" class="'+n+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){function e(e,t,n){return(n+e)/(t-e)}function i(e,t,n){return n*(t-e)-e}function o(t,n){function o(o){var a;a=s.value(),a=i(t,n,e(t,n,a)+.05*o),a=r(a,t,n),s.value(a),s.fire("dragstart",{value:a}),s.fire("drag",{value:a}),s.fire("dragend",{value:a})}s.on("keydown",function(e){switch(e.keyCode){case 37:case 38:o(-1);break;case 39:case 40:o(1)}})}function a(e,i,o){var a,l,c,p,m;s._dragHelper=new t(s._id,{handle:s._id+"-handle",start:function(e){a=e[u],l=parseInt(s.getEl("handle").style[d],10),c=(s.layoutRect()[h]||100)-n.getSize(o)[f],s.fire("dragstart",{value:m})},drag:function(t){var n=t[u]-a;p=r(l+n,0,c),o.style[d]=p+"px",m=e+p/c*(i-e),s.value(m),s.tooltip().text(""+s.settings.previewFilter(m)).show().moveRel(o,"bc tc"),s.fire("drag",{value:m})},stop:function(){s.tooltip().hide(),s.fire("dragend",{value:m})}})}var s=this,l,c,u,d,f,h;l=s._minValue,c=s._maxValue,"v"==s.settings.orientation?(u="screenY",d="top",f="height",h="h"):(u="screenX",d="left",f="width",h="w"),s._super(),o(l,c,s.getEl("handle")),a(l,c,s.getEl("handle"))},repaint:function(){this._super(),o(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){o(e,t.value)}),e._super()}})}),r(Xt,[De],function(e){return e.extend({renderHtml:function(){var e=this;return e.classes.add("spacer"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"></div>'}})}),r(Kt,[Ft,pe,g],function(e,t,n){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,r=e.getEl(),i=e.layoutRect(),o,a;return e._super(),o=r.firstChild,a=r.lastChild,n(o).css({width:i.w-t.getSize(a).width,height:i.h-2}),n(a).css({height:i.h-2}),e},activeMenu:function(e){var t=this;n(t.getEl().lastChild).toggleClass(t.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r,i=e.state.get("icon"),o=e.state.get("text"),a="";return r=e.settings.image,r?(i="none","string"!=typeof r&&(r=window.getSelection?r[0]:r[1]),r=" style=\"background-image: url('"+r+"')\""):r="",i=e.settings.icon?n+"ico "+n+"i-"+i:"",o&&(e.classes.add("btn-has-text"),a='<span class="'+n+'txt">'+e.encode(o)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(i?'<i class="'+i+'"'+r+"></i>":"")+a+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1">'+(e._menuBtnText?(i?"\xa0":"")+e._menuBtnText:"")+' <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void(t&&t.call(this,e));n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Gt,[Bt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}})}),r(Jt,[Ee,g,pe],function(e,t,n){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t(n).removeClass(this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t(n).addClass(this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='<div id="'+o+'" class="'+r+'tab" unselectable="on" role="tab" aria-controls="'+t._id+'" aria-selected="false" tabIndex="-1">'+e.encode(t.settings.title)+"</div>"}),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1"><div id="'+e._id+'-head" class="'+r+'tabs" role="tablist">'+n+'</div><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div></div>"},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,t,r,i;r=n.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=n.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,t=e._super(),t.deltaH+=o,t.innerH=t.h-t.deltaH,t}})}),r(Qt,[De,m,pe],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("textbox"),e.multiline?t.classes.add("multiline"):(t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))}),t.on("keyup",function(e){t.state.set("value",e.target.value)}))},repaint:function(){var e=this,t,n,r,i,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e.borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,r=e.settings,i,o;return i={id:e._id,hidefocus:"1"},t.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){i[e]=r[e]}),e.disabled()&&(i.disabled="disabled"),r.subtype&&(i.type=r.subtype),o=n.create(r.multiline?"textarea":"input",i),o.value=e.state.get("value"),o.className=e.classes,o.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e.getEl().value=e.state.get("value"),e._super(),e.$el.on("change",function(t){ e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!=t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.value}),e._super()},remove:function(){this.$el.off(),this._super()}})}),r(Zt,[],function(){var e=this||window,t=function(){return e.tinymce};return"function"==typeof e.define&&(e.define.amd||e.define("ephox/tinymce",[],t)),{}}),a([l,c,u,d,f,h,m,g,v,y,C,w,N,E,T,A,B,D,L,M,P,O,I,F,j,Y,J,Q,oe,ae,se,le,ue,fe,he,ve,ye,be,Ce,xe,we,Ne,Ee,_e,Se,ke,Te,Re,Ae,Be,De,Le,Me,Pe,Ie,ze,tt,nt,rt,it,at,st,lt,ct,ut,dt,ft,ht,pt,mt,gt,vt,yt,bt,Ct,xt,wt,Nt,Et,_t,St,kt,Tt,Rt,At,Bt,Dt,Lt,Mt,Pt,Ot,Ht,It,Ft,zt,Ut,Wt,Vt,$t,qt,jt,Yt,Xt,Kt,Gt,Jt,Qt])}(this); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/webcamjs-master2/webcam.js?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding |
| Request Header - size: 505 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/javascript/webcamjs-master2/webcam.js?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,144 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:41 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 26791 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 26,791 bytes. |
// WebcamJS v1.0.16
// Webcam library for capturing JPEG/PNG images in JavaScript // Attempts getUserMedia, falls back to Flash // Author: Joseph Huckaby: http://github.com/jhuckaby // Based on JPEGCam: http://code.google.com/p/jpegcam/ // Copyright (c) 2012 - 2016 Joseph Huckaby // Licensed under the MIT License (function(window) { var _userMedia; // declare error types // inheritance pattern here: // https://stackoverflow.com/questions/783818/how-do-i-create-a-custom-error-in-javascript function FlashError() { var temp = Error.apply(this, arguments); temp.name = this.name = "FlashError"; this.stack = temp.stack; this.message = temp.message; } function WebcamError() { var temp = Error.apply(this, arguments); temp.name = this.name = "WebcamError"; this.stack = temp.stack; this.message = temp.message; } IntermediateInheritor = function() {}; IntermediateInheritor.prototype = Error.prototype; FlashError.prototype = new IntermediateInheritor(); WebcamError.prototype = new IntermediateInheritor(); var Webcam = { version: '1.0.16', // globals protocol: location.protocol.match(/https/i) ? 'https' : 'http', loaded: false, // true when webcam movie finishes loading live: false, // true when webcam is initialized and ready to snap userMedia: true, // true when getUserMedia is supported natively params: { width: 0, height: 0, dest_width: 0, // size of captured image dest_height: 0, // these default to width/height image_format: 'jpeg', // image format (may be jpeg or png) jpeg_quality: 90, // jpeg image quality from 0 (worst) to 100 (best) enable_flash: true, // enable flash fallback, force_flash: false, // force flash mode, flip_horiz: false, // flip image horiz (mirror mode) fps: 30, // camera frames per second upload_name: 'webcam', // name of file in upload post data constraints: null, // custom user media constraints, swfURL: '', // URI to webcam.swf movie (defaults to the js location) flashNotDetectedText: 'ERROR: No Adobe Flash Player detected. Webcam.js relies on Flash for browsers that do not support getUserMedia (like yours).', noInterfaceFoundText: 'No supported webcam interface found.', unfreeze_snap: true // Whether to unfreeze the camera after snap (defaults to true) }, errors: { FlashError: FlashError, WebcamError: WebcamError }, hooks: {}, // callback hook functions init: function() { // initialize, check for getUserMedia support var self = this; // Setup getUserMedia, with polyfill for older browsers // Adapted from: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia this.mediaDevices = (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) ? navigator.mediaDevices : ((navigator.mozGetUserMedia || navigator.webkitGetUserMedia) ? { getUserMedia: function(c) { return new Promise(function(y, n) { (navigator.mozGetUserMedia || navigator.webkitGetUserMedia).call(navigator, c, y, n); }); } } : null); window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; this.userMedia = this.userMedia && !!this.mediaDevices && !!window.URL; // Older versions of firefox (< 21) apparently claim support but user media does not actually work if (navigator.userAgent.match(/Firefox\D+(\d+)/)) { if (parseInt(RegExp.$1, 10) < 21) this.userMedia = null; } // Make sure media stream is closed when navigating away from page if (this.userMedia) { window.addEventListener( 'beforeunload', function(event) { self.reset(); } ); } }, attach: function(elem) { // create webcam preview and attach to DOM element // pass in actual DOM reference, ID, or CSS selector if (typeof(elem) == 'string') { elem = document.getElementById(elem) || document.querySelector(elem); } if (!elem) { return this.dispatch('error', new WebcamError("Could not locate DOM element to attach to.")); } this.container = elem; elem.innerHTML = ''; // start with empty element // insert "peg" so we can insert our preview canvas adjacent to it later on var peg = document.createElement('div'); elem.appendChild( peg ); this.peg = peg; // set width/height if not already set if (!this.params.width) this.params.width = elem.offsetWidth; if (!this.params.height) this.params.height = elem.offsetHeight; // make sure we have a nonzero width and height at this point if (!this.params.width || !this.params.height) { return this.dispatch('error', new WebcamError("No width and/or height for webcam. Please call set() first, or attach to a visible element.")); } // set defaults for dest_width / dest_height if not set if (!this.params.dest_width) this.params.dest_width = this.params.width; if (!this.params.dest_height) this.params.dest_height = this.params.height; this.userMedia = _userMedia === undefined ? this.userMedia : _userMedia; // if force_flash is set, disable userMedia if (this.params.force_flash) { _userMedia = this.userMedia; this.userMedia = null; } // check for default fps if (typeof this.params.fps !== "number") this.params.fps = 30; // adjust scale if dest_width or dest_height is different var scaleX = this.params.width / this.params.dest_width; var scaleY = this.params.height / this.params.dest_height; if (this.userMedia) { // setup webcam video container var video = document.createElement('video'); video.setAttribute('autoplay', 'autoplay'); video.style.width = '' + this.params.dest_width + 'px'; video.style.height = '' + this.params.dest_height + 'px'; if ((scaleX != 1.0) || (scaleY != 1.0)) { elem.style.overflow = 'hidden'; video.style.webkitTransformOrigin = '0px 0px'; video.style.mozTransformOrigin = '0px 0px'; video.style.msTransformOrigin = '0px 0px'; video.style.oTransformOrigin = '0px 0px'; video.style.transformOrigin = '0px 0px'; video.style.webkitTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; video.style.mozTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; video.style.msTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; video.style.oTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; video.style.transform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; } // add video element to dom elem.appendChild( video ); this.video = video; // ask user for access to their camera var self = this; this.mediaDevices.getUserMedia({ "audio": false, "video": this.params.constraints || { mandatory: { minWidth: this.params.dest_width, minHeight: this.params.dest_height } } }) .then( function(stream) { // got access, attach stream to video video.onloadedmetadata = function(e) { self.stream = stream; self.loaded = true; self.live = true; self.dispatch('load'); self.dispatch('live'); self.flip(); }; video.src = window.URL.createObjectURL( stream ) || stream; }) .catch( function(err) { // JH 2016-07-31 Instead of dispatching error, now falling back to Flash if userMedia fails (thx @john2014) // JH 2016-08-07 But only if flash is actually installed -- if not, dispatch error here and now. if (self.params.enable_flash && self.detectFlash()) { setTimeout( function() { self.params.force_flash = 1; self.attach(elem); }, 1 ); } else { self.dispatch('error', err); } }); } else if (this.params.enable_flash && this.detectFlash()) { // flash fallback window.Webcam = Webcam; // needed for flash-to-js interface var div = document.createElement('div'); div.innerHTML = this.getSWFHTML(); elem.appendChild( div ); } else { this.dispatch('error', new WebcamError( this.params.noInterfaceFoundText )); } // setup final crop for live preview if (this.params.crop_width && this.params.crop_height) { var scaled_crop_width = Math.floor( this.params.crop_width * scaleX ); var scaled_crop_height = Math.floor( this.params.crop_height * scaleY ); elem.style.width = '' + scaled_crop_width + 'px'; elem.style.height = '' + scaled_crop_height + 'px'; elem.style.overflow = 'hidden'; elem.scrollLeft = Math.floor( (this.params.width / 2) - (scaled_crop_width / 2) ); elem.scrollTop = Math.floor( (this.params.height / 2) - (scaled_crop_height / 2) ); } else { // no crop, set size to desired elem.style.width = '' + this.params.width + 'px'; elem.style.height = '' + this.params.height + 'px'; } }, reset: function() { // shutdown camera, reset to potentially attach again if (this.preview_active) this.unfreeze(); // attempt to fix issue #64 this.unflip(); if (this.userMedia) { if (this.stream) { if (this.stream.getVideoTracks) { // get video track to call stop on it var tracks = this.stream.getVideoTracks(); if (tracks && tracks[0] && tracks[0].stop) tracks[0].stop(); } else if (this.stream.stop) { // deprecated, may be removed in future this.stream.stop(); } } delete this.stream; delete this.video; } if (this.userMedia !== true) { // call for turn off camera in flash var movie = this.getMovie(); if (movie && movie._releaseCamera) movie._releaseCamera(); } if (this.container) { this.container.innerHTML = ''; delete this.container; } this.loaded = false; this.live = false; }, set: function() { // set one or more params // variable argument list: 1 param = hash, 2 params = key, value if (arguments.length == 1) { for (var key in arguments[0]) { this.params[key] = arguments[0][key]; } } else { this.params[ arguments[0] ] = arguments[1]; } }, on: function(name, callback) { // set callback hook name = name.replace(/^on/i, '').toLowerCase(); if (!this.hooks[name]) this.hooks[name] = []; this.hooks[name].push( callback ); }, off: function(name, callback) { // remove callback hook name = name.replace(/^on/i, '').toLowerCase(); if (this.hooks[name]) { if (callback) { // remove one selected callback from list var idx = this.hooks[name].indexOf(callback); if (idx > -1) this.hooks[name].splice(idx, 1); } else { // no callback specified, so clear all this.hooks[name] = []; } } }, dispatch: function() { // fire hook callback, passing optional value to it var name = arguments[0].replace(/^on/i, '').toLowerCase(); var args = Array.prototype.slice.call(arguments, 1); if (this.hooks[name] && this.hooks[name].length) { for (var idx = 0, len = this.hooks[name].length; idx < len; idx++) { var hook = this.hooks[name][idx]; if (typeof(hook) == 'function') { // callback is function reference, call directly hook.apply(this, args); } else if ((typeof(hook) == 'object') && (hook.length == 2)) { // callback is PHP-style object instance method hook[0][hook[1]].apply(hook[0], args); } else if (window[hook]) { // callback is global function name window[ hook ].apply(window, args); } } // loop return true; } else if (name == 'error') { if ((args[0] instanceof FlashError) || (args[0] instanceof WebcamError)) { message = args[0].message; } else { message = "Could not access webcam: " + args[0].name + ": " + args[0].message + " " + args[0].toString(); } // default error handler if no custom one specified alert("Webcam.js Error: " + message); } return false; // no hook defined }, setSWFLocation: function(value) { // for backward compatibility. this.set('swfURL', value); }, detectFlash: function() { // return true if browser supports flash, false otherwise // Code snippet borrowed from: https://github.com/swfobject/swfobject var SHOCKWAVE_FLASH = "Shockwave Flash", SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", FLASH_MIME_TYPE = "application/x-shockwave-flash", win = window, nav = navigator, hasFlash = false; if (typeof nav.plugins !== "undefined" && typeof nav.plugins[SHOCKWAVE_FLASH] === "object") { var desc = nav.plugins[SHOCKWAVE_FLASH].description; if (desc && (typeof nav.mimeTypes !== "undefined" && nav.mimeTypes[FLASH_MIME_TYPE] && nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { hasFlash = true; } } else if (typeof win.ActiveXObject !== "undefined") { try { var ax = new ActiveXObject(SHOCKWAVE_FLASH_AX); if (ax) { var ver = ax.GetVariable("$version"); if (ver) hasFlash = true; } } catch (e) {;} } return hasFlash; }, getSWFHTML: function() { // Return HTML for embedding flash based webcam capture movie var html = '', swfURL = this.params.swfURL; // make sure we aren't running locally (flash doesn't work) if (location.protocol.match(/file/)) { this.dispatch('error', new FlashError("Flash does not work from local disk. Please run from a web server.")); return '<h3 style="color:red">ERROR: the Webcam.js Flash fallback does not work from local disk. Please run it from a web server.</h3>'; } // make sure we have flash if (!this.detectFlash()) { this.dispatch('error', new FlashError("Adobe Flash Player not found. Please install from get.adobe.com/flashplayer and try again.")); return '<h3 style="color:red">' + this.params.flashNotDetectedText + '</h3>'; } // set default swfURL if not explicitly set if (!swfURL) { // find our script tag, and use that base URL var base_url = ''; var scpts = document.getElementsByTagName('script'); for (var idx = 0, len = scpts.length; idx < len; idx++) { var src = scpts[idx].getAttribute('src'); if (src && src.match(/\/webcam(\.min)?\.js/)) { base_url = src.replace(/\/webcam(\.min)?\.js.*$/, ''); idx = len; } } if (base_url) swfURL = base_url + '/webcam.swf'; else swfURL = 'webcam.swf'; } // if this is the user's first visit, set flashvar so flash privacy settings panel is shown first if (window.localStorage && !localStorage.getItem('visited')) { this.params.new_user = 1; localStorage.setItem('visited', 1); } // construct flashvars string var flashvars = ''; for (var key in this.params) { if (flashvars) flashvars += '&'; flashvars += key + '=' + escape(this.params[key]); } // construct object/embed tag html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" type="application/x-shockwave-flash" codebase="'+this.protocol+'://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+this.params.width+'" height="'+this.params.height+'" id="webcam_movie_obj" align="middle"><param name="wmode" value="opaque" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+swfURL+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><embed id="webcam_movie_embed" src="'+swfURL+'" wmode="opaque" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+this.params.width+'" height="'+this.params.height+'" name="webcam_movie_embed" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'"></embed></object>'; return html; }, getMovie: function() { // get reference to movie object/embed in DOM if (!this.loaded) return this.dispatch('error', new FlashError("Flash Movie is not loaded yet")); var movie = document.getElementById('webcam_movie_obj'); if (!movie || !movie._snap) movie = document.getElementById('webcam_movie_embed'); if (!movie) this.dispatch('error', new FlashError("Cannot locate Flash movie in DOM")); return movie; }, freeze: function() { // show preview, freeze camera var self = this; var params = this.params; // kill preview if already active if (this.preview_active) this.unfreeze(); // determine scale factor var scaleX = this.params.width / this.params.dest_width; var scaleY = this.params.height / this.params.dest_height; // must unflip container as preview canvas will be pre-flipped this.unflip(); // calc final size of image var final_width = params.crop_width || params.dest_width; var final_height = params.crop_height || params.dest_height; // create canvas for holding preview var preview_canvas = document.createElement('canvas'); preview_canvas.width = final_width; preview_canvas.height = final_height; var preview_context = preview_canvas.getContext('2d'); // save for later use this.preview_canvas = preview_canvas; this.preview_context = preview_context; // scale for preview size if ((scaleX != 1.0) || (scaleY != 1.0)) { preview_canvas.style.webkitTransformOrigin = '0px 0px'; preview_canvas.style.mozTransformOrigin = '0px 0px'; preview_canvas.style.msTransformOrigin = '0px 0px'; preview_canvas.style.oTransformOrigin = '0px 0px'; preview_canvas.style.transformOrigin = '0px 0px'; preview_canvas.style.webkitTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; preview_canvas.style.mozTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; preview_canvas.style.msTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; preview_canvas.style.oTransform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; preview_canvas.style.transform = 'scaleX('+scaleX+') scaleY('+scaleY+')'; } // take snapshot, but fire our own callback this.snap( function() { // add preview image to dom, adjust for crop preview_canvas.style.position = 'relative'; preview_canvas.style.left = '' + self.container.scrollLeft + 'px'; preview_canvas.style.top = '' + self.container.scrollTop + 'px'; self.container.insertBefore( preview_canvas, self.peg ); self.container.style.overflow = 'hidden'; // set flag for user capture (use preview) self.preview_active = true; }, preview_canvas ); }, unfreeze: function() { // cancel preview and resume live video feed if (this.preview_active) { // remove preview canvas this.container.removeChild( this.preview_canvas ); delete this.preview_context; delete this.preview_canvas; // unflag this.preview_active = false; // re-flip if we unflipped before this.flip(); } }, flip: function() { // flip container horiz (mirror mode) if desired if (this.params.flip_horiz) { var sty = this.container.style; sty.webkitTransform = 'scaleX(-1)'; sty.mozTransform = 'scaleX(-1)'; sty.msTransform = 'scaleX(-1)'; sty.oTransform = 'scaleX(-1)'; sty.transform = 'scaleX(-1)'; sty.filter = 'FlipH'; sty.msFilter = 'FlipH'; } }, unflip: function() { // unflip container horiz (mirror mode) if desired if (this.params.flip_horiz) { var sty = this.container.style; sty.webkitTransform = 'scaleX(1)'; sty.mozTransform = 'scaleX(1)'; sty.msTransform = 'scaleX(1)'; sty.oTransform = 'scaleX(1)'; sty.transform = 'scaleX(1)'; sty.filter = ''; sty.msFilter = ''; } }, savePreview: function(user_callback, user_canvas) { // save preview freeze and fire user callback var params = this.params; var canvas = this.preview_canvas; var context = this.preview_context; // render to user canvas if desired if (user_canvas) { var user_context = user_canvas.getContext('2d'); user_context.drawImage( canvas, 0, 0 ); } // fire user callback if desired user_callback( user_canvas ? null : canvas.toDataURL('image/' + params.image_format, params.jpeg_quality / 100 ), canvas, context ); // remove preview if (this.params.unfreeze_snap) this.unfreeze(); }, snap: function(user_callback, user_canvas) { // take snapshot and return image data uri var self = this; var params = this.params; if (!this.loaded) return this.dispatch('error', new WebcamError("Webcam is not loaded yet")); // if (!this.live) return this.dispatch('error', new WebcamError("Webcam is not live yet")); if (!user_callback) return this.dispatch('error', new WebcamError("Please provide a callback function or canvas to snap()")); // if we have an active preview freeze, use that if (this.preview_active) { this.savePreview( user_callback, user_canvas ); return null; } // create offscreen canvas element to hold pixels var canvas = document.createElement('canvas'); canvas.width = this.params.dest_width; canvas.height = this.params.dest_height; var context = canvas.getContext('2d'); // flip canvas horizontally if desired if (this.params.flip_horiz) { context.translate( params.dest_width, 0 ); context.scale( -1, 1 ); } // create inline function, called after image load (flash) or immediately (native) var func = function() { // render image if needed (flash) if (this.src && this.width && this.height) { context.drawImage(this, 0, 0, params.dest_width, params.dest_height); } // crop if desired if (params.crop_width && params.crop_height) { var crop_canvas = document.createElement('canvas'); crop_canvas.width = params.crop_width; crop_canvas.height = params.crop_height; var crop_context = crop_canvas.getContext('2d'); crop_context.drawImage( canvas, Math.floor( (params.dest_width / 2) - (params.crop_width / 2) ), Math.floor( (params.dest_height / 2) - (params.crop_height / 2) ), params.crop_width, params.crop_height, 0, 0, params.crop_width, params.crop_height ); // swap canvases context = crop_context; canvas = crop_canvas; } // render to user canvas if desired if (user_canvas) { var user_context = user_canvas.getContext('2d'); user_context.drawImage( canvas, 0, 0 ); } // fire user callback if desired user_callback( user_canvas ? null : canvas.toDataURL('image/' + params.image_format, params.jpeg_quality / 100 ), canvas, context ); }; // grab image frame from userMedia or flash movie if (this.userMedia) { // native implementation context.drawImage(this.video, 0, 0, this.params.dest_width, this.params.dest_height); // fire callback right away func(); } else { // flash fallback var raw_data = this.getMovie()._snap(); // render to image, fire callback when complete var img = new Image(); img.onload = func; img.src = 'data:image/'+this.params.image_format+';base64,' + raw_data; } return null; }, configure: function(panel) { // open flash configuration panel -- specify tab name: // "camera", "privacy", "default", "localStorage", "microphone", "settingsManager" if (!panel) panel = "camera"; this.getMovie()._configure(panel); }, flashNotify: function(type, msg) { // receive notification from flash about event switch (type) { case 'flashLoadComplete': // movie loaded successfully this.loaded = true; this.dispatch('load'); break; case 'cameraLive': // camera is live and ready to snap this.live = true; this.dispatch('live'); break; case 'error': // Flash error this.dispatch('error', new FlashError(msg)); break; default: // catch-all event, just in case // console.log("webcam flash_notify: " + type + ": " + msg); break; } }, b64ToUint6: function(nChr) { // convert base64 encoded character to 6-bit integer // from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding return nChr > 64 && nChr < 91 ? nChr - 65 : nChr > 96 && nChr < 123 ? nChr - 71 : nChr > 47 && nChr < 58 ? nChr + 4 : nChr === 43 ? 62 : nChr === 47 ? 63 : 0; }, base64DecToArr: function(sBase64, nBlocksSize) { // convert base64 encoded string to Uintarray // from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding var sB64Enc = sBase64.replace(/[^A-Za-z0-9\+\/]/g, ""), nInLen = sB64Enc.length, nOutLen = nBlocksSize ? Math.ceil((nInLen * 3 + 1 >> 2) / nBlocksSize) * nBlocksSize : nInLen * 3 + 1 >> 2, taBytes = new Uint8Array(nOutLen); for (var nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx++) { nMod4 = nInIdx & 3; nUint24 |= this.b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 18 - 6 * nMod4; if (nMod4 === 3 || nInLen - nInIdx === 1) { for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) { taBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255; } nUint24 = 0; } } return taBytes; }, upload: function(image_data_uri, target_url, callback) { // submit image data to server using binary AJAX var form_elem_name = this.params.upload_name || 'webcam'; // detect image format from within image_data_uri var image_fmt = ''; if (image_data_uri.match(/^data\:image\/(\w+)/)) image_fmt = RegExp.$1; else throw "Cannot locate image format in Data URI"; // extract raw base64 data from Data URI var raw_image_data = image_data_uri.replace(/^data\:image\/\w+\;base64\,/, ''); // contruct use AJAX object var http = new XMLHttpRequest(); http.open("POST", target_url, true); // setup progress events if (http.upload && http.upload.addEventListener) { http.upload.addEventListener( 'progress', function(e) { if (e.lengthComputable) { var progress = e.loaded / e.total; Webcam.dispatch('uploadProgress', progress, e); } }, false ); } // completion handler var self = this; http.onload = function() { if (callback) callback.apply( self, [http.status, http.responseText, http.statusText] ); Webcam.dispatch('uploadComplete', http.status, http.responseText, http.statusText); }; // create a blob and decode our base64 to binary var blob = new Blob( [ this.base64DecToArr(raw_image_data) ], {type: 'image/'+image_fmt} ); // stuff into a form, so servers can easily receive it as a standard file upload var form = new FormData(); form.append( form_elem_name, blob, form_elem_name+"."+image_fmt.replace(/e/, '') ); // send data to server http.send(form); } }; Webcam.init(); if (typeof define === 'function' && define.amd) { define( function() { return Webcam; } ); } else if (typeof module === 'object' && module.exports) { module.exports = Webcam; } else { window.Webcam = Webcam; } }(window)); |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/alertify/css/alertify.min.css?v=20220209161346 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAh0lEQVQYlY2QsQ0EIQwEB9cBAR1CJUaI/gigDnwR6NBL/7/xWLNrZ2b8EwGotVpr7eOitWa1VjugiNB7R1UPrKrWe0dEAHBbXUqxMQbeewDmnHjvyTm7C3zDwAUd9c63YQdUVdu6EAJzzquz7HXvTiklt+H9DQFYaxFjvDqllFyMkbXWvfpXHjJrWFgdBq/hAAAAAElFTkSuQmCC |
| Request Header - size: 516 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/alertify/css/alertify.min.css?v=20220209161346 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: text/css,*/*;q=0.1 Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,130 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:06:54 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:46 GMT Accept-Ranges: bytes Content-Length: 19192 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: text/css |
| Response Body - size: 19,192 bytes. |
/*! alertifyjs - v1.2.1 - Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) */
.alertify .ajs-dimmer{position:fixed;z-index:999;top:0;right:0;bottom:0;left:0;padding:0;margin:0;background-color:#252525;opacity:.5}.alertify .ajs-modal{position:fixed;top:0;right:0;left:0;bottom:0;padding:0;overflow-y:auto;z-index:1981}.alertify .ajs-dialog{position:relative;margin:5% auto;min-height:110px;max-width:500px;padding:24px 24px 0;outline:0;background-color:#fff}.alertify .ajs-dialog.ajs-capture:before{content:'';position:absolute;top:0;right:0;bottom:0;left:0;display:block;z-index:1}.alertify .ajs-reset{position:absolute!important;display:inline!important;width:0!important;height:0!important;opacity:0!important}.alertify .ajs-commands{position:absolute;right:4px;margin:-14px 24px 0 0;z-index:2}.alertify .ajs-commands button{display:none;width:10px;height:10px;margin-left:10px;padding:10px;border:0;background-color:transparent;background-repeat:no-repeat;background-position:center;cursor:pointer}.alertify .ajs-commands button.ajs-close{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAh0lEQVQYlY2QsQ0EIQwEB9cBAR1CJUaI/gigDnwR6NBL/7/xWLNrZ2b8EwGotVpr7eOitWa1VjugiNB7R1UPrKrWe0dEAHBbXUqxMQbeewDmnHjvyTm7C3zDwAUd9c63YQdUVdu6EAJzzquz7HXvTiklt+H9DQFYaxFjvDqllFyMkbXWvfpXHjJrWFgdBq/hAAAAAElFTkSuQmCC)}.alertify .ajs-commands button.ajs-maximize{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAOUlEQVQYlWP8//8/AzGAhYGBgaG4uBiv6t7eXkYmooxjYGAgWiELsvHYFMCcRX2rSXcjoSBiJDbAAeD+EGu+8BZcAAAAAElFTkSuQmCC)}.alertify .ajs-header{margin:-24px -24px 0;padding:16px 24px;background-color:#fff}.alertify .ajs-body{min-height:56px}.alertify .ajs-body .ajs-content{padding:16px 24px 16px 16px}.alertify .ajs-footer{padding:4px;margin-left:-24px;margin-right:-24px;min-height:43px;background-color:#fff}.alertify .ajs-footer .ajs-buttons.ajs-primary{text-align:right}.alertify .ajs-footer .ajs-buttons.ajs-primary .ajs-button{margin:4px}.alertify .ajs-footer .ajs-buttons.ajs-auxiliary{float:left;clear:none;text-align:left}.alertify .ajs-footer .ajs-buttons.ajs-auxiliary .ajs-button{margin:4px}.alertify .ajs-footer .ajs-buttons .ajs-button{min-width:88px;min-height:35px}.alertify .ajs-handle{position:absolute;display:none;width:10px;height:10px;right:0;bottom:0;z-index:1;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMS8xNEDQYmMAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAQ0lEQVQYlaXNMQoAIAxD0dT7H657l0KX3iJuUlBUNOsPPCGJm7VDp6ryeMxMuDsAQH7owW3pyn3RS26iKxERMLN3ugOaAkaL3sWVigAAAABJRU5ErkJggg==);-webkit-transform:scaleX(1);transform:scaleX(1);cursor:se-resize}.alertify.ajs-no-overflow .ajs-body .ajs-content{overflow:hidden!important}.alertify.ajs-no-padding.ajs-maximized .ajs-body .ajs-content{left:0;right:0;padding:0}.alertify.ajs-no-padding:not(.ajs-maximized) .ajs-body{margin-left:-24px;margin-right:-24px}.alertify.ajs-no-padding:not(.ajs-maximized) .ajs-body .ajs-content{padding:0}.alertify.ajs-no-padding.ajs-resizable .ajs-body .ajs-content{left:0;right:0}.alertify.ajs-closable .ajs-commands button.ajs-close,.alertify.ajs-maximizable .ajs-commands button.ajs-maximize,.alertify.ajs-maximizable .ajs-commands button.ajs-restore{display:inline-block}.alertify.ajs-maximized .ajs-dialog{width:100%!important;height:100%!important;max-width:none!important;margin:0 auto!important;top:0!important;left:0!important}.alertify.ajs-maximized.ajs-modeless .ajs-modal{position:fixed!important;min-height:100%!important;max-height:none!important;margin:0!important}.alertify.ajs-maximized .ajs-commands button.ajs-maximize{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAASklEQVQYlZWQ0QkAMQhDtXRincOZX78KVtrDCwgqJNEoIB3MPLj7lRUROlpyVXGzby6zWuY+kz6tj5sBMTMAyVV3/595RbOh3cAXsww1raeiOcoAAAAASUVORK5CYII=)}.alertify.ajs-maximized .ajs-dialog,.alertify.ajs-resizable .ajs-dialog{padding:0}.alertify.ajs-maximized .ajs-commands,.alertify.ajs-resizable .ajs-commands{margin:14px 24px 0 0}.alertify.ajs-maximized .ajs-header,.alertify.ajs-resizable .ajs-header{position:absolute;top:0;left:0;right:0;margin:0;padding:16px 24px}.alertify.ajs-maximized .ajs-body,.alertify.ajs-resizable .ajs-body{min-height:224px;display:inline-block}.alertify.ajs-maximized .ajs-body .ajs-content,.alertify.ajs-resizable .ajs-body .ajs-content{position:absolute;top:50px;right:24px;bottom:50px;left:24px;overflow:auto}.alertify.ajs-maximized .ajs-footer,.alertify.ajs-resizable .ajs-footer{position:absolute;left:0;right:0;bottom:0;margin:0}.alertify.ajs-resizable:not(.ajs-maximized) .ajs-dialog{min-width:548px}.alertify.ajs-resizable:not(.ajs-maximized) .ajs-handle{display:block}.alertify.ajs-movable:not(.ajs-maximized) .ajs-header{cursor:move}.alertify.ajs-modeless .ajs-dimmer,.alertify.ajs-modeless .ajs-reset{display:none}.alertify.ajs-modeless .ajs-modal{overflow:visible;max-width:none;max-height:0}.alertify.ajs-modeless.ajs-pinnable .ajs-commands button.ajs-pin{display:inline-block;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAQklEQVQYlcWPMQ4AIAwCqU9u38GbcbHRWN1MvKQDhQFMEpKImGJA0gCgnYw0V0rwxseg5erT4oSkQVI5d9f+e9+xA0NbLpWfitPXAAAAAElFTkSuQmCC)}.alertify.ajs-modeless.ajs-unpinned .ajs-modal{position:absolute}.alertify.ajs-modeless.ajs-unpinned .ajs-commands button.ajs-pin{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAO0lEQVQYlWP8//8/AzGAiShV6AqLi4txGs+CLoBLMYbC3t5eRmyaWfBZhwwYkX2NTxPRvibKjRhW4wMAhxkYGbLu3pEAAAAASUVORK5CYII=)}.alertify.ajs-modeless:not(.ajs-unpinned) .ajs-body{max-height:500px;overflow:auto}.alertify.ajs-basic .ajs-header{opacity:0}.alertify.ajs-basic .ajs-footer{visibility:hidden}.alertify.ajs-frameless .ajs-header{position:absolute;top:0;left:0;right:0;min-height:60px;margin:0;padding:0;opacity:0;z-index:1}.alertify.ajs-frameless .ajs-footer{display:none}.alertify.ajs-frameless .ajs-body .ajs-content{position:absolute;top:0;right:0;bottom:0;left:0}.alertify.ajs-frameless:not(.ajs-resizable) .ajs-dialog{padding-top:0}.alertify.ajs-frameless:not(.ajs-resizable) .ajs-dialog .ajs-commands{margin-top:0}.ajs-no-overflow{overflow:hidden!important;outline:0}.ajs-no-selection,.ajs-no-selection *{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media screen and (max-width:568px){.alertify .ajs-dialog{min-width:150px}.alertify:not(.ajs-maximized) .ajs-modal{padding:0 5%}.alertify:not(.ajs-maximized).ajs-resizable .ajs-dialog{min-width:initial;min-width:auto}}@-moz-document url-prefix(){.alertify button:focus{outline:#3593D2 dotted 1px}}.alertify .ajs-dimmer,.alertify .ajs-modal{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transition-property:opacity,visibility;transition-property:opacity,visibility;-webkit-transition-timing-function:linear;transition-timing-function:linear;-webkit-transition-duration:250ms;transition-duration:250ms}.alertify.ajs-hidden .ajs-dimmer,.alertify.ajs-hidden .ajs-modal{visibility:hidden;opacity:0}.alertify.ajs-in:not(.ajs-hidden) .ajs-dialog{-webkit-animation-duration:500ms;animation-duration:500ms}.alertify.ajs-out.ajs-hidden .ajs-dialog{-webkit-animation-duration:250ms;animation-duration:250ms}.alertify .ajs-dialog.ajs-shake{-webkit-animation-name:ajs-shake;animation-name:ajs-shake;-webkit-animation-duration:.1s;animation-duration:.1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}@-webkit-keyframes ajs-shake{0%,100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}20%,40%,60%,80%{-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}}@keyframes ajs-shake{0%,100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}20%,40%,60%,80%{-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}}.alertify.ajs-slide.ajs-in:not(.ajs-hidden) .ajs-dialog{-webkit-animation-name:ajs-slideIn;animation-name:ajs-slideIn;-webkit-animation-timing-function:cubic-bezier(0.175,.885,.32,1.275);animation-timing-function:cubic-bezier(0.175,.885,.32,1.275)}.alertify.ajs-slide.ajs-out.ajs-hidden .ajs-dialog{-webkit-animation-name:ajs-slideOut;animation-name:ajs-slideOut;-webkit-animation-timing-function:cubic-bezier(0.6,-.28,.735,.045);animation-timing-function:cubic-bezier(0.6,-.28,.735,.045)}.alertify.ajs-zoom.ajs-in:not(.ajs-hidden) .ajs-dialog{-webkit-animation-name:ajs-zoomIn;animation-name:ajs-zoomIn}.alertify.ajs-zoom.ajs-out.ajs-hidden .ajs-dialog{-webkit-animation-name:ajs-zoomOut;animation-name:ajs-zoomOut}.alertify.ajs-fade.ajs-in:not(.ajs-hidden) .ajs-dialog{-webkit-animation-name:ajs-fadeIn;animation-name:ajs-fadeIn}.alertify.ajs-fade.ajs-out.ajs-hidden .ajs-dialog{-webkit-animation-name:ajs-fadeOut;animation-name:ajs-fadeOut}.alertify.ajs-pulse.ajs-in:not(.ajs-hidden) .ajs-dialog{-webkit-animation-name:ajs-pulseIn;animation-name:ajs-pulseIn}.alertify.ajs-pulse.ajs-out.ajs-hidden .ajs-dialog{-webkit-animation-name:ajs-pulseOut;animation-name:ajs-pulseOut}.alertify.ajs-flipx.ajs-in:not(.ajs-hidden) .ajs-dialog{-webkit-animation-name:ajs-flipInX;animation-name:ajs-flipInX}.alertify.ajs-flipx.ajs-out.ajs-hidden .ajs-dialog{-webkit-animation-name:ajs-flipOutX;animation-name:ajs-flipOutX}.alertify.ajs-flipy.ajs-in:not(.ajs-hidden) .ajs-dialog{-webkit-animation-name:ajs-flipInY;animation-name:ajs-flipInY}.alertify.ajs-flipy.ajs-out.ajs-hidden .ajs-dialog{-webkit-animation-name:ajs-flipOutY;animation-name:ajs-flipOutY}@-webkit-keyframes ajs-pulseIn{0%,100%,20%,40%,60%,80%{-webkit-transition-timing-function:cubic-bezier(0.215,.61,.355,1);transition-timing-function:cubic-bezier(0.215,.61,.355,1)}0%{opacity:0;-webkit-transform:scale3d(0.3,.3,.3);transform:scale3d(0.3,.3,.3)}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}40%{-webkit-transform:scale3d(0.9,.9,.9);transform:scale3d(0.9,.9,.9)}60%{opacity:1;-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}80%{-webkit-transform:scale3d(0.97,.97,.97);transform:scale3d(0.97,.97,.97)}100%{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}}@keyframes ajs-pulseIn{0%,100%,20%,40%,60%,80%{-webkit-transition-timing-function:cubic-bezier(0.215,.61,.355,1);transition-timing-function:cubic-bezier(0.215,.61,.355,1)}0%{opacity:0;-webkit-transform:scale3d(0.3,.3,.3);transform:scale3d(0.3,.3,.3)}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}40%{-webkit-transform:scale3d(0.9,.9,.9);transform:scale3d(0.9,.9,.9)}60%{opacity:1;-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}80%{-webkit-transform:scale3d(0.97,.97,.97);transform:scale3d(0.97,.97,.97)}100%{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}}@-webkit-keyframes ajs-pulseOut{20%{-webkit-transform:scale3d(0.9,.9,.9);transform:scale3d(0.9,.9,.9)}50%,55%{opacity:1;-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}100%{opacity:0;-webkit-transform:scale3d(0.3,.3,.3);transform:scale3d(0.3,.3,.3)}}@keyframes ajs-pulseOut{20%{-webkit-transform:scale3d(0.9,.9,.9);transform:scale3d(0.9,.9,.9)}50%,55%{opacity:1;-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}100%{opacity:0;-webkit-transform:scale3d(0.3,.3,.3);transform:scale3d(0.3,.3,.3)}}@-webkit-keyframes ajs-zoomIn{0%{opacity:0;-webkit-transform:scale3d(0.25,.25,.25);transform:scale3d(0.25,.25,.25)}100%{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}}@keyframes ajs-zoomIn{0%{opacity:0;-webkit-transform:scale3d(0.25,.25,.25);transform:scale3d(0.25,.25,.25)}100%{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}}@-webkit-keyframes ajs-zoomOut{0%{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}100%{opacity:0;-webkit-transform:scale3d(0.25,.25,.25);transform:scale3d(0.25,.25,.25)}}@keyframes ajs-zoomOut{0%{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}100%{opacity:0;-webkit-transform:scale3d(0.25,.25,.25);transform:scale3d(0.25,.25,.25)}}@-webkit-keyframes ajs-fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes ajs-fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes ajs-fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes ajs-fadeOut{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes ajs-flipInX{0%{-webkit-transform:perspective(400px) rotate3d(1,0,0,90deg);transform:perspective(400px) rotate3d(1,0,0,90deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);transform:perspective(400px) rotate3d(1,0,0,-20deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(1,0,0,10deg);transform:perspective(400px) rotate3d(1,0,0,10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-5deg);transform:perspective(400px) rotate3d(1,0,0,-5deg)}100%{-webkit-transform:perspective(400px);transform:perspective(400px)}}@keyframes ajs-flipInX{0%{-webkit-transform:perspective(400px) rotate3d(1,0,0,90deg);transform:perspective(400px) rotate3d(1,0,0,90deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);transform:perspective(400px) rotate3d(1,0,0,-20deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(1,0,0,10deg);transform:perspective(400px) rotate3d(1,0,0,10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-5deg);transform:perspective(400px) rotate3d(1,0,0,-5deg)}100%{-webkit-transform:perspective(400px);transform:perspective(400px)}}@-webkit-keyframes ajs-flipOutX{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);transform:perspective(400px) rotate3d(1,0,0,-20deg);opacity:1}100%{-webkit-transform:perspective(400px) rotate3d(1,0,0,90deg);transform:perspective(400px) rotate3d(1,0,0,90deg);opacity:0}}@keyframes ajs-flipOutX{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);transform:perspective(400px) rotate3d(1,0,0,-20deg);opacity:1}100%{-webkit-transform:perspective(400px) rotate3d(1,0,0,90deg);transform:perspective(400px) rotate3d(1,0,0,90deg);opacity:0}}@-webkit-keyframes ajs-flipInY{0%{-webkit-transform:perspective(400px) rotate3d(0,1,0,90deg);transform:perspective(400px) rotate3d(0,1,0,90deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-20deg);transform:perspective(400px) rotate3d(0,1,0,-20deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(0,1,0,10deg);transform:perspective(400px) rotate3d(0,1,0,10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-5deg);transform:perspective(400px) rotate3d(0,1,0,-5deg)}100%{-webkit-transform:perspective(400px);transform:perspective(400px)}}@keyframes ajs-flipInY{0%{-webkit-transform:perspective(400px) rotate3d(0,1,0,90deg);transform:perspective(400px) rotate3d(0,1,0,90deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-20deg);transform:perspective(400px) rotate3d(0,1,0,-20deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(0,1,0,10deg);transform:perspective(400px) rotate3d(0,1,0,10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-5deg);transform:perspective(400px) rotate3d(0,1,0,-5deg)}100%{-webkit-transform:perspective(400px);transform:perspective(400px)}}@-webkit-keyframes ajs-flipOutY{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-15deg);transform:perspective(400px) rotate3d(0,1,0,-15deg);opacity:1}100%{-webkit-transform:perspective(400px) rotate3d(0,1,0,90deg);transform:perspective(400px) rotate3d(0,1,0,90deg);opacity:0}}@keyframes ajs-flipOutY{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-15deg);transform:perspective(400px) rotate3d(0,1,0,-15deg);opacity:1}100%{-webkit-transform:perspective(400px) rotate3d(0,1,0,90deg);transform:perspective(400px) rotate3d(0,1,0,90deg);opacity:0}}@-webkit-keyframes ajs-slideIn{0%{margin-top:-100%}100%{margin-top:5%}}@keyframes ajs-slideIn{0%{margin-top:-100%}100%{margin-top:5%}}@-webkit-keyframes ajs-slideOut{0%{margin-top:5%}100%{margin-top:-100%}}@keyframes ajs-slideOut{0%{margin-top:5%}100%{margin-top:-100%}}.alertify-notifier{position:fixed;width:0;overflow:visible;z-index:1982;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.alertify-notifier .ajs-message{position:relative;width:260px;max-height:0;padding:0;opacity:0;margin:0;-webkit-transition-duration:250ms;transition-duration:250ms;-webkit-transition-timing-function:linear;transition-timing-function:linear}.alertify-notifier .ajs-message.ajs-visible{-webkit-transition-duration:500ms;transition-duration:500ms;-webkit-transition-timing-function:cubic-bezier(0.175,.885,.32,1.275);transition-timing-function:cubic-bezier(0.175,.885,.32,1.275);opacity:1;max-height:100%;padding:15px;margin-top:10px}.alertify-notifier .ajs-message.ajs-success{background:rgba(91,189,114,.95)}.alertify-notifier .ajs-message.ajs-error{background:rgba(217,92,92,.95)}.alertify-notifier .ajs-message.ajs-warning{background:rgba(252,248,215,.95)}.alertify-notifier.ajs-top{top:10px}.alertify-notifier.ajs-bottom{bottom:10px}.alertify-notifier.ajs-right{right:10px}.alertify-notifier.ajs-right .ajs-message{right:-320px}.alertify-notifier.ajs-right .ajs-message.ajs-visible{right:290px}.alertify-notifier.ajs-left{left:10px}.alertify-notifier.ajs-left .ajs-message{left:-300px}.alertify-notifier.ajs-left .ajs-message.ajs-visible{left:0} |
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | org/TR/2011/REC-css3-selectors-20110929/ |
| Request Header - size: 509 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/jquery/1.10.4/js/jquery-1.10.2.min.js?v=20220209161352 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/hris/mf_postype.php Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,145 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:05:05 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 273199 Vary: Accept-Encoding X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Type: application/javascript |
| Response Body - size: 273,199 bytes. |
/*!
* jQuery JavaScript Library v1.10.2 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03T13:48Z */ (function( window, undefined ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; var // The deferred used on DOM ready readyList, // A central reference to the root jQuery(document) rootjQuery, // Support: IE<10 // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined` core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) location = window.location, document = window.document, docElem = document.documentElement, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // [[Class]] -> type pairs class2type = {}, // List of deleted data cache ids, so we can reuse them core_deletedIds = [], core_version = "1.10.2", // Save a reference to some core methods core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Used for matching numbers core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, // Used for splitting on whitespace core_rnotwhite = /\S+/g, // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }, // The ready event handler completed = function( event ) { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } }, // Clean-up method for dom ready events detach = function() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: core_version, constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return core_slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }, slice: function() { return this.pushStack( core_slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: core_push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger("ready").off("ready"); } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { if ( obj == null ) { return String( obj ); } return typeof obj === "object" || typeof obj === "function" ? class2type[ core_toString.call(obj) ] || "object" : typeof obj; }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if ( jQuery.support.ownLast ) { for ( key in obj ) { return core_hasOwn.call( obj, key ); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string parseHTML: function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }, parseJSON: function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } if ( data === null ) { return data; } if ( typeof data === "string" ) { // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); if ( data ) { // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } } } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Use native String.trim function wherever possible trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { core_push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( core_indexOf ) { return core_indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var l = second.length, i = first.length, j = 0; if ( typeof l === "number" ) { for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var retVal, ret = [], i = 0, length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return core_concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = core_slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); }, // A method for quickly swapping in/out CSS properties to get correct calculations. // Note: this method belongs to the css module but it's needed here for the support module. // If support gets modularized, this method should be moved back to the css module. swap: function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || type !== "function" && ( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj ); } // All jQuery objects should point back to these rootjQuery = jQuery(document); /*! * Sizzle CSS Selector Engine v1.10.2 * http://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03 */ (function( window, undefined ) { var i, support, cachedruns, Expr, getText, isXML, compile, outermostContext, sortInput, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), hasDuplicate = false, sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; return 0; } return 0; }, // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Prefer arguments quoted, // then not containing pseudos/brackets, // then attribute selectors/non-parenthetical expressions, // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rsibling = new RegExp( whitespace + "*[+~]" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : // BMP codepoint high < 0 ? String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( documentIsHTML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // QSA path if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { nid = old = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && context.parentNode || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key += " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = attrs.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Detect xml * @param {Element|Object} elem An element or a document */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; // Expose support vars for convenience support = Sizzle.support = {}; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.defaultView; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsHTML = !isXML( doc ); // Support: IE>8 // If iframe document is assigned to "document" variable and if iframe has been reloaded, // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 // IE6-8 do not support the defaultView property so parent will be undefined if ( parent && parent.attachEvent && parent !== parent.top ) { parent.attachEvent( "onbeforeunload", function() { setDocument(); }); } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) support.attributes = assert(function( div ) { div.className = "i"; return !div.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if getElementsByClassName can be trusted support.getElementsByClassName = assert(function( div ) { div.innerHTML = "<div class='a'></div><div class='a i'></div>"; // Support: Safari<4 // Catch class over-caching div.firstChild.className = "i"; // Support: Opera<10 // Catch gEBCN failure to find non-leading classes return div.getElementsByClassName("i").length === 2; }); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !doc.getElementsByName || !doc.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && documentIsHTML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select><option selected=''></option></select>"; // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Support: Opera 10-12/IE8 // ^= $= *= and empty values // Should not select anything // Support: Windows 8 Native Apps // The type attribute is restricted during .innerHTML assignment var input = doc.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "t", "" ); if ( div.querySelectorAll("[t^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = docElem.compareDocumentPosition ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); if ( compare ) { // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === doc || contains(preferredDoc, a) ) { return -1; } if ( b === doc || contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } // Not directly comparable, sort on existence of method return a.compareDocumentPosition ? -1 : 1; } : function( a, b ) { var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; // Parentless nodes are either documents or disconnected } else if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return doc; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [elem] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val === undefined ? support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null : val; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array for ( ; (node = elem[i]); i++ ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[5] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] && match[4] !== undefined ) { match[2] = match[4]; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( tokens = [] ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); } function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var data, cache, outerCache, dirkey = dirruns + " " + doneName; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { if ( (data = cache[1]) === true || data === cachedruns ) { return data === true; } } else { cache = outerCache[ dir ] = [ dirkey ]; cache[1] = matcher( elem, context, xml ) || cachedruns; if ( cache[1] === true ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // A counter to specify which element is currently being matched var matcherCachedRuns = 0, bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, expandContext ) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, // We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); if ( outermost ) { outermostContext = context !== document && context; cachedruns = matcherCachedRuns; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below for ( ; (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; cachedruns = ++matcherCachedRuns; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !group ) { group = tokenize( selector ); } i = group.length; while ( i-- ) { cached = matcherFromTokens( group[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); } return cached; }; function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function select( selector, context, results, seed ) { var i, tokens, token, type, find, match = tokenize( selector ); if ( !seed ) { // Try to minimize operations if there is only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && context.parentNode || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } } // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile( selector, match )( seed, context, !documentIsHTML, results, rsibling.test( selector ) ); return results; } // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Support: Chrome<14 // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( document.createElement("div") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert(function( div ) { div.innerHTML = "<input/>"; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert(function( div ) { return div.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return (val = elem.getAttributeNode( name )) && val.specified ? val.value : elem[ name ] === true ? name.toLowerCase() : null; } }); } jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })( window ); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; firingLength = 0; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( list && ( !fired || stack ) ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var action = tuple[ 0 ], fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = core_slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; if( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); jQuery.support = (function( support ) { var all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); // Setup div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // Finish early in limited (non-browser) environments all = div.getElementsByTagName("*") || []; a = div.getElementsByTagName("a")[ 0 ]; if ( !a || !a.style || !all.length ) { return support; } // First batch of tests select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px;float:left;opacity:.5"; // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) support.getSetAttribute = div.className !== "t"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName("tbody").length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !!div.getElementsByTagName("link").length; // Get the style information from getAttribute // (IE uses .cssText instead) support.style = /top/.test( a.getAttribute("style") ); // Make sure that URLs aren't manipulated // (IE normalizes it by default) support.hrefNormalized = a.getAttribute("href") === "/a"; // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 support.opacity = /^0.5/.test( a.style.opacity ); // Verify style float existence // (IE uses styleFloat instead of cssFloat) support.cssFloat = !!a.style.cssFloat; // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) support.checkOn = !!input.value; // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) support.optSelected = opt.selected; // Tests for enctype support on a form (#6743) support.enctype = !!document.createElement("form").enctype; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>"; // Will be defined later support.inlineBlockNeedsLayout = false; support.shrinkWrapBlocks = false; support.pixelPosition = false; support.deleteExpando = true; support.noCloneEvent = true; support.reliableMarginRight = true; support.boxSizingReliable = true; // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE<9 try { delete div.test; } catch( e ) { support.deleteExpando = false; } // Check if we can trust getAttribute("value") input = document.createElement("input"); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "checked", "t" ); input.setAttribute( "name", "t" ); fragment = document.createDocumentFragment(); fragment.appendChild( input ); // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) for ( i in { submit: true, change: true, focusin: true }) { div.setAttribute( eventName = "on" + i, "t" ); support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; } div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Support: IE<9 // Iteration over object's inherited properties before its own. for ( i in jQuery( support ) ) { break; } support.ownLast = i !== "0"; // Run tests that need a body at doc ready jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } container = document.createElement("div"); container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; body.appendChild( container ).appendChild( div ); // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; tds = div.getElementsByTagName("td"); tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Support: IE8 // Check if empty table cells still have offsetWidth/Height support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check box-sizing and margin behavior. div.innerHTML = ""; div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; // Workaround failing boxSizing test due to offsetWidth returning wrong value // with some non-1 values of body zoom, ticket #13543 jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { support.boxSizing = div.offsetWidth === 4; }); // Use window.getComputedStyle because jsdom on node.js will break without it. if ( window.getComputedStyle ) { support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right marginDiv = div.appendChild( document.createElement("div") ); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; support.reliableMarginRight = !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== core_strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Support: IE6 // Check if elements with layout shrink-wrap their children div.style.display = "block"; div.innerHTML = "<div></div>"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); if ( support.inlineBlockNeedsLayout ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); // Null elements to avoid leaks in IE container = div = tds = marginDiv = null; }); // Null elements to avoid leaks in IE all = select = fragment = opt = a = input = null; return support; })({}); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData( elem, name, data, pvt /* Internal Use Only */ ){ if ( !jQuery.acceptData( elem ) ) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( typeof name === "string" ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } i = name.length; while ( i-- ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if ( jQuery.support.deleteExpando || cache != cache.window ) { /* jshint eqeqeq: true */ delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "applet": true, "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { // Do not set data on non-element because it will not be cleared (#8335). if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { return false; } var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; // nodes accept data unless otherwise specified; rejection can be conditional return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); jQuery.fn.extend({ data: function( key, value ) { var attrs, name, data = null, i = 0, elem = this[0]; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attrs = elem.attributes; for ( ; i < attrs.length; i++ ) { name = attrs[i].name; if ( name.indexOf("data-") === 0 ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return arguments.length > 1 ? // Sets one value this.each(function() { jQuery.data( this, key, value ); }) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var nodeHook, boolHook, rclass = /[\t\r\n\f]/g, rreturn = /\r/g, rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, getSetInput = jQuery.support.input; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } elem.className = jQuery.trim( cur ); } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } elem.className = value ? jQuery.trim( cur ) : ""; } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value; if ( typeof stateVal === "boolean" && type === "string" ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), classNames = value.match( core_rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( type === core_strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; }, val: function( value ) { var ret, hooks, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map(val, function ( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { // Use proper attribute retrieval(#6932, #12072) var val = jQuery.find.attr( elem, "value" ); return val != null ? val : elem.text; } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) { optionSet = true; } } // force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return values; } } }, attr: function( elem, name, value ) { var hooks, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === core_strundefined ) { return jQuery.prop( elem, name, value ); } // All attributes are lowercase // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( core_rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( jQuery.expr.match.bool.test( name ) ) { // Set corresponding property to false if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { elem[ propName ] = false; // Support: IE<9 // Also clear defaultChecked/defaultSelected (if appropriate) } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, propFix: { "for": "htmlFor", "class": "className" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? ret : ( elem[ name ] = value ); } else { return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? ret : elem[ name ]; } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); return tabindex ? parseInt( tabindex, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1; } } } }); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr; jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? function( elem, name, isXML ) { var fn = jQuery.expr.attrHandle[ name ], ret = isXML ? undefined : /* jshint eqeqeq: false */ (jQuery.expr.attrHandle[ name ] = undefined) != getter( elem, name, isXML ) ? name.toLowerCase() : null; jQuery.expr.attrHandle[ name ] = fn; return ret; } : function( elem, name, isXML ) { return isXML ? undefined : elem[ jQuery.camelCase( "default-" + name ) ] ? name.toLowerCase() : null; }; }); // fix oldIE attroperties if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = { set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) return name === "value" || value === elem.getAttribute( name ) ? value : undefined; } }; jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = // Some attributes are constructed with empty-string values when not defined function( elem, name, isXML ) { var ret; return isXML ? undefined : (ret = elem.getAttributeNode( name )) && ret.value !== "" ? ret.value : null; }; jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return ret && ret.specified ? ret.value : undefined; }, set: nodeHook.set }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }; }); } // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }; } jQuery.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; }); // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }; if ( !jQuery.support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { // Support: Webkit // "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; }; } }); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = core_hasOwn.call( event, "type" ) ? event.type : event, namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Even when returnValue equals to undefined Firefox will still show alert if ( event.result !== undefined ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === core_strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); var isSimple = /^.[^:#\[\.,]*$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var i, ret = [], self = this, len = self.length; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector || [], true) ); }, filter: function( selector ) { return this.pushStack( winnow(this, selector || [], false) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)) ) { cur = ret.push( cur ); break; } } } return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( jQuery.unique(all) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { ret = jQuery.unique( ret ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } return this.pushStack( ret ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; })); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; }); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; }); } if ( typeof qualifier === "string" ) { if ( isSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, manipulation_rcheckableType = /^(?:checkbox|radio)$/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], area: [ 1, "<map>", "</map>" ], param: [ 1, "<object>", "</object>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } }); }, prepend: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } }); }, before: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { var elem, elems = selector ? jQuery.filter( selector, this ) : this, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var // Snapshot the DOM in case .domManip sweeps something relevant into its fragment args = jQuery.map( this, function( elem ) { return [ elem.nextSibling, elem.parentNode ]; }), i = 0; // Make the changes, replacing each context element with the new content this.domManip( arguments, function( elem ) { var next = args[ i++ ], parent = args[ i++ ]; if ( parent ) { // Don't use the snapshot next if it has moved (#13810) if ( next && next.parentNode !== parent ) { next = this.nextSibling; } jQuery( this ).remove(); parent.insertBefore( elem, next ); } // Allow new content to include elements from the context set }, true ); // Force removal if there was no new content (e.g., from empty arguments) return i ? this : this.remove(); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, callback, allowIntersection ) { // Flatten any nested arrays args = core_concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, self.html() ); } self.domManip( args, callback, allowIntersection ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Hope ajax is available... jQuery._evalUrl( node.src ); } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() core_push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( manipulation_rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !jQuery.support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== core_strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } core_deletedIds.push( id ); } } } } }, _evalUrl: function( url ) { return jQuery.ajax({ url: url, type: "GET", dataType: "script", async: false, global: false, "throws": true }); } }); jQuery.fn.extend({ wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); } }); var iframe, getStyles, curCSS, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, rposition = /^(top|right|bottom|left)$/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), elemdisplay = { BODY: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400 }, cssExpand = [ "Top", "Right", "Bottom", "Left" ], cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function isHidden( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); } } else { if ( !values[ index ] ) { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } jQuery.fn.extend({ css: function( name, value ) { return jQuery.access( this, function( elem, name, value ) { var len, styles, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { if ( typeof state === "boolean" ) { return state ? this.show() : this.hide(); } return this.each(function() { if ( isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "columnCount": true, "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; } }); // NOTE: we've included the "window" in window.getComputedStyle // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { getStyles = function( elem ) { return window.getComputedStyle( elem, null ); }; curCSS = function( elem, name, _computed ) { var width, minWidth, maxWidth, computed = _computed || getStyles( elem ), // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, style = elem.style; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, _computed ) { var left, rs, rsLeft, computed = _computed || getStyles( elem ), ret = computed ? computed[ name ] : undefined, style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } // Try to determine the default display value of an element function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>") .css( "cssText", "display:block !important" ) ).appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; doc.write("<!doctype html><html><body>"); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } // Called ONLY from within css_defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[0], "display" ); elem.remove(); return display; } jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } // These hooks cannot be added until DOM ready because the support test // for it is not run until after DOM ready jQuery(function() { if ( !jQuery.support.reliableMarginRight ) { jQuery.cssHooks.marginRight = { get: function( elem, computed ) { if ( computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } }; } // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = { get: function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } }; }); } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; jQuery.fn.extend({ serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function(){ // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; }) .filter(function(){ var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !manipulation_rcheckableType.test( type ) ); }) .map(function( i, elem ){ var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ){ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); //Serialize an array of form elements or a set of //key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; }); jQuery.fn.extend({ hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); } }); var // Document location ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat("*"); // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( (dataType = dataTypes[i++]) ) { // Prepend if requested if ( dataType[0] === "+" ) { dataType = dataType.slice( 1 ) || "*"; (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); // Otherwise append } else { (structure[ dataType ] = structure[ dataType ] || []).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } }); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, response, type, self = this, off = url.indexOf(" "); if ( off >= 0 ) { selector = url.slice( off, url.length ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax({ url: url, // if "type" variable is undefined, then "GET" method will be used type: type, dataType: "html", data: params }).done(function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); }).complete( callback && function( jqXHR, status ) { self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); }); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ jQuery.fn[ type ] = function( fn ){ return this.on( type, fn ); }; }); jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( (match = rheaders.exec( responseHeadersString )) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to fireGlobals = s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger("ajaxStart"); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) : // Otherwise add one to the end cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader("Last-Modified"); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader("etag"); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); } }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ url: url, type: method, dataType: type, data: data, success: callback }); }; }); /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s[ "throws" ] ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery("head")[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement("script"); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } }); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) ); this[ callback ] = true; return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always(function() { // Restore preexisting value window[ callbackName ] = overwritten; // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; }); // Delegate to script return "script"; } }); var xhrCallbacks, xhrSupported, xhrId = 0, // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject && function() { // Abort all pending requests var key; for ( key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } }; // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties xhrSupported = jQuery.ajaxSettings.xhr(); jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = jQuery.support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport(function( s ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !s.crossDomain || jQuery.support.cors ) { var callback; return { send: function( headers, complete ) { // Get a new xhr var handle, i, xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open( s.type, s.url, s.async, s.username, s.password ); } else { xhr.open( s.type, s.url, s.async ); } // Apply custom fields if provided if ( s.xhrFields ) { for ( i in s.xhrFields ) { xhr[ i ] = s.xhrFields[ i ]; } } // Override mime type if needed if ( s.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( s.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !s.crossDomain && !headers["X-Requested-With"] ) { headers["X-Requested-With"] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } } catch( err ) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( s.hasContent && s.data ) || null ); // Listener callback = function( _, isAbort ) { var status, responseHeaders, statusText, responses; // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; if ( xhrOnUnloadAbort ) { delete xhrCallbacks[ handle ]; } } // If it's an abort if ( isAbort ) { // Abort it manually if needed if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); // When requesting binary data, IE6-9 will throw an exception // on any attempt to access responseText (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && s.isLocal && !s.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } } catch( firefoxAccessException ) { if ( !isAbort ) { complete( -1, firefoxAccessException ); } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, responseHeaders ); } }; if ( !s.async ) { // if we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback setTimeout( callback ); } else { handle = ++xhrId; if ( xhrOnUnloadAbort ) { // Create the active xhrs callbacks list if needed // and attach the unload handler if ( !xhrCallbacks ) { xhrCallbacks = {}; jQuery( window ).unload( xhrOnUnloadAbort ); } // Add to list of active xhrs callbacks xhrCallbacks[ handle ] = callback; } xhr.onreadystatechange = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } }); } var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), rrun = /queueHooks$/, animationPrefilters = [ defaultPrefilter ], tweeners = { "*": [function( prop, value ) { var tween = this.createTween( prop, value ), target = tween.cur(), parts = rfxnum.exec( value ), unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) && rfxnum.exec( jQuery.css( tween.elem, prop ) ), scale = 1, maxIterations = 20; if ( start && start[ 3 ] !== unit ) { // Trust units reported by jQuery.css unit = unit || start[ 3 ]; // Make sure we update the tween properties later on parts = parts || []; // Iteratively approximate from a nonzero starting point start = +target || 1; do { // If previous iteration zeroed out, double until we get *something* // Use a string for doubling factor so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply start = start / scale; jQuery.style( tween.elem, prop, start + unit ); // Update scale, tolerating zero or NaN from tween.cur() // And breaking the loop if scale is unchanged or perfect, or if we've just had enough } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); } // Update tween properties if ( parts ) { start = tween.start = +start || +target || 0; tween.unit = unit; // If a +=/-= token was provided, we're doing a relative animation tween.end = parts[ 1 ] ? start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : +parts[ 2 ]; } return tween; }] }; // Animations created synchronously will run synchronously function createFxNow() { setTimeout(function() { fxNow = undefined; }); return ( fxNow = jQuery.now() ); } function createTween( value, prop, animation ) { var tween, collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( (tween = collection[ index ].call( animation, prop, value )) ) { // we're done with this property return tween; } } } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; }), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ]); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise({ elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {} }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // resolve when we played the last frame // otherwise, reject if ( gotoEnd ) { deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } }), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { return result; } } jQuery.map( props, createTween, animation ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue }) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } function propFilter( props, specialEasing ) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } jQuery.Animation = jQuery.extend( Animation, { tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.split(" "); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; tweeners[ prop ] = tweeners[ prop ] || []; tweeners[ prop ].unshift( callback ); } }, prefilter: function( callback, prepend ) { if ( prepend ) { animationPrefilters.unshift( callback ); } else { animationPrefilters.push( callback ); } } }); function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ var prop, value, toggle, tween, hooks, oldfire, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHidden( elem ), dataShow = jQuery._data( elem, "fxshow" ); // handle queue: false promises if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always(function() { // doing this makes sure that the complete handler will be called // before this completes anim.always(function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } }); }); } // height/width overflow pass if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated if ( jQuery.css( elem, "display" ) === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; } } } if ( opts.overflow ) { style.overflow = "hidden"; if ( !jQuery.support.shrinkWrapBlocks ) { anim.always(function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; }); } } // show/hide pass for ( prop in props ) { value = props[ prop ]; if ( rfxtypes.exec( value ) ) { delete props[ prop ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { continue; } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); } } if ( !jQuery.isEmptyObject( orig ) ) { if ( dataShow ) { if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } } else { dataShow = jQuery._data( elem, "fxshow", {} ); } // store state if its toggle - enables .stop().toggle() to "reverse" if ( toggle ) { dataShow.hidden = !hidden; } if ( hidden ) { jQuery( elem ).show(); } else { anim.done(function() { jQuery( elem ).hide(); }); } anim.done(function() { var prop; jQuery._removeData( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } }); for ( prop in orig ) { tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = tween.start; if ( hidden ) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } } } function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || "swing"; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; if ( tween.elem[ tween.prop ] != null && (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { return tween.elem[ tween.prop ]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Support: IE <=9 // Panic based approach to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; }); jQuery.fn.extend({ fadeTo: function( speed, to, easing, callback ) { // show any hidden elements after setting opacity to 0 return this.filter( isHidden ).css( "opacity", 0 ).show() // animate to the value specified .end().animate({ opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each(function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } }); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each(function() { var index, data = jQuery._data( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.stop ) { hooks.stop.call( this, true ); } // look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // turn off finishing flag delete data.finish; }); } }); // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth? 1 : 0; for( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p*Math.PI ) / 2; } }; jQuery.timers = []; jQuery.fx = Tween.prototype.init; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { if ( timer() && jQuery.timers.push( timer ) ) { jQuery.fx.start(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { clearInterval( timerId ); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Back Compat <1.8 extension point jQuery.fx.step = {}; if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } jQuery.fn.offset = function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== core_strundefined ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }; jQuery.offset = { setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || docElem; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || docElem; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return jQuery.access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return jQuery.access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; }); }); // Limit scope pollution from any deprecated API // (function() { // The number of elements contained in the matched element set jQuery.fn.size = function() { return this.length; }; jQuery.fn.andSelf = jQuery.fn.addBack; // })(); if ( typeof module === "object" && module && typeof module.exports === "object" ) { // Expose jQuery as module.exports in loaders that implement the Node // module pattern (including browserify). Do not create the global, since // the user will be storing it themselves locally, and globals are frowned // upon in the Node module world. module.exports = jQuery; } else { // Otherwise expose jQuery to the global object as usual window.jQuery = window.$ = jQuery; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. if ( typeof define === "function" && define.amd ) { define( "jquery", [], function () { return jQuery; } ); } } })( window ); |
| Instances | 8 |
| Solution |
Manually confirm that the Base64 data does not leak sensitive information, and that the data cannot be aggregated/used to exploit other vulnerabilities.
|
| Reference | http://projects.webappsec.org/w/page/13246936/Information%20Leakage |
| Tags |
OWASP_2021_A04
OWASP_2017_A03 |
| CWE Id | 200 |
| WASC Id | 13 |
| Plugin Id | 10094 |
|
Informational |
Content-Type Header Missing |
|---|---|
| Description |
The Content-Type header was either missing or empty.
|
| URL | http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/font-awesome-4.6.2/fonts/fontawesome-webfont.woff2?v=4.6.2 |
| Method | GET |
| Parameter | |
| Attack | |
| Evidence | |
| Request Header - size: 587 bytes. |
GET http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/font-awesome-4.6.2/fonts/fontawesome-webfont.woff2?v=4.6.2 HTTP/1.1
Host: 192.168.2.47 Proxy-Connection: keep-alive Origin: http://192.168.2.47 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Accept: */* Referer: http://192.168.2.47/online_test/web_standard_onedb//webapp/lib/font-awesome-4.6.2/css/font-awesome.min.css?v=20220209161352 Accept-Language: en-US,en;q=0.9 Cookie: lstv_webapp_onedb_sessid=uu14bqh26bsqtk2ao437jqtu4p |
| Request Body - size: 0 bytes. |
|
| Response Header - size: 1,083 bytes. |
HTTP/1.1 200 OK
Date: Mon, 06 Jun 2022 04:08:42 GMT Server: Apache Content-Security-Policy: script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://yui.yahooapis.com http://ajax.googleapis.com https://ajax.googleapis.com; object-src 'self'; style-src 'self' data: 'unsafe-inline' https://maps.googleapis.com https://maps.gstatic.com https://fonts.googleapis.com https://www.gstatic.com https://maxcdn.bootstrapcdn.com/; img-src 'self' data: https://maps.googleapis.com https://maps.gstatic.com https://www.gstatic.com http://icant.co.uk http://yui.yahooapis.com http://o.aolcdn.com http://maps.google.com; media-src 'self'; frame-src 'self'; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com https://maxcdn.bootstrapcdn.com Last-Modified: Wed, 09 Feb 2022 08:13:52 GMT Accept-Ranges: bytes Content-Length: 71760 X-XSS-Protection: 1; mode=block x-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains |
| Response Body - size: 71,760 bytes. |
wOF2 P S ñ ?FFTM `
¸ æR6$z ~²L?webf[»ÞqEÙö¤»<NUµm´È@z³Ê"ö^©ÈȰq dptwöÿÿÿÙÉby÷èý jUkÛÉ,)({ âpi©9£¢Éc#zC°cjöʺóÊ[JñèëZ7ÜRv:ÈËÞà5àÁ ¸cXZÞ[m\gE¾¨ð¸;XR2gíPðà^c¬¬%CðÔÓðÔxyaÙEábG£ Ã%%ÜxñÄô³"Y%Èd]îJ½ËrÍF²¶¸ .÷3®ÈÆöu¬ü±-³kºïÏiÄÏc ÷%]ÓÿÒ{î½ãÓÑ¿êtÒ /ûo¾²e¾ð?%Æ®!%³®<ð;Þ?ÁL²%¶·}æü@ ˬ&tKÚ;§CĦа,øÜðüÜzKj5bc#$7¢öÀèQ¹!5@ª ÿER!&**ÂÌÀ¸Ó§}º[·¢·f0`0ÆÆ Ç#nÉ6cIE A¬ÄÈׯ¬×ÿ×þ÷Ó×ïUõ¿óÄW$ ÑMQD˶âO9VÿåªÞnÛnvçãm뿪çßT¥ï½tØ ¨#yr qeõ;æsN7nì !Ôè!/¤â Ý@7Ð ôÀ<Pbá+ Nçhj&¶ÿkçßñ ãßñðòõÛ ^~þGÍ(üô )træ÷]jkWuK¶L'àIÖ@hâ ԮŪÌâØE Ã|ë¡úßH¶©iÚ´oÿï©0`ÚU§¶¬ôÑîM`HR Ùb^ 4º-Ñ çöF.(¢ÚvË ¨ã-[£6TmZ5LimûRÊJ"ñÆ:?)<_ìÇïÎÎ>ù&¹Fñ½vô;L'QªLd(§¥Ô²tÇÀ̬ ¢l>Rvû6Y¶dh)YàÀlMqFOÐW¼ Óv`»½#!Àd»ÌªPab6æTÒ²Ø5þ^h÷ÛZýWõÝ{ítÛoL½|ÿ¿åOÛ$]xæxì§îË;«(ó«£:K]zº«Â}Ò\TNÐÈHÖ(¿7Õ*¸ÒÔhW6&Ònó65>ÞïFÝ0 A C $¥R$ R5@!3 r ÔX'·ÆÿeÔHÛ \³K®%ÇRë¬fÏ]téE*¼$¼ÐhïâèÂÐÙ ¹¿OÕêJÊ¢[r{CHS7äûÎm/G¾÷? ý R J6@Émm¢mV7II <¶&©5ÉíMOöN "(»MÉîéNöä¼SÍùÒå2{ZqØl{ÿ[½ðc°Ã.c+áâ@ö ¶,L$è/m'© ó6iÕ^ ÃcÙ,½-±xQÅHÈdÄÔÝÇÿ:dӪ¯þ£`%ç§ÿlëyàwçÄ!R£aüø¹ýÇQm2#%EA$E }ÜzïÑÌÂm¬ cÅáÈøE¤s¹~Ü8té®üà ]°þ ðÌj¾L ¼²ÚJë÷u } ðá/ÅÑÆ@ÐÝiOÓcôûõ{;Éw?`Ͻh¨C9 ÚÞ:#XØû°xÝÀÞ4Ô\ÈU\Ï<εE=)ÕfE¶ý'UhQ1×Þv·¯ËÙÕÝ#>BE!«Û`·YÙj÷ .j×}¶{³|%?ØúO¬EÎ!ÖêM¤Ï]P0@bVS Äsµ¯ÇÓ²mõ¨þÁâ-JGGåZ>ü§ìo÷êÆCÂØbl0D5Ácp,ÞÓÝÕPÿïr:ì6«Ål2ô:Æ;o½ñÚ+/½ðܳÛ~iFî,9¥ÝaçÙßaqï'w(i,ýª¾TÝÉ»Rþ!dEÈoÂMW~x¸ª v½§Ò+Í:ËEÄÍsEÒåÊ鿹fÏ©KuÈ]!éiÓD"yCR""°×,®ZÁ*k¦Nfa¥'J#A'1¸VÕ NbÃE'4Át¤È°[K¶Wm¤1b9ТÐê9sI;Éz¤DM½gðÊ&ÀCByQ©:¨ÄP×¹ M¢UÚÊÂ?Eê4³a¦1]z@)¬ór2IP5ÍMÄÆËÜËØ;b`1Ï\waa|IYàòBÔ¤¤¥bÏÄåQRå§´qN+^A"ÃÊÓ)Í5Å.×<±c¤5AB¹gJùEö ·x4¿nL¸{eLiÄÐJ,ÑΪ)I;aq ݰyÄq.5Z1Ñ é\sYÀ2þ NO¶1ùûctÏý{ 7f=2*}xóø í8u©NnítáEkæÐ§ áv»9LÀ]3½é\LC¿¦Ég/dãÀ÷wÝGÀ!¼ãÈüZ÷OôßϨYÚfÂ` æÓÌì/.ýÃ> jâ~x²Np*KÈåeñ"¦ÀjµÞuÕp/hlQÇÀ å æ*#T`j·%{Nó©wóq$Ê®°F¸fc~|úééï®øöðð¸# Í®ëµ~E±Yþ»îúú]@¾kÿ³O0cÏ.r±»×ùüæog»Q@Vþ6@® ¾ÚÌ ¯×Sß~ÅJÉ|TÊÏÒ êÁÀrÀW.Ä -øî·I*q¸CëÏàÅHÒßýut¤Í'?¬?vOªu·û|¯ä÷_&cìÛsïtI¬]õìRäÓQòy¹Oè&!Á 0<åDÖÀæ§³ÈÙñ¨óM<3¤®SZ$¹ÛçùOÖc*S9̺῵"^Äâl:þi;%r¿íDeÝø%æ^ ¸ÉÀo'M±Üå"ÀÔöÚd4ãóݳa/óUATì{·ýB7AÀqPnTmۥ๠MήYò¢jVO8 1q#'íLàæäN®´âRQºvÍÁí8jʬ®Áºý_½6üg7ZtòÌú¬êqÍÁãQ±x!ÿ7.ÅN.Cþ¬Lù`ɰJx2aÇ}@cþ8 -ªhìñ&Íbse#å¶È»¨ÉTøÇ¬¦ô°[MËÁ½Ü*bµèPmEQìlÍD å§Í-j}Nì¤+Ú±³ºfløä¶½ á@\=7ò@Ä>°Ð'ë~~8]<ÍJf®öõemÒýésºj·s¡mîª çð©Çu\º=_Ö?VuµS! Ç̧f|¥`Øÿ^J)}³\äwòï´1Õ¦ ÍP[:à £b`f43f0²=#b3÷Ö_&»bBìXÎ0»¡d]º u .ÙTÃahmèëú¥6´ñ;ùRAJWÎËßn.´Xl¤TÌóX(³M¨iÆsì¤Ä%ÃéR²ÙÁùó(oK¶f<~÷)p5åî2Ê&1ËìµóE¿¥aÀ ÒxEgY^Ñ|òÊ ö£µ¥1åÜIî,£ÉüSR.¹>ï÷!¥H5¯¿mNôäÍ[p÷û´ç?Í/ðüX^éêVßÈEäÇ§èØ¾µo[þ1,pÚð~Ó²«éc¦ViòŦ2¥©lùd=¯[Ý? Nzë¨sâ>Ü5m S>þ¼1()ÉÂIUÇy^»Gl¯Ô%wÝùxK+äó<|}tTûnµ}úùÛiÞñܬós]¥A¸(Ë[cãFÞ*íç2MËíÑHÝÑ´ú)ö{ J ¥ºÂaô&ô¤¦Ñ0³RÇ>?&EjKêwi:se«&ÿ03ص3?¡0cVHb¬Mô¦Râ$ÍæmXS®s¨ZÕ+ q¸dÀábîf3Ut6ò5¿ÑÌ<ø}3k_#\ë_D|ói÷A 5":xW¾|ç+¸Yó¾âªY·¦ó?£¢J·Zæú|×H u%À¾}ùä¾8Ø×{ì¶(ª2¤*z°ÒØÉèFÑ|;Éð±/\;3S:[æ79¡â 8=©§Ë¦ä8@Ô»õcÙ¿% 4¤D=y+<ºÞ£8[ÿ SY[)¡&2ê÷<îÁ%Ô¾§}£Î5ÓvÔÀfHÁëýåKñ^ð¢`!ßÐRÇëh§è¼a&g.Ð$1Ý?¤²#Ì®Lj.¸kkéd¼_gööµ«íéêZ «Ãsßÿ¼ºMQ§uY¾ÀQÒ#t`Yåi»ÚÖôâ4Ex%®ÛóX¬Z®Ó·$°§D©Í´V¿¸±-þ¦O\!Ï<½/÷å¶À ºF5 ,þ¥ÝO¡Qú Z$»YÉy4ò\#è£ÍpZ¨Þ7z.»nÚ®>-R·²ª1e¬doæVL{´DçÏÏè%9¶â|ï9&Ùç|K¦Íì@ C÷ÁCVlSÓ9lü«h!SÖaÉ»H;.ÍEûÓ'¶ÄÚ1½?Üô«Èð)« 4zºcZ ±ÈzF°¬ì¿{kóµçp«ÙQÓ¾Å×Wëôâ[ì1lNc5ñV½Òcâ»9ÔÛrî>JFY$/,ÅnݵPóúµvâ¹ÜÓº%ÊÀ³äCÿþêBÉ'Ú=ñ±ñÕE½Ê¥XÑf[ýÈY8BËUðÂY#Çøm.ä˳Wçâ æ ¬m]9>CÍÐC*L¦ Ñß²r¿¦íÖA#Mbïwúåi¥ÎQ*eþuéØ) Ó7]Û²×P8ØiÀ¤O(ÓÖ¶Íä¶]9Í8È«Zö_TÚy-¯=.}a£¡þ@$<Óy"º¨õøòEø}znXÎ$o®±b{ûCÑR# ¼Ú¦uBñÔj êÄÏ^ï¦O«©ÇÁ2èÅöÍ¥ùaSu'öÞBWZÉ]N¹¡Ê^oµº¯ö÷ô±«g¡ ùÁ9}|[)gUä/é³>"â¹àÁª¹ïXÝ#x^B?ë¥ÍjãõÌbyÁÐTä{CÁÓkÁï+õÑà)Z@öçX/),ª@³Ï몽¦ùBöP+·\? kjýi}Öe8ÖE-^çËfAHms[toçuX:¹MñºÚëH®<Ú·'NîãX%ÝÀWÀ;El|³ÄØ&ÕQ¹ rÈ/Î<(¾G;± g(F¾=<f^Ö?Àr/kÍÐsmZ³q±h ÜÚ××ìèímöW¢Ì8&Xu¸*6±wSÞѱµO`k½F«1W©hï;·ëlô\n4KkõWD`ê Áeð"°"ÿát¿¹>»dã k9â_ ;J¾¯×«]¼3íöMR»ãX¸Úºàðk[«kÜ£âüó¿óþÌGÜCüÎ}7ºn)A;á>ôµØb§æµ¿ÕñªZ¨Fö;ae,ñfƵ9¬®¸zëvÖ$ö=Ûµ#ýMgw& .SªÑØ ¶\+T²³ mK0öhÛ¦jIp)¬Âÿ³=Ï<?vÜX³Âb:©o<ðô42lÈU3æ¸4Gjð¬<ϰâ¨}±*q{¬ï_ø&àü½í54)bx{³YÕeFãMAòÃLsÑåiÄ ÅÔ×Y~Ý ü`¾&ÝëÒ-;-ÁGö¦¸·ûp` ÏítÒ÷þóXáC*®¢:ixÙÈ(=ûü8ÈûÍ5Ð7eVØv»¨RM:(bJ®·!ÜÕüÆÅÚ¯ìµ!C\f*·?˼¬nåU6VÖ#Q!,7ºqnÈ5es«ñ]ñÂ'Ð{ |/kO0nO°¶ÖòêÐXîHýBÓ®øbÎÂq¢·dØX¹Ïû½4Nq-dÕwëñ1¬íÇÍz ÙyöèÚóÁ°ÏÎV#yòdÄj}þèÓ§Xk&Øc¯±:ÐìÒç vä¸}ɼi¬Ù=wØX÷gÒe?M¾âEù&}*ò{+Y4îóÇHXI×J¸ü ó ë/g·½Ö/ÿ5?"2¡W©j\{ì¶=æÍå§?µ@6ã66@&Dýb#lbMc¿ýó `[(þÌ,©d#1òÕQðZm0×£½uðv&)? =- tÚ.j¦yaÑE¡îut\q{!£|©Í6ÒæÌ9ÈÜ×¼öTDbl1´öß-ÜÜ¡fָܬqO÷¸fÅ8à$N8¿S1ÊV;û×?TóÂ*5§Ûb¨GL Í@|°ßA8«Hôù ãyÙêmµ ¯à`%Þ±¥¼å]°tLLö\XSÔh%Àÿ\û"¬æx^Q,ÊRõÀ²( Á%$¬QùÌ7É:# (¹(â-m4PY?ÂÄ|óͰÄz]nEÝ *BC»öuǼ¢ ¹üA²¢«YëE.íKÐǶý!¨ØN¼b LL:Õø×w1eÐ5cWVWPáçºéáSuI Ìé¯ñ÷¥9X¯Nr¬Ö_⪠Y¨ØoçߥJ3C T¸ ¥¶ÀQä¬F"]Î(ònâMBëu`^®Lý©w÷X^Bðò= $Éè{¦ü=u¬>Øã6BÉÙ3ñÕ§®Shê$2c¢$-jݦ]¬¾nKÇt ?û¾ð|!ß^×ìíÔÓQ°ôpñ$#>¨$E¿ ¦J°<M3Å@¸0¤N}r*©PGÙÌu¡¼$F ¿o®ù&0)²²Èù½ ~³6ñ7` eié©9Ûɵù)Z¶Åò"[ YT#!)dNµõУbêäMðÕ¡RC®yr-¸I#¼}À6lH îØÁ|¹hY_ÛF#!É|Ä$WÁ;JéÞZ[; Dë@ÍsæÃp·W{Þz¿ûwdá þ{4² !H°Eåcõo2ä%ÙB5ùÍx|í¶¬¿ÇAR,9£Ø´æ)f'é°Â-{«}W¶Û>{C¦¢i±6-@+{x]¥Y½.Öñ0:OD2¬ÕÐÄðüPÿÿoO×U¿5ærû,ËûQ0põ -lÁ3=«¯v9ß³Àðï#]Ï/« V·lÅ^TPc¥^ò2 7å£HþÇ"«©}âîÁS& fºæ)$7Å3$ÑtÏ ¬õ(de]y?:;z? x¹±04kðìý{¢1>Èlß>iMÛ!c>¶ *þ· ñÏ»soëËÌü¯96\Áçÿ÷,=Mã ÄÕÞü}å+0àDQÔç©ð9|~ö§½Xz{L÷ )62H½Aç¨âÓ<dIjù-©þO~sóÔ£¼yxom3L¼Ú¾)ê©Ä#ê±rY\1ql²×§´Ü´ yrMëÖ§ÍGnÑ:¶öôñýÕì÷T¹/*Ð%§ ÕHüÎo×ÈìõDqbYW â5¤¨'#éÏ\%H¸µäÿ#èD<»:O«6£ôèíKoBAKÞ Ü!c-na\¸9»õ¶êZ' kmØâ 8ÊP!飮oè§ÚyZØ+Ѿ7¿lS<É NÍ3A2i!1Ñ@vkAØ'Ü(dÙ4Ô XëI¹ö)Ó «r¨u jԬРJü^ÌT_ÞÚÙÑØ_¼¤vâDúÊ3W%i8gTjÔÏ2Gµ/Nq_=´Z©Ù¯þf@^¡ÝÖx·Þ?º"H¶kÑøB:v QMIâµú²ê¡ué 6שA`m´¸¶*Ü'$ìK]ºBÅæººDIÇ$.H\)yÓ²õ¬° /LHåþ'`J|[~QIÐP+ó³è®ÎÊF'BÑý+6æÿ¯ª3¢T(à ºÅ®ðpâ mã~ 9}+B¥ôF£ÂuðÔ¼ÎS òäô0TJ½h´LÓ¤¡qÝ.Ãúß<ä´ãONÝ3Ì]é¶/&Ò[ ůÇÜ3~Ñ®Õݵ¾¸HClß³áûBÄMv %î°\p \9Á«øb?þ«t%<ߤW°yêþ«öB©èÝ9Ø*ÖñZ01Ñ ÎÀ lö¥-×ÞðVT8Ì·µtíÇ:Í øÚäéwrìÜ¡Bb}jM7ûû[¶H¯Gé¼ RL Ùð ÷4ä+÷2nAx' G2 × û¯rþ~MëMk²Ê:«¨!ësTb0#ò{5øóq îp6$±zVV6M²B¯àdB¯I9átÊÉ@ÍÐ*ó°wck'%$S#Â9Oç¡vß§HÓv5,¹ó©ÙþE!;ðÌýIôÙ5®r7®Íã;è(ãD?p.H98AaÕ{ÚigLªý²e ÈÓç>Ü÷ËϾÉ-ôªÔ>!;M{GÌ0S¾@λ¶T*|,OîªQõOHð&Ë=¥<7µë«H>/̹zÜ£Sxoi¶AQáÕ¶ò31¥-ºH¸ææ¶,Yß¿ã5*±Ýи^Ƕ2f Ð À¸ú¶TxÕeLÇ÷ÙsÝih©ããæI£zÌä3GÙ0N£"Çp_WoÇôMÈ"âCu»·PIôáÞU»õûÓ< ùÃá=¸'Ð'µÎ£2f4ùäázXÀÿtõëzõ×ÅNÎaB§®^·åöý!5d7ÄYb7!í¯D"Ь=ĶìLr{Ì¢H$=poð ÐÏõ²E ôÔAjÛÂIé7B2ô QY±¹nɪ½2*2çûÔÌÈôäelxgâY¨-*öÀHÖQ=ZNïHÊêýs¶YQ¶ñf?ï_oVXÕAw \êíÕPKÒ¿îkD±ÆÒ4X@®Í4íËFdwK ç< EÑY >hô]wÅL²!&5øF¸F²S:Ë3§S´¬-¬>ZÜþÆÒ_D&j£¥×È¿3$l)Ûô[îÕ8Eö-,DÐOè ïÍÉË$¼VféÙ±ÄB@¨ªÑ«}ð¨IÅÚÛßT`s¤'ý-S½õ¶ëÎtõÉïQ³¥_$UaxÉÇ/;W8¢R÷iWºÎÆ ×Kø_obÚ´¹ ¼'õ/Ú=é%§±²¦PGE`_M¦rÙGÇO¸®{±ìû»µè~Òß޸ɽÆúÝú®óM£]ò_»úöë/-U¹ê Ë©¾¾ßÿvtKÈ ury83IÔF]QJ¯$ÑmüvaE7í9ò¿¿6òKþÏ:øÀ)Èn °òËòLròh!éëL²±Y¸ÁÀ#ÉéM%ôZÇ¡úÚ`þ¢Zöf[dÜ:Ôk¡áskíFÞÚì6éÐÜ Ä¹µzÏì¢Ù¯î]V©;× I&»U¤¤"J¿kóv¬FõbÍ6¸¦óm¾}ûi·mµòL¶¢¨9ÍÕØV_©Z9xlÞC±¿qIðn î÷qÕ3!×WÏ×ÂÂþ3 ôñà tmPظ<èäËlµEï³Pò)$÷âQ -Ü+Ð £¦ð®&°®!üËPmfiìX=yr+}Ï7/à×úþIãÙ^BfLñ¬?(d8[*iúAÄ[÷í×±¾_Õ<M}²ü;¶`àjlÞÞ(ÿh[vûéStãþðJQj KWÕRùÑT ÛTë&,pèÀÏu+la+çX Ò |¯óý¿Ç¿IÔìoIËäFl¦d&éÔÁä7&µyñÀÕJEc7¨¦ãDïH³ !ÿ_q@ i\Î1a¤ÉãÊXC =ác¹ ¹X¸ÖUÒVæk±noð«büqJwà «a$ê4Øé©(|¬àXK (~à ¶ ·iâîL«©1goµÖªU¨ §¬"®_ ¾µªN h+½ìÚ :¸ÓE§6*¨*e |ZÁUþ»Yå ¨r=IQÀ¿Ã¦¬è¸¡.óÉáx¬ªÅ÷¥;lU É4k6ÜEJØz6OgP¾ãZ)a¸!ËI£*Ô_÷zq`8HÓ ,ÑkZE/#$]9fÓØ©$·¥÷QÃ-W¿æ¼6X<*ÌÒ ÔÌiå*(Ð uèA±8úV bGqUûKÔÒò¶úçYq&O¿[ÎÇ*s ô7©×µ&çVd{¡AWã;¨°j!^fÓ¥(QùL4 ŧèÁë}çv: 6âpDÆÖ0H¦gU¨G@ÊX=uºÃo®ÛJÉMQÒÿ,ÕR5r(¡· )àÊÕ²õuâÃ>(vè!-ÆãcËÉ1¬UÝÕ ¶~,$ÕWrán~µ± Î<uµÁAÁÜz m !s²°²ç ØæÐ¬'ØW|Ê¬Øæ>gþ³Â19íØø2XLÌ]+Ð×òÕeQUCq9&ñfCÎulÜç=ËÖë¼bWô¦i5tdkâó,6~ë¦x]±ÉúmIÖ¸Þx½J 6ì`ý¼îì·`Ær{ók~ÉOcdÆÞUg"İY[é-6fÇã"«\n{Ið[=®[ÖU±èL°5eÓA÷§µ¡¿ ¬÷.4JÉ1)ê&#÷2¨õî C0Ô°ÍW¬×¢ÃØu')\ \qÕV;Ñ[_ËãÉïªÓYGtüâÎå¼òk(óSb{úkdòíëzÀ'@8_ñ}y¸ÖjÜÙ[l&Kû8ë:!üª8 ÖðÆzBar`Õ¦E&¯5M¿}¾DéÉÙÖïìbûgï Ù ãqä Ê_¿Mn»¹gy𢺡jÜ'`5"Ï77ììyóm·!³M{Õ"úöº·$;©k9ød8½ù¦oÑ£M×}·WC9¶by¯e ý,ÿÜÛÑvF`|$Aj+ eï,=ÖDÂéè\^[y÷vl%%NjÐqå«gÙÉþs ¹ÈèÀ%!ªnL]PÿÏÅ?«NÈÿ_mb·Åêúòkå]¨-LþyQ®UvU6Ü ¶ü5Li§6bÂ7LÝçùLu©®"ÖÇ{ü·À)Ð2^¿äÒìªx@A°( ,$u#:ÌMb¯Äã¨R1¬V¬lèÆ¥[üΩÃK÷¨@@@qEÖÚæÊÐÞ¦(ît@29;ÇÉ¿ÛhÈÜ Z,ðuLðüÃR}þöXãßHÁïïPÉì¢.`ý)Mo-X9¹ñ£¨Ln¹Ê`ÞÉvÅf[Z"Ç6ð¹'âøö·ßü}"%v'ªõÛ¼àY)È#ºÝCqøâ^e /Ö>x1Bqj ·(8Ñpé]YwÈOÇ~|Áè 2Bø"wúxd¦«pH½NdI)HDR Gá!Ëj&ß$;MV}=:!r]d6±Æÿâ3ÓlzVx̲ZÆìkÙ/" ºÚÙ1¥U6öKÀJéù¡þÚ} ÇRµ¡ngüXH©ùUÔ¿9±ßZÇÞ#Õà¸7\´®=¿yýó__ê4V¼pIævÌlù~ò`ÕïÜ\ Ïöø¹µ°ëÎbÂoqýÎÓÇð[y³xÆÇjü¨ÍdFÚ¹°Uì>¥_ªþ- +.BnÏò@8Âh/Àôa?âtó6£,æ=WuK½³Ô~ kðɤJR÷+ð PFXöÎ4¥nEàUüÀ!eCå}¤!«ËùîDéï7èfSte IK°+'ñ ÂQ7b2 çÜpP¬mo±lH®Ù_îc"¤ÒÝ» {6!û×]Qjkër(,í:R*Î Úü_åj¬T6¬dþÍ1U7ìlÙ'È@fyÎBÞQx`V\îÉ=ÔiL=Q<ÏüH\ÕÞ:ñ:í@>G!{|½÷ª·,]ûÝy·&ÈéôpSìcÚ´ÂLÁ³j>A_B¼beÚUÛöã¯3¾ÊOªìFÖ«ûûë=R òªàI#QÃø9Õ³É+ i±Q"·p@1Ãf³¼û ·üuÒàʽá2}B¤¤ ²S.Xçª$Ió©%tCïJÐõ êìäËMÿ°}WrÌixª¾b%ì©X±5ÄlýJ¹ðSq»N!1ë¡Ër;2°ÓLúÒNÁ:r0ºsABJB´""iK[4 ÈE9J(W}Db¿]p8+ÿª(·¶ËGú´õzàâË,Ò#&ß9*ÍGQ¢ ë°`Ò,Ð~kÐê³/§JÕYþº%´2ÔÒ]$F&\*Oƽ ¢æJzý>`pð´ïjØ<è¬ú»5Ê+ïðCúFc 9&êÿï*MqòÓ¾Sþ"íEbZòݦºI:5ÿóÜYÒP9Eys}_Õ0kŪÌmk·Êj_Fs·¶iÁbõR@µD(üÿM/'ÖõÔn´pDXÇþV^ aÐ0YBPXÌGÊøZä£$bb¨Ù0 ºóßµHÜ$Bjªee)F1+óoLÿ> ÆKÿÈ.PÿæÊ~_`kXY6&NîG sé´|¶yÀ9[MlMµ@¾ õ#ðÓÐ%U è Ùc·ØµaùÛ¥L Äè3&yÓQ©<:Dtâ°¼ð±Z;§ avGø2x²¹g`Ãx·Ì0KÏDúF¬´nI'ì;cå¶ö¡5 >dV±½U;&{\L*MöÝiK)õ·.ªýáçÀ¡>÷WÚ~èuJÙ,ß8ÑáI Sõ« Â@øw'ï -aEE¤nJ§Kg0õ»aOAD(W3_ÞEý»º/OO¼y¥ÇüêÛ_D§·ÄûjZ 7ÏBld/X²n÷ßßó¹/s{y3Yonø#·æ(-Ê#aÿÅÓåDÊ÷Eõ¹ö|Ò1R· ó¼ÿLø@¢÷ û{»tÄæx¾&H2ÁôpK|]¹®êÔ (ª+7`ÓvåãÕ:ÿ¢ù EsF>ô%HÎ u¡Ó[\2¨?ÝóÝÛpT§ÌΤɷ[^<$Z61Ò¦¯uÄ ´«Y,ÇN~å²]¤ª¦ôï´Cð(¤¸ç:Ò ]µÂ5ÐmkÞ<ãµ,ZÓÁ0k:¼àÆ~ç¦È~ÍÀ!@¾,A7rB¯ký eÀ.þ:9p[Ã5¼q ª57pZ)MPØL¸YéöÖêçÃ{stªÖe$æ!{st#Ee_¡?¯¢Mo®ºâôaZÿíîÍÿîâü"çøgzdzw68ý¢YÍv@ã$0²O÷¿[¢ÒEE Jcdq2& x°&¨Ðû»»üLwoÕ8(æ¤è-;´ÀnkÂëopÅàb¢ ²{ÞêÂ:EFYï$¹uä×x!èÉñ;pV¡í^3FDr5å{;ª}«J{l®%*ª 2±,ä åÚY¿y]ÖþP<°3j¸nþ»é:ä+·çP@yuØ©>kPb¡?|ºÛ¨ ßèÏ&`6yS³eóËBn43úá2ù ß4ì,gò½a÷#< è¯ð~íhÞº³æWpøS¿gÜ:úå ûÛÒ¢F{Nê"°Øwm1,. ÎL% mÖ\`ÀBí%ÌÓ¯xüVmzßlË;®s°M7wê f´ãÁG:äyR¹E¤aúÌfu^¢Ív·®zgnÉA*{UR&myúpN³lóßk8^ä/ ×UUh^ßjQé¿æÓ/HKa4?oÓÝ:xåW ûv rFñÄ)cßsñ\J)2©=+{«=ÈCCZS ÃÅsDñõº¨¿ogÆÈ¶øEÅ4²ùÖ\s¢§iÒóx²¢ Að$J¯MÈj¿.¥ùOϵT ¶ ²ÂJò½{+üÙ,JL«ÅeÃ9æµ:ø|Ù¤ PêóÇ/55>_ÕáSTõ¨ØGÖ¹F6a®¥¸%Ï© «ä/nUJò¯*ôÊ£k\oÀÏ2ü>Þ è)-qXTWߤÞí`++%¶ÆÔ^váEwW×k} <äÐ5Jc¥®h¿º§VThª7ÑD7¸¼ aÓµY¥ry1ÐÝVE§ÝÎR'©Ó)8ö¹±:¶N³²×Athðl¶t¿å·561 úzwÓ)J´èáØDµV'ÖÍõPgkóÖ¥ÓJ$2 wí&Lùÿ+S£=»ÕFWyy½k·#c ëÈ{âQÀ)Ø¡8êKïC"¢«SeäÞF[9õÈM%Ö/Ö´Î~ Êtí~ÜÒm«p«aGîÒñܸ1øÆ]¶¹BÏf¼§Åjx¨ï®kb7|%ªì]íUÉGo]Q°Â[B'|_ÊÇ fÝÝòäÁãå´GzdOÎûò1[y'äØ1×YþbÖ(êc$¸Í&¯ï¡öèÇoS¨Íÿn]ÒnEg:î9|LêJÌÐö¤j_L×y^íê±c [·ÙEÂw.ë:ÒBNY]JIKnÀ´ªò¨\*4édVÈ'wæûO(åîu÷5Z½»×\éÄòÊÊQ.ìÑDüh5,Ô)&)Où·¥BXA}=Bcdµr(í,Ì6åùW§Õ è°¾Û"ÙÙky°ësCß¸Û fG Þ´ë:aã±ë×%£º}ÎÕÃÄ+YäÝÔ!Þ=5"ÁÆK,D ý 5Ç £¡AÈÍÑg8?!Ht×Âûh°ÃòKá/÷L ÊÜ \óIÄ+eÃ9½ùw4 Sò ¼DÈ6IÚó<j¹_æD"uÍ»KbðSæi¹îÙI>@(l 9ϵÔ}Í(´Eàûmå÷§ÛùÍwFÀïÍ+/g$ zÀ;%Mê÷ù¦æÕq/\õ5Ç]ôû¶m©Nuµ¡¨´½Ø¬FÅjß,â?EöðK 7ª©1gÚ%PýÍÙÝ·qå|ìèù+Þkì¥J<±Æy^qC¦å+oZ¹{$aå8&hVE?ËÜUh)¦U·¾È*Îa$Z2ĺ´BAL]¸ÓHÒ/Zw¾¹pZMÄ걪°1Ú"ü¥ÅFUf¸øY1ÝÍÈ5ìó5ÇKRRA¤ÒÅ ìEZ´:§Ì`]ѤÐbò!$ßMtU°nÒÈØØ^"Å8\ÁjߥºÈ{ßó÷âÜ,`àÛÞÕµ£±E^~=4 `iàඦÇ/ o0ü¥I.íÁÿb÷Ôk!d~UïâÿÞËY \¡Bg õßÚiZqKl)~ $öºûVDBùÀ4eYäIÙV²ZE¶J3\g»étÐnt5í9¬m±YÇ2;¦mj÷]H=âi¯]´NøTr~öÏ!Èoþx ÁùdÏÿ¥Löf«ÙÖ̾=pC(5aïÝÀz³ ñï°Çb+İ¡:º@Ϩt+ =cd@+ºWK2²;9WÀ?³¯§¶ñ +YÇ.:DÈ#´ò)xü¬:(b»ÅÞEÕȼS¦ÈØØÎT×Îß½v$¹Jïì |ó®ö»ÂÙD(6¯ÔH:czÒI·ÃèÜH?9àÞìÎ&GC-Cþ¨6ʸ t.¾Äùïó)õ¾íwTvæ,pN÷.Õë¸ÌKåÍw1o°×Î]?xȹàkäS£Á¡/é.wÙî#NªµîVvx§éoyÒ:Ñùóìë1§!*%Lásç!ÆùUo\+~{Yfq¬£Ï=è8g1á3KI'Þ;ã÷窶XçB!OÌF9/öG$!YôM¼&wÆA eøùöÄ 3øFP¯¥#qõÜ·Ó(6°:;yòn°9 dIwï^&'Ä0ͯ£§cW?]³¥ nzÕl 5¦&J10Â.ÍK.Cüõ§ÛL©åCVM®F<eBåq38CHÃÎ@µ´9©bJ%Qáë¨ÜU@l&á.õ9{q]}g iClmõ^Ú <b±CÓNMKGÏÏg¢C)6©ÓØoud±F¨Æ]¡6vÍO¶Á*°ûJJ9ëðkùJc@ ÐêpW UåçÇ7 Û%JHV.|PÞ4KI²cdðLnà^b|_f Á¥:I É2nOvß½+BaZ¥&¬çàÆ·à'C;à&êç|â¾À5Ü|À=Ó¾@~§%AfEqeÍÇãϰ S2*l·ul9`fWÚ)3S xkn¸û¢fÏMÓVØRZ$9$kãÌ_,ÌK"âgIw@¯ÄvÆC]]æsÞá<©6!N÷§;ç p%>¨L±éÝÑiÔ\cn¶''PÉì<àWµ¿ÎÓ| ÿPæPJOnv6Ôë[q!_%ËÑRo:ýHi·Ûa?ËöìlNÄúáô¿Y¼HÊyoÖÍ8)1vìgd5_R6ðÙ¼Y1Zw1¥<ÝM÷ªMwî\oP_8jD©¥Æy,«Dd 6îÄ%h¼ª'ÑH©t(JMQR)°Ä¡&)sÔ¶jmÂo5/vØM¿¾\Ã9lÕg±1§ëÖÓQ±^O u±tRòumr²èû`Åþ9ýÙ·½ýÝPÔÎûÌôIÔE ¤Ýá8v xÇ"`m'w:N·WXª]Lu\øBêYtÛX|È.1°òVkÉ£d»ºÞH×ÿ+`Ó- ÆËì0C{?§÷;d@áÈØòõBïè¯Eøb_±ËÁ2ç-Ô*]éÇ®½Éók±«1uºÀt!±¥7Éi kV¾)®ü°"À§©ÓßÚ§'Þz$ÆKñóvêÚ¸ J=±4c Ib6ÚkIà5²cÔðæúÞ=»ËIźLÚS$ݼÞvÉk¬Ü UJaÅ Û÷=H,dÌNñ ¤u²Ôv%½A,ù½=h© V¥Wäá¨A=kÍ)êºì ëOq6¤,mü!ä)Ýqæ´G |p°ªÂhioãw¨;ãD}míùÑÊ'©u*Qp¸b¨¤yD0¦8×oS/y®VMq>]`a¤©Ý°K)*^·l ògR®ºyfØö°·£¯åfĽ÷à+o+IØ;:QäÒ#B¸æT|#¼^ëiÿ v:5n>¢X2CúpèäÙU¦ìDd!sPïC/*ã)F <JVÊh·á`ï(FIa(±@'UÑÖVl\³vTöÓÿ#rCjì.t ßE8Ëúi`¤Iøh,C# ×çeT6³<ÎtnföÊY¬ZÈÉñ(ÜUõ±â¶]1é~(= 18c°S=ÊÙGR,~WwËåkÞÏó0»xnÔîïd K¢ ¯ûbüËOcâ|þD?#@âH¦SWèÙ§È éøØz¨ ÞåCî HéùשIe$°LÖÀ~Ù×ErVW@¸L+^A[±rPâÕ®²Sf¸R¢¯-õ?§Ð¸&ËJ:øé¹f©¤èd f ÎYüZ²¿ýkÖöc·Ãû ¶¨Ö¢UíqxkøiÙ»ÜmBrµ[#* ¢l?-¯méÃï'lûìK£´g9#d¨Þõ j&â¯3CåV¹¬¼ñ7Tzä×¼Èaý#/qȯ ³µÆ¬eÓ>+Ô3ÏÅXé¸ú½¾x§[Osaò¢ýzâ ¸H¬,ß8Bé¨ý§ ! >Y?Ûa¤ßyr<\ü¿ø¯öáª< ìßî@Ê>¡úΧ9ç¯N°>£çí/ s8Ú#9ãt¯ñ ]âÇÄMá$_}2sAÉoSê #ãÄ÷î&fEÝH$Ú8ü»ºËåÑpþ°!ÃÜQ¡õíĨJ8Õ²²4áÜÕsÈ6#S|ZWtÕ½Ó&Àíþo¥r7®¼í$²¨ä+nEçKfÌÂ&s¼TR#³¶Câ²Z(Ngºª% Î4àv_Õ³º¢7Iëµâ%\FvÄØûjk`ê>y 9 Ūú¦Êj®ûéeå-ÏþëÑ·,&'Z.¥|!n¸Z»äwEÉ;îɹÅSÿzZ ÆwùV?Æú3¯M¤ £qÉÑ 9L[Bd¬²ÝÞm®(U¶_ècuDöàÓ£î¸k}VP^ÔóD =¦ÄÑ ¾¿SÖæv>SФ]Õ©mFô:ÓJ×w; !:¸MÃj|¸vVµ¼ôùØ;.%!Á Úª°Q-êB^óÚÀZ÷ìÓ}Ä ®Å{@ñRÖTcªÈåwîúEºQC×ö¹ß¸(á\ùxñ᪦¬äòɶ`ºO_5>%è8B®ÀáªTïjê>.'ÆÄO¤.ôâ lFסêA=yË9?¾(è}ggæv"¡Õ?Ñi&ÌusÞÄÍ¡s=íKÂËûÔ·Ä9}óv3Ó£m}Q&ïâ¬võÙnX¹»×¢½ûÈþh</ÓmbDÈâÆ62KÔ#iü2Ønì)ñ%¡²Äâ*ìm.J¿¢5¥«< Î =Ì"ÄÄVM{FÎp-±=¹°w 0óêY_×á<òÏ=9©LºÒ»w@ý!>àE:Knnã¸}âéö:î%ÝâÒÉÈÖz·È¢Þò [PM3Ø[´ö9¶Æù ˲Úuy/dz"§ìéi¬ ÷cxZý¤joxÞ´ZÉ"ï7òÁ ját+6)ä:^n}*ä=bAN_ëþ/¢úzIÚjv Â6*iJ%×/ºA ·Ã|vV)?6_âLÏ·MVܼgÆæ `û?-L{f½"NyíÉ>v>uBo7Ï Ï5nU×Î:=N8¹"Od"I&ݯ» âÍñfF?©ö¬ô>AwQ+gþÃÜÀÊ (p=¶lüâ Êì[¯¿[,Êx[9wEY¢(däÀ«vÙÓ×'ÅæÀ ²ä -t,= )ðÀñ×A&÷Ko¹6Þ«sãaþ7x,\ʱ ¸@ÔdïP¤¹9ÖÎ\F"«kÆ×X5deËðÌÕx¸érèÕKj/¬{RPév9Ä=$ûÓ:I9OX¥ÿàÕØêwúv°Ã òn?·Îæ6¾ó|ä6'z¼ü(þ³àd 3½¯tã@úó+M½fü~O¤yðdbF¤û»ï]F!4¦!ÄÏçOÞ7÷ Âó:ítÜSÑ8f¾4ô]ɸ±Â¡ È]Ø Â¶]6ñ?ªãh*SXÁ.ñ¸»)N&kÏ0ÍÒ?"uS'å åܳ&q¬tk+·Ö}vEú¶7Ç^`µ}3tj^ÏÙðÈ|â¾øEgO|yíÌ?kå+>Ð^¯I98/Ý ¬Ï¶å ìï7)o>l0!Ký0§Úµ°Kbd"¿µXé.yåUáKÀøtT kËSäV|"|´BÖ«8Iú=ê[@ÀÅ1IpoA¡©ìÒâcm<ݧÎÒGÅòïÛÓÄÆúî¦/=Ï=9F$øòb³VvÙ¢°±ç}¬«*N³Ü o«[ä5ëóç¹È4]ð 5?±IÍzc¸ Â>zÄ{úqVïðàøúeÝ{-VÈ2¢¦XVZÀÇt6"ì<$Ýñ.D\é²VkDC¦î{øè·ÜI!¶Ë XùuU,XX&VåT´¬ðHëBÛhXÄûYGW Ò,®¥o"ÔôMɦ<v½Ób*¬ý%î ØRP»ÀÝg£AÈêB¢Á¼g)O C Î '`l4JçwY]ÿ¤âã§?tÓR~JúA õO=xçÅï®MÊÄÇò%YJSà,|È´âO¢=oÒê §QÛQõïµmOyÁÒ:ýi¿A}Ë$CPn~0A1MO¨ÝÄ;s:>.)ç/5JøÆA}ùòòúå2yD¦D?®!+ÎÖ8rxxN³¯Gò.ë¿'Ú}v£vJ©z8ÁT!Õ]ª¿n´ÖøÊ!*nLN#¦f5À_ÐBg\ûýÖajiä¥ ô¯eRQïÊ4Mó{ë.ôstzdBÒv¤!Ï1q:5~Oò XrÉqïR?ôè{µRîO´WÓ¬ Ò=óØÒÂÛ"æ îë53KZN¹eEjí+Ö¸qCo¹;<_Ðaù!MJwÜýÂì{zaŨÁ¾2V=æOί4Àÿdð?ä%ÎÍÛ#Ìø>μÚi Ìh× ^¼!Nxi-|£Á¨Å>&Û·éy{óS|úe)yjiuCfÖâO}ÿ{ð{ïùkªlWß5]d#5×1ÈÅ úÉu÷¯Z@ðLMAù@ÞnÛ»ý§9oAËé&¨/|H\Ðëpµ,h¾µËPço¿õSëéç²Ê" µäÂãS®|.cd¬eX?-ðnñà@æÞ'´;RÛ/½¦ß:¦FÐí,4"É><5#CõÉcfkÒât*IJë"1u$e¾{°Ò¯ W¶ÝÈjXgrvo¯õ%ÜUôs§*g»»ÜZ«`ú¬ ùª£ÚÈ)ÀJÜZ¾O _ìÆ1¼{&¤./½ ¿t¯gyCÖvNðCîôùë´ïêµý!ç´È¤ÒZWx$Çû'ÓN¬»íÉìñ $ï-#éjT¢¿ç;ÃúrigSÁRõ´ê{v#¦X.¥2éø¬Þ±¡îl¯ûRóÖOeéÃÁb£8Ð'_ß~ÉÏ{»j^À¯O+5ÛöQýÝÞ1LaÈ]Ç\¶,e-ssÜ;wz6´Å®Vçm¾PGX;_ÊZ¨wçÆ#íþîk?ëà@âùb`/sB=ØÌÐû®ûlo"±È3\v¸C.ÅxUÏ3Öò%ûÁ + <ÔøÕ^ó@²|-½=é É>óa¥*±°RÝ}býs/°Bòñ}ëÄiÀD/ÿ>v Î ×óÞø@r{u×|Òþìçì¨J\¬ô0§¤RAüêxÍØ&2Å ¿µÊ&¿\ðëÌ@\fÁvãç Â!Ãýi@öMJ 9Ieg÷»þ¨üñPBnb?ºIE!Èüü×®j+Z /äòOt#ÐØFµ ï¹4ÔpÞE²~kSrë$O,¸m¿ç,+Áf8É)Ö®åU[%emXæëعc¬ÔÔtÐ|-ïÖxRé}§AÞÐwõCmÎ| a!O ã.+Îq<y!½q4#=ûê -b#ÕnÑ ý]ÞT¡eM.$pü.×é³GmôÜÃ×Üæµ» ãíìÒvô[ô ôêk¡ÖklÊrðx»ÿؽìõrIõ{ßõ2iÖ¿b»ï³c£;LïXYZùédçHÿ25ïì sí¨ÔF.7äÄ |ÈÍÃ?îV+.¨ÁCs§-: E²W2æá®søPNÎìP,u7d ·ÕG¾°'%îxÛ¿güþÿ61¥Õ&¸±¹ ÞyMÓþ;{Rõ¯V# V5:¾fàÀ«¥~AÍQwa3òz1J¿óºnô#Ò¸ØMáÓ gß~¿ªÂd̼ª[ ótx®ßd¶ò§òr½N\ä»çoòÞüò üý½ÿø©!f:ë-½Ú»ÎO'¯ ·çïq*'ºá!éTÉîèF¸§yö¯«`xª¹ÅF!?Åó=û¬ì¼IaxÊׯµ ÂõÊãHN¼v-$mëë,R ¤V`1cCº§ÜîAM«ª 2x+n +ýävíª"a`CVÜ8VÈM|ðþxãlut[:>Z$Ö«qXNé]Î>©'EfË/ÇL\"ÒÝæÞû|:yhß,ÌÁÎALêjöÕ¢ ãVrt§vZ2¸D)®æ\TãòABÝêò~f®BÎí Û|RGmzE¡ÅU+ºwÙÆ/¢2BdÍ9.¹cúO±æ_+Æ6_iúcñÜCG{àjÁ-,Q²ëpÀ/Ð Qá`ÉA3, ÒBZJþ÷¿|8( 4 øD|<®À¥tЬn¢§ß.Ô l}I¡aҨҵ羦ô$zÁcèq&»)÷ß¹®}F -ü±¿C$[@óÄ*"óFIþ0gÂÑÑ^zèZâ¼â ÊÁ¿{« ÉÕHl¶Å·Û8Àd@§øâj_¨¬lü)¿LäÔñí¥«RÜÊü&\¿{'ÂÁÇüÏk¼ÖÕÕ1?pG~(¦)~é*¯/oªÎp¡TÁ2B¥pÅ|Èy´ÏÅÛ\ù´¡9ßÏSb)HdcÍCKHÊà Xu~ʯìÇÌ!}Içe òôY)Í`í]©L8?cbÎ'°ï.»Ñ/°'k¶¬Dá£Xó¥ùW¶äOZù"éJ3DyÁ6=+¤è»4qÃzS[ê0FÒíü4JȺô B§¬·¼óqlUÂç±¾Ïç·+[[Èþw_`}ܯ¯«Ão¨å5Û] a»dcbJª%Ç SÉwßíåÒ7$*]c¾÷÷J¸÷äõaKÓÚJxÙð%jC×0á¯ßZñ§LgU<êúDªG «¯5²OÔXÛò{U¨è.ÍøwOxòêÜb ÙÄÊwþ+Ø,äÙE³S ¡Èôç·¨IÑÞxñ#(Ô_É![ð«b&)f3¿q*ÉDZÆq4êSÝçköõ`¥Ô{¿ëâ ¬=âäkq®FoCó&ß<UÍy½4ºæã¤õÿ3I*K2xfæÖ«HW±ûÉ©b' kèD/h»Û¹,ÂÛbì¶á[YRHM#s¼ºo×\Zi¿}Íï¸,iåæµ¢ Ù¯VãáÔ}b±EE6MJ®ú¤ÜRÕgÑ3er4jn7Ñ¢Wøa[lµ+êæRb 83Az½e©']É$¿~¿äÝÉpä ) .óHÓ#cµ°J³î®9íú 9âÕ£4¢ m²[ǵOkýmD^$åE/ix' å©MnòìkÉàì½M.ýß«îîDåjW÷&ÓI/W},¬9Éj@ flÓ´2fü`qXSTí¨®s8Yí tí&aäÊÏmÈÃð'QñÄîîDÊ<EOLÐ[°Jä«Ù|ínè¸'* Ô=Ús»;¢·Y¡¦ ÕFµÔȶ ³Üõê°Çï #)fæõu^WWypëd¤3Xh ̪×+ûì¹jæåø¼ò¾ô±»Ú äCl¬®ÊÒ)r?ùq1,ùÃ47sfÓ3$B$¦- 5Ö¼ýàPÅôâfw%g|,e_ 6¼9¥÷ØöøM>ÆZ´Þ§,µÕcÅÿöõ¤¶nÜðmµÅmh0w¦¼ûÕ ´Ûú¢:Í0z7?[!·kàrÇ«6Bø¢ñGsÄUKá)GI¯\4¹¬¸~N/Ú@L¨?û8»ª>¬?ðÎÊt¥·MÉRÛl»àª²LÉ yå6¦îH¶é´¼5)eUBÎJ°¦(o »b F".°æbeCZS>.q½÷}Udàçåò´¼òû¤*=¨~dE^÷á¦ìå*U! û¯â-yXRjt%qlé$këÚ)"®þ6qßþ}ÞJËõ&¤$,êÒ(MLÞìÆþûÎ7MÁí$*%ßÎPg£|FûÅ{÷÷fÃ@nîY@ø<³u´>þ9"@øîÀñv±-iÉO.f±CóRàÅÙjÔ¨CN)¼7tTû5`HY¾IÛÐçÖDÅsÐ%Pþùµ(?úç©èÇ µ4ô¼èÖËC¦ÚðøRXªpN;-V Z7#wäÝ I´íëÝ(14"¼J| ÖxÞT#îõ/TlÔ¬K4l¯ÃF÷ÉâL{Ï߬DÔß ßÒ½SJ(EÔ dA] KìÓFª¯¢Ðï#uö Èf-¼ß HÿÒWV¤m·¦æñ ]Õ3ðÀÔ~£ùÏ·ènâðà1ÝØ5HÉkzAn:åsÊ<T+gvuCJÕów«·f ÒÇÖþZÓ`ósK[lt8²Ü¸D#>sgJÊñËÉqñQt¸0\2¯r´¡>5 .1ÖºQ1¹m¸çÌ¥å¦k_ç :<вÛÞUÇÕMø[û}»Þ}~²rùÞÄsÅY6mG®QØÇhíx4'à§Õ6ÀoÌÐc©=)TCÆ=Àøîjìa2Y¬«\ð6|©Õ/5öD)2qfè@Æ»hBYwĽîrÃí±àîésx½È²ß¸$òn9þ¥$î\éÓÕTæV´Ïê©ÈWÀ3§L"ª½ñË1ñÞÉ`y(§Ã¶9CD5ã9tóv¦&xbøÔø«Ûfû9§µ ͲK©½Æ~zEY¯2Ëa Ì[PÕ~¨û RÖÄú BÁ"Ä#÷Ís.)]óüÖNç´ðåKLÅ·©ñ~a¤ §Ñäeñ½L6&RyYYzÃ:cƪ-æ§YPzÀ63V")=i¤Lñín ±86ÇéȲLóyzý4X©t½µfÅæÿR®KLIMê<<` ߬X%Éë´ðA`ñä}oÎnÅC~zð¿'VÊÖÝf^ëûi0ºáHϳ»~1ÇÇgÍxXH3?¬jØÏmêJ¹æè¥½ñÎ;ÄíäoúdòÆiJøH{CIw·`[WýË&qÌ+A¿6ÆíÚö0¨á#¤McªÍíݦ©aýGßyXmBlîÚ§ ëIO³,ªV &È#3¶looLgݽ ÒtÔá~®raÎX°V¸*;¿s&£/¨õs¢Lèò#9Eäø^è[A½ÃÎNsÉRý¹;}Hl"a*ßes÷.²ô¤ù(7\Ô(±7=bô¥`r f_Kþ²/DjþÃö¢BÒ;u0Àè ´ÍºðX¼ìÁLj3S·å¨³ÍR;"7ý³?j)ÕôÈÆq[%ü@ZV)'T ö£ Ø=úrÞA$ OchØoêT¬ßÚ|ËíÃY+(+ÔÜÐÛ¤P*¬På0çRýñÕ½ùâøñæßg])v¯zÉ Ó¹}LõÁH>:ì t4+,O®ãµ Å®ÈÕÕ¨nR[hEP`ö³ âL¥ôÃdOø&ÄöYþ×ÅN¦xàÉtz})¬Vtô¤»òâíÖ鵡Ǭ` Ym?ïjeä6^rw½Îyrße íÕèáµ}óäîQÎy|oeÿ>F)]'_çu=8¢ûx05%Û ³s*Ö巶δÓå4IïPt&ÅäÆZ ?RªÎeÕödí¤´ªÆug¡±"qÖGÙN@Ê¥$® N{»ºRB«ô"¦øk å≮EÐÈ?(],.ñ×ã¿ oH3¢I«#BWnqniÎÑ£#r¼Ø¹ÇÊ:Eù4÷HÊÀL(ì?ÒÙºü¼©Pìu«CÒäæ7"-»h_<|ÃÙ5Ù±X¾!wì×|j9çL1oá»Ó½áÇ/Mhþ³¨h,¶$D2j_}ÆçÛ¥áØ½ê®ú<8¶ÂN\U*cYÓ¼,w½¯!¡êo\¥bLMµXä ÆÕIp &8<^d5Y{K-àFPù%èwÒØÌ!FXçïa ¨l¥²í6¿²£Ôt}KàYWãÝ)¶[ÖZãµÆZMxHäÙÅÙ *ykh¹¬jøÖÆ[Z{!èÏ]~òÜL*ÍTc!PÂý´0þlÅ%Rk,X@Û0íåÈnî¢ÄA¥Zoø.GP8 #øn¾õÖø ®uíÞÅ4«c.q&`kï¾®îO£ô&4>"õ|d}»<h¨é gò±L4V§»$Ó²;Änõ^§ÑÉ3ªLÞAÏ!Þ¢+*íFï´<*Í&£)Ñ?¸-¤dG"²Ï×Ël~1¾üC@ÂÀ÷åï ¨ ¦ _PWÀÛbÂ5CVÍt;¶%û½¥U¢`Î?\DÂA³Æ§ðÆ»¦ýíöÏA6F9.#7®!þûí#M_T~¡wô_£ånZª}V媺ÿzÔPÀOVÐÆ,ë§ #¼b¿cì÷Æo¯±CW'y8aNJ oi9¯Ãþ9yyôu°Péé%ì¨ûqyç÷þ=e)ûmvÎ'/Pr)Òü ÿμo<ªê¾u½êQÞúÚÞoDgâèÎÞè¡[«-7öù&ÈEÒõÈ'-ñy sÃ!K]¾l$Ó{öíôM@ä¡Äeñ²¡ec ISM.Vçð 1åªä:ÜB²#M½éÃôÓ¸T ÂÄ8 #Éç¾E7âL3ò¯EÂ_¶á'Ã!ø3ôÌÙÛùë*Ò|ÐØÍ/)sOÁÕwß?Vß]}ö¼]rj?hçÂZ´yfmxÝT±m @&î¿+zÚ;Gîê@óª°Ç¢:¬t«®p;2ÎÙ¼ÐÌ_8qº³*?bÒ×ÍÁ¬`6 =ÒòèäU¹Üñq#_ya½©n¤aÄ3¨Õ²z=oú(¦[:8úÄ¿KX®ß¦Õ½r ÍäèÂè¦)èà| Ëâ°/$çSª.ZÍô!rvµàitKnuHüÒuĦýLü$ìmvYhÎÎ3~Áå=r"¤°å§J+:t¾:ÄïÖé2%¦«TßÄTÝDúÁÑd¹~[ÇuÕâ´@¢^»QË!ûõ´ïc»ÛS=möë¬Ù«7nFÍJv; Ï#0{*®ü¹ï[Ö¶ÞÚÄ.0ÝâÙgÄÜî¬Ê{`=6 Pf®w<eóx}>I.ÀÍþÃpihv=uÿ!`ÃxþDmýµ½PÀdU+æ &ÐQQîô,Ð~V¬þ³$TÍþ¼êïG!ÕÆU;%Ëd}uuÁ±°þâúâ¶*¢x4ôV«þ2¶oeêÁÅÝ (ä«t©jÕd>ª¶ Áä2-bú39×nõwn`yùBL5íUÒrc¯K8ç-²×ÞkCÃ^SÍ90âÕ^wûÒáë£añ~â÷îKÓÛ½Ð(´¾A)}&غU6ªÆ¨Äu%8ç·'.uªÿñc-X°jÝt÷BH½ÓN+p²9ó¿;ÿàìB|^ÌͲx¶tê¿t\1þ³7Oï4*)ç3á ¨Zcý)lÞ6òSWÿ¨JW÷Æòb, ²b¾çÞa¼-¢rÙ¤'hð&¤äÁ«æ·áÎÅ iª+L1Ë\©!dþè<²Bn)¸æÔ÷÷?UZc¥ë ÖmTÒ BIw16§~>'oòéÿüâÛÂx«6}O°ßÝõ´ÿGsMLNòm¾vùzD,èiÂJh©0É´YZ¯Ù?Î`TjÛVs¥6¦ývö 8ÛÄÈ!¨<ÂÊ/İÅìcNùí1sI> yâÔfÐqÛ9ÃÏÎôÚ©\Ä|ÿ¼¸/*ÅäiƱ ÍÕÀ8©Ú)F>;{6 9ô}G2ú(Õ[ë!3Ó>&OпgRåBÿ§æôspûò°PÞ®&á0¦tã໫)ï?Ly-ô+=öù¿kÓ `ÇÊ97qäï^y×8XO&â!{¤ó%_íc¶R}z§PA¼µoÓE©l¡÷s»Éí_Ë¿H:¨±©(FàÕN¤^2³ x4;ôÔº }S¯«}âÉç P ³mµ0=.ëgÿX7ØmàÄÀöFéox+Éþ°±s{Q7?8z¶ÃGʨçç¡ò¸-#¦j\3ÈÂ;R²ö>:ÞÏ.½{Ôo=+_µz5½/"¥óaߪö¹·mèä`È(*O¹{sÙWO©áøØ¾ WÛ?-ËîïþEìg_ñ½Èûµ¯óvì¤@ýoÕ Çÿ=¼kì:ÙôNfÖÌó]ìÖ;áö{MNY Jæã9kJQÙUàÈ^dk®Ãða°Ä¦øc§N8HEìNO&\fqÛ©=\q¦½n?Ùì©ßï|¹è`%eüÿ´Âÿ#¡a¶ôw$®è&çû¾«Èp-Ïçô[7~AÇÑ~êߪ )w}éýªü¸B-ºVn¶C±õ{|ôG$¹aî[ 4õ&¦¾ú¦,ñq$»ßåË«JFoj×R·ú|>Z¢/Uø+úqHE¿ÝCõ(iûÊ <XG«ª*I>ìðý¼Ê`L]Ç QìùÁqCy°¾Ëú?Rs£sñ<ÿde±)Û|Y~_m[°rÎ ;òoX+8ç<±ºc ý)Ø@k.N?gáDMòt¨O9*ñóifWvjýYW <¥è ÿ«@öX×1ö¶¹Ýó¾½õb·óÑï>¶çyUR6E3á»·Ñòçöö9Ú¹EZk[Î/î>QÀ&RàEsÁr,?ÑRàqroiûÁÍdàÏ33 z¹Dí· ôöºß¦#íÛ% {EyÐ{«Cu¤/^QQä&$Ý}꾺z®SwÞî{é³EIRßÖt©-&ؼ·ôV³%h¡%íg¤þ¹Õ0ÓR{cÊÝ6õÅS]Âh}pÁ¥²{àÀ@B3¤&6ôuOü4k|ÿôN Ó¥¯5ÈܯùÔUP6±EÌïùò}Ûè©Ëç´Ôz&;°:¢O¸MÖ¸l¤±õÒï$¡¡ÞèÇ*óû¡Ès¦<ã^pP^ß{*ð.g~xzù¥á(jª¹àNåÔ®5ê¼Aa¸¦Gã±\ûSk Õð¤r3¯Ä(-,¹Y-äª tÕeÒ¾Ø6îÎ!©ØÞÛâZõä;YþÐïJT"xN¸{ùT-:Ô2HvI\Òqúï _!]<¦J¨+PM¥Â0N^c¦tÞÐ"QRZpùßaZþrj_Kî½ßƨµGZ.þè ©YLoIʰÂoT¶¿H_¶GÍÇÖ£jì¤D¡}¢kM :,á1$ùêo|a§ö8qÞRò-¡éÕÂþDål|ÑE®ã°æúfÛÇ{ /!{,ø@ â -ÿ TjY²Ó)agк+&(-º«¸TrU%T>5m×BBï͵ayÎKÒ¶£Ìá¿õÔN|~ÈN°¿Òªà7ÜûH«¶ßõæ~sæhÜ=ÒÈ[oK6}¬¸NKR+¿G2ÑÑan'/ÎQÐoûJæºÊù©î©<;ÏâvJ¢ÕV.xx¿Þ"h])í³:å¥t³y«¯=Y\á¦PÖ$îȶxÖÚ$¬quâøÅ¤ÃÔÚxvúÌ03/wR\£¯ãÿÄ~¤Üoz:Úùò©®²µ÷6vÁK;®MCE ãÌGârß@w\SUàËT®ººhvë@¯[[;ôÀ h\cÇ ù`ñ-×Êãú_8Ö+dô¯üjN=ò´ëõÝaØ¿^ú¦ö;<ÏnÝ*]¾¤]¦¯ïK))$Süôýr\gèXõ0>x`j¯Ú?ªØ½%Ä%ôÊQFi'>¬I · Oàý#9 ©¼æÈNMVÒ¥dGUsÎ*f0¤ÓnìgAô[ÎßýcȰåÌyc/÷öj%sûªrX»Ó;MDþ°ló-Dÿúz}]t£@O((WëMÃ0ÑÑ´ãcBE£þf'å5ÊÙ¡oºe²À<l.½ÅßuÖ6hþ;ö7Æ7ºA]õéÚ¢$R'Ø¿ªq«>^kã¼rípUW %MX ©D '¾j°÷ê÷E+Å'yMdB8o>^:¸Aâµ mRÞcDgÇqçd'xAQéÞ,ÎgÜ»¶®lÈÕ8¯DÄ/bÝ%¼"mÜ«3,&tXNýÉKÂî!n®_^&éà9âLÝî\±¶ÖËúðæ8kä~ð½÷$dõ]vÉXfÌW0Õ!ÁÚþ£¬X¢Õ9G¡`+m#µDd+ÏÐÚÓaEÞHã^EL§Ö÷.mæM®iKû>À|ÎâDQ\ÝZÎjÄ^VäÊrJQ,Wñ&ÞþQa·ë &\Î|ò®¹#?Ñ{¿×2ë5YFâOãáéUÙ9iµ |Ê©ù ¶j\(\aýw$á@95b «Â1.í6®n,½|«´¶~Ç!*,Ñ7rî·¤mOvÂnCM+fUN-vqºëð¯¢Î´â3M·grM"ÈHyRúÀ½lÞ6íW©°k}}ã¯Z3ÛZ¥äͰ]ÝnÚæò~v´²hf;ZΣhæ!$|bctrÇS.3O4ûmÊì1¢nôK0cT,3Î'<D¾çoÍÚÔ«)°Ûa©^ÒrXs¯>ѹÒe»Ý¦ù"fL½EóÖ³Z 4®ù Ëë¯xíúçzáK"#CN×£sê vµÛ-èÑÎvGÀs¬w~?Å<Äz¸60hrIª{S¬|< IÛ¡RàeòÑøðÄÞq,anujFßLʾè@`© ({5×IF¬Jó3ÛÑ/oÑsÜEð¬íeåð85g´ß¹8Ú¡s~3Îó+&ômåDþÝOR*êÖµÏEEûïÈÇréø¶í,áðý%üXvC7Y¹=2'7 9Î<ì&¹ý¶sÜÖ5et <ÙÂnó*iÎÏ^ÞÖéÉÃß:{>v¡>ßzþlKXxM·^Ž¥h$. í)ØòÖ§ÄÏëÙ.Îùä7Þ B[÷»³;<^2ñ¾nÔ¯¿ðýrèõ¢Álø="ômà 0Ng°®úCþ{î»ø$s0© T®32üéø¬4ú¯Ü@9N®ó/ìçDÁÕhoLNeé®`*lîc,ÒêLLwsÜUµ^|÷úD§GK8ü®@5H(ÓÖT¯¥NÔNOKsÑ7 üvù\©Ë¶ ¢ë9z;£áÔ@uõ6 X Ö2%%ÌñÈ&Äiξڼó®¤oOÀy'Í}Øq«ÄhÓr©BfÁñçô»-=Zwl H³ãPÅòG » 1 Là¿pË+kÚ=~,vfB Ìiûa Ë+_"ÞnP9´×(DnYQ±8~m£ny ndt$ÇãZR@aR5×-wHægø,=úþç³P£G±LÆfؽFÐgwå¿zUÈ1uÄü4ýW¤µXüÍm ¸T`mBÖ-H볦¦¯bÕi¶/;`áj@Í ½ÙïHCy0¶xSíéÓ¦åÚ.ÐÕ&e5ݵùµQt E«`drÓYü´øvÑf»åÍ3H_Ö Ás#V³óÂ_¥¶Ð÷³^صp~b&)µÎÍYÊf¡;M8Û×fxàÍ£² 7P«# ê..ïO(¨Jv5(9Þ-8¼c>èäÿ( J0ÖñnÁ8 /ÿ,¹~½µuF¼<@³µM×jm bþ]Fü¶Î0 B« "¨RQ*Ãàg·¯ch~HWïXØ^àdhd]É¥K&µAªYwPÁï^¼GN|ý$ÉοY+io?"¹j`<ÉymþͧIFHò¯ó#Ý|8ø8²È'£|pm©D! ¸Z ä¤ð']ÜRüO ÷gPÑ6¯1¸Ñß?ãÅ_÷NXs,éíºVnµ|¯Ûz¬Àì "Òm^?¨Ko(ÍÎ#ê%^=H?ö hó{Ôè´Éý5É0A{EïêUÄsíùÜþVæ·é§*×\RïéݬLZwJ¨üh4¸¡Â@Õ ;lÒ©BÞí×-wÿØoÙ&I«¹-·TÄLɹ[»±!vÐO³ Dh¦GG 2O  üo;õ ò®9!Ví÷Ðız ZúÀåø?ÿ»pb'5xçÀ ¤lY e#ìjv, Ò ¾)aKÌ,ÖÔ¬ñô1ྠ]îöĨbQM0bwÿüÙÍ&H¯ JÓ7^É.m40=S:(3Åò®ÄÃDW!«Ã |!0¾vTõT5RKFJQéì¾N£ùÐbHsD qÀæbh>eèëláÄMjûfÆ&R7(_Þ:°n µõ*»ZDÖ|;7§ç®]Þjâíòæ|J`Ñ2°¿ÿ6£m<Þ²r¥lG12fø #Õ¥G¶.Ùã>{1$GcþÞgÈmºþá$×7}>¦ÇÑÁºbû¯x·`OèüÁõ ½9ä÷BþþÙ±þzÌà?.ö§´ÓÀ¿koïm;'?¿ÍWÏöãW_ϧç}ÒlkoÕ¬]¼»zçºÙóvQêº^½¢ü¬¥ÈeDÒKU8Og L¯\ ,»&ºpêV[[ PÆòKJ¶UJ"ÕKµ"ýýiÎô&j@:CaÔªçÈ¥l ^ï¶å?Ø!F,ÊEim¿¾Å«¬DuLØðxS;O ùW¢ËäsPÌ;©ÒÐ(¡sJÉDW@Ãñ×Ï.|þ*æ\' *wìú§|ßû·û`¥n·&GÎ|¾îMõtÁ´Ww´«{£mª[´-äè²oæ0R¬5=ù±[<^%µY:$§îB¸"È6^áJÛ?Æ'TÛo9HaòG6wÚ<½Ì®SÙ8ÃgÀCâQ*Mb%´{ *Ãd´¼_¥kØ¢ítöÖÛfa³-¡ÑÚ^gØÙQ¦ógm ö±2ÑÛ12Cå\Íú C3vz;ä?nÝwù»ñZü$¥eg¼Ë¸Xßfu謽n1+"ø³À0²=V#í5«ujXôÑÀÂcXxB" |