PK!̈́Ĵswfupload/handlers.jsnu[var topWin = window.dialogArguments || opener || parent || top; function fileDialogStart() {} function fileQueued() {} function uploadStart() {} function uploadProgress() {} function prepareMediaItem() {} function prepareMediaItemInit() {} function itemAjaxError() {} function deleteSuccess() {} function deleteError() {} function updateMediaForm() {} function uploadSuccess() {} function uploadComplete() {} function wpQueueError() {} function wpFileError() {} function fileQueueError() {} function fileDialogComplete() {} function uploadError() {} function cancelUpload() {} function switchUploader() { jQuery( '#' + swfu.customSettings.swfupload_element_id ).hide(); jQuery( '#' + swfu.customSettings.degraded_element_id ).show(); jQuery( '.upload-html-bypass' ).hide(); } function swfuploadPreLoad() { switchUploader(); } function swfuploadLoadFailed() { switchUploader(); } jQuery(document).ready(function($){ $( 'input[type="radio"]', '#media-items' ).on( 'click', function(){ var tr = $(this).closest('tr'); if ( $(tr).hasClass('align') ) setUserSetting('align', $(this).val()); else if ( $(tr).hasClass('image-size') ) setUserSetting('imgsize', $(this).val()); }); $( 'button.button', '#media-items' ).on( 'click', function(){ var c = this.className || ''; c = c.match(/url([^ '"]+)/); if ( c && c[1] ) { setUserSetting('urlbutton', c[1]); $(this).siblings('.urlfield').val( $(this).attr('title') ); } }); }); PK!ȑswfupload/handlers.min.jsnu[function fileDialogStart(){}function fileQueued(){}function uploadStart(){}function uploadProgress(){}function prepareMediaItem(){}function prepareMediaItemInit(){}function itemAjaxError(){}function deleteSuccess(){}function deleteError(){}function updateMediaForm(){}function uploadSuccess(){}function uploadComplete(){}function wpQueueError(){}function wpFileError(){}function fileQueueError(){}function fileDialogComplete(){}function uploadError(){}function cancelUpload(){}function switchUploader(){jQuery("#"+swfu.customSettings.swfupload_element_id).hide(),jQuery("#"+swfu.customSettings.degraded_element_id).show(),jQuery(".upload-html-bypass").hide()}function swfuploadPreLoad(){switchUploader()}function swfuploadLoadFailed(){switchUploader()}var topWin=window.dialogArguments||opener||parent||top;jQuery(document).ready(function(a){a('input[type="radio"]',"#media-items").on("click",function(){var b=a(this).closest("tr");a(b).hasClass("align")?setUserSetting("align",a(this).val()):a(b).hasClass("image-size")&&setUserSetting("imgsize",a(this).val())}),a("button.button","#media-items").on("click",function(){var b=this.className||"";b=b.match(/url([^ '"]+)/),b&&b[1]&&(setUserSetting("urlbutton",b[1]),a(this).siblings(".urlfield").val(a(this).attr("title")))})});PK!swfupload/license.txtnu[/** * SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com * * mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/ * * SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilzén and Mammon Media and is released under the MIT License: * http://www.opensource.org/licenses/mit-license.php * * SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License: * http://www.opensource.org/licenses/mit-license.php * */ The MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.PK!}yWWswfupload/swfupload.jsnu[/** * SWFUpload fallback * * @since 4.9.0 */ var SWFUpload; ( function () { function noop() {} if (SWFUpload == undefined) { SWFUpload = function (settings) { this.initSWFUpload(settings); }; } SWFUpload.prototype.initSWFUpload = function ( settings ) { function fallback() { var $ = window.jQuery; var $placeholder = settings.button_placeholder_id ? $( '#' + settings.button_placeholder_id ) : $( settings.button_placeholder ); if ( ! $placeholder.length ) { return; } var $form = $placeholder.closest( 'form' ); if ( ! $form.length ) { $form = $( '
' ); $form.attr( 'action', settings.upload_url ); $form.insertAfter( $placeholder ).append( $placeholder ); } $placeholder.replaceWith( $( '
' ) .append( $( '' ).attr({ name: settings.file_post_name || 'async-upload', accepts: settings.file_types || '*.*' }) ).append( $( '' ) ) ); } try { // Try the built-in fallback. if ( typeof settings.swfupload_load_failed_handler === 'function' && settings.custom_settings ) { window.swfu = { customSettings: settings.custom_settings }; settings.swfupload_load_failed_handler(); } else { fallback(); } } catch ( ex ) { fallback(); } }; SWFUpload.instances = {}; SWFUpload.movieCount = 0; SWFUpload.version = "0"; SWFUpload.QUEUE_ERROR = {}; SWFUpload.UPLOAD_ERROR = {}; SWFUpload.FILE_STATUS = {}; SWFUpload.BUTTON_ACTION = {}; SWFUpload.CURSOR = {}; SWFUpload.WINDOW_MODE = {}; SWFUpload.completeURL = noop; SWFUpload.prototype.initSettings = noop; SWFUpload.prototype.loadFlash = noop; SWFUpload.prototype.getFlashHTML = noop; SWFUpload.prototype.getFlashVars = noop; SWFUpload.prototype.getMovieElement = noop; SWFUpload.prototype.buildParamString = noop; SWFUpload.prototype.destroy = noop; SWFUpload.prototype.displayDebugInfo = noop; SWFUpload.prototype.addSetting = noop; SWFUpload.prototype.getSetting = noop; SWFUpload.prototype.callFlash = noop; SWFUpload.prototype.selectFile = noop; SWFUpload.prototype.selectFiles = noop; SWFUpload.prototype.startUpload = noop; SWFUpload.prototype.cancelUpload = noop; SWFUpload.prototype.stopUpload = noop; SWFUpload.prototype.getStats = noop; SWFUpload.prototype.setStats = noop; SWFUpload.prototype.getFile = noop; SWFUpload.prototype.addFileParam = noop; SWFUpload.prototype.removeFileParam = noop; SWFUpload.prototype.setUploadURL = noop; SWFUpload.prototype.setPostParams = noop; SWFUpload.prototype.addPostParam = noop; SWFUpload.prototype.removePostParam = noop; SWFUpload.prototype.setFileTypes = noop; SWFUpload.prototype.setFileSizeLimit = noop; SWFUpload.prototype.setFileUploadLimit = noop; SWFUpload.prototype.setFileQueueLimit = noop; SWFUpload.prototype.setFilePostName = noop; SWFUpload.prototype.setUseQueryString = noop; SWFUpload.prototype.setRequeueOnError = noop; SWFUpload.prototype.setHTTPSuccess = noop; SWFUpload.prototype.setAssumeSuccessTimeout = noop; SWFUpload.prototype.setDebugEnabled = noop; SWFUpload.prototype.setButtonImageURL = noop; SWFUpload.prototype.setButtonDimensions = noop; SWFUpload.prototype.setButtonText = noop; SWFUpload.prototype.setButtonTextPadding = noop; SWFUpload.prototype.setButtonTextStyle = noop; SWFUpload.prototype.setButtonDisabled = noop; SWFUpload.prototype.setButtonAction = noop; SWFUpload.prototype.setButtonCursor = noop; SWFUpload.prototype.queueEvent = noop; SWFUpload.prototype.executeNextEvent = noop; SWFUpload.prototype.unescapeFilePostParams = noop; SWFUpload.prototype.testExternalInterface = noop; SWFUpload.prototype.flashReady = noop; SWFUpload.prototype.cleanUp = noop; SWFUpload.prototype.fileDialogStart = noop; SWFUpload.prototype.fileQueued = noop; SWFUpload.prototype.fileQueueError = noop; SWFUpload.prototype.fileDialogComplete = noop; SWFUpload.prototype.uploadStart = noop; SWFUpload.prototype.returnUploadStart = noop; SWFUpload.prototype.uploadProgress = noop; SWFUpload.prototype.uploadError = noop; SWFUpload.prototype.uploadSuccess = noop; SWFUpload.prototype.uploadComplete = noop; SWFUpload.prototype.debug = noop; SWFUpload.prototype.debugMessage = noop; SWFUpload.Console = { writeLine: noop }; }() ); PK!cqjquery/jquery.masonry.min.jsnu[/*! * Masonry v2 shim * to maintain backwards compatibility * as of Masonry v3.1.2 * * Cascading grid layout library * http://masonry.desandro.com * MIT License * by David DeSandro */ !function(a){"use strict";var b=a.Masonry;b.prototype._remapV2Options=function(){this._remapOption("gutterWidth","gutter"),this._remapOption("isResizable","isResizeBound"),this._remapOption("isRTL","isOriginLeft",function(a){return!a});var a=this.options.isAnimated;if(void 0!==a&&(this.options.transitionDuration=a?this.options.transitionDuration:0),void 0===a||a){var b=this.options.animationOptions,c=b&&b.duration;c&&(this.options.transitionDuration="string"==typeof c?c:c+"ms")}},b.prototype._remapOption=function(a,b,c){var d=this.options[a];void 0!==d&&(this.options[b]=c?c(d):d)};var c=b.prototype._create;b.prototype._create=function(){var a=this;this._remapV2Options(),c.apply(this,arguments),setTimeout(function(){jQuery(a.element).addClass("masonry")},0)};var d=b.prototype.layout;b.prototype.layout=function(){this._remapV2Options(),d.apply(this,arguments)};var e=b.prototype.option;b.prototype.option=function(){e.apply(this,arguments),this._remapV2Options()};var f=b.prototype._itemize;b.prototype._itemize=function(a){var b=f.apply(this,arguments);return jQuery(a).addClass("masonry-brick"),b};var g=b.prototype.measureColumns;b.prototype.measureColumns=function(){var a=this.options.columnWidth;a&&"function"==typeof a&&(this.getContainerWidth(),this.columnWidth=a(this.containerWidth)),g.apply(this,arguments)},b.prototype.reload=function(){this.reloadItems.apply(this,arguments),this.layout.apply(this)};var h=b.prototype.destroy;b.prototype.destroy=function(){var a=this.getItemElements();jQuery(this.element).removeClass("masonry"),jQuery(a).removeClass("masonry-brick"),h.apply(this,arguments)}}(window);PK!C jquery/jquery.schedule.jsnu[ (function($){$.scheduler=function(){this.bucket={};return;};$.scheduler.prototype={schedule:function(){var ctx={"id":null,"time":1000,"repeat":false,"protect":false,"obj":null,"func":function(){},"args":[]};function _isfn(fn){return(!!fn&&typeof fn!="string"&&typeof fn[0]=="undefined"&&RegExp("function","i").test(fn+""));};var i=0;var override=false;if(typeof arguments[i]=="object"&&arguments.length>1){override=true;i++;} if(typeof arguments[i]=="object"){for(var option in arguments[i]) if(typeof ctx[option]!="undefined") ctx[option]=arguments[i][option];i++;} if(typeof arguments[i]=="number"||(typeof arguments[i]=="string"&&arguments[i].match(RegExp("^[0-9]+[smhdw]$")))) ctx["time"]=arguments[i++];if(typeof arguments[i]=="boolean") ctx["repeat"]=arguments[i++];if(typeof arguments[i]=="boolean") ctx["protect"]=arguments[i++];if(typeof arguments[i]=="object"&&typeof arguments[i+1]=="string"&&_isfn(arguments[i][arguments[i+1]])){ctx["obj"]=arguments[i++];ctx["func"]=arguments[i++];} else if(typeof arguments[i]!="undefined"&&(_isfn(arguments[i])||typeof arguments[i]=="string")) ctx["func"]=arguments[i++];while(typeof arguments[i]!="undefined") ctx["args"].push(arguments[i++]);if(override){if(typeof arguments[1]=="object"){for(var option in arguments[0]) if(typeof ctx[option]!="undefined"&&typeof arguments[1][option]=="undefined") ctx[option]=arguments[0][option];} else{for(var option in arguments[0]) if(typeof ctx[option]!="undefined") ctx[option]=arguments[0][option];} i++;} ctx["_scheduler"]=this;ctx["_handle"]=null;var match=String(ctx["time"]).match(RegExp("^([0-9]+)([smhdw])$"));if(match&&match[0]!="undefined"&&match[1]!="undefined") ctx["time"]=String(parseInt(match[1])*{s:1000,m:1000*60,h:1000*60*60,d:1000*60*60*24,w:1000*60*60*24*7}[match[2]]);if(ctx["id"]==null) ctx["id"]=(String(ctx["repeat"])+":" +String(ctx["protect"])+":" +String(ctx["time"])+":" +String(ctx["obj"])+":" +String(ctx["func"])+":" +String(ctx["args"]));if(ctx["protect"]) if(typeof this.bucket[ctx["id"]]!="undefined") return this.bucket[ctx["id"]];if(!_isfn(ctx["func"])){if(ctx["obj"]!=null&&typeof ctx["obj"]=="object"&&typeof ctx["func"]=="string"&&_isfn(ctx["obj"][ctx["func"]])) ctx["func"]=ctx["obj"][ctx["func"]];else ctx["func"]=eval("function () { "+ctx["func"]+" }");} ctx["_handle"]=this._schedule(ctx);this.bucket[ctx["id"]]=ctx;return ctx;},reschedule:function(ctx){if(typeof ctx=="string") ctx=this.bucket[ctx];ctx["_handle"]=this._schedule(ctx);return ctx;},_schedule:function(ctx){var trampoline=function(){var obj=(ctx["obj"]!=null?ctx["obj"]:ctx);(ctx["func"]).apply(obj,ctx["args"]);if(typeof(ctx["_scheduler"]).bucket[ctx["id"]]!="undefined"&&ctx["repeat"]) (ctx["_scheduler"])._schedule(ctx);else delete(ctx["_scheduler"]).bucket[ctx["id"]];};return setTimeout(trampoline,ctx["time"]);},cancel:function(ctx){if(typeof ctx=="string") ctx=this.bucket[ctx];if(typeof ctx=="object"){clearTimeout(ctx["_handle"]);delete this.bucket[ctx["id"]];}}};$.extend({scheduler$:new $.scheduler(),schedule:function(){return $.scheduler$.schedule.apply($.scheduler$,arguments)},reschedule:function(){return $.scheduler$.reschedule.apply($.scheduler$,arguments)},cancel:function(){return $.scheduler$.cancel.apply($.scheduler$,arguments)}});$.fn.extend({schedule:function(){var a=[{}];for(var i=0;i1){return}g.preventDefault();var i=g.originalEvent.changedTouches[0],f=document.createEvent("MouseEvents");f.initMouseEvent(h,true,true,window,1,i.screenX,i.screenY,i.clientX,i.clientY,false,false,false,false,0,null);g.target.dispatchEvent(f)}c._touchStart=function(g){var f=this;if(a||!f._mouseCapture(g.originalEvent.changedTouches[0])){return}a=true;f._touchMoved=false;d(g,"mouseover");d(g,"mousemove");d(g,"mousedown")};c._touchMove=function(f){if(!a){return}this._touchMoved=true;d(f,"mousemove")};c._touchEnd=function(f){if(!a){return}d(f,"mouseup");d(f,"mouseout");if(!this._touchMoved){d(f,"click")}a=false};c._mouseInit=function(){var f=this;f.element.bind("touchstart",b.proxy(f,"_touchStart")).bind("touchmove",b.proxy(f,"_touchMove")).bind("touchend",b.proxy(f,"_touchEnd"));e.call(f)}})(jQuery);PK!,||jquery/jquery-migrate.jsnu[/*! * jQuery Migrate - v3.4.1 - 2023-02-23T15:31Z * Copyright OpenJS Foundation and other contributors */ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery" ], function( jQuery ) { return factory( jQuery, window ); } ); } else if ( typeof module === "object" && module.exports ) { // Node/CommonJS // eslint-disable-next-line no-undef module.exports = factory( require( "jquery" ), window ); } else { // Browser globals factory( jQuery, window ); } } )( function( jQuery, window ) { "use strict"; jQuery.migrateVersion = "3.4.1"; // Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2 function compareVersions( v1, v2 ) { var i, rVersionParts = /^(\d+)\.(\d+)\.(\d+)/, v1p = rVersionParts.exec( v1 ) || [ ], v2p = rVersionParts.exec( v2 ) || [ ]; for ( i = 1; i <= 3; i++ ) { if ( +v1p[ i ] > +v2p[ i ] ) { return 1; } if ( +v1p[ i ] < +v2p[ i ] ) { return -1; } } return 0; } function jQueryVersionSince( version ) { return compareVersions( jQuery.fn.jquery, version ) >= 0; } // A map from disabled patch codes to `true`. This should really // be a `Set` but those are unsupported in IE. var disabledPatches = Object.create( null ); // Don't apply patches for specified codes. Helpful for code bases // where some Migrate warnings have been addressed and it's desirable // to avoid needless patches or false positives. jQuery.migrateDisablePatches = function() { var i; for ( i = 0; i < arguments.length; i++ ) { disabledPatches[ arguments[ i ] ] = true; } }; // Allow enabling patches disabled via `jQuery.migrateDisablePatches`. // Helpful if you want to disable a patch only for some code that won't // be updated soon to be able to focus on other warnings - and enable it // immediately after such a call: // ```js // jQuery.migrateDisablePatches( "workaroundA" ); // elem.pluginViolatingWarningA( "pluginMethod" ); // jQuery.migrateEnablePatches( "workaroundA" ); // ``` jQuery.migrateEnablePatches = function() { var i; for ( i = 0; i < arguments.length; i++ ) { delete disabledPatches[ arguments[ i ] ]; } }; jQuery.migrateIsPatchEnabled = function( patchCode ) { return !disabledPatches[ patchCode ]; }; ( function() { // Support: IE9 only // IE9 only creates console object when dev tools are first opened // IE9 console is a host object, callable but doesn't have .apply() if ( !window.console || !window.console.log ) { return; } // Need jQuery 3.x-4.x and no older Migrate loaded if ( !jQuery || !jQueryVersionSince( "3.0.0" ) || jQueryVersionSince( "5.0.0" ) ) { window.console.log( "JQMIGRATE: jQuery 3.x-4.x REQUIRED" ); } if ( jQuery.migrateWarnings ) { window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" ); } // Show a message on the console so devs know we're active window.console.log( "JQMIGRATE: Migrate is installed" + ( jQuery.migrateMute ? "" : " with logging active" ) + ", version " + jQuery.migrateVersion ); } )(); var warnedAbout = {}; // By default each warning is only reported once. jQuery.migrateDeduplicateWarnings = true; // List of warnings already given; public read only jQuery.migrateWarnings = []; // Set to false to disable traces that appear with warnings if ( jQuery.migrateTrace === undefined ) { jQuery.migrateTrace = true; } // Forget any warnings we've already given; public jQuery.migrateReset = function() { warnedAbout = {}; jQuery.migrateWarnings.length = 0; }; function migrateWarn( code, msg ) { var console = window.console; if ( jQuery.migrateIsPatchEnabled( code ) && ( !jQuery.migrateDeduplicateWarnings || !warnedAbout[ msg ] ) ) { warnedAbout[ msg ] = true; jQuery.migrateWarnings.push( msg + " [" + code + "]" ); if ( console && console.warn && !jQuery.migrateMute ) { console.warn( "JQMIGRATE: " + msg ); if ( jQuery.migrateTrace && console.trace ) { console.trace(); } } } } function migrateWarnProp( obj, prop, value, code, msg ) { Object.defineProperty( obj, prop, { configurable: true, enumerable: true, get: function() { migrateWarn( code, msg ); return value; }, set: function( newValue ) { migrateWarn( code, msg ); value = newValue; } } ); } function migrateWarnFuncInternal( obj, prop, newFunc, code, msg ) { var finalFunc, origFunc = obj[ prop ]; obj[ prop ] = function() { // If `msg` not provided, do not warn; more sophisticated warnings // logic is most likely embedded in `newFunc`, in that case here // we just care about the logic choosing the proper implementation // based on whether the patch is disabled or not. if ( msg ) { migrateWarn( code, msg ); } // Since patches can be disabled & enabled dynamically, we // need to decide which implementation to run on each invocation. finalFunc = jQuery.migrateIsPatchEnabled( code ) ? newFunc : // The function may not have existed originally so we need a fallback. ( origFunc || jQuery.noop ); return finalFunc.apply( this, arguments ); }; } function migratePatchAndWarnFunc( obj, prop, newFunc, code, msg ) { if ( !msg ) { throw new Error( "No warning message provided" ); } return migrateWarnFuncInternal( obj, prop, newFunc, code, msg ); } function migratePatchFunc( obj, prop, newFunc, code ) { return migrateWarnFuncInternal( obj, prop, newFunc, code ); } if ( window.document.compatMode === "BackCompat" ) { // jQuery has never supported or tested Quirks Mode migrateWarn( "quirks", "jQuery is not compatible with Quirks Mode" ); } var findProp, class2type = {}, oldInit = jQuery.fn.init, oldFind = jQuery.find, rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/, rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g, // Require that the "whitespace run" starts from a non-whitespace // to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position. rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g; migratePatchFunc( jQuery.fn, "init", function( arg1 ) { var args = Array.prototype.slice.call( arguments ); if ( jQuery.migrateIsPatchEnabled( "selector-empty-id" ) && typeof arg1 === "string" && arg1 === "#" ) { // JQuery( "#" ) is a bogus ID selector, but it returned an empty set // before jQuery 3.0 migrateWarn( "selector-empty-id", "jQuery( '#' ) is not a valid selector" ); args[ 0 ] = []; } return oldInit.apply( this, args ); }, "selector-empty-id" ); // This is already done in Core but the above patch will lose this assignment // so we need to redo it. It doesn't matter whether the patch is enabled or not // as the method is always going to be a Migrate-created wrapper. jQuery.fn.init.prototype = jQuery.fn; migratePatchFunc( jQuery, "find", function( selector ) { var args = Array.prototype.slice.call( arguments ); // Support: PhantomJS 1.x // String#match fails to match when used with a //g RegExp, only on some strings if ( typeof selector === "string" && rattrHashTest.test( selector ) ) { // The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0 // First see if qS thinks it's a valid selector, if so avoid a false positive try { window.document.querySelector( selector ); } catch ( err1 ) { // Didn't *look* valid to qSA, warn and try quoting what we think is the value selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) { return "[" + attr + op + "\"" + value + "\"]"; } ); // If the regexp *may* have created an invalid selector, don't update it // Note that there may be false alarms if selector uses jQuery extensions try { window.document.querySelector( selector ); migrateWarn( "selector-hash", "Attribute selector with '#' must be quoted: " + args[ 0 ] ); args[ 0 ] = selector; } catch ( err2 ) { migrateWarn( "selector-hash", "Attribute selector with '#' was not fixed: " + args[ 0 ] ); } } } return oldFind.apply( this, args ); }, "selector-hash" ); // Copy properties attached to original jQuery.find method (e.g. .attr, .isXML) for ( findProp in oldFind ) { if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) { jQuery.find[ findProp ] = oldFind[ findProp ]; } } // The number of elements contained in the matched element set migratePatchAndWarnFunc( jQuery.fn, "size", function() { return this.length; }, "size", "jQuery.fn.size() is deprecated and removed; use the .length property" ); migratePatchAndWarnFunc( jQuery, "parseJSON", function() { return JSON.parse.apply( null, arguments ); }, "parseJSON", "jQuery.parseJSON is deprecated; use JSON.parse" ); migratePatchAndWarnFunc( jQuery, "holdReady", jQuery.holdReady, "holdReady", "jQuery.holdReady is deprecated" ); migratePatchAndWarnFunc( jQuery, "unique", jQuery.uniqueSort, "unique", "jQuery.unique is deprecated; use jQuery.uniqueSort" ); // Now jQuery.expr.pseudos is the standard incantation migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos, "expr-pre-pseudos", "jQuery.expr.filters is deprecated; use jQuery.expr.pseudos" ); migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos, "expr-pre-pseudos", "jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos" ); // Prior to jQuery 3.1.1 there were internal refs so we don't warn there if ( jQueryVersionSince( "3.1.1" ) ) { migratePatchAndWarnFunc( jQuery, "trim", function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "$1" ); }, "trim", "jQuery.trim is deprecated; use String.prototype.trim" ); } // Prior to jQuery 3.2 there were internal refs so we don't warn there if ( jQueryVersionSince( "3.2.0" ) ) { migratePatchAndWarnFunc( jQuery, "nodeName", function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, "nodeName", "jQuery.nodeName is deprecated" ); migratePatchAndWarnFunc( jQuery, "isArray", Array.isArray, "isArray", "jQuery.isArray is deprecated; use Array.isArray" ); } if ( jQueryVersionSince( "3.3.0" ) ) { migratePatchAndWarnFunc( jQuery, "isNumeric", function( obj ) { // As of jQuery 3.0, isNumeric is limited to // strings and numbers (primitives or objects) // that can be coerced to finite numbers (gh-2662) var type = typeof obj; return ( type === "number" || type === "string" ) && // parseFloat NaNs numeric-cast false positives ("") // ...but misinterprets leading-number strings, e.g. hex literals ("0x...") // subtraction forces infinities to NaN !isNaN( obj - parseFloat( obj ) ); }, "isNumeric", "jQuery.isNumeric() is deprecated" ); // Populate the class2type map jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol". split( " " ), function( _, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); } ); migratePatchAndWarnFunc( jQuery, "type", function( obj ) { if ( obj == null ) { return obj + ""; } // Support: Android <=2.3 only (functionish RegExp) return typeof obj === "object" || typeof obj === "function" ? class2type[ Object.prototype.toString.call( obj ) ] || "object" : typeof obj; }, "type", "jQuery.type is deprecated" ); migratePatchAndWarnFunc( jQuery, "isFunction", function( obj ) { return typeof obj === "function"; }, "isFunction", "jQuery.isFunction() is deprecated" ); migratePatchAndWarnFunc( jQuery, "isWindow", function( obj ) { return obj != null && obj === obj.window; }, "isWindow", "jQuery.isWindow() is deprecated" ); } // Support jQuery slim which excludes the ajax module if ( jQuery.ajax ) { var oldAjax = jQuery.ajax, rjsonp = /(=)\?(?=&|$)|\?\?/; migratePatchFunc( jQuery, "ajax", function() { var jQXHR = oldAjax.apply( this, arguments ); // Be sure we got a jQXHR (e.g., not sync) if ( jQXHR.promise ) { migratePatchAndWarnFunc( jQXHR, "success", jQXHR.done, "jqXHR-methods", "jQXHR.success is deprecated and removed" ); migratePatchAndWarnFunc( jQXHR, "error", jQXHR.fail, "jqXHR-methods", "jQXHR.error is deprecated and removed" ); migratePatchAndWarnFunc( jQXHR, "complete", jQXHR.always, "jqXHR-methods", "jQXHR.complete is deprecated and removed" ); } return jQXHR; }, "jqXHR-methods" ); // Only trigger the logic in jQuery <4 as the JSON-to-JSONP auto-promotion // behavior is gone in jQuery 4.0 and as it has security implications, we don't // want to restore the legacy behavior. if ( !jQueryVersionSince( "4.0.0" ) ) { // Register this prefilter before the jQuery one. Otherwise, a promoted // request is transformed into one with the script dataType and we can't // catch it anymore. jQuery.ajaxPrefilter( "+json", function( s ) { // Warn if JSON-to-JSONP auto-promotion happens. if ( s.jsonp !== false && ( rjsonp.test( s.url ) || typeof s.data === "string" && ( s.contentType || "" ) .indexOf( "application/x-www-form-urlencoded" ) === 0 && rjsonp.test( s.data ) ) ) { migrateWarn( "jsonp-promotion", "JSON-to-JSONP auto-promotion is deprecated" ); } } ); } } var oldRemoveAttr = jQuery.fn.removeAttr, oldToggleClass = jQuery.fn.toggleClass, rmatchNonSpace = /\S+/g; migratePatchFunc( jQuery.fn, "removeAttr", function( name ) { var self = this, patchNeeded = false; jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) { if ( jQuery.expr.match.bool.test( attr ) ) { // Only warn if at least a single node had the property set to // something else than `false`. Otherwise, this Migrate patch // doesn't influence the behavior and there's no need to set or warn. self.each( function() { if ( jQuery( this ).prop( attr ) !== false ) { patchNeeded = true; return false; } } ); } if ( patchNeeded ) { migrateWarn( "removeAttr-bool", "jQuery.fn.removeAttr no longer sets boolean properties: " + attr ); self.prop( attr, false ); } } ); return oldRemoveAttr.apply( this, arguments ); }, "removeAttr-bool" ); migratePatchFunc( jQuery.fn, "toggleClass", function( state ) { // Only deprecating no-args or single boolean arg if ( state !== undefined && typeof state !== "boolean" ) { return oldToggleClass.apply( this, arguments ); } migrateWarn( "toggleClass-bool", "jQuery.fn.toggleClass( boolean ) is deprecated" ); // Toggle entire class name of each element return this.each( function() { var className = this.getAttribute && this.getAttribute( "class" ) || ""; if ( className ) { jQuery.data( this, "__className__", 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. if ( this.setAttribute ) { this.setAttribute( "class", className || state === false ? "" : jQuery.data( this, "__className__" ) || "" ); } } ); }, "toggleClass-bool" ); function camelCase( string ) { return string.replace( /-([a-z])/g, function( _, letter ) { return letter.toUpperCase(); } ); } var origFnCss, internalCssNumber, internalSwapCall = false, ralphaStart = /^[a-z]/, // The regex visualized: // // /----------\ // | | /-------\ // | / Top \ | | | // /--- Border ---+-| Right |-+---+- Width -+---\ // | | Bottom | | // | \ Left / | // | | // | /----------\ | // | /-------------\ | | |- END // | | | | / Top \ | | // | | / Margin \ | | | Right | | | // |---------+-| |-+---+-| Bottom |-+----| // | \ Padding / \ Left / | // BEGIN -| | // | /---------\ | // | | | | // | | / Min \ | / Width \ | // \--------------+-| |-+---| |---/ // \ Max / \ Height / rautoPx = /^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/; // If this version of jQuery has .swap(), don't false-alarm on internal uses if ( jQuery.swap ) { jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) { var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get; if ( oldHook ) { jQuery.cssHooks[ name ].get = function() { var ret; internalSwapCall = true; ret = oldHook.apply( this, arguments ); internalSwapCall = false; return ret; }; } } ); } migratePatchFunc( jQuery, "swap", function( elem, options, callback, args ) { var ret, name, old = {}; if ( !internalSwapCall ) { migrateWarn( "swap", "jQuery.swap() is undocumented and deprecated" ); } // 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; }, "swap" ); if ( jQueryVersionSince( "3.4.0" ) && typeof Proxy !== "undefined" ) { jQuery.cssProps = new Proxy( jQuery.cssProps || {}, { set: function() { migrateWarn( "cssProps", "jQuery.cssProps is deprecated" ); return Reflect.set.apply( this, arguments ); } } ); } // In jQuery >=4 where jQuery.cssNumber is missing fill it with the latest 3.x version: // https://github.com/jquery/jquery/blob/3.6.0/src/css.js#L212-L233 // This way, number values for the CSS properties below won't start triggering // Migrate warnings when jQuery gets updated to >=4.0.0 (gh-438). if ( jQueryVersionSince( "4.0.0" ) ) { // We need to keep this as a local variable as we need it internally // in a `jQuery.fn.css` patch and this usage shouldn't warn. internalCssNumber = { animationIterationCount: true, columnCount: true, fillOpacity: true, flexGrow: true, flexShrink: true, fontWeight: true, gridArea: true, gridColumn: true, gridColumnEnd: true, gridColumnStart: true, gridRow: true, gridRowEnd: true, gridRowStart: true, lineHeight: true, opacity: true, order: true, orphans: true, widows: true, zIndex: true, zoom: true }; if ( typeof Proxy !== "undefined" ) { jQuery.cssNumber = new Proxy( internalCssNumber, { get: function() { migrateWarn( "css-number", "jQuery.cssNumber is deprecated" ); return Reflect.get.apply( this, arguments ); }, set: function() { migrateWarn( "css-number", "jQuery.cssNumber is deprecated" ); return Reflect.set.apply( this, arguments ); } } ); } else { // Support: IE 9-11+ // IE doesn't support proxies, but we still want to restore the legacy // jQuery.cssNumber there. jQuery.cssNumber = internalCssNumber; } } else { // Make `internalCssNumber` defined for jQuery <4 as well as it's needed // in the `jQuery.fn.css` patch below. internalCssNumber = jQuery.cssNumber; } function isAutoPx( prop ) { // The first test is used to ensure that: // 1. The prop starts with a lowercase letter (as we uppercase it for the second regex). // 2. The prop is not empty. return ralphaStart.test( prop ) && rautoPx.test( prop[ 0 ].toUpperCase() + prop.slice( 1 ) ); } origFnCss = jQuery.fn.css; migratePatchFunc( jQuery.fn, "css", function( name, value ) { var camelName, origThis = this; if ( name && typeof name === "object" && !Array.isArray( name ) ) { jQuery.each( name, function( n, v ) { jQuery.fn.css.call( origThis, n, v ); } ); return this; } if ( typeof value === "number" ) { camelName = camelCase( name ); // Use `internalCssNumber` to avoid triggering our warnings in this // internal check. if ( !isAutoPx( camelName ) && !internalCssNumber[ camelName ] ) { migrateWarn( "css-number", "Number-typed values are deprecated for jQuery.fn.css( \"" + name + "\", value )" ); } } return origFnCss.apply( this, arguments ); }, "css-number" ); var origData = jQuery.data; migratePatchFunc( jQuery, "data", function( elem, name, value ) { var curData, sameKeys, key; // Name can be an object, and each entry in the object is meant to be set as data if ( name && typeof name === "object" && arguments.length === 2 ) { curData = jQuery.hasData( elem ) && origData.call( this, elem ); sameKeys = {}; for ( key in name ) { if ( key !== camelCase( key ) ) { migrateWarn( "data-camelCase", "jQuery.data() always sets/gets camelCased names: " + key ); curData[ key ] = name[ key ]; } else { sameKeys[ key ] = name[ key ]; } } origData.call( this, elem, sameKeys ); return name; } // If the name is transformed, look for the un-transformed name in the data object if ( name && typeof name === "string" && name !== camelCase( name ) ) { curData = jQuery.hasData( elem ) && origData.call( this, elem ); if ( curData && name in curData ) { migrateWarn( "data-camelCase", "jQuery.data() always sets/gets camelCased names: " + name ); if ( arguments.length > 2 ) { curData[ name ] = value; } return curData[ name ]; } } return origData.apply( this, arguments ); }, "data-camelCase" ); // Support jQuery slim which excludes the effects module if ( jQuery.fx ) { var intervalValue, intervalMsg, oldTweenRun = jQuery.Tween.prototype.run, linearEasing = function( pct ) { return pct; }; migratePatchFunc( jQuery.Tween.prototype, "run", function( ) { if ( jQuery.easing[ this.easing ].length > 1 ) { migrateWarn( "easing-one-arg", "'jQuery.easing." + this.easing.toString() + "' should use only one argument" ); jQuery.easing[ this.easing ] = linearEasing; } oldTweenRun.apply( this, arguments ); }, "easing-one-arg" ); intervalValue = jQuery.fx.interval; intervalMsg = "jQuery.fx.interval is deprecated"; // Support: IE9, Android <=4.4 // Avoid false positives on browsers that lack rAF // Don't warn if document is hidden, jQuery uses setTimeout (#292) if ( window.requestAnimationFrame ) { Object.defineProperty( jQuery.fx, "interval", { configurable: true, enumerable: true, get: function() { if ( !window.document.hidden ) { migrateWarn( "fx-interval", intervalMsg ); } // Only fallback to the default if patch is enabled if ( !jQuery.migrateIsPatchEnabled( "fx-interval" ) ) { return intervalValue; } return intervalValue === undefined ? 13 : intervalValue; }, set: function( newValue ) { migrateWarn( "fx-interval", intervalMsg ); intervalValue = newValue; } } ); } } var oldLoad = jQuery.fn.load, oldEventAdd = jQuery.event.add, originalFix = jQuery.event.fix; jQuery.event.props = []; jQuery.event.fixHooks = {}; migrateWarnProp( jQuery.event.props, "concat", jQuery.event.props.concat, "event-old-patch", "jQuery.event.props.concat() is deprecated and removed" ); migratePatchFunc( jQuery.event, "fix", function( originalEvent ) { var event, type = originalEvent.type, fixHook = this.fixHooks[ type ], props = jQuery.event.props; if ( props.length ) { migrateWarn( "event-old-patch", "jQuery.event.props are deprecated and removed: " + props.join() ); while ( props.length ) { jQuery.event.addProp( props.pop() ); } } if ( fixHook && !fixHook._migrated_ ) { fixHook._migrated_ = true; migrateWarn( "event-old-patch", "jQuery.event.fixHooks are deprecated and removed: " + type ); if ( ( props = fixHook.props ) && props.length ) { while ( props.length ) { jQuery.event.addProp( props.pop() ); } } } event = originalFix.call( this, originalEvent ); return fixHook && fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, "event-old-patch" ); migratePatchFunc( jQuery.event, "add", function( elem, types ) { // This misses the multiple-types case but that seems awfully rare if ( elem === window && types === "load" && window.document.readyState === "complete" ) { migrateWarn( "load-after-event", "jQuery(window).on('load'...) called after load event occurred" ); } return oldEventAdd.apply( this, arguments ); }, "load-after-event" ); jQuery.each( [ "load", "unload", "error" ], function( _, name ) { migratePatchFunc( jQuery.fn, name, function() { var args = Array.prototype.slice.call( arguments, 0 ); // If this is an ajax load() the first arg should be the string URL; // technically this could also be the "Anything" arg of the event .load() // which just goes to show why this dumb signature has been deprecated! // jQuery custom builds that exclude the Ajax module justifiably die here. if ( name === "load" && typeof args[ 0 ] === "string" ) { return oldLoad.apply( this, args ); } migrateWarn( "shorthand-removed-v3", "jQuery.fn." + name + "() is deprecated" ); args.splice( 0, 0, name ); if ( arguments.length ) { return this.on.apply( this, args ); } // Use .triggerHandler here because: // - load and unload events don't need to bubble, only applied to window or image // - error event should not bubble to window, although it does pre-1.7 // See http://bugs.jquery.com/ticket/11820 this.triggerHandler.apply( this, args ); return this; }, "shorthand-removed-v3" ); } ); jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup contextmenu" ).split( " " ), function( _i, name ) { // Handle event binding migratePatchAndWarnFunc( jQuery.fn, name, function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }, "shorthand-deprecated-v3", "jQuery.fn." + name + "() event shorthand is deprecated" ); } ); // Trigger "ready" event only once, on document ready jQuery( function() { jQuery( window.document ).triggerHandler( "ready" ); } ); jQuery.event.special.ready = { setup: function() { if ( this === window.document ) { migrateWarn( "ready-event", "'ready' event is deprecated" ); } } }; migratePatchAndWarnFunc( jQuery.fn, "bind", function( types, data, fn ) { return this.on( types, null, data, fn ); }, "pre-on-methods", "jQuery.fn.bind() is deprecated" ); migratePatchAndWarnFunc( jQuery.fn, "unbind", function( types, fn ) { return this.off( types, null, fn ); }, "pre-on-methods", "jQuery.fn.unbind() is deprecated" ); migratePatchAndWarnFunc( jQuery.fn, "delegate", function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, "pre-on-methods", "jQuery.fn.delegate() is deprecated" ); migratePatchAndWarnFunc( jQuery.fn, "undelegate", function( selector, types, fn ) { return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); }, "pre-on-methods", "jQuery.fn.undelegate() is deprecated" ); migratePatchAndWarnFunc( jQuery.fn, "hover", function( fnOver, fnOut ) { return this.on( "mouseenter", fnOver ).on( "mouseleave", fnOut || fnOver ); }, "pre-on-methods", "jQuery.fn.hover() is deprecated" ); var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, makeMarkup = function( html ) { var doc = window.document.implementation.createHTMLDocument( "" ); doc.body.innerHTML = html; return doc.body && doc.body.innerHTML; }, warnIfChanged = function( html ) { var changed = html.replace( rxhtmlTag, "<$1>" ); if ( changed !== html && makeMarkup( html ) !== makeMarkup( changed ) ) { migrateWarn( "self-closed-tags", "HTML tags must be properly nested and closed: " + html ); } }; /** * Deprecated, please use `jQuery.migrateDisablePatches( "self-closed-tags" )` instead. * @deprecated */ jQuery.UNSAFE_restoreLegacyHtmlPrefilter = function() { jQuery.migrateEnablePatches( "self-closed-tags" ); }; migratePatchFunc( jQuery, "htmlPrefilter", function( html ) { warnIfChanged( html ); return html.replace( rxhtmlTag, "<$1>" ); }, "self-closed-tags" ); // This patch needs to be disabled by default as it re-introduces // security issues (CVE-2020-11022, CVE-2020-11023). jQuery.migrateDisablePatches( "self-closed-tags" ); var origOffset = jQuery.fn.offset; migratePatchFunc( jQuery.fn, "offset", function() { var elem = this[ 0 ]; if ( elem && ( !elem.nodeType || !elem.getBoundingClientRect ) ) { migrateWarn( "offset-valid-elem", "jQuery.fn.offset() requires a valid DOM element" ); return arguments.length ? this : undefined; } return origOffset.apply( this, arguments ); }, "offset-valid-elem" ); // Support jQuery slim which excludes the ajax module // The jQuery.param patch is about respecting `jQuery.ajaxSettings.traditional` // so it doesn't make sense for the slim build. if ( jQuery.ajax ) { var origParam = jQuery.param; migratePatchFunc( jQuery, "param", function( data, traditional ) { var ajaxTraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; if ( traditional === undefined && ajaxTraditional ) { migrateWarn( "param-ajax-traditional", "jQuery.param() no longer uses jQuery.ajaxSettings.traditional" ); traditional = ajaxTraditional; } return origParam.call( this, data, traditional ); }, "param-ajax-traditional" ); } migratePatchAndWarnFunc( jQuery.fn, "andSelf", jQuery.fn.addBack, "andSelf", "jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()" ); // Support jQuery slim which excludes the deferred module in jQuery 4.0+ if ( jQuery.Deferred ) { var oldDeferred = jQuery.Deferred, tuples = [ // Action, add listener, callbacks, .then handlers, final state [ "resolve", "done", jQuery.Callbacks( "once memory" ), jQuery.Callbacks( "once memory" ), "resolved" ], [ "reject", "fail", jQuery.Callbacks( "once memory" ), jQuery.Callbacks( "once memory" ), "rejected" ], [ "notify", "progress", jQuery.Callbacks( "memory" ), jQuery.Callbacks( "memory" ) ] ]; migratePatchFunc( jQuery, "Deferred", function( func ) { var deferred = oldDeferred(), promise = deferred.promise(); function newDeferredPipe( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred( function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var fn = typeof fns[ i ] === "function" && fns[ i ]; // Deferred.done(function() { bind to newDefer or newDefer.resolve }) // deferred.fail(function() { bind to newDefer or newDefer.reject }) // deferred.progress(function() { bind to newDefer or newDefer.notify }) deferred[ tuple[ 1 ] ]( function() { var returned = fn && fn.apply( this, arguments ); if ( returned && typeof returned.promise === "function" ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } } ); } ); fns = null; } ).promise(); } migratePatchAndWarnFunc( deferred, "pipe", newDeferredPipe, "deferred-pipe", "deferred.pipe() is deprecated" ); migratePatchAndWarnFunc( promise, "pipe", newDeferredPipe, "deferred-pipe", "deferred.pipe() is deprecated" ); if ( func ) { func.call( deferred, deferred ); } return deferred; }, "deferred-pipe" ); // Preserve handler of uncaught exceptions in promise chains jQuery.Deferred.exceptionHook = oldDeferred.exceptionHook; } return jQuery; } ); PK!'3hVVjquery/jquery.min.jsnu[/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(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(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0=c.minchars?(cached=g(e),cached?i(cached.items):a.get(c.source,{q:e},function(a){p.hide(),d=j(a,e),i(d),h(e,d,a.length)})):p.hide()}function g(a){var b;for(b=0;bc.maxCacheSize;)e=s.pop(),t-=e.size;s.push({q:a,size:d,items:b}),t+=d}function i(b){var e,f="";if(b){if(!b.length)return void p.hide();for(d(),e=0;e"+b[e]+"";p.html(f).show(),p.children("li").mouseover(function(){p.children("li").removeClass(c.selectClass),a(this).addClass(c.selectClass)}).click(function(a){a.preventDefault(),a.stopPropagation(),l()})}}function j(b,d){var e,f,g=[],h=b.split(c.delimiter);for(e=0;e'+a+""}),g[g.length]=f);return g}function k(){var a;return p.is(":visible")?(a=p.children("li."+c.selectClass),a.length||(a=!1),a):!1}function l(){$currentResult=k(),$currentResult&&(c.multiple?(-1!=o.val().indexOf(c.multipleSep)?$currentVal=o.val().substr(0,o.val().lastIndexOf(c.multipleSep)+c.multipleSep.length)+" ":$currentVal="",o.val($currentVal+$currentResult.text()+c.multipleSep+" "),o.focus()):o.val($currentResult.text()),p.hide(),o.trigger("change"),c.onSelect&&c.onSelect.apply(o[0]))}function m(){$currentResult=k(),$currentResult?$currentResult.removeClass(c.selectClass).next().addClass(c.selectClass):p.children("li:first-child").addClass(c.selectClass)}function n(){var a=k();a?a.removeClass(c.selectClass).prev().addClass(c.selectClass):p.children("li:last-child").addClass(c.selectClass)}var o,p,q,r,s,t;o=a(b).attr("autocomplete","off"),p=a("
    "),q=!1,r=0,s=[],t=0,p.addClass(c.resultsClass).appendTo("body"),d(),a(window).on("load",d).on("resize",d),o.blur(function(){setTimeout(function(){p.hide()},200)}),o.keydown(e)},a.fn.suggest=function(b,c){return b?(c=c||{},c.multiple=c.multiple||!1,c.multipleSep=c.multipleSep||",",c.source=b,c.delay=c.delay||100,c.resultsClass=c.resultsClass||"ac_results",c.selectClass=c.selectClass||"ac_over",c.matchClass=c.matchClass||"ac_match",c.minchars=c.minchars||2,c.delimiter=c.delimiter||"\n",c.onSelect=c.onSelect||!1,c.maxCacheSize=c.maxCacheSize||65536,this.each(function(){new a.suggest(this,c)}),this):void 0}}(jQuery); PK! %jquery/jquery.color.min.jsnu[/*! jQuery Color v3.0.0 https://github.com/jquery/jquery-color | jquery.org/license */ !function(r,t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(r.jQuery)}(this,function(s,l){"use strict";var u,n={},t=n.toString,c=/^([\-+])=\s*(\d+\.?\d*)/,r=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(r){return[r[1],r[2],r[3],r[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(r){return[2.55*r[1],2.55*r[2],2.55*r[3],r[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(r){return[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16),r[4]?(parseInt(r[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(r){return[parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16),r[4]?(parseInt(r[4]+r[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(r){return[r[1],r[2]/100,r[3]/100,r[4]]}}],f=s.Color=function(r,t,n,e){return new s.Color.fn.parse(r,t,n,e)},p={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"}}}},d={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},h=s.each;function b(r){return null==r?r+"":"object"==typeof r?n[t.call(r)]||"object":typeof r}function g(r,t,n){var e=d[t.type]||{};return null==r?n||!t.def?null:t.def:(r=e.floor?~~r:parseFloat(r),e.mod?(r+e.mod)%e.mod:Math.min(e.max,Math.max(0,r)))}function m(e){var o=f(),a=o._rgba=[];return e=e.toLowerCase(),h(r,function(r,t){var n=t.re.exec(e),n=n&&t.parse(n),t=t.space||"rgba";if(n)return n=o[t](n),o[p[t].cache]=n[p[t].cache],a=o._rgba=n._rgba,!1}),a.length?("0,0,0,0"===a.join()&&s.extend(a,u.transparent),o):u[e]}function o(r,t,n){return 6*(n=(n+1)%1)<1?r+(t-r)*n*6:2*n<1?t:3*n<2?r+(t-r)*(2/3-n)*6:r}h(p,function(r,t){t.cache="_"+r,t.props.alpha={idx:3,type:"percent",def:1}}),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(r,t){n["[object "+t+"]"]=t.toLowerCase()}),(f.fn=s.extend(f.prototype,{parse:function(o,r,t,n){if(o===l)return this._rgba=[null,null,null,null],this;(o.jquery||o.nodeType)&&(o=s(o).css(r),r=l);var a=this,e=b(o),i=this._rgba=[];return r!==l&&(o=[o,r,t,n],e="array"),"string"===e?this.parse(m(o)||u._default):"array"===e?(h(p.rgba.props,function(r,t){i[t.idx]=g(o[t.idx],t)}),this):"object"===e?(o instanceof f?h(p,function(r,t){o[t.cache]&&(a[t.cache]=o[t.cache].slice())}):h(p,function(r,n){var e=n.cache;h(n.props,function(r,t){if(!a[e]&&n.to){if("alpha"===r||null==o[r])return;a[e]=n.to(a._rgba)}a[e][t.idx]=g(o[r],t,!0)}),a[e]&&s.inArray(null,a[e].slice(0,3))<0&&(null==a[e][3]&&(a[e][3]=1),n.from)&&(a._rgba=n.from(a[e]))}),this):void 0},is:function(r){var o=f(r),a=!0,i=this;return h(p,function(r,t){var n,e=o[t.cache];return e&&(n=i[t.cache]||t.to&&t.to(i._rgba)||[],h(t.props,function(r,t){if(null!=e[t.idx])return a=e[t.idx]===n[t.idx]})),a}),a},_space:function(){var n=[],e=this;return h(p,function(r,t){e[t.cache]&&n.push(r)}),n.pop()},transition:function(r,i){var r=(l=f(r))._space(),t=p[r],n=0===this.alpha()?f("transparent"):this,s=n[t.cache]||t.to(n._rgba),u=s.slice(),l=l[t.cache];return h(t.props,function(r,t){var n=t.idx,e=s[n],o=l[n],a=d[t.type]||{};null!==o&&(null===e?u[n]=o:(a.mod&&(o-e>a.mod/2?e+=a.mod:e-o>a.mod/2&&(e-=a.mod)),u[n]=g((o-e)*i+e,t)))}),this[r](u)},blend:function(r){var t,n,e;return 1===this._rgba[3]?this:(t=this._rgba.slice(),n=t.pop(),e=f(r)._rgba,f(s.map(t,function(r,t){return(1-n)*e[t]+n*r})))},toRgbaString:function(){var r="rgba(",t=s.map(this._rgba,function(r,t){return null!=r?r:2","/":"?","\\":"|"};this.add=function(c,b,h){if(a.isFunction(b)){h=b;b={}}var d={},f={type:"keydown",propagate:false,disableInInput:false,target:a("html")[0]},e=this;d=a.extend(d,f,b||{});c=c.toLowerCase();var g=function(j){var o=j.target;if(d.disableInInput){var s=a(o);if(s.is("input")||s.is("textarea")){return}}var l=j.which,u=j.type,r=String.fromCharCode(l).toLowerCase(),t=e.special_keys[l],m=j.shiftKey,i=j.ctrlKey,p=j.altKey,w=j.metaKey,q=true,k=null;while(!e.all[o]&&o.parentNode){o=o.parentNode}var v=e.all[o].events[u].callbackMap;if(!m&&!i&&!p&&!w){k=v[t]||v[r]}else{var n="";if(p){n+="alt+"}if(i){n+="ctrl+"}if(m){n+="shift+"}if(w){n+="meta+"}k=v[n+t]||v[n+r]||v[n+e.shift_nums[r]]}if(k){k.cb(j);if(!k.propagate){j.stopPropagation();j.preventDefault();return false}}};if(!this.all[d.target]){this.all[d.target]={events:{}}}if(!this.all[d.target].events[d.type]){this.all[d.target].events[d.type]={callbackMap:{}};a.event.add(d.target,d.type,g)}this.all[d.target].events[d.type].callbackMap[c]={cb:h,propagate:d.propagate};return a};this.remove=function(c,b){b=b||{};target=b.target||a("html")[0];type=b.type||"keydown";c=c.toLowerCase();delete this.all[target].events[type].callbackMap[c];return a};a.hotkeys=this;return a})(jQuery);PK!Mhl!jquery/jquery.serialize-object.jsnu[/*! * jQuery serializeObject - v0.2-wp - 1/20/2010 * http://benalman.com/projects/jquery-misc-plugins/ * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ // Whereas .serializeArray() serializes a form into an array, .serializeObject() // serializes a form into an (arguably more useful) object. (function($,undefined){ '$:nomunge'; // Used by YUI compressor. $.fn.serializeObject = function(){ var obj = {}; $.each( this.serializeArray(), function(i,o){ var n = o.name, v = o.value; obj[n] = obj[n] === undefined ? v : Array.isArray( obj[n] ) ? obj[n].concat( v ) : [ obj[n], v ]; }); return obj; }; })(jQuery); PK!9nnjquery/jquery.query.jsnu[/** * jQuery.query - Query String Modification and Creation for jQuery * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com) * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/). * Date: 2009/8/13 * * @author Blair Mitchelmore * @version 2.2.3 * **/ !function(e){var t=e.separator||"&",l=!1!==e.spaces,n=(e.suffix,!1!==e.prefix?!0===e.hash?"#":"?":""),i=!1!==e.numbers;jQuery.query=new function(){function c(e,t){return null!=e&&null!==e&&(!t||e.constructor==t)}function u(e){for(var t,n=/\[([^[]*)\]/g,r=/^([^[]+)(\[.*\])?$/.exec(e),e=r[1],u=[];t=n.exec(r[2]);)u.push(t[1]);return[e,u]}function o(e,t,n){var r=t.shift();if("object"!=typeof e&&(e=null),""===r)if(c(e=e||[],Array))e.push(0==t.length?n:o(null,t.slice(0),n));else if(c(e,Object)){for(var u=0;null!=e[u++];);e[--u]=0==t.length?n:o(e[u],t.slice(0),n)}else(e=[]).push(0==t.length?n:o(null,t.slice(0),n));else if(r&&r.match(/^\s*[0-9]+\s*$/))(e=e||[])[i=parseInt(r,10)]=0==t.length?n:o(e[i],t.slice(0),n);else{if(!r)return n;var i=r.replace(/^\s*|\s*$/g,"");if(c(e=e||{},Array)){for(var s={},u=0;u $.hotkeys.remove('Ctrl+c'); $.hotkeys.remove('Ctrl+c', {target:'div#editor', type:'keypress'}); ******************************************************************************************************************************/ (function (jQuery){ this.version = '(beta)(0.0.3)'; this.all = {}; this.special_keys = { 27: 'esc', 9: 'tab', 32:'space', 13: 'return', 8:'backspace', 145: 'scroll', 20: 'capslock', 144: 'numlock', 19:'pause', 45:'insert', 36:'home', 46:'del',35:'end', 33: 'pageup', 34:'pagedown', 37:'left', 38:'up', 39:'right',40:'down', 112:'f1',113:'f2', 114:'f3', 115:'f4', 116:'f5', 117:'f6', 118:'f7', 119:'f8', 120:'f9', 121:'f10', 122:'f11', 123:'f12'}; this.shift_nums = { "`":"~", "1":"!", "2":"@", "3":"#", "4":"$", "5":"%", "6":"^", "7":"&", "8":"*", "9":"(", "0":")", "-":"_", "=":"+", ";":":", "'":"\"", ",":"<", ".":">", "/":"?", "\\":"|" }; this.add = function(combi, options, callback) { if ( typeof options === 'function' ){ callback = options; options = {}; } var opt = {}, defaults = {type: 'keydown', propagate: false, disableInInput: false, target: jQuery('html')[0]}, that = this; opt = jQuery.extend( opt , defaults, options || {} ); combi = combi.toLowerCase(); // inspect if keystroke matches var inspector = function(event) { // WP: not needed with newer jQuery // event = jQuery.event.fix(event); // jQuery event normalization. var element = event.target; // @ TextNode -> nodeType == 3 // WP: not needed with newer jQuery // element = (element.nodeType==3) ? element.parentNode : element; if ( opt['disableInInput'] ) { // Disable shortcut keys in Input, Textarea fields var target = jQuery(element); if ( ( target.is('input') || target.is('textarea') ) && ( ! opt.noDisable || ! target.is( opt.noDisable ) ) ) { return; } } var code = event.which, type = event.type, character = String.fromCharCode(code).toLowerCase(), special = that.special_keys[code], shift = event.shiftKey, ctrl = event.ctrlKey, alt= event.altKey, meta = event.metaKey, propagate = true, // default behaivour mapPoint = null; // in opera + safari, the event.target is unpredictable. // for example: 'keydown' might be associated with HtmlBodyElement // or the element where you last clicked with your mouse. // WP: needed for all browsers // if (jQuery.browser.opera || jQuery.browser.safari){ while (!that.all[element] && element.parentNode){ element = element.parentNode; } // } var cbMap = that.all[element].events[type].callbackMap; if(!shift && !ctrl && !alt && !meta) { // No Modifiers mapPoint = cbMap[special] || cbMap[character] } // deals with combinaitons (alt|ctrl|shift+anything) else{ var modif = ''; if(alt) modif +='alt+'; if(ctrl) modif+= 'ctrl+'; if(shift) modif += 'shift+'; if(meta) modif += 'meta+'; // modifiers + special keys or modifiers + characters or modifiers + shift characters mapPoint = cbMap[modif+special] || cbMap[modif+character] || cbMap[modif+that.shift_nums[character]] } if (mapPoint){ mapPoint.cb(event); if(!mapPoint.propagate) { event.stopPropagation(); event.preventDefault(); return false; } } }; // first hook for this element if (!this.all[opt.target]){ this.all[opt.target] = {events:{}}; } if (!this.all[opt.target].events[opt.type]){ this.all[opt.target].events[opt.type] = {callbackMap: {}} jQuery.event.add(opt.target, opt.type, inspector); } this.all[opt.target].events[opt.type].callbackMap[combi] = {cb: callback, propagate:opt.propagate}; return jQuery; }; this.remove = function(exp, opt) { opt = opt || {}; target = opt.target || jQuery('html')[0]; type = opt.type || 'keydown'; exp = exp.toLowerCase(); delete this.all[target].events[type].callbackMap[exp] return jQuery; }; jQuery.hotkeys = this; return jQuery; })(jQuery); PK! jquery/jquery.form.jsnu[/*! * jQuery Form Plugin * version: 4.3.0 * Requires jQuery v1.7.2 or later * Project repository: https://github.com/jquery-form/form * Copyright 2017 Kevin Morris * Copyright 2006 M. Alsup * Dual licensed under the LGPL-2.1+ or MIT licenses * https://github.com/jquery-form/form#license * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ /* global ActiveXObject */ /* eslint-disable */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof module === 'object' && module.exports) { // Node/CommonJS module.exports = function( root, jQuery ) { if (typeof jQuery === 'undefined') { // require('jQuery') returns a factory that requires window to build a jQuery instance, we normalize how we use modules // that require this pattern but the window provided is a noop if it's defined (how jquery works) if (typeof window !== 'undefined') { jQuery = require('jquery'); } else { jQuery = require('jquery')(root); } } factory(jQuery); return jQuery; }; } else { // Browser globals factory(jQuery); } }(function ($) { /* eslint-enable */ 'use strict'; /* Usage Note: ----------- Do not use both ajaxSubmit and ajaxForm on the same form. These functions are mutually exclusive. Use ajaxSubmit if you want to bind your own submit handler to the form. For example, $(document).ready(function() { $('#myForm').on('submit', function(e) { e.preventDefault(); // <-- important $(this).ajaxSubmit({ target: '#output' }); }); }); Use ajaxForm when you want the plugin to manage all the event binding for you. For example, $(document).ready(function() { $('#myForm').ajaxForm({ target: '#output' }); }); You can also use ajaxForm with delegation (requires jQuery v1.7+), so the form does not have to exist when you invoke ajaxForm: $('#myForm').ajaxForm({ delegation: true, target: '#output' }); When using ajaxForm, the ajaxSubmit function will be invoked for you at the appropriate time. */ var rCRLF = /\r?\n/g; /** * Feature detection */ var feature = {}; feature.fileapi = $('').get(0).files !== undefined; feature.formdata = (typeof window.FormData !== 'undefined'); var hasProp = !!$.fn.prop; // attr2 uses prop when it can but checks the return type for // an expected string. This accounts for the case where a form // contains inputs with names like "action" or "method"; in those // cases "prop" returns the element $.fn.attr2 = function() { if (!hasProp) { return this.attr.apply(this, arguments); } var val = this.prop.apply(this, arguments); if ((val && val.jquery) || typeof val === 'string') { return val; } return this.attr.apply(this, arguments); }; /** * ajaxSubmit() provides a mechanism for immediately submitting * an HTML form using AJAX. * * @param {object|string} options jquery.form.js parameters or custom url for submission * @param {object} data extraData * @param {string} dataType ajax dataType * @param {function} onSuccess ajax success callback function */ $.fn.ajaxSubmit = function(options, data, dataType, onSuccess) { // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) if (!this.length) { log('ajaxSubmit: skipping submit process - no element selected'); return this; } /* eslint consistent-this: ["error", "$form"] */ var method, action, url, isMsie, iframeSrc, $form = this; if (typeof options === 'function') { options = {success: options}; } else if (typeof options === 'string' || (options === false && arguments.length > 0)) { options = { 'url' : options, 'data' : data, 'dataType' : dataType }; if (typeof onSuccess === 'function') { options.success = onSuccess; } } else if (typeof options === 'undefined') { options = {}; } method = options.method || options.type || this.attr2('method'); action = options.url || this.attr2('action'); url = (typeof action === 'string') ? $.trim(action) : ''; url = url || window.location.href || ''; if (url) { // clean url (don't include hash vaue) url = (url.match(/^([^#]+)/) || [])[1]; } // IE requires javascript:false in https, but this breaks chrome >83 and goes against spec. // Instead of using javascript:false always, let's only apply it for IE. isMsie = /(MSIE|Trident)/.test(navigator.userAgent || ''); iframeSrc = (isMsie && /^https/i.test(window.location.href || '')) ? 'javascript:false' : 'about:blank'; // eslint-disable-line no-script-url options = $.extend(true, { url : url, success : $.ajaxSettings.success, type : method || $.ajaxSettings.type, iframeSrc : iframeSrc }, options); // hook for manipulating the form data before it is extracted; // convenient for use with rich editors like tinyMCE or FCKEditor var veto = {}; this.trigger('form-pre-serialize', [this, options, veto]); if (veto.veto) { log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); return this; } // provide opportunity to alter form data before it is serialized if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { log('ajaxSubmit: submit aborted via beforeSerialize callback'); return this; } var traditional = options.traditional; if (typeof traditional === 'undefined') { traditional = $.ajaxSettings.traditional; } var elements = []; var qx, a = this.formToArray(options.semantic, elements, options.filtering); if (options.data) { var optionsData = $.isFunction(options.data) ? options.data(a) : options.data; options.extraData = optionsData; qx = $.param(optionsData, traditional); } // give pre-submit callback an opportunity to abort the submit if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { log('ajaxSubmit: submit aborted via beforeSubmit callback'); return this; } // fire vetoable 'validate' event this.trigger('form-submit-validate', [a, this, options, veto]); if (veto.veto) { log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); return this; } var q = $.param(a, traditional); if (qx) { q = (q ? (q + '&' + qx) : qx); } if (options.type.toUpperCase() === 'GET') { options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; options.data = null; // data is null for 'get' } else { options.data = q; // data is the query string for 'post' } var callbacks = []; if (options.resetForm) { callbacks.push(function() { $form.resetForm(); }); } if (options.clearForm) { callbacks.push(function() { $form.clearForm(options.includeHidden); }); } // perform a load on the target only if dataType is not provided if (!options.dataType && options.target) { var oldSuccess = options.success || function(){}; callbacks.push(function(data, textStatus, jqXHR) { var successArguments = arguments, fn = options.replaceTarget ? 'replaceWith' : 'html'; $(options.target)[fn](data).each(function(){ oldSuccess.apply(this, successArguments); }); }); } else if (options.success) { if ($.isArray(options.success)) { $.merge(callbacks, options.success); } else { callbacks.push(options.success); } } options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg var context = options.context || this; // jQuery 1.4+ supports scope context for (var i = 0, max = callbacks.length; i < max; i++) { callbacks[i].apply(context, [data, status, xhr || $form, $form]); } }; if (options.error) { var oldError = options.error; options.error = function(xhr, status, error) { var context = options.context || this; oldError.apply(context, [xhr, status, error, $form]); }; } if (options.complete) { var oldComplete = options.complete; options.complete = function(xhr, status) { var context = options.context || this; oldComplete.apply(context, [xhr, status, $form]); }; } // are there files to upload? // [value] (issue #113), also see comment: // https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219 var fileInputs = $('input[type=file]:enabled', this).filter(function() { return $(this).val() !== ''; }); var hasFileInputs = fileInputs.length > 0; var mp = 'multipart/form-data'; var multipart = ($form.attr('enctype') === mp || $form.attr('encoding') === mp); var fileAPI = feature.fileapi && feature.formdata; log('fileAPI :' + fileAPI); var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI; var jqxhr; // options.iframe allows user to force iframe mode // 06-NOV-09: now defaulting to iframe mode if file input is detected if (options.iframe !== false && (options.iframe || shouldUseFrame)) { // hack to fix Safari hang (thanks to Tim Molendijk for this) // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d if (options.closeKeepAlive) { $.get(options.closeKeepAlive, function() { jqxhr = fileUploadIframe(a); }); } else { jqxhr = fileUploadIframe(a); } } else if ((hasFileInputs || multipart) && fileAPI) { jqxhr = fileUploadXhr(a); } else { jqxhr = $.ajax(options); } $form.removeData('jqxhr').data('jqxhr', jqxhr); // clear element array for (var k = 0; k < elements.length; k++) { elements[k] = null; } // fire 'notify' event this.trigger('form-submit-notify', [this, options]); return this; // utility fn for deep serialization function deepSerialize(extraData) { var serialized = $.param(extraData, options.traditional).split('&'); var len = serialized.length; var result = []; var i, part; for (i = 0; i < len; i++) { // #252; undo param space replacement serialized[i] = serialized[i].replace(/\+/g, ' '); part = serialized[i].split('='); // #278; use array instead of object storage, favoring array serializations result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]); } return result; } // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz) function fileUploadXhr(a) { var formdata = new FormData(); for (var i = 0; i < a.length; i++) { formdata.append(a[i].name, a[i].value); } if (options.extraData) { var serializedData = deepSerialize(options.extraData); for (i = 0; i < serializedData.length; i++) { if (serializedData[i]) { formdata.append(serializedData[i][0], serializedData[i][1]); } } } options.data = null; var s = $.extend(true, {}, $.ajaxSettings, options, { contentType : false, processData : false, cache : false, type : method || 'POST' }); if (options.uploadProgress) { // workaround because jqXHR does not expose upload property s.xhr = function() { var xhr = $.ajaxSettings.xhr(); if (xhr.upload) { xhr.upload.addEventListener('progress', function(event) { var percent = 0; var position = event.loaded || event.position; /* event.position is deprecated */ var total = event.total; if (event.lengthComputable) { percent = Math.ceil(position / total * 100); } options.uploadProgress(event, position, total, percent); }, false); } return xhr; }; } s.data = null; var beforeSend = s.beforeSend; s.beforeSend = function(xhr, o) { // Send FormData() provided by user if (options.formData) { o.data = options.formData; } else { o.data = formdata; } if (beforeSend) { beforeSend.call(this, xhr, o); } }; return $.ajax(s); } // private function for handling file uploads (hat tip to YAHOO!) function fileUploadIframe(a) { var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; var deferred = $.Deferred(); // #341 deferred.abort = function(status) { xhr.abort(status); }; if (a) { // ensure that every serialized input is still enabled for (i = 0; i < elements.length; i++) { el = $(elements[i]); if (hasProp) { el.prop('disabled', false); } else { el.removeAttr('disabled'); } } } s = $.extend(true, {}, $.ajaxSettings, options); s.context = s.context || s; id = 'jqFormIO' + new Date().getTime(); var ownerDocument = form.ownerDocument; var $body = $form.closest('body'); if (s.iframeTarget) { $io = $(s.iframeTarget, ownerDocument); n = $io.attr2('name'); if (!n) { $io.attr2('name', id); } else { id = n; } } else { $io = $(''; } if (typeof html === 'undefined') { html = layout.renderHtml(self); } if (self.statusbar) { footerHtml = self.statusbar.renderHtml(); } return '
    ' + '
    ' + headerHtml + '
    ' + html + '
    ' + footerHtml + '
    ' + '
    '; }, fullscreen: function (state) { var self = this; var documentElement = domGlobals.document.documentElement; var slowRendering; var prefix = self.classPrefix; var layoutRect; if (state !== self._fullscreen) { global$7(domGlobals.window).on('resize', function () { var time; if (self._fullscreen) { if (!slowRendering) { time = new Date().getTime(); var rect = funcs.getWindowSize(); self.moveTo(0, 0).resizeTo(rect.w, rect.h); if (new Date().getTime() - time > 50) { slowRendering = true; } } else { if (!self._timer) { self._timer = global$3.setTimeout(function () { var rect = funcs.getWindowSize(); self.moveTo(0, 0).resizeTo(rect.w, rect.h); self._timer = 0; }, 50); } } } }); layoutRect = self.layoutRect(); self._fullscreen = state; if (!state) { self.borderBox = BoxUtils.parseBox(self.settings.border); self.getEl('head').style.display = ''; layoutRect.deltaH += layoutRect.headerH; global$7([ documentElement, domGlobals.document.body ]).removeClass(prefix + 'fullscreen'); self.classes.remove('fullscreen'); self.moveTo(self._initial.x, self._initial.y).resizeTo(self._initial.w, self._initial.h); } else { self._initial = { x: layoutRect.x, y: layoutRect.y, w: layoutRect.w, h: layoutRect.h }; self.borderBox = BoxUtils.parseBox('0'); self.getEl('head').style.display = 'none'; layoutRect.deltaH -= layoutRect.headerH + 2; global$7([ documentElement, domGlobals.document.body ]).addClass(prefix + 'fullscreen'); self.classes.add('fullscreen'); var rect = funcs.getWindowSize(); self.moveTo(0, 0).resizeTo(rect.w, rect.h); } } return self.reflow(); }, postRender: function () { var self = this; var startPos; setTimeout(function () { self.classes.add('in'); self.fire('open'); }, 0); self._super(); if (self.statusbar) { self.statusbar.postRender(); } self.focus(); this.dragHelper = new DragHelper(self._id + '-dragh', { start: function () { startPos = { x: self.layoutRect().x, y: self.layoutRect().y }; }, drag: function (e) { self.moveTo(startPos.x + e.deltaX, startPos.y + e.deltaY); } }); self.on('submit', function (e) { if (!e.isDefaultPrevented()) { self.close(); } }); windows.push(self); toggleFullScreenState(true); }, submit: function () { return this.fire('submit', { data: this.toJSON() }); }, remove: function () { var self = this; var i; self.dragHelper.destroy(); self._super(); if (self.statusbar) { this.statusbar.remove(); } toggleBodyFullScreenClasses(self.classPrefix, false); i = windows.length; while (i--) { if (windows[i] === self) { windows.splice(i, 1); } } toggleFullScreenState(windows.length > 0); }, getContentWindow: function () { var ifr = this.getEl().getElementsByTagName('iframe')[0]; return ifr ? ifr.contentWindow : null; } }); handleWindowResize(); var MessageBox = Window.extend({ init: function (settings) { settings = { border: 1, padding: 20, layout: 'flex', pack: 'center', align: 'center', containerCls: 'panel', autoScroll: true, buttons: { type: 'button', text: 'Ok', action: 'ok' }, items: { type: 'label', multiline: true, maxWidth: 500, maxHeight: 200 } }; this._super(settings); }, Statics: { OK: 1, OK_CANCEL: 2, YES_NO: 3, YES_NO_CANCEL: 4, msgBox: function (settings) { var buttons; var callback = settings.callback || function () { }; function createButton(text, status, primary) { return { type: 'button', text: text, subtype: primary ? 'primary' : '', onClick: function (e) { e.control.parents()[1].close(); callback(status); } }; } switch (settings.buttons) { case MessageBox.OK_CANCEL: buttons = [ createButton('Ok', true, true), createButton('Cancel', false) ]; break; case MessageBox.YES_NO: case MessageBox.YES_NO_CANCEL: buttons = [ createButton('Yes', 1, true), createButton('No', 0) ]; if (settings.buttons === MessageBox.YES_NO_CANCEL) { buttons.push(createButton('Cancel', -1)); } break; default: buttons = [createButton('Ok', true, true)]; break; } return new Window({ padding: 20, x: settings.x, y: settings.y, minWidth: 300, minHeight: 100, layout: 'flex', pack: 'center', align: 'center', buttons: buttons, title: settings.title, role: 'alertdialog', items: { type: 'label', multiline: true, maxWidth: 500, maxHeight: 200, text: settings.text }, onPostRender: function () { this.aria('describedby', this.items()[0]._id); }, onClose: settings.onClose, onCancel: function () { callback(false); } }).renderTo(domGlobals.document.body).reflow(); }, alert: function (settings, callback) { if (typeof settings === 'string') { settings = { text: settings }; } settings.callback = callback; return MessageBox.msgBox(settings); }, confirm: function (settings, callback) { if (typeof settings === 'string') { settings = { text: settings }; } settings.callback = callback; settings.buttons = MessageBox.OK_CANCEL; return MessageBox.msgBox(settings); } } }); function WindowManagerImpl (editor) { var open = function (args, params, closeCallback) { var win; args.title = args.title || ' '; args.url = args.url || args.file; if (args.url) { args.width = parseInt(args.width || 320, 10); args.height = parseInt(args.height || 240, 10); } if (args.body) { args.items = { defaults: args.defaults, type: args.bodyType || 'form', items: args.body, data: args.data, callbacks: args.commands }; } if (!args.url && !args.buttons) { args.buttons = [ { text: 'Ok', subtype: 'primary', onclick: function () { win.find('form')[0].submit(); } }, { text: 'Cancel', onclick: function () { win.close(); } } ]; } win = new Window(args); win.on('close', function () { closeCallback(win); }); if (args.data) { win.on('postRender', function () { this.find('*').each(function (ctrl) { var name = ctrl.name(); if (name in args.data) { ctrl.value(args.data[name]); } }); }); } win.features = args || {}; win.params = params || {}; win = win.renderTo(domGlobals.document.body).reflow(); return win; }; var alert = function (message, choiceCallback, closeCallback) { var win; win = MessageBox.alert(message, function () { choiceCallback(); }); win.on('close', function () { closeCallback(win); }); return win; }; var confirm = function (message, choiceCallback, closeCallback) { var win; win = MessageBox.confirm(message, function (state) { choiceCallback(state); }); win.on('close', function () { closeCallback(win); }); return win; }; var close = function (window) { window.close(); }; var getParams = function (window) { return window.params; }; var setParams = function (window, params) { window.params = params; }; return { open: open, alert: alert, confirm: confirm, close: close, getParams: getParams, setParams: setParams }; } var get = function (editor, panel) { var renderUI = function () { return Render.renderUI(editor, panel); }; return { renderUI: renderUI, getNotificationManagerImpl: function () { return NotificationManagerImpl(editor); }, getWindowManagerImpl: function () { return WindowManagerImpl(); } }; }; var ThemeApi = { get: get }; var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); var path = function (parts, scope) { var o = scope !== undefined && scope !== null ? scope : Global; for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) { o = o[parts[i]]; } return o; }; var resolve = function (p, scope) { var parts = p.split('.'); return path(parts, scope); }; var unsafe = function (name, scope) { return resolve(name, scope); }; var getOrDie = function (name, scope) { var actual = unsafe(name, scope); if (actual === undefined || actual === null) { throw new Error(name + ' not available on this browser'); } return actual; }; var Global$1 = { getOrDie: getOrDie }; function FileReader () { var f = Global$1.getOrDie('FileReader'); return new f(); } var global$c = tinymce.util.Tools.resolve('tinymce.util.Promise'); var blobToBase64 = function (blob) { return new global$c(function (resolve) { var reader = FileReader(); reader.onloadend = function () { resolve(reader.result.split(',')[1]); }; reader.readAsDataURL(blob); }); }; var Conversions = { blobToBase64: blobToBase64 }; var pickFile = function () { return new global$c(function (resolve) { var fileInput; fileInput = domGlobals.document.createElement('input'); fileInput.type = 'file'; fileInput.style.position = 'fixed'; fileInput.style.left = 0; fileInput.style.top = 0; fileInput.style.opacity = 0.001; domGlobals.document.body.appendChild(fileInput); fileInput.onchange = function (e) { resolve(Array.prototype.slice.call(e.target.files)); }; fileInput.click(); fileInput.parentNode.removeChild(fileInput); }); }; var Picker = { pickFile: pickFile }; var count$1 = 0; var seed = function () { var rnd = function () { return Math.round(Math.random() * 4294967295).toString(36); }; return 's' + Date.now().toString(36) + rnd() + rnd() + rnd(); }; var uuid = function (prefix) { return prefix + count$1++ + seed(); }; var Uuid = { uuid: uuid }; var create$1 = function (dom, rng) { var bookmark = {}; function setupEndPoint(start) { var offsetNode, container, offset; container = rng[start ? 'startContainer' : 'endContainer']; offset = rng[start ? 'startOffset' : 'endOffset']; if (container.nodeType === 1) { offsetNode = dom.create('span', { 'data-mce-type': 'bookmark' }); if (container.hasChildNodes()) { offset = Math.min(offset, container.childNodes.length - 1); if (start) { container.insertBefore(offsetNode, container.childNodes[offset]); } else { dom.insertAfter(offsetNode, container.childNodes[offset]); } } else { container.appendChild(offsetNode); } container = offsetNode; offset = 0; } bookmark[start ? 'startContainer' : 'endContainer'] = container; bookmark[start ? 'startOffset' : 'endOffset'] = offset; } setupEndPoint(true); if (!rng.collapsed) { setupEndPoint(); } return bookmark; }; var resolve$1 = function (dom, bookmark) { function restoreEndPoint(start) { var container, offset, node; function nodeIndex(container) { var node = container.parentNode.firstChild, idx = 0; while (node) { if (node === container) { return idx; } if (node.nodeType !== 1 || node.getAttribute('data-mce-type') !== 'bookmark') { idx++; } node = node.nextSibling; } return -1; } container = node = bookmark[start ? 'startContainer' : 'endContainer']; offset = bookmark[start ? 'startOffset' : 'endOffset']; if (!container) { return; } if (container.nodeType === 1) { offset = nodeIndex(container); container = container.parentNode; dom.remove(node); } bookmark[start ? 'startContainer' : 'endContainer'] = container; bookmark[start ? 'startOffset' : 'endOffset'] = offset; } restoreEndPoint(true); restoreEndPoint(); var rng = dom.createRng(); rng.setStart(bookmark.startContainer, bookmark.startOffset); if (bookmark.endContainer) { rng.setEnd(bookmark.endContainer, bookmark.endOffset); } return rng; }; var Bookmark = { create: create$1, resolve: resolve$1 }; var global$d = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker'); var global$e = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils'); var getSelectedElements = function (rootElm, startNode, endNode) { var walker, node; var elms = []; walker = new global$d(startNode, rootElm); for (node = startNode; node; node = walker.next()) { if (node.nodeType === 1) { elms.push(node); } if (node === endNode) { break; } } return elms; }; var unwrapElements = function (editor, elms) { var bookmark, dom, selection; dom = editor.dom; selection = editor.selection; bookmark = Bookmark.create(dom, selection.getRng()); global$4.each(elms, function (elm) { editor.dom.remove(elm, true); }); selection.setRng(Bookmark.resolve(dom, bookmark)); }; var isLink = function (elm) { return elm.nodeName === 'A' && elm.hasAttribute('href'); }; var getParentAnchorOrSelf = function (dom, elm) { var anchorElm = dom.getParent(elm, isLink); return anchorElm ? anchorElm : elm; }; var getSelectedAnchors = function (editor) { var startElm, endElm, rootElm, anchorElms, selection, dom, rng; selection = editor.selection; dom = editor.dom; rng = selection.getRng(); startElm = getParentAnchorOrSelf(dom, global$e.getNode(rng.startContainer, rng.startOffset)); endElm = global$e.getNode(rng.endContainer, rng.endOffset); rootElm = editor.getBody(); anchorElms = global$4.grep(getSelectedElements(rootElm, startElm, endElm), isLink); return anchorElms; }; var unlinkSelection = function (editor) { unwrapElements(editor, getSelectedAnchors(editor)); }; var Unlink = { unlinkSelection: unlinkSelection }; var createTableHtml = function (cols, rows) { var x, y, html; html = ''; html += ''; for (y = 0; y < rows; y++) { html += ''; for (x = 0; x < cols; x++) { html += ''; } html += ''; } html += ''; html += '

    '; return html; }; var getInsertedElement = function (editor) { var elms = editor.dom.select('*[data-mce-id]'); return elms[0]; }; var insertTableHtml = function (editor, cols, rows) { editor.undoManager.transact(function () { var tableElm, cellElm; editor.insertContent(createTableHtml(cols, rows)); tableElm = getInsertedElement(editor); tableElm.removeAttribute('data-mce-id'); cellElm = editor.dom.select('td,th', tableElm); editor.selection.setCursorLocation(cellElm[0], 0); }); }; var insertTable = function (editor, cols, rows) { editor.plugins.table ? editor.plugins.table.insertTable(cols, rows) : insertTableHtml(editor, cols, rows); }; var formatBlock = function (editor, formatName) { editor.execCommand('FormatBlock', false, formatName); }; var insertBlob = function (editor, base64, blob) { var blobCache, blobInfo; blobCache = editor.editorUpload.blobCache; blobInfo = blobCache.create(Uuid.uuid('mceu'), blob, base64); blobCache.add(blobInfo); editor.insertContent(editor.dom.createHTML('img', { src: blobInfo.blobUri() })); }; var collapseSelectionToEnd = function (editor) { editor.selection.collapse(false); }; var unlink = function (editor) { editor.focus(); Unlink.unlinkSelection(editor); collapseSelectionToEnd(editor); }; var changeHref = function (editor, elm, url) { editor.focus(); editor.dom.setAttrib(elm, 'href', url); collapseSelectionToEnd(editor); }; var insertLink = function (editor, url) { editor.execCommand('mceInsertLink', false, { href: url }); collapseSelectionToEnd(editor); }; var updateOrInsertLink = function (editor, url) { var elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]'); elm ? changeHref(editor, elm, url) : insertLink(editor, url); }; var createLink = function (editor, url) { url.trim().length === 0 ? unlink(editor) : updateOrInsertLink(editor, url); }; var Actions = { insertTable: insertTable, formatBlock: formatBlock, insertBlob: insertBlob, createLink: createLink, unlink: unlink }; var addHeaderButtons = function (editor) { var formatBlock = function (name) { return function () { Actions.formatBlock(editor, name); }; }; for (var i = 1; i < 6; i++) { var name = 'h' + i; editor.addButton(name, { text: name.toUpperCase(), tooltip: 'Heading ' + i, stateSelector: name, onclick: formatBlock(name), onPostRender: function () { var span = this.getEl().firstChild.firstChild; span.style.fontWeight = 'bold'; } }); } }; var addToEditor = function (editor, panel) { editor.addButton('quicklink', { icon: 'link', tooltip: 'Insert/Edit link', stateSelector: 'a[href]', onclick: function () { panel.showForm(editor, 'quicklink'); } }); editor.addButton('quickimage', { icon: 'image', tooltip: 'Insert image', onclick: function () { Picker.pickFile().then(function (files) { var blob = files[0]; Conversions.blobToBase64(blob).then(function (base64) { Actions.insertBlob(editor, base64, blob); }); }); } }); editor.addButton('quicktable', { icon: 'table', tooltip: 'Insert table', onclick: function () { panel.hide(); Actions.insertTable(editor, 2, 2); } }); addHeaderButtons(editor); }; var Buttons = { addToEditor: addToEditor }; var getUiContainerDelta$1 = function () { var uiContainer = global$1.container; if (uiContainer && global$2.DOM.getStyle(uiContainer, 'position', true) !== 'static') { var containerPos = global$2.DOM.getPos(uiContainer); var dx = containerPos.x - uiContainer.scrollLeft; var dy = containerPos.y - uiContainer.scrollTop; return Option.some({ x: dx, y: dy }); } else { return Option.none(); } }; var UiContainer$1 = { getUiContainerDelta: getUiContainerDelta$1 }; var isDomainLike = function (href) { return /^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(href.trim()); }; var isAbsolute = function (href) { return /^https?:\/\//.test(href.trim()); }; var UrlType = { isDomainLike: isDomainLike, isAbsolute: isAbsolute }; var focusFirstTextBox = function (form) { form.find('textbox').eq(0).each(function (ctrl) { ctrl.focus(); }); }; var createForm = function (name, spec) { var form = global$b.create(global$4.extend({ type: 'form', layout: 'flex', direction: 'row', padding: 5, name: name, spacing: 3 }, spec)); form.on('show', function () { focusFirstTextBox(form); }); return form; }; var toggleVisibility = function (ctrl, state) { return state ? ctrl.show() : ctrl.hide(); }; var askAboutPrefix = function (editor, href) { return new global$c(function (resolve) { editor.windowManager.confirm('The URL you entered seems to be an external link. Do you want to add the required http:// prefix?', function (result) { var output = result === true ? 'http://' + href : href; resolve(output); }); }); }; var convertLinkToAbsolute = function (editor, href) { return !UrlType.isAbsolute(href) && UrlType.isDomainLike(href) ? askAboutPrefix(editor, href) : global$c.resolve(href); }; var createQuickLinkForm = function (editor, hide) { var attachState = {}; var unlink = function () { editor.focus(); Actions.unlink(editor); hide(); }; var onChangeHandler = function (e) { var meta = e.meta; if (meta && meta.attach) { attachState = { href: this.value(), attach: meta.attach }; } }; var onShowHandler = function (e) { if (e.control === this) { var elm = void 0, linkurl = ''; elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]'); if (elm) { linkurl = editor.dom.getAttrib(elm, 'href'); } this.fromJSON({ linkurl: linkurl }); toggleVisibility(this.find('#unlink'), elm); this.find('#linkurl')[0].focus(); } }; return createForm('quicklink', { items: [ { type: 'button', name: 'unlink', icon: 'unlink', onclick: unlink, tooltip: 'Remove link' }, { type: 'filepicker', name: 'linkurl', placeholder: 'Paste or type a link', filetype: 'file', onchange: onChangeHandler }, { type: 'button', icon: 'checkmark', subtype: 'primary', tooltip: 'Ok', onclick: 'submit' } ], onshow: onShowHandler, onsubmit: function (e) { convertLinkToAbsolute(editor, e.data.linkurl).then(function (url) { editor.undoManager.transact(function () { if (url === attachState.href) { attachState.attach(); attachState = {}; } Actions.createLink(editor, url); }); hide(); }); } }); }; var Forms = { createQuickLinkForm: createQuickLinkForm }; var getSelectorStateResult = function (itemName, item) { var result = function (selector, handler) { return { selector: selector, handler: handler }; }; var activeHandler = function (state) { item.active(state); }; var disabledHandler = function (state) { item.disabled(state); }; if (item.settings.stateSelector) { return result(item.settings.stateSelector, activeHandler); } if (item.settings.disabledStateSelector) { return result(item.settings.disabledStateSelector, disabledHandler); } return null; }; var bindSelectorChanged = function (editor, itemName, item) { return function () { var result = getSelectorStateResult(itemName, item); if (result !== null) { editor.selection.selectorChanged(result.selector, result.handler); } }; }; var itemsToArray$1 = function (items) { if (Type.isArray(items)) { return items; } else if (Type.isString(items)) { return items.split(/[ ,]/); } return []; }; var create$2 = function (editor, name, items) { var toolbarItems = []; var buttonGroup; if (!items) { return; } global$4.each(itemsToArray$1(items), function (item) { if (item === '|') { buttonGroup = null; } else { if (editor.buttons[item]) { if (!buttonGroup) { buttonGroup = { type: 'buttongroup', items: [] }; toolbarItems.push(buttonGroup); } var button = editor.buttons[item]; if (Type.isFunction(button)) { button = button(); } button.type = button.type || 'button'; button = global$b.create(button); button.on('postRender', bindSelectorChanged(editor, item, button)); buttonGroup.items.push(button); } } }); return global$b.create({ type: 'toolbar', layout: 'flow', name: name, items: toolbarItems }); }; var Toolbar = { create: create$2 }; var create$3 = function () { var panel, currentRect; var createToolbars = function (editor, toolbars) { return global$4.map(toolbars, function (toolbar) { return Toolbar.create(editor, toolbar.id, toolbar.items); }); }; var hasToolbarItems = function (toolbar) { return toolbar.items().length > 0; }; var create = function (editor, toolbars) { var items = createToolbars(editor, toolbars).concat([ Toolbar.create(editor, 'text', Settings.getTextSelectionToolbarItems(editor)), Toolbar.create(editor, 'insert', Settings.getInsertToolbarItems(editor)), Forms.createQuickLinkForm(editor, hide) ]); return global$b.create({ type: 'floatpanel', role: 'dialog', classes: 'tinymce tinymce-inline arrow', ariaLabel: 'Inline toolbar', layout: 'flex', direction: 'column', align: 'stretch', autohide: false, autofix: true, fixed: true, border: 1, items: global$4.grep(items, hasToolbarItems), oncancel: function () { editor.focus(); } }); }; var showPanel = function (panel) { if (panel) { panel.show(); } }; var movePanelTo = function (panel, pos) { panel.moveTo(pos.x, pos.y); }; var togglePositionClass = function (panel, relPos) { relPos = relPos ? relPos.substr(0, 2) : ''; global$4.each({ t: 'down', b: 'up', c: 'center' }, function (cls, pos) { panel.classes.toggle('arrow-' + cls, pos === relPos.substr(0, 1)); }); if (relPos === 'cr') { panel.classes.toggle('arrow-left', true); panel.classes.toggle('arrow-right', false); } else if (relPos === 'cl') { panel.classes.toggle('arrow-left', false); panel.classes.toggle('arrow-right', true); } else { global$4.each({ l: 'left', r: 'right' }, function (cls, pos) { panel.classes.toggle('arrow-' + cls, pos === relPos.substr(1, 1)); }); } }; var showToolbar = function (panel, id) { var toolbars = panel.items().filter('#' + id); if (toolbars.length > 0) { toolbars[0].show(); panel.reflow(); return true; } return false; }; var repositionPanelAt = function (panel, id, editor, targetRect) { var contentAreaRect, panelRect, result, userConstainHandler; userConstainHandler = Settings.getPositionHandler(editor); contentAreaRect = Measure.getContentAreaRect(editor); panelRect = global$2.DOM.getRect(panel.getEl()); if (id === 'insert') { result = Layout.calcInsert(targetRect, contentAreaRect, panelRect); } else { result = Layout.calc(targetRect, contentAreaRect, panelRect); } if (result) { var delta = UiContainer$1.getUiContainerDelta().getOr({ x: 0, y: 0 }); var transposedPanelRect = { x: result.rect.x - delta.x, y: result.rect.y - delta.y, w: result.rect.w, h: result.rect.h }; currentRect = targetRect; movePanelTo(panel, Layout.userConstrain(userConstainHandler, targetRect, contentAreaRect, transposedPanelRect)); togglePositionClass(panel, result.position); return true; } else { return false; } }; var showPanelAt = function (panel, id, editor, targetRect) { showPanel(panel); panel.items().hide(); if (!showToolbar(panel, id)) { hide(); return; } if (repositionPanelAt(panel, id, editor, targetRect) === false) { hide(); } }; var hasFormVisible = function () { return panel.items().filter('form:visible').length > 0; }; var showForm = function (editor, id) { if (panel) { panel.items().hide(); if (!showToolbar(panel, id)) { hide(); return; } var contentAreaRect = void 0, panelRect = void 0, result = void 0, userConstainHandler = void 0; showPanel(panel); panel.items().hide(); showToolbar(panel, id); userConstainHandler = Settings.getPositionHandler(editor); contentAreaRect = Measure.getContentAreaRect(editor); panelRect = global$2.DOM.getRect(panel.getEl()); result = Layout.calc(currentRect, contentAreaRect, panelRect); if (result) { panelRect = result.rect; movePanelTo(panel, Layout.userConstrain(userConstainHandler, currentRect, contentAreaRect, panelRect)); togglePositionClass(panel, result.position); } } }; var show = function (editor, id, targetRect, toolbars) { if (!panel) { Events.fireBeforeRenderUI(editor); panel = create(editor, toolbars); panel.renderTo().reflow().moveTo(targetRect.x, targetRect.y); editor.nodeChanged(); } showPanelAt(panel, id, editor, targetRect); }; var reposition = function (editor, id, targetRect) { if (panel) { repositionPanelAt(panel, id, editor, targetRect); } }; var hide = function () { if (panel) { panel.hide(); } }; var focus = function () { if (panel) { panel.find('toolbar:visible').eq(0).each(function (item) { item.focus(true); }); } }; var remove = function () { if (panel) { panel.remove(); panel = null; } }; var inForm = function () { return panel && panel.visible() && hasFormVisible(); }; return { show: show, showForm: showForm, reposition: reposition, inForm: inForm, hide: hide, focus: focus, remove: remove }; }; var Layout$1 = global$8.extend({ Defaults: { firstControlClass: 'first', lastControlClass: 'last' }, init: function (settings) { this.settings = global$4.extend({}, this.Defaults, settings); }, preRender: function (container) { container.bodyClasses.add(this.settings.containerClass); }, applyClasses: function (items) { var self = this; var settings = self.settings; var firstClass, lastClass, firstItem, lastItem; firstClass = settings.firstControlClass; lastClass = settings.lastControlClass; items.each(function (item) { item.classes.remove(firstClass).remove(lastClass).add(settings.controlClass); if (item.visible()) { if (!firstItem) { firstItem = item; } lastItem = item; } }); if (firstItem) { firstItem.classes.add(firstClass); } if (lastItem) { lastItem.classes.add(lastClass); } }, renderHtml: function (container) { var self = this; var html = ''; self.applyClasses(container.items()); container.items().each(function (item) { html += item.renderHtml(); }); return html; }, recalc: function () { }, postRender: function () { }, isNative: function () { return false; } }); var AbsoluteLayout = Layout$1.extend({ Defaults: { containerClass: 'abs-layout', controlClass: 'abs-layout-item' }, recalc: function (container) { container.items().filter(':visible').each(function (ctrl) { var settings = ctrl.settings; ctrl.layoutRect({ x: settings.x, y: settings.y, w: settings.w, h: settings.h }); if (ctrl.recalc) { ctrl.recalc(); } }); }, renderHtml: function (container) { return '
    ' + this._super(container); } }); var Button = Widget.extend({ Defaults: { classes: 'widget btn', role: 'button' }, init: function (settings) { var self = this; var size; self._super(settings); settings = self.settings; size = self.settings.size; self.on('click mousedown', function (e) { e.preventDefault(); }); self.on('touchstart', function (e) { self.fire('click', e); e.preventDefault(); }); if (settings.subtype) { self.classes.add(settings.subtype); } if (size) { self.classes.add('btn-' + size); } if (settings.icon) { self.icon(settings.icon); } }, icon: function (icon) { if (!arguments.length) { return this.state.get('icon'); } this.state.set('icon', icon); return this; }, repaint: function () { var btnElm = this.getEl().firstChild; var btnStyle; if (btnElm) { btnStyle = btnElm.style; btnStyle.width = btnStyle.height = '100%'; } this._super(); }, renderHtml: function () { var self = this, id = self._id, prefix = self.classPrefix; var icon = self.state.get('icon'), image; var text = self.state.get('text'); var textHtml = ''; var ariaPressed; var settings = self.settings; image = settings.image; if (image) { icon = 'none'; if (typeof image !== 'string') { image = domGlobals.window.getSelection ? image[0] : image[1]; } image = ' style="background-image: url(\'' + image + '\')"'; } else { image = ''; } if (text) { self.classes.add('btn-has-text'); textHtml = '' + self.encode(text) + ''; } icon = icon ? prefix + 'ico ' + prefix + 'i-' + icon : ''; ariaPressed = typeof settings.active === 'boolean' ? ' aria-pressed="' + settings.active + '"' : ''; return '
    ' + '' + '
    '; }, bindStates: function () { var self = this, $ = self.$, textCls = self.classPrefix + 'txt'; function setButtonText(text) { var $span = $('span.' + textCls, self.getEl()); if (text) { if (!$span[0]) { $('button:first', self.getEl()).append(''); $span = $('span.' + textCls, self.getEl()); } $span.html(self.encode(text)); } else { $span.remove(); } self.classes.toggle('btn-has-text', !!text); } self.state.on('change:text', function (e) { setButtonText(e.value); }); self.state.on('change:icon', function (e) { var icon = e.value; var prefix = self.classPrefix; self.settings.icon = icon; icon = icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : ''; var btnElm = self.getEl().firstChild; var iconElm = btnElm.getElementsByTagName('i')[0]; if (icon) { if (!iconElm || iconElm !== btnElm.firstChild) { iconElm = domGlobals.document.createElement('i'); btnElm.insertBefore(iconElm, btnElm.firstChild); } iconElm.className = icon; } else if (iconElm) { btnElm.removeChild(iconElm); } setButtonText(self.state.get('text')); }); return self._super(); } }); var BrowseButton = Button.extend({ init: function (settings) { var self = this; settings = global$4.extend({ text: 'Browse...', multiple: false, accept: null }, settings); self._super(settings); self.classes.add('browsebutton'); if (settings.multiple) { self.classes.add('multiple'); } }, postRender: function () { var self = this; var input = funcs.create('input', { type: 'file', id: self._id + '-browse', accept: self.settings.accept }); self._super(); global$7(input).on('change', function (e) { var files = e.target.files; self.value = function () { if (!files.length) { return null; } else if (self.settings.multiple) { return files; } else { return files[0]; } }; e.preventDefault(); if (files.length) { self.fire('change', e); } }); global$7(input).on('click', function (e) { e.stopPropagation(); }); global$7(self.getEl('button')).on('click touchstart', function (e) { e.stopPropagation(); input.click(); e.preventDefault(); }); self.getEl().appendChild(input); }, remove: function () { global$7(this.getEl('button')).off(); global$7(this.getEl('input')).off(); this._super(); } }); var ButtonGroup = Container.extend({ Defaults: { defaultType: 'button', role: 'group' }, renderHtml: function () { var self = this, layout = self._layout; self.classes.add('btn-group'); self.preRender(); layout.preRender(self); return '
    ' + '
    ' + (self.settings.html || '') + layout.renderHtml(self) + '
    ' + '
    '; } }); var Checkbox = Widget.extend({ Defaults: { classes: 'checkbox', role: 'checkbox', checked: false }, init: function (settings) { var self = this; self._super(settings); self.on('click mousedown', function (e) { e.preventDefault(); }); self.on('click', function (e) { e.preventDefault(); if (!self.disabled()) { self.checked(!self.checked()); } }); self.checked(self.settings.checked); }, checked: function (state) { if (!arguments.length) { return this.state.get('checked'); } this.state.set('checked', state); return this; }, value: function (state) { if (!arguments.length) { return this.checked(); } return this.checked(state); }, renderHtml: function () { var self = this, id = self._id, prefix = self.classPrefix; return '
    ' + '' + '' + self.encode(self.state.get('text')) + '' + '
    '; }, bindStates: function () { var self = this; function checked(state) { self.classes.toggle('checked', state); self.aria('checked', state); } self.state.on('change:text', function (e) { self.getEl('al').firstChild.data = self.translate(e.value); }); self.state.on('change:checked change:value', function (e) { self.fire('change'); checked(e.value); }); self.state.on('change:icon', function (e) { var icon = e.value; var prefix = self.classPrefix; if (typeof icon === 'undefined') { return self.settings.icon; } self.settings.icon = icon; icon = icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : ''; var btnElm = self.getEl().firstChild; var iconElm = btnElm.getElementsByTagName('i')[0]; if (icon) { if (!iconElm || iconElm !== btnElm.firstChild) { iconElm = domGlobals.document.createElement('i'); btnElm.insertBefore(iconElm, btnElm.firstChild); } iconElm.className = icon; } else if (iconElm) { btnElm.removeChild(iconElm); } }); if (self.state.get('checked')) { checked(true); } return self._super(); } }); var global$f = tinymce.util.Tools.resolve('tinymce.util.VK'); var ComboBox = Widget.extend({ init: function (settings) { var self = this; self._super(settings); settings = self.settings; self.classes.add('combobox'); self.subinput = true; self.ariaTarget = 'inp'; settings.menu = settings.menu || settings.values; if (settings.menu) { settings.icon = 'caret'; } self.on('click', function (e) { var elm = e.target; var root = self.getEl(); if (!global$7.contains(root, elm) && elm !== root) { return; } while (elm && elm !== root) { if (elm.id && elm.id.indexOf('-open') !== -1) { self.fire('action'); if (settings.menu) { self.showMenu(); if (e.aria) { self.menu.items()[0].focus(); } } } elm = elm.parentNode; } }); self.on('keydown', function (e) { var rootControl; if (e.keyCode === 13 && e.target.nodeName === 'INPUT') { e.preventDefault(); self.parents().reverse().each(function (ctrl) { if (ctrl.toJSON) { rootControl = ctrl; return false; } }); self.fire('submit', { data: rootControl.toJSON() }); } }); self.on('keyup', function (e) { if (e.target.nodeName === 'INPUT') { var oldValue = self.state.get('value'); var newValue = e.target.value; if (newValue !== oldValue) { self.state.set('value', newValue); self.fire('autocomplete', e); } } }); self.on('mouseover', function (e) { var tooltip = self.tooltip().moveTo(-65535); if (self.statusLevel() && e.target.className.indexOf(self.classPrefix + 'status') !== -1) { var statusMessage = self.statusMessage() || 'Ok'; var rel = tooltip.text(statusMessage).show().testMoveRel(e.target, [ 'bc-tc', 'bc-tl', 'bc-tr' ]); tooltip.classes.toggle('tooltip-n', rel === 'bc-tc'); tooltip.classes.toggle('tooltip-nw', rel === 'bc-tl'); tooltip.classes.toggle('tooltip-ne', rel === 'bc-tr'); tooltip.moveRel(e.target, rel); } }); }, statusLevel: function (value) { if (arguments.length > 0) { this.state.set('statusLevel', value); } return this.state.get('statusLevel'); }, statusMessage: function (value) { if (arguments.length > 0) { this.state.set('statusMessage', value); } return this.state.get('statusMessage'); }, showMenu: function () { var self = this; var settings = self.settings; var menu; if (!self.menu) { menu = settings.menu || []; if (menu.length) { menu = { type: 'menu', items: menu }; } else { menu.type = menu.type || 'menu'; } self.menu = global$b.create(menu).parent(self).renderTo(self.getContainerElm()); self.fire('createmenu'); self.menu.reflow(); self.menu.on('cancel', function (e) { if (e.control === self.menu) { self.focus(); } }); self.menu.on('show hide', function (e) { e.control.items().each(function (ctrl) { ctrl.active(ctrl.value() === self.value()); }); }).fire('show'); self.menu.on('select', function (e) { self.value(e.control.value()); }); self.on('focusin', function (e) { if (e.target.tagName.toUpperCase() === 'INPUT') { self.menu.hide(); } }); self.aria('expanded', true); } self.menu.show(); self.menu.layoutRect({ w: self.layoutRect().w }); self.menu.moveRel(self.getEl(), self.isRtl() ? [ 'br-tr', 'tr-br' ] : [ 'bl-tl', 'tl-bl' ]); }, focus: function () { this.getEl('inp').focus(); }, repaint: function () { var self = this, elm = self.getEl(), openElm = self.getEl('open'), rect = self.layoutRect(); var width, lineHeight, innerPadding = 0; var inputElm = elm.firstChild; if (self.statusLevel() && self.statusLevel() !== 'none') { innerPadding = parseInt(funcs.getRuntimeStyle(inputElm, 'padding-right'), 10) - parseInt(funcs.getRuntimeStyle(inputElm, 'padding-left'), 10); } if (openElm) { width = rect.w - funcs.getSize(openElm).width - 10; } else { width = rect.w - 10; } var doc = domGlobals.document; if (doc.all && (!doc.documentMode || doc.documentMode <= 8)) { lineHeight = self.layoutRect().h - 2 + 'px'; } global$7(inputElm).css({ width: width - innerPadding, lineHeight: lineHeight }); self._super(); return self; }, postRender: function () { var self = this; global$7(this.getEl('inp')).on('change', function (e) { self.state.set('value', e.target.value); self.fire('change', e); }); return self._super(); }, renderHtml: function () { var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix; var value = self.state.get('value') || ''; var icon, text, openBtnHtml = '', extraAttrs = '', statusHtml = ''; if ('spellcheck' in settings) { extraAttrs += ' spellcheck="' + settings.spellcheck + '"'; } if (settings.maxLength) { extraAttrs += ' maxlength="' + settings.maxLength + '"'; } if (settings.size) { extraAttrs += ' size="' + settings.size + '"'; } if (settings.subtype) { extraAttrs += ' type="' + settings.subtype + '"'; } statusHtml = ''; if (self.disabled()) { extraAttrs += ' disabled="disabled"'; } icon = settings.icon; if (icon && icon !== 'caret') { icon = prefix + 'ico ' + prefix + 'i-' + settings.icon; } text = self.state.get('text'); if (icon || text) { openBtnHtml = '
    ' + '' + '
    '; self.classes.add('has-open'); } return '
    ' + '' + statusHtml + openBtnHtml + '
    '; }, value: function (value) { if (arguments.length) { this.state.set('value', value); return this; } if (this.state.get('rendered')) { this.state.set('value', this.getEl('inp').value); } return this.state.get('value'); }, showAutoComplete: function (items, term) { var self = this; if (items.length === 0) { self.hideMenu(); return; } var insert = function (value, title) { return function () { self.fire('selectitem', { title: title, value: value }); }; }; if (self.menu) { self.menu.items().remove(); } else { self.menu = global$b.create({ type: 'menu', classes: 'combobox-menu', layout: 'flow' }).parent(self).renderTo(); } global$4.each(items, function (item) { self.menu.add({ text: item.title, url: item.previewUrl, match: term, classes: 'menu-item-ellipsis', onclick: insert(item.value, item.title) }); }); self.menu.renderNew(); self.hideMenu(); self.menu.on('cancel', function (e) { if (e.control.parent() === self.menu) { e.stopPropagation(); self.focus(); self.hideMenu(); } }); self.menu.on('select', function () { self.focus(); }); var maxW = self.layoutRect().w; self.menu.layoutRect({ w: maxW, minW: 0, maxW: maxW }); self.menu.repaint(); self.menu.reflow(); self.menu.show(); self.menu.moveRel(self.getEl(), self.isRtl() ? [ 'br-tr', 'tr-br' ] : [ 'bl-tl', 'tl-bl' ]); }, hideMenu: function () { if (this.menu) { this.menu.hide(); } }, bindStates: function () { var self = this; self.state.on('change:value', function (e) { if (self.getEl('inp').value !== e.value) { self.getEl('inp').value = e.value; } }); self.state.on('change:disabled', function (e) { self.getEl('inp').disabled = e.value; }); self.state.on('change:statusLevel', function (e) { var statusIconElm = self.getEl('status'); var prefix = self.classPrefix, value = e.value; funcs.css(statusIconElm, 'display', value === 'none' ? 'none' : ''); funcs.toggleClass(statusIconElm, prefix + 'i-checkmark', value === 'ok'); funcs.toggleClass(statusIconElm, prefix + 'i-warning', value === 'warn'); funcs.toggleClass(statusIconElm, prefix + 'i-error', value === 'error'); self.classes.toggle('has-status', value !== 'none'); self.repaint(); }); funcs.on(self.getEl('status'), 'mouseleave', function () { self.tooltip().hide(); }); self.on('cancel', function (e) { if (self.menu && self.menu.visible()) { e.stopPropagation(); self.hideMenu(); } }); var focusIdx = function (idx, menu) { if (menu && menu.items().length > 0) { menu.items().eq(idx)[0].focus(); } }; self.on('keydown', function (e) { var keyCode = e.keyCode; if (e.target.nodeName === 'INPUT') { if (keyCode === global$f.DOWN) { e.preventDefault(); self.fire('autocomplete'); focusIdx(0, self.menu); } else if (keyCode === global$f.UP) { e.preventDefault(); focusIdx(-1, self.menu); } } }); return self._super(); }, remove: function () { global$7(this.getEl('inp')).off(); if (this.menu) { this.menu.remove(); } this._super(); } }); var ColorBox = ComboBox.extend({ init: function (settings) { var self = this; settings.spellcheck = false; if (settings.onaction) { settings.icon = 'none'; } self._super(settings); self.classes.add('colorbox'); self.on('change keyup postrender', function () { self.repaintColor(self.value()); }); }, repaintColor: function (value) { var openElm = this.getEl('open'); var elm = openElm ? openElm.getElementsByTagName('i')[0] : null; if (elm) { try { elm.style.background = value; } catch (ex) { } } }, bindStates: function () { var self = this; self.state.on('change:value', function (e) { if (self.state.get('rendered')) { self.repaintColor(e.value); } }); return self._super(); } }); var PanelButton = Button.extend({ showPanel: function () { var self = this, settings = self.settings; self.classes.add('opened'); if (!self.panel) { var panelSettings = settings.panel; if (panelSettings.type) { panelSettings = { layout: 'grid', items: panelSettings }; } panelSettings.role = panelSettings.role || 'dialog'; panelSettings.popover = true; panelSettings.autohide = true; panelSettings.ariaRoot = true; self.panel = new FloatPanel(panelSettings).on('hide', function () { self.classes.remove('opened'); }).on('cancel', function (e) { e.stopPropagation(); self.focus(); self.hidePanel(); }).parent(self).renderTo(self.getContainerElm()); self.panel.fire('show'); self.panel.reflow(); } else { self.panel.show(); } var rtlRels = [ 'bc-tc', 'bc-tl', 'bc-tr' ]; var ltrRels = [ 'bc-tc', 'bc-tr', 'bc-tl', 'tc-bc', 'tc-br', 'tc-bl' ]; var rel = self.panel.testMoveRel(self.getEl(), settings.popoverAlign || (self.isRtl() ? rtlRels : ltrRels)); self.panel.classes.toggle('start', rel.substr(-1) === 'l'); self.panel.classes.toggle('end', rel.substr(-1) === 'r'); var isTop = rel.substr(0, 1) === 't'; self.panel.classes.toggle('bottom', !isTop); self.panel.classes.toggle('top', isTop); self.panel.moveRel(self.getEl(), rel); }, hidePanel: function () { var self = this; if (self.panel) { self.panel.hide(); } }, postRender: function () { var self = this; self.aria('haspopup', true); self.on('click', function (e) { if (e.control === self) { if (self.panel && self.panel.visible()) { self.hidePanel(); } else { self.showPanel(); self.panel.focus(!!e.aria); } } }); return self._super(); }, remove: function () { if (this.panel) { this.panel.remove(); this.panel = null; } return this._super(); } }); var DOM = global$2.DOM; var ColorButton = PanelButton.extend({ init: function (settings) { this._super(settings); this.classes.add('splitbtn'); this.classes.add('colorbutton'); }, color: function (color) { if (color) { this._color = color; this.getEl('preview').style.backgroundColor = color; return this; } return this._color; }, resetColor: function () { this._color = null; this.getEl('preview').style.backgroundColor = null; return this; }, renderHtml: function () { var self = this, id = self._id, prefix = self.classPrefix, text = self.state.get('text'); var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : ''; var image = self.settings.image ? ' style="background-image: url(\'' + self.settings.image + '\')"' : ''; var textHtml = ''; if (text) { self.classes.add('btn-has-text'); textHtml = '' + self.encode(text) + ''; } return '
    ' + '' + '' + '
    '; }, postRender: function () { var self = this, onClickHandler = self.settings.onclick; self.on('click', function (e) { if (e.aria && e.aria.key === 'down') { return; } if (e.control === self && !DOM.getParent(e.target, '.' + self.classPrefix + 'open')) { e.stopImmediatePropagation(); onClickHandler.call(self, e); } }); delete self.settings.onclick; return self._super(); } }); var global$g = tinymce.util.Tools.resolve('tinymce.util.Color'); var ColorPicker = Widget.extend({ Defaults: { classes: 'widget colorpicker' }, init: function (settings) { this._super(settings); }, postRender: function () { var self = this; var color = self.color(); var hsv, hueRootElm, huePointElm, svRootElm, svPointElm; hueRootElm = self.getEl('h'); huePointElm = self.getEl('hp'); svRootElm = self.getEl('sv'); svPointElm = self.getEl('svp'); function getPos(elm, event) { var pos = funcs.getPos(elm); var x, y; x = event.pageX - pos.x; y = event.pageY - pos.y; x = Math.max(0, Math.min(x / elm.clientWidth, 1)); y = Math.max(0, Math.min(y / elm.clientHeight, 1)); return { x: x, y: y }; } function updateColor(hsv, hueUpdate) { var hue = (360 - hsv.h) / 360; funcs.css(huePointElm, { top: hue * 100 + '%' }); if (!hueUpdate) { funcs.css(svPointElm, { left: hsv.s + '%', top: 100 - hsv.v + '%' }); } svRootElm.style.background = global$g({ s: 100, v: 100, h: hsv.h }).toHex(); self.color().parse({ s: hsv.s, v: hsv.v, h: hsv.h }); } function updateSaturationAndValue(e) { var pos; pos = getPos(svRootElm, e); hsv.s = pos.x * 100; hsv.v = (1 - pos.y) * 100; updateColor(hsv); self.fire('change'); } function updateHue(e) { var pos; pos = getPos(hueRootElm, e); hsv = color.toHsv(); hsv.h = (1 - pos.y) * 360; updateColor(hsv, true); self.fire('change'); } self._repaint = function () { hsv = color.toHsv(); updateColor(hsv); }; self._super(); self._svdraghelper = new DragHelper(self._id + '-sv', { start: updateSaturationAndValue, drag: updateSaturationAndValue }); self._hdraghelper = new DragHelper(self._id + '-h', { start: updateHue, drag: updateHue }); self._repaint(); }, rgb: function () { return this.color().toRgb(); }, value: function (value) { var self = this; if (arguments.length) { self.color().parse(value); if (self._rendered) { self._repaint(); } } else { return self.color().toHex(); } }, color: function () { if (!this._color) { this._color = global$g(); } return this._color; }, renderHtml: function () { var self = this; var id = self._id; var prefix = self.classPrefix; var hueHtml; var stops = '#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000'; function getOldIeFallbackHtml() { var i, l, html = '', gradientPrefix, stopsList; gradientPrefix = 'filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='; stopsList = stops.split(','); for (i = 0, l = stopsList.length - 1; i < l; i++) { html += '
    '; } return html; } var gradientCssText = 'background: -ms-linear-gradient(top,' + stops + ');' + 'background: linear-gradient(to bottom,' + stops + ');'; hueHtml = '
    ' + getOldIeFallbackHtml() + '
    ' + '
    '; return '
    ' + '
    ' + '
    ' + '
    ' + '
    ' + '
    ' + '
    ' + '
    ' + '
    ' + '
    ' + hueHtml + '
    '; } }); var DropZone = Widget.extend({ init: function (settings) { var self = this; settings = global$4.extend({ height: 100, text: 'Drop an image here', multiple: false, accept: null }, settings); self._super(settings); self.classes.add('dropzone'); if (settings.multiple) { self.classes.add('multiple'); } }, renderHtml: function () { var self = this; var attrs, elm; var cfg = self.settings; attrs = { id: self._id, hidefocus: '1' }; elm = funcs.create('div', attrs, '' + this.translate(cfg.text) + ''); if (cfg.height) { funcs.css(elm, 'height', cfg.height + 'px'); } if (cfg.width) { funcs.css(elm, 'width', cfg.width + 'px'); } elm.className = self.classes; return elm.outerHTML; }, postRender: function () { var self = this; var toggleDragClass = function (e) { e.preventDefault(); self.classes.toggle('dragenter'); self.getEl().className = self.classes; }; var filter = function (files) { var accept = self.settings.accept; if (typeof accept !== 'string') { return files; } var re = new RegExp('(' + accept.split(/\s*,\s*/).join('|') + ')$', 'i'); return global$4.grep(files, function (file) { return re.test(file.name); }); }; self._super(); self.$el.on('dragover', function (e) { e.preventDefault(); }); self.$el.on('dragenter', toggleDragClass); self.$el.on('dragleave', toggleDragClass); self.$el.on('drop', function (e) { e.preventDefault(); if (self.state.get('disabled')) { return; } var files = filter(e.dataTransfer.files); self.value = function () { if (!files.length) { return null; } else if (self.settings.multiple) { return files; } else { return files[0]; } }; if (files.length) { self.fire('change', e); } }); }, remove: function () { this.$el.off(); this._super(); } }); var Path = Widget.extend({ init: function (settings) { var self = this; if (!settings.delimiter) { settings.delimiter = '\xBB'; } self._super(settings); self.classes.add('path'); self.canFocus = true; self.on('click', function (e) { var index; var target = e.target; if (index = target.getAttribute('data-index')) { self.fire('select', { value: self.row()[index], index: index }); } }); self.row(self.settings.row); }, focus: function () { var self = this; self.getEl().firstChild.focus(); return self; }, row: function (row) { if (!arguments.length) { return this.state.get('row'); } this.state.set('row', row); return this; }, renderHtml: function () { var self = this; return '
    ' + self._getDataPathHtml(self.state.get('row')) + '
    '; }, bindStates: function () { var self = this; self.state.on('change:row', function (e) { self.innerHtml(self._getDataPathHtml(e.value)); }); return self._super(); }, _getDataPathHtml: function (data) { var self = this; var parts = data || []; var i, l, html = ''; var prefix = self.classPrefix; for (i = 0, l = parts.length; i < l; i++) { html += (i > 0 ? '' : '') + '
    ' + parts[i].name + '
    '; } if (!html) { html = '
    \xA0
    '; } return html; } }); var ElementPath = Path.extend({ postRender: function () { var self = this, editor = self.settings.editor; function isHidden(elm) { if (elm.nodeType === 1) { if (elm.nodeName === 'BR' || !!elm.getAttribute('data-mce-bogus')) { return true; } if (elm.getAttribute('data-mce-type') === 'bookmark') { return true; } } return false; } if (editor.settings.elementpath !== false) { self.on('select', function (e) { editor.focus(); editor.selection.select(this.row()[e.index].element); editor.nodeChanged(); }); editor.on('nodeChange', function (e) { var outParents = []; var parents = e.parents; var i = parents.length; while (i--) { if (parents[i].nodeType === 1 && !isHidden(parents[i])) { var args = editor.fire('ResolveName', { name: parents[i].nodeName.toLowerCase(), target: parents[i] }); if (!args.isDefaultPrevented()) { outParents.push({ name: args.name, element: parents[i] }); } if (args.isPropagationStopped()) { break; } } } self.row(outParents); }); } return self._super(); } }); var FormItem = Container.extend({ Defaults: { layout: 'flex', align: 'center', defaults: { flex: 1 } }, renderHtml: function () { var self = this, layout = self._layout, prefix = self.classPrefix; self.classes.add('formitem'); layout.preRender(self); return '
    ' + (self.settings.title ? '
    ' + self.settings.title + '
    ' : '') + '
    ' + (self.settings.html || '') + layout.renderHtml(self) + '
    ' + '
    '; } }); var Form = Container.extend({ Defaults: { containerCls: 'form', layout: 'flex', direction: 'column', align: 'stretch', flex: 1, padding: 15, labelGap: 30, spacing: 10, callbacks: { submit: function () { this.submit(); } } }, preRender: function () { var self = this, items = self.items(); if (!self.settings.formItemDefaults) { self.settings.formItemDefaults = { layout: 'flex', autoResize: 'overflow', defaults: { flex: 1 } }; } items.each(function (ctrl) { var formItem; var label = ctrl.settings.label; if (label) { formItem = new FormItem(global$4.extend({ items: { type: 'label', id: ctrl._id + '-l', text: label, flex: 0, forId: ctrl._id, disabled: ctrl.disabled() } }, self.settings.formItemDefaults)); formItem.type = 'formitem'; ctrl.aria('labelledby', ctrl._id + '-l'); if (typeof ctrl.settings.flex === 'undefined') { ctrl.settings.flex = 1; } self.replace(ctrl, formItem); formItem.add(ctrl); } }); }, submit: function () { return this.fire('submit', { data: this.toJSON() }); }, postRender: function () { var self = this; self._super(); self.fromJSON(self.settings.data); }, bindStates: function () { var self = this; self._super(); function recalcLabels() { var maxLabelWidth = 0; var labels = []; var i, labelGap, items; if (self.settings.labelGapCalc === false) { return; } if (self.settings.labelGapCalc === 'children') { items = self.find('formitem'); } else { items = self.items(); } items.filter('formitem').each(function (item) { var labelCtrl = item.items()[0], labelWidth = labelCtrl.getEl().clientWidth; maxLabelWidth = labelWidth > maxLabelWidth ? labelWidth : maxLabelWidth; labels.push(labelCtrl); }); labelGap = self.settings.labelGap || 0; i = labels.length; while (i--) { labels[i].settings.minWidth = maxLabelWidth + labelGap; } } self.on('show', recalcLabels); recalcLabels(); } }); var FieldSet = Form.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 self = this, layout = self._layout, prefix = self.classPrefix; self.preRender(); layout.preRender(self); return '
    ' + (self.settings.title ? '' + self.settings.title + '' : '') + '
    ' + (self.settings.html || '') + layout.renderHtml(self) + '
    ' + '
    '; } }); var unique$1 = 0; var generate = function (prefix) { var date = new Date(); var time = date.getTime(); var random = Math.floor(Math.random() * 1000000000); unique$1++; return prefix + '_' + random + unique$1 + String(time); }; var fromHtml = function (html, scope) { var doc = scope || domGlobals.document; var div = doc.createElement('div'); div.innerHTML = html; if (!div.hasChildNodes() || div.childNodes.length > 1) { domGlobals.console.error('HTML does not have a single root node', html); throw new Error('HTML must have a single root node'); } return fromDom(div.childNodes[0]); }; var fromTag = function (tag, scope) { var doc = scope || domGlobals.document; var node = doc.createElement(tag); return fromDom(node); }; var fromText = function (text, scope) { var doc = scope || domGlobals.document; var node = doc.createTextNode(text); return fromDom(node); }; var fromDom = function (node) { if (node === null || node === undefined) { throw new Error('Node cannot be null or undefined'); } return { dom: constant(node) }; }; var fromPoint = function (docElm, x, y) { var doc = docElm.dom(); return Option.from(doc.elementFromPoint(x, y)).map(fromDom); }; var Element = { fromHtml: fromHtml, fromTag: fromTag, fromText: fromText, fromDom: fromDom, fromPoint: fromPoint }; var cached = function (f) { var called = false; var r; return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } if (!called) { called = true; r = f.apply(null, args); } return r; }; }; var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; var COMMENT = domGlobals.Node.COMMENT_NODE; var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; var ELEMENT = domGlobals.Node.ELEMENT_NODE; var TEXT = domGlobals.Node.TEXT_NODE; var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; var ENTITY = domGlobals.Node.ENTITY_NODE; var NOTATION = domGlobals.Node.NOTATION_NODE; var Immutable = function () { var fields = []; for (var _i = 0; _i < arguments.length; _i++) { fields[_i] = arguments[_i]; } return function () { var values = []; for (var _i = 0; _i < arguments.length; _i++) { values[_i] = arguments[_i]; } if (fields.length !== values.length) { throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments'); } var struct = {}; each(fields, function (name, i) { struct[name] = constant(values[i]); }); return struct; }; }; var node = function () { var f = Global$1.getOrDie('Node'); return f; }; var compareDocumentPosition = function (a, b, match) { return (a.compareDocumentPosition(b) & match) !== 0; }; var documentPositionPreceding = function (a, b) { return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_PRECEDING); }; var documentPositionContainedBy = function (a, b) { return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_CONTAINED_BY); }; var Node = { documentPositionPreceding: documentPositionPreceding, documentPositionContainedBy: documentPositionContainedBy }; var firstMatch = function (regexes, s) { for (var i = 0; i < regexes.length; i++) { var x = regexes[i]; if (x.test(s)) { return x; } } return undefined; }; var find$1 = function (regexes, agent) { var r = firstMatch(regexes, agent); if (!r) { return { major: 0, minor: 0 }; } var group = function (i) { return Number(agent.replace(r, '$' + i)); }; return nu(group(1), group(2)); }; var detect = function (versionRegexes, agent) { var cleanedAgent = String(agent).toLowerCase(); if (versionRegexes.length === 0) { return unknown(); } return find$1(versionRegexes, cleanedAgent); }; var unknown = function () { return nu(0, 0); }; var nu = function (major, minor) { return { major: major, minor: minor }; }; var Version = { nu: nu, detect: detect, unknown: unknown }; var edge = 'Edge'; var chrome = 'Chrome'; var ie = 'IE'; var opera = 'Opera'; var firefox = 'Firefox'; var safari = 'Safari'; var isBrowser = function (name, current) { return function () { return current === name; }; }; var unknown$1 = function () { return nu$1({ current: undefined, version: Version.unknown() }); }; var nu$1 = function (info) { var current = info.current; var version = info.version; return { current: current, version: version, isEdge: isBrowser(edge, current), isChrome: isBrowser(chrome, current), isIE: isBrowser(ie, current), isOpera: isBrowser(opera, current), isFirefox: isBrowser(firefox, current), isSafari: isBrowser(safari, current) }; }; var Browser = { unknown: unknown$1, nu: nu$1, edge: constant(edge), chrome: constant(chrome), ie: constant(ie), opera: constant(opera), firefox: constant(firefox), safari: constant(safari) }; var windows$1 = 'Windows'; var ios = 'iOS'; var android = 'Android'; var linux = 'Linux'; var osx = 'OSX'; var solaris = 'Solaris'; var freebsd = 'FreeBSD'; var isOS = function (name, current) { return function () { return current === name; }; }; var unknown$2 = function () { return nu$2({ current: undefined, version: Version.unknown() }); }; var nu$2 = function (info) { var current = info.current; var version = info.version; return { current: current, version: version, isWindows: isOS(windows$1, current), isiOS: isOS(ios, current), isAndroid: isOS(android, current), isOSX: isOS(osx, current), isLinux: isOS(linux, current), isSolaris: isOS(solaris, current), isFreeBSD: isOS(freebsd, current) }; }; var OperatingSystem = { unknown: unknown$2, nu: nu$2, windows: constant(windows$1), ios: constant(ios), android: constant(android), linux: constant(linux), osx: constant(osx), solaris: constant(solaris), freebsd: constant(freebsd) }; var DeviceType = function (os, browser, userAgent) { var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; var isiPhone = os.isiOS() && !isiPad; var isAndroid3 = os.isAndroid() && os.version.major === 3; var isAndroid4 = os.isAndroid() && os.version.major === 4; var isTablet = isiPad || isAndroid3 || isAndroid4 && /mobile/i.test(userAgent) === true; var isTouch = os.isiOS() || os.isAndroid(); var isPhone = isTouch && !isTablet; var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; return { isiPad: constant(isiPad), isiPhone: constant(isiPhone), isTablet: constant(isTablet), isPhone: constant(isPhone), isTouch: constant(isTouch), isAndroid: os.isAndroid, isiOS: os.isiOS, isWebView: constant(iOSwebview) }; }; var detect$1 = function (candidates, userAgent) { var agent = String(userAgent).toLowerCase(); return find(candidates, function (candidate) { return candidate.search(agent); }); }; var detectBrowser = function (browsers, userAgent) { return detect$1(browsers, userAgent).map(function (browser) { var version = Version.detect(browser.versionRegexes, userAgent); return { current: browser.name, version: version }; }); }; var detectOs = function (oses, userAgent) { return detect$1(oses, userAgent).map(function (os) { var version = Version.detect(os.versionRegexes, userAgent); return { current: os.name, version: version }; }); }; var UaString = { detectBrowser: detectBrowser, detectOs: detectOs }; var contains = function (str, substr) { return str.indexOf(substr) !== -1; }; var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/; var checkContains = function (target) { return function (uastring) { return contains(uastring, target); }; }; var browsers = [ { name: 'Edge', versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], search: function (uastring) { return contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit'); } }, { name: 'Chrome', versionRegexes: [ /.*?chrome\/([0-9]+)\.([0-9]+).*/, normalVersionRegex ], search: function (uastring) { return contains(uastring, 'chrome') && !contains(uastring, 'chromeframe'); } }, { name: 'IE', versionRegexes: [ /.*?msie\ ?([0-9]+)\.([0-9]+).*/, /.*?rv:([0-9]+)\.([0-9]+).*/ ], search: function (uastring) { return contains(uastring, 'msie') || contains(uastring, 'trident'); } }, { name: 'Opera', versionRegexes: [ normalVersionRegex, /.*?opera\/([0-9]+)\.([0-9]+).*/ ], search: checkContains('opera') }, { name: 'Firefox', versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], search: checkContains('firefox') }, { name: 'Safari', versionRegexes: [ normalVersionRegex, /.*?cpu os ([0-9]+)_([0-9]+).*/ ], search: function (uastring) { return (contains(uastring, 'safari') || contains(uastring, 'mobile/')) && contains(uastring, 'applewebkit'); } } ]; var oses = [ { name: 'Windows', search: checkContains('win'), versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] }, { name: 'iOS', search: function (uastring) { return contains(uastring, 'iphone') || contains(uastring, 'ipad'); }, versionRegexes: [ /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, /.*cpu os ([0-9]+)_([0-9]+).*/, /.*cpu iphone os ([0-9]+)_([0-9]+).*/ ] }, { name: 'Android', search: checkContains('android'), versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] }, { name: 'OSX', search: checkContains('os x'), versionRegexes: [/.*?os\ x\ ?([0-9]+)_([0-9]+).*/] }, { name: 'Linux', search: checkContains('linux'), versionRegexes: [] }, { name: 'Solaris', search: checkContains('sunos'), versionRegexes: [] }, { name: 'FreeBSD', search: checkContains('freebsd'), versionRegexes: [] } ]; var PlatformInfo = { browsers: constant(browsers), oses: constant(oses) }; var detect$2 = function (userAgent) { var browsers = PlatformInfo.browsers(); var oses = PlatformInfo.oses(); var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); var deviceType = DeviceType(os, browser, userAgent); return { browser: browser, os: os, deviceType: deviceType }; }; var PlatformDetection = { detect: detect$2 }; var detect$3 = cached(function () { var userAgent = domGlobals.navigator.userAgent; return PlatformDetection.detect(userAgent); }); var PlatformDetection$1 = { detect: detect$3 }; var ELEMENT$1 = ELEMENT; var DOCUMENT$1 = DOCUMENT; var bypassSelector = function (dom) { return dom.nodeType !== ELEMENT$1 && dom.nodeType !== DOCUMENT$1 || dom.childElementCount === 0; }; var all = function (selector, scope) { var base = scope === undefined ? domGlobals.document : scope.dom(); return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), Element.fromDom); }; var one = function (selector, scope) { var base = scope === undefined ? domGlobals.document : scope.dom(); return bypassSelector(base) ? Option.none() : Option.from(base.querySelector(selector)).map(Element.fromDom); }; var regularContains = function (e1, e2) { var d1 = e1.dom(); var d2 = e2.dom(); return d1 === d2 ? false : d1.contains(d2); }; var ieContains = function (e1, e2) { return Node.documentPositionContainedBy(e1.dom(), e2.dom()); }; var browser = PlatformDetection$1.detect().browser; var contains$1 = browser.isIE() ? ieContains : regularContains; var spot = Immutable('element', 'offset'); var descendants = function (scope, selector) { return all(selector, scope); }; var trim = global$4.trim; var hasContentEditableState = function (value) { return function (node) { if (node && node.nodeType === 1) { if (node.contentEditable === value) { return true; } if (node.getAttribute('data-mce-contenteditable') === value) { return true; } } return false; }; }; var isContentEditableTrue = hasContentEditableState('true'); var isContentEditableFalse = hasContentEditableState('false'); var create$4 = function (type, title, url, level, attach) { return { type: type, title: title, url: url, level: level, attach: attach }; }; var isChildOfContentEditableTrue = function (node) { while (node = node.parentNode) { var value = node.contentEditable; if (value && value !== 'inherit') { return isContentEditableTrue(node); } } return false; }; var select = function (selector, root) { return map(descendants(Element.fromDom(root), selector), function (element) { return element.dom(); }); }; var getElementText = function (elm) { return elm.innerText || elm.textContent; }; var getOrGenerateId = function (elm) { return elm.id ? elm.id : generate('h'); }; var isAnchor = function (elm) { return elm && elm.nodeName === 'A' && (elm.id || elm.name); }; var isValidAnchor = function (elm) { return isAnchor(elm) && isEditable(elm); }; var isHeader = function (elm) { return elm && /^(H[1-6])$/.test(elm.nodeName); }; var isEditable = function (elm) { return isChildOfContentEditableTrue(elm) && !isContentEditableFalse(elm); }; var isValidHeader = function (elm) { return isHeader(elm) && isEditable(elm); }; var getLevel = function (elm) { return isHeader(elm) ? parseInt(elm.nodeName.substr(1), 10) : 0; }; var headerTarget = function (elm) { var headerId = getOrGenerateId(elm); var attach = function () { elm.id = headerId; }; return create$4('header', getElementText(elm), '#' + headerId, getLevel(elm), attach); }; var anchorTarget = function (elm) { var anchorId = elm.id || elm.name; var anchorText = getElementText(elm); return create$4('anchor', anchorText ? anchorText : '#' + anchorId, '#' + anchorId, 0, noop); }; var getHeaderTargets = function (elms) { return map(filter(elms, isValidHeader), headerTarget); }; var getAnchorTargets = function (elms) { return map(filter(elms, isValidAnchor), anchorTarget); }; var getTargetElements = function (elm) { var elms = select('h1,h2,h3,h4,h5,h6,a:not([href])', elm); return elms; }; var hasTitle = function (target) { return trim(target.title).length > 0; }; var find$2 = function (elm) { var elms = getTargetElements(elm); return filter(getHeaderTargets(elms).concat(getAnchorTargets(elms)), hasTitle); }; var LinkTargets = { find: find$2 }; var getActiveEditor = function () { return window.tinymce ? window.tinymce.activeEditor : global$5.activeEditor; }; var history = {}; var HISTORY_LENGTH = 5; var clearHistory = function () { history = {}; }; var toMenuItem = function (target) { return { title: target.title, value: { title: { raw: target.title }, url: target.url, attach: target.attach } }; }; var toMenuItems = function (targets) { return global$4.map(targets, toMenuItem); }; var staticMenuItem = function (title, url) { return { title: title, value: { title: title, url: url, attach: noop } }; }; var isUniqueUrl = function (url, targets) { var foundTarget = exists(targets, function (target) { return target.url === url; }); return !foundTarget; }; var getSetting = function (editorSettings, name, defaultValue) { var value = name in editorSettings ? editorSettings[name] : defaultValue; return value === false ? null : value; }; var createMenuItems = function (term, targets, fileType, editorSettings) { var separator = { title: '-' }; var fromHistoryMenuItems = function (history) { var historyItems = history.hasOwnProperty(fileType) ? history[fileType] : []; var uniqueHistory = filter(historyItems, function (url) { return isUniqueUrl(url, targets); }); return global$4.map(uniqueHistory, function (url) { return { title: url, value: { title: url, url: url, attach: noop } }; }); }; var fromMenuItems = function (type) { var filteredTargets = filter(targets, function (target) { return target.type === type; }); return toMenuItems(filteredTargets); }; var anchorMenuItems = function () { var anchorMenuItems = fromMenuItems('anchor'); var topAnchor = getSetting(editorSettings, 'anchor_top', '#top'); var bottomAchor = getSetting(editorSettings, 'anchor_bottom', '#bottom'); if (topAnchor !== null) { anchorMenuItems.unshift(staticMenuItem('', topAnchor)); } if (bottomAchor !== null) { anchorMenuItems.push(staticMenuItem('', bottomAchor)); } return anchorMenuItems; }; var join = function (items) { return foldl(items, function (a, b) { var bothEmpty = a.length === 0 || b.length === 0; return bothEmpty ? a.concat(b) : a.concat(separator, b); }, []); }; if (editorSettings.typeahead_urls === false) { return []; } return fileType === 'file' ? join([ filterByQuery(term, fromHistoryMenuItems(history)), filterByQuery(term, fromMenuItems('header')), filterByQuery(term, anchorMenuItems()) ]) : filterByQuery(term, fromHistoryMenuItems(history)); }; var addToHistory = function (url, fileType) { var items = history[fileType]; if (!/^https?/.test(url)) { return; } if (items) { if (indexOf(items, url).isNone()) { history[fileType] = items.slice(0, HISTORY_LENGTH).concat(url); } } else { history[fileType] = [url]; } }; var filterByQuery = function (term, menuItems) { var lowerCaseTerm = term.toLowerCase(); var result = global$4.grep(menuItems, function (item) { return item.title.toLowerCase().indexOf(lowerCaseTerm) !== -1; }); return result.length === 1 && result[0].title === term ? [] : result; }; var getTitle = function (linkDetails) { var title = linkDetails.title; return title.raw ? title.raw : title; }; var setupAutoCompleteHandler = function (ctrl, editorSettings, bodyElm, fileType) { var autocomplete = function (term) { var linkTargets = LinkTargets.find(bodyElm); var menuItems = createMenuItems(term, linkTargets, fileType, editorSettings); ctrl.showAutoComplete(menuItems, term); }; ctrl.on('autocomplete', function () { autocomplete(ctrl.value()); }); ctrl.on('selectitem', function (e) { var linkDetails = e.value; ctrl.value(linkDetails.url); var title = getTitle(linkDetails); if (fileType === 'image') { ctrl.fire('change', { meta: { alt: title, attach: linkDetails.attach } }); } else { ctrl.fire('change', { meta: { text: title, attach: linkDetails.attach } }); } ctrl.focus(); }); ctrl.on('click', function (e) { if (ctrl.value().length === 0 && e.target.nodeName === 'INPUT') { autocomplete(''); } }); ctrl.on('PostRender', function () { ctrl.getRoot().on('submit', function (e) { if (!e.isDefaultPrevented()) { addToHistory(ctrl.value(), fileType); } }); }); }; var statusToUiState = function (result) { var status = result.status, message = result.message; if (status === 'valid') { return { status: 'ok', message: message }; } else if (status === 'unknown') { return { status: 'warn', message: message }; } else if (status === 'invalid') { return { status: 'warn', message: message }; } else { return { status: 'none', message: '' }; } }; var setupLinkValidatorHandler = function (ctrl, editorSettings, fileType) { var validatorHandler = editorSettings.filepicker_validator_handler; if (validatorHandler) { var validateUrl_1 = function (url) { if (url.length === 0) { ctrl.statusLevel('none'); return; } validatorHandler({ url: url, type: fileType }, function (result) { var uiState = statusToUiState(result); ctrl.statusMessage(uiState.message); ctrl.statusLevel(uiState.status); }); }; ctrl.state.on('change:value', function (e) { validateUrl_1(e.value); }); } }; var FilePicker = ComboBox.extend({ Statics: { clearHistory: clearHistory }, init: function (settings) { var self = this, editor = getActiveEditor(), editorSettings = editor.settings; var actionCallback, fileBrowserCallback, fileBrowserCallbackTypes; var fileType = settings.filetype; settings.spellcheck = false; fileBrowserCallbackTypes = editorSettings.file_picker_types || editorSettings.file_browser_callback_types; if (fileBrowserCallbackTypes) { fileBrowserCallbackTypes = global$4.makeMap(fileBrowserCallbackTypes, /[, ]/); } if (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[fileType]) { fileBrowserCallback = editorSettings.file_picker_callback; if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[fileType])) { actionCallback = function () { var meta = self.fire('beforecall').meta; meta = global$4.extend({ filetype: fileType }, meta); fileBrowserCallback.call(editor, function (value, meta) { self.value(value).fire('change', { meta: meta }); }, self.value(), meta); }; } else { fileBrowserCallback = editorSettings.file_browser_callback; if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[fileType])) { actionCallback = function () { fileBrowserCallback(self.getEl('inp').id, self.value(), fileType, window); }; } } } if (actionCallback) { settings.icon = 'browse'; settings.onaction = actionCallback; } self._super(settings); self.classes.add('filepicker'); setupAutoCompleteHandler(self, editorSettings, editor.getBody(), fileType); setupLinkValidatorHandler(self, editorSettings, fileType); } }); var FitLayout = AbsoluteLayout.extend({ recalc: function (container) { var contLayoutRect = container.layoutRect(), paddingBox = container.paddingBox; container.items().filter(':visible').each(function (ctrl) { ctrl.layoutRect({ x: paddingBox.left, y: paddingBox.top, w: contLayoutRect.innerW - paddingBox.right - paddingBox.left, h: contLayoutRect.innerH - paddingBox.top - paddingBox.bottom }); if (ctrl.recalc) { ctrl.recalc(); } }); } }); var FlexLayout = AbsoluteLayout.extend({ recalc: function (container) { var i, l, items, contLayoutRect, contPaddingBox, contSettings, align, pack, spacing, totalFlex, availableSpace, direction; var ctrl, ctrlLayoutRect, ctrlSettings, flex; var maxSizeItems = []; var size, maxSize, ratio, rect, pos, maxAlignEndPos; var sizeName, minSizeName, posName, maxSizeName, beforeName, innerSizeName, deltaSizeName, contentSizeName; var alignAxisName, alignInnerSizeName, alignSizeName, alignMinSizeName, alignBeforeName, alignAfterName; var alignDeltaSizeName, alignContentSizeName; var max = Math.max, min = Math.min; items = container.items().filter(':visible'); contLayoutRect = container.layoutRect(); contPaddingBox = container.paddingBox; contSettings = container.settings; direction = container.isRtl() ? contSettings.direction || 'row-reversed' : contSettings.direction; align = contSettings.align; pack = container.isRtl() ? contSettings.pack || 'end' : contSettings.pack; spacing = contSettings.spacing || 0; if (direction === 'row-reversed' || direction === 'column-reverse') { items = items.set(items.toArray().reverse()); direction = direction.split('-')[0]; } if (direction === 'column') { posName = 'y'; sizeName = 'h'; minSizeName = 'minH'; maxSizeName = 'maxH'; innerSizeName = 'innerH'; beforeName = 'top'; deltaSizeName = 'deltaH'; contentSizeName = 'contentH'; alignBeforeName = 'left'; alignSizeName = 'w'; alignAxisName = 'x'; alignInnerSizeName = 'innerW'; alignMinSizeName = 'minW'; alignAfterName = 'right'; alignDeltaSizeName = 'deltaW'; alignContentSizeName = 'contentW'; } else { posName = 'x'; sizeName = 'w'; minSizeName = 'minW'; maxSizeName = 'maxW'; innerSizeName = 'innerW'; beforeName = 'left'; deltaSizeName = 'deltaW'; contentSizeName = 'contentW'; alignBeforeName = 'top'; alignSizeName = 'h'; alignAxisName = 'y'; alignInnerSizeName = 'innerH'; alignMinSizeName = 'minH'; alignAfterName = 'bottom'; alignDeltaSizeName = 'deltaH'; alignContentSizeName = 'contentH'; } availableSpace = contLayoutRect[innerSizeName] - contPaddingBox[beforeName] - contPaddingBox[beforeName]; maxAlignEndPos = totalFlex = 0; for (i = 0, l = items.length; i < l; i++) { ctrl = items[i]; ctrlLayoutRect = ctrl.layoutRect(); ctrlSettings = ctrl.settings; flex = ctrlSettings.flex; availableSpace -= i < l - 1 ? spacing : 0; if (flex > 0) { totalFlex += flex; if (ctrlLayoutRect[maxSizeName]) { maxSizeItems.push(ctrl); } ctrlLayoutRect.flex = flex; } availableSpace -= ctrlLayoutRect[minSizeName]; size = contPaddingBox[alignBeforeName] + ctrlLayoutRect[alignMinSizeName] + contPaddingBox[alignAfterName]; if (size > maxAlignEndPos) { maxAlignEndPos = size; } } rect = {}; if (availableSpace < 0) { rect[minSizeName] = contLayoutRect[minSizeName] - availableSpace + contLayoutRect[deltaSizeName]; } else { rect[minSizeName] = contLayoutRect[innerSizeName] - availableSpace + contLayoutRect[deltaSizeName]; } rect[alignMinSizeName] = maxAlignEndPos + contLayoutRect[alignDeltaSizeName]; rect[contentSizeName] = contLayoutRect[innerSizeName] - availableSpace; rect[alignContentSizeName] = maxAlignEndPos; rect.minW = min(rect.minW, contLayoutRect.maxW); rect.minH = min(rect.minH, contLayoutRect.maxH); rect.minW = max(rect.minW, contLayoutRect.startMinWidth); rect.minH = max(rect.minH, contLayoutRect.startMinHeight); if (contLayoutRect.autoResize && (rect.minW !== contLayoutRect.minW || rect.minH !== contLayoutRect.minH)) { rect.w = rect.minW; rect.h = rect.minH; container.layoutRect(rect); this.recalc(container); if (container._lastRect === null) { var parentCtrl = container.parent(); if (parentCtrl) { parentCtrl._lastRect = null; parentCtrl.recalc(); } } return; } ratio = availableSpace / totalFlex; for (i = 0, l = maxSizeItems.length; i < l; i++) { ctrl = maxSizeItems[i]; ctrlLayoutRect = ctrl.layoutRect(); maxSize = ctrlLayoutRect[maxSizeName]; size = ctrlLayoutRect[minSizeName] + ctrlLayoutRect.flex * ratio; if (size > maxSize) { availableSpace -= ctrlLayoutRect[maxSizeName] - ctrlLayoutRect[minSizeName]; totalFlex -= ctrlLayoutRect.flex; ctrlLayoutRect.flex = 0; ctrlLayoutRect.maxFlexSize = maxSize; } else { ctrlLayoutRect.maxFlexSize = 0; } } ratio = availableSpace / totalFlex; pos = contPaddingBox[beforeName]; rect = {}; if (totalFlex === 0) { if (pack === 'end') { pos = availableSpace + contPaddingBox[beforeName]; } else if (pack === 'center') { pos = Math.round(contLayoutRect[innerSizeName] / 2 - (contLayoutRect[innerSizeName] - availableSpace) / 2) + contPaddingBox[beforeName]; if (pos < 0) { pos = contPaddingBox[beforeName]; } } else if (pack === 'justify') { pos = contPaddingBox[beforeName]; spacing = Math.floor(availableSpace / (items.length - 1)); } } rect[alignAxisName] = contPaddingBox[alignBeforeName]; for (i = 0, l = items.length; i < l; i++) { ctrl = items[i]; ctrlLayoutRect = ctrl.layoutRect(); size = ctrlLayoutRect.maxFlexSize || ctrlLayoutRect[minSizeName]; if (align === 'center') { rect[alignAxisName] = Math.round(contLayoutRect[alignInnerSizeName] / 2 - ctrlLayoutRect[alignSizeName] / 2); } else if (align === 'stretch') { rect[alignSizeName] = max(ctrlLayoutRect[alignMinSizeName] || 0, contLayoutRect[alignInnerSizeName] - contPaddingBox[alignBeforeName] - contPaddingBox[alignAfterName]); rect[alignAxisName] = contPaddingBox[alignBeforeName]; } else if (align === 'end') { rect[alignAxisName] = contLayoutRect[alignInnerSizeName] - ctrlLayoutRect[alignSizeName] - contPaddingBox.top; } if (ctrlLayoutRect.flex > 0) { size += ctrlLayoutRect.flex * ratio; } rect[sizeName] = size; rect[posName] = pos; ctrl.layoutRect(rect); if (ctrl.recalc) { ctrl.recalc(); } pos += size + spacing; } } }); var FlowLayout = Layout$1.extend({ Defaults: { containerClass: 'flow-layout', controlClass: 'flow-layout-item', endClass: 'break' }, recalc: function (container) { container.items().filter(':visible').each(function (ctrl) { if (ctrl.recalc) { ctrl.recalc(); } }); }, isNative: function () { return true; } }); var descendant = function (scope, selector) { return one(selector, scope); }; var toggleFormat = function (editor, fmt) { return function () { editor.execCommand('mceToggleFormat', false, fmt); }; }; var addFormatChangedListener = function (editor, name, changed) { var handler = function (state) { changed(state, name); }; if (editor.formatter) { editor.formatter.formatChanged(name, handler); } else { editor.on('init', function () { editor.formatter.formatChanged(name, handler); }); } }; var postRenderFormatToggle = function (editor, name) { return function (e) { addFormatChangedListener(editor, name, function (state) { e.control.active(state); }); }; }; var register = function (editor) { var alignFormats = [ 'alignleft', 'aligncenter', 'alignright', 'alignjustify' ]; var defaultAlign = 'alignleft'; var alignMenuItems = [ { text: 'Left', icon: 'alignleft', onclick: toggleFormat(editor, 'alignleft') }, { text: 'Center', icon: 'aligncenter', onclick: toggleFormat(editor, 'aligncenter') }, { text: 'Right', icon: 'alignright', onclick: toggleFormat(editor, 'alignright') }, { text: 'Justify', icon: 'alignjustify', onclick: toggleFormat(editor, 'alignjustify') } ]; editor.addMenuItem('align', { text: 'Align', menu: alignMenuItems }); editor.addButton('align', { type: 'menubutton', icon: defaultAlign, menu: alignMenuItems, onShowMenu: function (e) { var menu = e.control.menu; global$4.each(alignFormats, function (formatName, idx) { menu.items().eq(idx).each(function (item) { return item.active(editor.formatter.match(formatName)); }); }); }, onPostRender: function (e) { var ctrl = e.control; global$4.each(alignFormats, function (formatName, idx) { addFormatChangedListener(editor, formatName, function (state) { ctrl.icon(defaultAlign); if (state) { ctrl.icon(formatName); } }); }); } }); global$4.each({ alignleft: [ 'Align left', 'JustifyLeft' ], aligncenter: [ 'Align center', 'JustifyCenter' ], alignright: [ 'Align right', 'JustifyRight' ], alignjustify: [ 'Justify', 'JustifyFull' ], alignnone: [ 'No alignment', 'JustifyNone' ] }, function (item, name) { editor.addButton(name, { active: false, tooltip: item[0], cmd: item[1], onPostRender: postRenderFormatToggle(editor, name) }); }); }; var Align = { register: register }; var getFirstFont = function (fontFamily) { return fontFamily ? fontFamily.split(',')[0] : ''; }; var findMatchingValue = function (items, fontFamily) { var font = fontFamily ? fontFamily.toLowerCase() : ''; var value; global$4.each(items, function (item) { if (item.value.toLowerCase() === font) { value = item.value; } }); global$4.each(items, function (item) { if (!value && getFirstFont(item.value).toLowerCase() === getFirstFont(font).toLowerCase()) { value = item.value; } }); return value; }; var createFontNameListBoxChangeHandler = function (editor, items) { return function () { var self = this; self.state.set('value', null); editor.on('init nodeChange', function (e) { var fontFamily = editor.queryCommandValue('FontName'); var match = findMatchingValue(items, fontFamily); self.value(match ? match : null); if (!match && fontFamily) { self.text(getFirstFont(fontFamily)); } }); }; }; var createFormats = function (formats) { formats = formats.replace(/;$/, '').split(';'); var i = formats.length; while (i--) { formats[i] = formats[i].split('='); } return formats; }; var getFontItems = function (editor) { var defaultFontsFormats = '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'; var fonts = createFormats(editor.settings.font_formats || defaultFontsFormats); return global$4.map(fonts, function (font) { return { text: { raw: font[0] }, value: font[1], textStyle: font[1].indexOf('dings') === -1 ? 'font-family:' + font[1] : '' }; }); }; var registerButtons = function (editor) { editor.addButton('fontselect', function () { var items = getFontItems(editor); return { type: 'listbox', text: 'Font Family', tooltip: 'Font Family', values: items, fixedWidth: true, onPostRender: createFontNameListBoxChangeHandler(editor, items), onselect: function (e) { if (e.control.settings.value) { editor.execCommand('FontName', false, e.control.settings.value); } } }; }); }; var register$1 = function (editor) { registerButtons(editor); }; var FontSelect = { register: register$1 }; var round = function (number, precision) { var factor = Math.pow(10, precision); return Math.round(number * factor) / factor; }; var toPt = function (fontSize, precision) { if (/[0-9.]+px$/.test(fontSize)) { return round(parseInt(fontSize, 10) * 72 / 96, precision || 0) + 'pt'; } return fontSize; }; var findMatchingValue$1 = function (items, pt, px) { var value; global$4.each(items, function (item) { if (item.value === px) { value = px; } else if (item.value === pt) { value = pt; } }); return value; }; var createFontSizeListBoxChangeHandler = function (editor, items) { return function () { var self = this; editor.on('init nodeChange', function (e) { var px, pt, precision, match; px = editor.queryCommandValue('FontSize'); if (px) { for (precision = 3; !match && precision >= 0; precision--) { pt = toPt(px, precision); match = findMatchingValue$1(items, pt, px); } } self.value(match ? match : null); if (!match) { self.text(pt); } }); }; }; var getFontSizeItems = function (editor) { var defaultFontsizeFormats = '8pt 10pt 12pt 14pt 18pt 24pt 36pt'; var fontsizeFormats = editor.settings.fontsize_formats || defaultFontsizeFormats; return global$4.map(fontsizeFormats.split(' '), function (item) { var text = item, value = item; var values = item.split('='); if (values.length > 1) { text = values[0]; value = values[1]; } return { text: text, value: value }; }); }; var registerButtons$1 = function (editor) { editor.addButton('fontsizeselect', function () { var items = getFontSizeItems(editor); return { type: 'listbox', text: 'Font Sizes', tooltip: 'Font Sizes', values: items, fixedWidth: true, onPostRender: createFontSizeListBoxChangeHandler(editor, items), onclick: function (e) { if (e.control.settings.value) { editor.execCommand('FontSize', false, e.control.settings.value); } } }; }); }; var register$2 = function (editor) { registerButtons$1(editor); }; var FontSizeSelect = { register: register$2 }; var hideMenuObjects = function (editor, menu) { var count = menu.length; global$4.each(menu, function (item) { if (item.menu) { item.hidden = hideMenuObjects(editor, item.menu) === 0; } var formatName = item.format; if (formatName) { item.hidden = !editor.formatter.canApply(formatName); } if (item.hidden) { count--; } }); return count; }; var hideFormatMenuItems = function (editor, menu) { var count = menu.items().length; menu.items().each(function (item) { if (item.menu) { item.visible(hideFormatMenuItems(editor, item.menu) > 0); } if (!item.menu && item.settings.menu) { item.visible(hideMenuObjects(editor, item.settings.menu) > 0); } var formatName = item.settings.format; if (formatName) { item.visible(editor.formatter.canApply(formatName)); } if (!item.visible()) { count--; } }); return count; }; var createFormatMenu = function (editor) { var count = 0; var newFormats = []; var defaultStyleFormats = [ { 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' } ] } ]; var createMenu = function (formats) { var menu = []; if (!formats) { return; } global$4.each(formats, function (format) { var menuItem = { text: format.title, icon: format.icon }; if (format.items) { menuItem.menu = createMenu(format.items); } else { var formatName = format.format || 'custom' + count++; if (!format.format) { format.name = formatName; newFormats.push(format); } menuItem.format = formatName; menuItem.cmd = format.cmd; } menu.push(menuItem); }); return menu; }; var createStylesMenu = function () { var menu; if (editor.settings.style_formats_merge) { if (editor.settings.style_formats) { menu = createMenu(defaultStyleFormats.concat(editor.settings.style_formats)); } else { menu = createMenu(defaultStyleFormats); } } else { menu = createMenu(editor.settings.style_formats || defaultStyleFormats); } return menu; }; editor.on('init', function () { global$4.each(newFormats, function (format) { editor.formatter.register(format.name, format); }); }); return { type: 'menu', items: createStylesMenu(), onPostRender: function (e) { editor.fire('renderFormatsMenu', { control: e.control }); }, itemDefaults: { preview: true, textStyle: function () { if (this.settings.format) { return editor.formatter.getCssText(this.settings.format); } }, onPostRender: function () { var self = this; self.parent().on('show', function () { var formatName, command; formatName = self.settings.format; if (formatName) { self.disabled(!editor.formatter.canApply(formatName)); self.active(editor.formatter.match(formatName)); } command = self.settings.cmd; if (command) { self.active(editor.queryCommandState(command)); } }); }, onclick: function () { if (this.settings.format) { toggleFormat(editor, this.settings.format)(); } if (this.settings.cmd) { editor.execCommand(this.settings.cmd); } } } }; }; var registerMenuItems = function (editor, formatMenu) { editor.addMenuItem('formats', { text: 'Formats', menu: formatMenu }); }; var registerButtons$2 = function (editor, formatMenu) { editor.addButton('styleselect', { type: 'menubutton', text: 'Formats', menu: formatMenu, onShowMenu: function () { if (editor.settings.style_formats_autohide) { hideFormatMenuItems(editor, this.menu); } } }); }; var register$3 = function (editor) { var formatMenu = createFormatMenu(editor); registerMenuItems(editor, formatMenu); registerButtons$2(editor, formatMenu); }; var Formats = { register: register$3 }; var defaultBlocks = 'Paragraph=p;' + 'Heading 1=h1;' + 'Heading 2=h2;' + 'Heading 3=h3;' + 'Heading 4=h4;' + 'Heading 5=h5;' + 'Heading 6=h6;' + 'Preformatted=pre'; var createFormats$1 = function (formats) { formats = formats.replace(/;$/, '').split(';'); var i = formats.length; while (i--) { formats[i] = formats[i].split('='); } return formats; }; var createListBoxChangeHandler = function (editor, items, formatName) { return function () { var self = this; editor.on('nodeChange', function (e) { var formatter = editor.formatter; var value = null; global$4.each(e.parents, function (node) { global$4.each(items, function (item) { if (formatName) { if (formatter.matchNode(node, formatName, { value: item.value })) { value = item.value; } } else { if (formatter.matchNode(node, item.value)) { value = item.value; } } if (value) { return false; } }); if (value) { return false; } }); self.value(value); }); }; }; var lazyFormatSelectBoxItems = function (editor, blocks) { return function () { var items = []; global$4.each(blocks, function (block) { items.push({ text: block[0], value: block[1], textStyle: function () { return editor.formatter.getCssText(block[1]); } }); }); return { type: 'listbox', text: blocks[0][0], values: items, fixedWidth: true, onselect: function (e) { if (e.control) { var fmt = e.control.value(); toggleFormat(editor, fmt)(); } }, onPostRender: createListBoxChangeHandler(editor, items) }; }; }; var buildMenuItems = function (editor, blocks) { return global$4.map(blocks, function (block) { return { text: block[0], onclick: toggleFormat(editor, block[1]), textStyle: function () { return editor.formatter.getCssText(block[1]); } }; }); }; var register$4 = function (editor) { var blocks = createFormats$1(editor.settings.block_formats || defaultBlocks); editor.addMenuItem('blockformats', { text: 'Blocks', menu: buildMenuItems(editor, blocks) }); editor.addButton('formatselect', lazyFormatSelectBoxItems(editor, blocks)); }; var FormatSelect = { register: register$4 }; var createCustomMenuItems = function (editor, names) { var items, nameList; if (typeof names === 'string') { nameList = names.split(' '); } else if (global$4.isArray(names)) { return flatten$1(global$4.map(names, function (names) { return createCustomMenuItems(editor, names); })); } items = global$4.grep(nameList, function (name) { return name === '|' || name in editor.menuItems; }); return global$4.map(items, function (name) { return name === '|' ? { text: '-' } : editor.menuItems[name]; }); }; var isSeparator = function (menuItem) { return menuItem && menuItem.text === '-'; }; var trimMenuItems = function (menuItems) { var menuItems2 = filter(menuItems, function (menuItem, i) { return !isSeparator(menuItem) || !isSeparator(menuItems[i - 1]); }); return filter(menuItems2, function (menuItem, i) { return !isSeparator(menuItem) || i > 0 && i < menuItems2.length - 1; }); }; var createContextMenuItems = function (editor, context) { var outputMenuItems = [{ text: '-' }]; var menuItems = global$4.grep(editor.menuItems, function (menuItem) { return menuItem.context === context; }); global$4.each(menuItems, function (menuItem) { if (menuItem.separator === 'before') { outputMenuItems.push({ text: '|' }); } if (menuItem.prependToContext) { outputMenuItems.unshift(menuItem); } else { outputMenuItems.push(menuItem); } if (menuItem.separator === 'after') { outputMenuItems.push({ text: '|' }); } }); return outputMenuItems; }; var createInsertMenu = function (editor) { var insertButtonItems = editor.settings.insert_button_items; if (insertButtonItems) { return trimMenuItems(createCustomMenuItems(editor, insertButtonItems)); } else { return trimMenuItems(createContextMenuItems(editor, 'insert')); } }; var registerButtons$3 = function (editor) { editor.addButton('insert', { type: 'menubutton', icon: 'insert', menu: [], oncreatemenu: function () { this.menu.add(createInsertMenu(editor)); this.menu.renderNew(); } }); }; var register$5 = function (editor) { registerButtons$3(editor); }; var InsertButton = { register: register$5 }; var registerFormatButtons = function (editor) { global$4.each({ bold: 'Bold', italic: 'Italic', underline: 'Underline', strikethrough: 'Strikethrough', subscript: 'Subscript', superscript: 'Superscript' }, function (text, name) { editor.addButton(name, { active: false, tooltip: text, onPostRender: postRenderFormatToggle(editor, name), onclick: toggleFormat(editor, name) }); }); }; var registerCommandButtons = function (editor) { global$4.each({ outdent: [ 'Decrease indent', 'Outdent' ], indent: [ 'Increase indent', 'Indent' ], cut: [ 'Cut', 'Cut' ], copy: [ 'Copy', 'Copy' ], paste: [ 'Paste', 'Paste' ], help: [ 'Help', 'mceHelp' ], selectall: [ 'Select all', 'SelectAll' ], visualaid: [ 'Visual aids', 'mceToggleVisualAid' ], newdocument: [ 'New document', 'mceNewDocument' ], removeformat: [ 'Clear formatting', 'RemoveFormat' ], remove: [ 'Remove', 'Delete' ] }, function (item, name) { editor.addButton(name, { tooltip: item[0], cmd: item[1] }); }); }; var registerCommandToggleButtons = function (editor) { global$4.each({ blockquote: [ 'Blockquote', 'mceBlockQuote' ], subscript: [ 'Subscript', 'Subscript' ], superscript: [ 'Superscript', 'Superscript' ] }, function (item, name) { editor.addButton(name, { active: false, tooltip: item[0], cmd: item[1], onPostRender: postRenderFormatToggle(editor, name) }); }); }; var registerButtons$4 = function (editor) { registerFormatButtons(editor); registerCommandButtons(editor); registerCommandToggleButtons(editor); }; var registerMenuItems$1 = function (editor) { global$4.each({ bold: [ 'Bold', 'Bold', 'Meta+B' ], italic: [ 'Italic', 'Italic', 'Meta+I' ], underline: [ 'Underline', 'Underline', 'Meta+U' ], strikethrough: [ 'Strikethrough', 'Strikethrough' ], subscript: [ 'Subscript', 'Subscript' ], superscript: [ 'Superscript', 'Superscript' ], removeformat: [ 'Clear formatting', 'RemoveFormat' ], newdocument: [ 'New document', 'mceNewDocument' ], cut: [ 'Cut', 'Cut', 'Meta+X' ], copy: [ 'Copy', 'Copy', 'Meta+C' ], paste: [ 'Paste', 'Paste', 'Meta+V' ], selectall: [ 'Select all', 'SelectAll', 'Meta+A' ] }, function (item, name) { editor.addMenuItem(name, { text: item[0], icon: name, shortcut: item[2], cmd: item[1] }); }); editor.addMenuItem('codeformat', { text: 'Code', icon: 'code', onclick: toggleFormat(editor, 'code') }); }; var register$6 = function (editor) { registerButtons$4(editor); registerMenuItems$1(editor); }; var SimpleControls = { register: register$6 }; var toggleUndoRedoState = function (editor, type) { return function () { var self = this; var checkState = function () { var typeFn = type === 'redo' ? 'hasRedo' : 'hasUndo'; return editor.undoManager ? editor.undoManager[typeFn]() : false; }; self.disabled(!checkState()); editor.on('Undo Redo AddUndo TypingUndo ClearUndos SwitchMode', function () { self.disabled(editor.readonly || !checkState()); }); }; }; var registerMenuItems$2 = function (editor) { editor.addMenuItem('undo', { text: 'Undo', icon: 'undo', shortcut: 'Meta+Z', onPostRender: toggleUndoRedoState(editor, 'undo'), cmd: 'undo' }); editor.addMenuItem('redo', { text: 'Redo', icon: 'redo', shortcut: 'Meta+Y', onPostRender: toggleUndoRedoState(editor, 'redo'), cmd: 'redo' }); }; var registerButtons$5 = function (editor) { editor.addButton('undo', { tooltip: 'Undo', onPostRender: toggleUndoRedoState(editor, 'undo'), cmd: 'undo' }); editor.addButton('redo', { tooltip: 'Redo', onPostRender: toggleUndoRedoState(editor, 'redo'), cmd: 'redo' }); }; var register$7 = function (editor) { registerMenuItems$2(editor); registerButtons$5(editor); }; var UndoRedo = { register: register$7 }; var toggleVisualAidState = function (editor) { return function () { var self = this; editor.on('VisualAid', function (e) { self.active(e.hasVisual); }); self.active(editor.hasVisual); }; }; var registerMenuItems$3 = function (editor) { editor.addMenuItem('visualaid', { text: 'Visual aids', selectable: true, onPostRender: toggleVisualAidState(editor), cmd: 'mceToggleVisualAid' }); }; var register$8 = function (editor) { registerMenuItems$3(editor); }; var VisualAid = { register: register$8 }; var setupEnvironment = function () { Widget.tooltips = !global$1.iOS; Control$1.translate = function (text) { return global$5.translate(text); }; }; var setupUiContainer = function (editor) { if (editor.settings.ui_container) { global$1.container = descendant(Element.fromDom(domGlobals.document.body), editor.settings.ui_container).fold(constant(null), function (elm) { return elm.dom(); }); } }; var setupRtlMode = function (editor) { if (editor.rtl) { Control$1.rtl = true; } }; var setupHideFloatPanels = function (editor) { editor.on('mousedown progressstate', function () { FloatPanel.hideAll(); }); }; var setup = function (editor) { setupRtlMode(editor); setupHideFloatPanels(editor); setupUiContainer(editor); setupEnvironment(); FormatSelect.register(editor); Align.register(editor); SimpleControls.register(editor); UndoRedo.register(editor); FontSizeSelect.register(editor); FontSelect.register(editor); Formats.register(editor); VisualAid.register(editor); InsertButton.register(editor); }; var FormatControls = { setup: setup }; var GridLayout = AbsoluteLayout.extend({ recalc: function (container) { var settings, rows, cols, items, contLayoutRect, width, height, rect, ctrlLayoutRect, ctrl, x, y, posX, posY, ctrlSettings, contPaddingBox, align, spacingH, spacingV, alignH, alignV, maxX, maxY; var colWidths = []; var rowHeights = []; var ctrlMinWidth, ctrlMinHeight, availableWidth, availableHeight, reverseRows, idx; settings = container.settings; items = container.items().filter(':visible'); contLayoutRect = container.layoutRect(); cols = settings.columns || Math.ceil(Math.sqrt(items.length)); rows = Math.ceil(items.length / cols); spacingH = settings.spacingH || settings.spacing || 0; spacingV = settings.spacingV || settings.spacing || 0; alignH = settings.alignH || settings.align; alignV = settings.alignV || settings.align; contPaddingBox = container.paddingBox; reverseRows = 'reverseRows' in settings ? settings.reverseRows : container.isRtl(); if (alignH && typeof alignH === 'string') { alignH = [alignH]; } if (alignV && typeof alignV === 'string') { alignV = [alignV]; } for (x = 0; x < cols; x++) { colWidths.push(0); } for (y = 0; y < rows; y++) { rowHeights.push(0); } for (y = 0; y < rows; y++) { for (x = 0; x < cols; x++) { ctrl = items[y * cols + x]; if (!ctrl) { break; } ctrlLayoutRect = ctrl.layoutRect(); ctrlMinWidth = ctrlLayoutRect.minW; ctrlMinHeight = ctrlLayoutRect.minH; colWidths[x] = ctrlMinWidth > colWidths[x] ? ctrlMinWidth : colWidths[x]; rowHeights[y] = ctrlMinHeight > rowHeights[y] ? ctrlMinHeight : rowHeights[y]; } } availableWidth = contLayoutRect.innerW - contPaddingBox.left - contPaddingBox.right; for (maxX = 0, x = 0; x < cols; x++) { maxX += colWidths[x] + (x > 0 ? spacingH : 0); availableWidth -= (x > 0 ? spacingH : 0) + colWidths[x]; } availableHeight = contLayoutRect.innerH - contPaddingBox.top - contPaddingBox.bottom; for (maxY = 0, y = 0; y < rows; y++) { maxY += rowHeights[y] + (y > 0 ? spacingV : 0); availableHeight -= (y > 0 ? spacingV : 0) + rowHeights[y]; } maxX += contPaddingBox.left + contPaddingBox.right; maxY += contPaddingBox.top + contPaddingBox.bottom; rect = {}; rect.minW = maxX + (contLayoutRect.w - contLayoutRect.innerW); rect.minH = maxY + (contLayoutRect.h - contLayoutRect.innerH); rect.contentW = rect.minW - contLayoutRect.deltaW; rect.contentH = rect.minH - contLayoutRect.deltaH; rect.minW = Math.min(rect.minW, contLayoutRect.maxW); rect.minH = Math.min(rect.minH, contLayoutRect.maxH); rect.minW = Math.max(rect.minW, contLayoutRect.startMinWidth); rect.minH = Math.max(rect.minH, contLayoutRect.startMinHeight); if (contLayoutRect.autoResize && (rect.minW !== contLayoutRect.minW || rect.minH !== contLayoutRect.minH)) { rect.w = rect.minW; rect.h = rect.minH; container.layoutRect(rect); this.recalc(container); if (container._lastRect === null) { var parentCtrl = container.parent(); if (parentCtrl) { parentCtrl._lastRect = null; parentCtrl.recalc(); } } return; } if (contLayoutRect.autoResize) { rect = container.layoutRect(rect); rect.contentW = rect.minW - contLayoutRect.deltaW; rect.contentH = rect.minH - contLayoutRect.deltaH; } var flexV; if (settings.packV === 'start') { flexV = 0; } else { flexV = availableHeight > 0 ? Math.floor(availableHeight / rows) : 0; } var totalFlex = 0; var flexWidths = settings.flexWidths; if (flexWidths) { for (x = 0; x < flexWidths.length; x++) { totalFlex += flexWidths[x]; } } else { totalFlex = cols; } var ratio = availableWidth / totalFlex; for (x = 0; x < cols; x++) { colWidths[x] += flexWidths ? flexWidths[x] * ratio : ratio; } posY = contPaddingBox.top; for (y = 0; y < rows; y++) { posX = contPaddingBox.left; height = rowHeights[y] + flexV; for (x = 0; x < cols; x++) { if (reverseRows) { idx = y * cols + cols - 1 - x; } else { idx = y * cols + x; } ctrl = items[idx]; if (!ctrl) { break; } ctrlSettings = ctrl.settings; ctrlLayoutRect = ctrl.layoutRect(); width = Math.max(colWidths[x], ctrlLayoutRect.startMinWidth); ctrlLayoutRect.x = posX; ctrlLayoutRect.y = posY; align = ctrlSettings.alignH || (alignH ? alignH[x] || alignH[0] : null); if (align === 'center') { ctrlLayoutRect.x = posX + width / 2 - ctrlLayoutRect.w / 2; } else if (align === 'right') { ctrlLayoutRect.x = posX + width - ctrlLayoutRect.w; } else if (align === 'stretch') { ctrlLayoutRect.w = width; } align = ctrlSettings.alignV || (alignV ? alignV[x] || alignV[0] : null); if (align === 'center') { ctrlLayoutRect.y = posY + height / 2 - ctrlLayoutRect.h / 2; } else if (align === 'bottom') { ctrlLayoutRect.y = posY + height - ctrlLayoutRect.h; } else if (align === 'stretch') { ctrlLayoutRect.h = height; } ctrl.layoutRect(ctrlLayoutRect); posX += width + spacingH; if (ctrl.recalc) { ctrl.recalc(); } } posY += height + spacingV; } } }); var Iframe = Widget.extend({ renderHtml: function () { var self = this; self.classes.add('iframe'); self.canFocus = false; return ''; }, src: function (src) { this.getEl().src = src; }, html: function (html, callback) { var self = this, body = this.getEl().contentWindow.document.body; if (!body) { global$3.setTimeout(function () { self.html(html); }); } else { body.innerHTML = html; if (callback) { callback(); } } return this; } }); var InfoBox = Widget.extend({ init: function (settings) { var self = this; self._super(settings); self.classes.add('widget').add('infobox'); self.canFocus = false; }, severity: function (level) { this.classes.remove('error'); this.classes.remove('warning'); this.classes.remove('success'); this.classes.add(level); }, help: function (state) { this.state.set('help', state); }, renderHtml: function () { var self = this, prefix = self.classPrefix; return '
    ' + '
    ' + self.encode(self.state.get('text')) + '' + '
    ' + '
    '; }, bindStates: function () { var self = this; self.state.on('change:text', function (e) { self.getEl('body').firstChild.data = self.encode(e.value); if (self.state.get('rendered')) { self.updateLayoutRect(); } }); self.state.on('change:help', function (e) { self.classes.toggle('has-help', e.value); if (self.state.get('rendered')) { self.updateLayoutRect(); } }); return self._super(); } }); var Label = Widget.extend({ init: function (settings) { var self = this; self._super(settings); self.classes.add('widget').add('label'); self.canFocus = false; if (settings.multiline) { self.classes.add('autoscroll'); } if (settings.strong) { self.classes.add('strong'); } }, initLayoutRect: function () { var self = this, layoutRect = self._super(); if (self.settings.multiline) { var size = funcs.getSize(self.getEl()); if (size.width > layoutRect.maxW) { layoutRect.minW = layoutRect.maxW; self.classes.add('multiline'); } self.getEl().style.width = layoutRect.minW + 'px'; layoutRect.startMinH = layoutRect.h = layoutRect.minH = Math.min(layoutRect.maxH, funcs.getSize(self.getEl()).height); } return layoutRect; }, repaint: function () { var self = this; if (!self.settings.multiline) { self.getEl().style.lineHeight = self.layoutRect().h + 'px'; } return self._super(); }, severity: function (level) { this.classes.remove('error'); this.classes.remove('warning'); this.classes.remove('success'); this.classes.add(level); }, renderHtml: function () { var self = this; var targetCtrl, forName, forId = self.settings.forId; var text = self.settings.html ? self.settings.html : self.encode(self.state.get('text')); if (!forId && (forName = self.settings.forName)) { targetCtrl = self.getRoot().find('#' + forName)[0]; if (targetCtrl) { forId = targetCtrl._id; } } if (forId) { return ''; } return '' + text + ''; }, bindStates: function () { var self = this; self.state.on('change:text', function (e) { self.innerHtml(self.encode(e.value)); if (self.state.get('rendered')) { self.updateLayoutRect(); } }); return self._super(); } }); var Toolbar$1 = Container.extend({ Defaults: { role: 'toolbar', layout: 'flow' }, init: function (settings) { var self = this; self._super(settings); self.classes.add('toolbar'); }, postRender: function () { var self = this; self.items().each(function (ctrl) { ctrl.classes.add('toolbar-item'); }); return self._super(); } }); var MenuBar = Toolbar$1.extend({ Defaults: { role: 'menubar', containerCls: 'menubar', ariaRoot: true, defaults: { type: 'menubutton' } } }); function isChildOf$1(node, parent) { while (node) { if (parent === node) { return true; } node = node.parentNode; } return false; } var MenuButton = Button.extend({ init: function (settings) { var self = this; self._renderOpen = true; self._super(settings); settings = self.settings; self.classes.add('menubtn'); if (settings.fixedWidth) { self.classes.add('fixed-width'); } self.aria('haspopup', true); self.state.set('menu', settings.menu || self.render()); }, showMenu: function (toggle) { var self = this; var menu; if (self.menu && self.menu.visible() && toggle !== false) { return self.hideMenu(); } if (!self.menu) { menu = self.state.get('menu') || []; self.classes.add('opened'); if (menu.length) { menu = { type: 'menu', animate: true, items: menu }; } else { menu.type = menu.type || 'menu'; menu.animate = true; } if (!menu.renderTo) { self.menu = global$b.create(menu).parent(self).renderTo(); } else { self.menu = menu.parent(self).show().renderTo(); } self.fire('createmenu'); self.menu.reflow(); self.menu.on('cancel', function (e) { if (e.control.parent() === self.menu) { e.stopPropagation(); self.focus(); self.hideMenu(); } }); self.menu.on('select', function () { self.focus(); }); self.menu.on('show hide', function (e) { if (e.type === 'hide' && e.control.parent() === self) { self.classes.remove('opened-under'); } if (e.control === self.menu) { self.activeMenu(e.type === 'show'); self.classes.toggle('opened', e.type === 'show'); } self.aria('expanded', e.type === 'show'); }).fire('show'); } self.menu.show(); self.menu.layoutRect({ w: self.layoutRect().w }); self.menu.repaint(); self.menu.moveRel(self.getEl(), self.isRtl() ? [ 'br-tr', 'tr-br' ] : [ 'bl-tl', 'tl-bl' ]); var menuLayoutRect = self.menu.layoutRect(); var selfBottom = self.$el.offset().top + self.layoutRect().h; if (selfBottom > menuLayoutRect.y && selfBottom < menuLayoutRect.y + menuLayoutRect.h) { self.classes.add('opened-under'); } self.fire('showmenu'); }, hideMenu: function () { var self = this; if (self.menu) { self.menu.items().each(function (item) { if (item.hideMenu) { item.hideMenu(); } }); self.menu.hide(); } }, activeMenu: function (state) { this.classes.toggle('active', state); }, renderHtml: function () { var self = this, id = self._id, prefix = self.classPrefix; var icon = self.settings.icon, image; var text = self.state.get('text'); var textHtml = ''; image = self.settings.image; if (image) { icon = 'none'; if (typeof image !== 'string') { image = domGlobals.window.getSelection ? image[0] : image[1]; } image = ' style="background-image: url(\'' + image + '\')"'; } else { image = ''; } if (text) { self.classes.add('btn-has-text'); textHtml = '' + self.encode(text) + ''; } icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : ''; self.aria('role', self.parent() instanceof MenuBar ? 'menuitem' : 'button'); return '
    ' + '' + '
    '; }, postRender: function () { var self = this; self.on('click', function (e) { if (e.control === self && isChildOf$1(e.target, self.getEl())) { self.focus(); self.showMenu(!e.aria); if (e.aria) { self.menu.items().filter(':visible')[0].focus(); } } }); self.on('mouseenter', function (e) { var overCtrl = e.control; var parent = self.parent(); var hasVisibleSiblingMenu; if (overCtrl && parent && overCtrl instanceof MenuButton && overCtrl.parent() === parent) { parent.items().filter('MenuButton').each(function (ctrl) { if (ctrl.hideMenu && ctrl !== overCtrl) { if (ctrl.menu && ctrl.menu.visible()) { hasVisibleSiblingMenu = true; } ctrl.hideMenu(); } }); if (hasVisibleSiblingMenu) { overCtrl.focus(); overCtrl.showMenu(); } } }); return self._super(); }, bindStates: function () { var self = this; self.state.on('change:menu', function () { if (self.menu) { self.menu.remove(); } self.menu = null; }); return self._super(); }, remove: function () { this._super(); if (this.menu) { this.menu.remove(); } } }); function Throbber (elm, inline) { var self = this; var state; var classPrefix = Control$1.classPrefix; var timer; self.show = function (time, callback) { function render() { if (state) { global$7(elm).append('
    '); if (callback) { callback(); } } } self.hide(); state = true; if (time) { timer = global$3.setTimeout(render, time); } else { render(); } return self; }; self.hide = function () { var child = elm.lastChild; global$3.clearTimeout(timer); if (child && child.className.indexOf('throbber') !== -1) { child.parentNode.removeChild(child); } state = false; return self; }; } var Menu = FloatPanel.extend({ Defaults: { defaultType: 'menuitem', border: 1, layout: 'stack', role: 'application', bodyRole: 'menu', ariaRoot: true }, init: function (settings) { var self = this; settings.autohide = true; settings.constrainToViewport = true; if (typeof settings.items === 'function') { settings.itemsFactory = settings.items; settings.items = []; } if (settings.itemDefaults) { var items = settings.items; var i = items.length; while (i--) { items[i] = global$4.extend({}, settings.itemDefaults, items[i]); } } self._super(settings); self.classes.add('menu'); if (settings.animate && global$1.ie !== 11) { self.classes.add('animate'); } }, repaint: function () { this.classes.toggle('menu-align', true); this._super(); this.getEl().style.height = ''; this.getEl('body').style.height = ''; return this; }, cancel: function () { var self = this; self.hideAll(); self.fire('select'); }, load: function () { var self = this; var time, factory; function hideThrobber() { if (self.throbber) { self.throbber.hide(); self.throbber = null; } } factory = self.settings.itemsFactory; if (!factory) { return; } if (!self.throbber) { self.throbber = new Throbber(self.getEl('body'), true); if (self.items().length === 0) { self.throbber.show(); self.fire('loading'); } else { self.throbber.show(100, function () { self.items().remove(); self.fire('loading'); }); } self.on('hide close', hideThrobber); } self.requestTime = time = new Date().getTime(); self.settings.itemsFactory(function (items) { if (items.length === 0) { self.hide(); return; } if (self.requestTime !== time) { return; } self.getEl().style.width = ''; self.getEl('body').style.width = ''; hideThrobber(); self.items().remove(); self.getEl('body').innerHTML = ''; self.add(items); self.renderNew(); self.fire('loaded'); }); }, hideAll: function () { var self = this; this.find('menuitem').exec('hideMenu'); return self._super(); }, preRender: function () { var self = this; self.items().each(function (ctrl) { var settings = ctrl.settings; if (settings.icon || settings.image || settings.selectable) { self._hasIcons = true; return false; } }); if (self.settings.itemsFactory) { self.on('postrender', function () { if (self.settings.itemsFactory) { self.load(); } }); } self.on('show hide', function (e) { if (e.control === self) { if (e.type === 'show') { global$3.setTimeout(function () { self.classes.add('in'); }, 0); } else { self.classes.remove('in'); } } }); return self._super(); } }); var ListBox = MenuButton.extend({ init: function (settings) { var self = this; var values, selected, selectedText, lastItemCtrl; function setSelected(menuValues) { for (var i = 0; i < menuValues.length; i++) { selected = menuValues[i].selected || settings.value === menuValues[i].value; if (selected) { selectedText = selectedText || menuValues[i].text; self.state.set('value', menuValues[i].value); return true; } if (menuValues[i].menu) { if (setSelected(menuValues[i].menu)) { return true; } } } } self._super(settings); settings = self.settings; self._values = values = settings.values; if (values) { if (typeof settings.value !== 'undefined') { setSelected(values); } if (!selected && values.length > 0) { selectedText = values[0].text; self.state.set('value', values[0].value); } self.state.set('menu', values); } self.state.set('text', settings.text || selectedText); self.classes.add('listbox'); self.on('select', function (e) { var ctrl = e.control; if (lastItemCtrl) { e.lastControl = lastItemCtrl; } if (settings.multiple) { ctrl.active(!ctrl.active()); } else { self.value(e.control.value()); } lastItemCtrl = ctrl; }); }, value: function (value) { if (arguments.length === 0) { return this.state.get('value'); } if (typeof value === 'undefined') { return this; } function valueExists(values) { return exists(values, function (a) { return a.menu ? valueExists(a.menu) : a.value === value; }); } if (this.settings.values) { if (valueExists(this.settings.values)) { this.state.set('value', value); } else if (value === null) { this.state.set('value', null); } } else { this.state.set('value', value); } return this; }, bindStates: function () { var self = this; function activateMenuItemsByValue(menu, value) { if (menu instanceof Menu) { menu.items().each(function (ctrl) { if (!ctrl.hasMenus()) { ctrl.active(ctrl.value() === value); } }); } } function getSelectedItem(menuValues, value) { var selectedItem; if (!menuValues) { return; } for (var i = 0; i < menuValues.length; i++) { if (menuValues[i].value === value) { return menuValues[i]; } if (menuValues[i].menu) { selectedItem = getSelectedItem(menuValues[i].menu, value); if (selectedItem) { return selectedItem; } } } } self.on('show', function (e) { activateMenuItemsByValue(e.control, self.value()); }); self.state.on('change:value', function (e) { var selectedItem = getSelectedItem(self.state.get('menu'), e.value); if (selectedItem) { self.text(selectedItem.text); } else { self.text(self.settings.text); } }); return self._super(); } }); var toggleTextStyle = function (ctrl, state) { var textStyle = ctrl._textStyle; if (textStyle) { var textElm = ctrl.getEl('text'); textElm.setAttribute('style', textStyle); if (state) { textElm.style.color = ''; textElm.style.backgroundColor = ''; } } }; var MenuItem = Widget.extend({ Defaults: { border: 0, role: 'menuitem' }, init: function (settings) { var self = this; var text; self._super(settings); settings = self.settings; self.classes.add('menu-item'); if (settings.menu) { self.classes.add('menu-item-expand'); } if (settings.preview) { self.classes.add('menu-item-preview'); } text = self.state.get('text'); if (text === '-' || text === '|') { self.classes.add('menu-item-sep'); self.aria('role', 'separator'); self.state.set('text', '-'); } if (settings.selectable) { self.aria('role', 'menuitemcheckbox'); self.classes.add('menu-item-checkbox'); settings.icon = 'selected'; } if (!settings.preview && !settings.selectable) { self.classes.add('menu-item-normal'); } self.on('mousedown', function (e) { e.preventDefault(); }); if (settings.menu && !settings.ariaHideMenu) { self.aria('haspopup', true); } }, hasMenus: function () { return !!this.settings.menu; }, showMenu: function () { var self = this; var settings = self.settings; var menu; var parent = self.parent(); parent.items().each(function (ctrl) { if (ctrl !== self) { ctrl.hideMenu(); } }); if (settings.menu) { menu = self.menu; if (!menu) { menu = settings.menu; if (menu.length) { menu = { type: 'menu', items: menu }; } else { menu.type = menu.type || 'menu'; } if (parent.settings.itemDefaults) { menu.itemDefaults = parent.settings.itemDefaults; } menu = self.menu = global$b.create(menu).parent(self).renderTo(); menu.reflow(); menu.on('cancel', function (e) { e.stopPropagation(); self.focus(); menu.hide(); }); menu.on('show hide', function (e) { if (e.control.items) { e.control.items().each(function (ctrl) { ctrl.active(ctrl.settings.selected); }); } }).fire('show'); menu.on('hide', function (e) { if (e.control === menu) { self.classes.remove('selected'); } }); menu.submenu = true; } else { menu.show(); } menu._parentMenu = parent; menu.classes.add('menu-sub'); var rel = menu.testMoveRel(self.getEl(), self.isRtl() ? [ 'tl-tr', 'bl-br', 'tr-tl', 'br-bl' ] : [ 'tr-tl', 'br-bl', 'tl-tr', 'bl-br' ]); menu.moveRel(self.getEl(), rel); menu.rel = rel; rel = 'menu-sub-' + rel; menu.classes.remove(menu._lastRel).add(rel); menu._lastRel = rel; self.classes.add('selected'); self.aria('expanded', true); } }, hideMenu: function () { var self = this; if (self.menu) { self.menu.items().each(function (item) { if (item.hideMenu) { item.hideMenu(); } }); self.menu.hide(); self.aria('expanded', false); } return self; }, renderHtml: function () { var self = this; var id = self._id; var settings = self.settings; var prefix = self.classPrefix; var text = self.state.get('text'); var icon = self.settings.icon, image = '', shortcut = settings.shortcut; var url = self.encode(settings.url), iconHtml = ''; function convertShortcut(shortcut) { var i, value, replace = {}; if (global$1.mac) { replace = { alt: '⌥', ctrl: '⌘', shift: '⇧', meta: '⌘' }; } else { replace = { meta: 'Ctrl' }; } shortcut = shortcut.split('+'); for (i = 0; i < shortcut.length; i++) { value = replace[shortcut[i].toLowerCase()]; if (value) { shortcut[i] = value; } } return shortcut.join('+'); } function escapeRegExp(str) { return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); } function markMatches(text) { var match = settings.match || ''; return match ? text.replace(new RegExp(escapeRegExp(match), 'gi'), function (match) { return '!mce~match[' + match + ']mce~match!'; }) : text; } function boldMatches(text) { return text.replace(new RegExp(escapeRegExp('!mce~match['), 'g'), '').replace(new RegExp(escapeRegExp(']mce~match!'), 'g'), ''); } if (icon) { self.parent().classes.add('menu-has-icons'); } if (settings.image) { image = ' style="background-image: url(\'' + settings.image + '\')"'; } if (shortcut) { shortcut = convertShortcut(shortcut); } icon = prefix + 'ico ' + prefix + 'i-' + (self.settings.icon || 'none'); iconHtml = text !== '-' ? '\xA0' : ''; text = boldMatches(self.encode(markMatches(text))); url = boldMatches(self.encode(markMatches(url))); return '
    ' + iconHtml + (text !== '-' ? '' + text + '' : '') + (shortcut ? '
    ' + shortcut + '
    ' : '') + (settings.menu ? '
    ' : '') + (url ? '' : '') + '
    '; }, postRender: function () { var self = this, settings = self.settings; var textStyle = settings.textStyle; if (typeof textStyle === 'function') { textStyle = textStyle.call(this); } if (textStyle) { var textElm = self.getEl('text'); if (textElm) { textElm.setAttribute('style', textStyle); self._textStyle = textStyle; } } self.on('mouseenter click', function (e) { if (e.control === self) { if (!settings.menu && e.type === 'click') { self.fire('select'); global$3.requestAnimationFrame(function () { self.parent().hideAll(); }); } else { self.showMenu(); if (e.aria) { self.menu.focus(true); } } } }); self._super(); return self; }, hover: function () { var self = this; self.parent().items().each(function (ctrl) { ctrl.classes.remove('selected'); }); self.classes.toggle('selected', true); return self; }, active: function (state) { toggleTextStyle(this, state); if (typeof state !== 'undefined') { this.aria('checked', state); } return this._super(state); }, remove: function () { this._super(); if (this.menu) { this.menu.remove(); } } }); var Radio = Checkbox.extend({ Defaults: { classes: 'radio', role: 'radio' } }); var ResizeHandle = Widget.extend({ renderHtml: function () { var self = this, prefix = self.classPrefix; self.classes.add('resizehandle'); if (self.settings.direction === 'both') { self.classes.add('resizehandle-both'); } self.canFocus = false; return '
    ' + '' + '
    '; }, postRender: function () { var self = this; self._super(); self.resizeDragHelper = new DragHelper(this._id, { start: function () { self.fire('ResizeStart'); }, drag: function (e) { if (self.settings.direction !== 'both') { e.deltaX = 0; } self.fire('Resize', e); }, stop: function () { self.fire('ResizeEnd'); } }); }, remove: function () { if (this.resizeDragHelper) { this.resizeDragHelper.destroy(); } return this._super(); } }); function createOptions(options) { var strOptions = ''; if (options) { for (var i = 0; i < options.length; i++) { strOptions += ''; } } return strOptions; } var SelectBox = Widget.extend({ Defaults: { classes: 'selectbox', role: 'selectbox', options: [] }, init: function (settings) { var self = this; self._super(settings); if (self.settings.size) { self.size = self.settings.size; } if (self.settings.options) { self._options = self.settings.options; } self.on('keydown', function (e) { var rootControl; if (e.keyCode === 13) { e.preventDefault(); self.parents().reverse().each(function (ctrl) { if (ctrl.toJSON) { rootControl = ctrl; return false; } }); self.fire('submit', { data: rootControl.toJSON() }); } }); }, options: function (state) { if (!arguments.length) { return this.state.get('options'); } this.state.set('options', state); return this; }, renderHtml: function () { var self = this; var options, size = ''; options = createOptions(self._options); if (self.size) { size = ' size = "' + self.size + '"'; } return ''; }, bindStates: function () { var self = this; self.state.on('change:options', function (e) { self.getEl().innerHTML = createOptions(e.value); }); return self._super(); } }); function constrain(value, minVal, maxVal) { if (value < minVal) { value = minVal; } if (value > maxVal) { value = maxVal; } return value; } function setAriaProp(el, name, value) { el.setAttribute('aria-' + name, value); } function updateSliderHandle(ctrl, value) { var maxHandlePos, shortSizeName, sizeName, stylePosName, styleValue, handleEl; if (ctrl.settings.orientation === 'v') { stylePosName = 'top'; sizeName = 'height'; shortSizeName = 'h'; } else { stylePosName = 'left'; sizeName = 'width'; shortSizeName = 'w'; } handleEl = ctrl.getEl('handle'); maxHandlePos = (ctrl.layoutRect()[shortSizeName] || 100) - funcs.getSize(handleEl)[sizeName]; styleValue = maxHandlePos * ((value - ctrl._minValue) / (ctrl._maxValue - ctrl._minValue)) + 'px'; handleEl.style[stylePosName] = styleValue; handleEl.style.height = ctrl.layoutRect().h + 'px'; setAriaProp(handleEl, 'valuenow', value); setAriaProp(handleEl, 'valuetext', '' + ctrl.settings.previewFilter(value)); setAriaProp(handleEl, 'valuemin', ctrl._minValue); setAriaProp(handleEl, 'valuemax', ctrl._maxValue); } var Slider = Widget.extend({ init: function (settings) { var self = this; if (!settings.previewFilter) { settings.previewFilter = function (value) { return Math.round(value * 100) / 100; }; } self._super(settings); self.classes.add('slider'); if (settings.orientation === 'v') { self.classes.add('vertical'); } self._minValue = isNumber$1(settings.minValue) ? settings.minValue : 0; self._maxValue = isNumber$1(settings.maxValue) ? settings.maxValue : 100; self._initValue = self.state.get('value'); }, renderHtml: function () { var self = this, id = self._id, prefix = self.classPrefix; return '
    ' + '
    ' + '
    '; }, reset: function () { this.value(this._initValue).repaint(); }, postRender: function () { var self = this; var minValue, maxValue, screenCordName, stylePosName, sizeName, shortSizeName; function toFraction(min, max, val) { return (val + min) / (max - min); } function fromFraction(min, max, val) { return val * (max - min) - min; } function handleKeyboard(minValue, maxValue) { function alter(delta) { var value; value = self.value(); value = fromFraction(minValue, maxValue, toFraction(minValue, maxValue, value) + delta * 0.05); value = constrain(value, minValue, maxValue); self.value(value); self.fire('dragstart', { value: value }); self.fire('drag', { value: value }); self.fire('dragend', { value: value }); } self.on('keydown', function (e) { switch (e.keyCode) { case 37: case 38: alter(-1); break; case 39: case 40: alter(1); break; } }); } function handleDrag(minValue, maxValue, handleEl) { var startPos, startHandlePos, maxHandlePos, handlePos, value; self._dragHelper = new DragHelper(self._id, { handle: self._id + '-handle', start: function (e) { startPos = e[screenCordName]; startHandlePos = parseInt(self.getEl('handle').style[stylePosName], 10); maxHandlePos = (self.layoutRect()[shortSizeName] || 100) - funcs.getSize(handleEl)[sizeName]; self.fire('dragstart', { value: value }); }, drag: function (e) { var delta = e[screenCordName] - startPos; handlePos = constrain(startHandlePos + delta, 0, maxHandlePos); handleEl.style[stylePosName] = handlePos + 'px'; value = minValue + handlePos / maxHandlePos * (maxValue - minValue); self.value(value); self.tooltip().text('' + self.settings.previewFilter(value)).show().moveRel(handleEl, 'bc tc'); self.fire('drag', { value: value }); }, stop: function () { self.tooltip().hide(); self.fire('dragend', { value: value }); } }); } minValue = self._minValue; maxValue = self._maxValue; if (self.settings.orientation === 'v') { screenCordName = 'screenY'; stylePosName = 'top'; sizeName = 'height'; shortSizeName = 'h'; } else { screenCordName = 'screenX'; stylePosName = 'left'; sizeName = 'width'; shortSizeName = 'w'; } self._super(); handleKeyboard(minValue, maxValue); handleDrag(minValue, maxValue, self.getEl('handle')); }, repaint: function () { this._super(); updateSliderHandle(this, this.value()); }, bindStates: function () { var self = this; self.state.on('change:value', function (e) { updateSliderHandle(self, e.value); }); return self._super(); } }); var Spacer = Widget.extend({ renderHtml: function () { var self = this; self.classes.add('spacer'); self.canFocus = false; return '
    '; } }); var SplitButton = MenuButton.extend({ Defaults: { classes: 'widget btn splitbtn', role: 'button' }, repaint: function () { var self = this; var elm = self.getEl(); var rect = self.layoutRect(); var mainButtonElm, menuButtonElm; self._super(); mainButtonElm = elm.firstChild; menuButtonElm = elm.lastChild; global$7(mainButtonElm).css({ width: rect.w - funcs.getSize(menuButtonElm).width, height: rect.h - 2 }); global$7(menuButtonElm).css({ height: rect.h - 2 }); return self; }, activeMenu: function (state) { var self = this; global$7(self.getEl().lastChild).toggleClass(self.classPrefix + 'active', state); }, renderHtml: function () { var self = this; var id = self._id; var prefix = self.classPrefix; var image; var icon = self.state.get('icon'); var text = self.state.get('text'); var settings = self.settings; var textHtml = '', ariaPressed; image = settings.image; if (image) { icon = 'none'; if (typeof image !== 'string') { image = domGlobals.window.getSelection ? image[0] : image[1]; } image = ' style="background-image: url(\'' + image + '\')"'; } else { image = ''; } icon = settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : ''; if (text) { self.classes.add('btn-has-text'); textHtml = '' + self.encode(text) + ''; } ariaPressed = typeof settings.active === 'boolean' ? ' aria-pressed="' + settings.active + '"' : ''; return '
    ' + '' + '' + '
    '; }, postRender: function () { var self = this, onClickHandler = self.settings.onclick; self.on('click', function (e) { var node = e.target; if (e.control === this) { while (node) { if (e.aria && e.aria.key !== 'down' || node.nodeName === 'BUTTON' && node.className.indexOf('open') === -1) { e.stopImmediatePropagation(); if (onClickHandler) { onClickHandler.call(this, e); } return; } node = node.parentNode; } } }); delete self.settings.onclick; return self._super(); } }); var StackLayout = FlowLayout.extend({ Defaults: { containerClass: 'stack-layout', controlClass: 'stack-layout-item', endClass: 'break' }, isNative: function () { return true; } }); var TabPanel = Panel.extend({ Defaults: { layout: 'absolute', defaults: { type: 'panel' } }, activateTab: function (idx) { var activeTabElm; if (this.activeTabId) { activeTabElm = this.getEl(this.activeTabId); global$7(activeTabElm).removeClass(this.classPrefix + 'active'); activeTabElm.setAttribute('aria-selected', 'false'); } this.activeTabId = 't' + idx; activeTabElm = this.getEl('t' + idx); activeTabElm.setAttribute('aria-selected', 'true'); global$7(activeTabElm).addClass(this.classPrefix + 'active'); this.items()[idx].show().fire('showtab'); this.reflow(); this.items().each(function (item, i) { if (idx !== i) { item.hide(); } }); }, renderHtml: function () { var self = this; var layout = self._layout; var tabsHtml = ''; var prefix = self.classPrefix; self.preRender(); layout.preRender(self); self.items().each(function (ctrl, i) { var id = self._id + '-t' + i; ctrl.aria('role', 'tabpanel'); ctrl.aria('labelledby', id); tabsHtml += ''; }); return '
    ' + '
    ' + tabsHtml + '
    ' + '
    ' + layout.renderHtml(self) + '
    ' + '
    '; }, postRender: function () { var self = this; self._super(); self.settings.activeTab = self.settings.activeTab || 0; self.activateTab(self.settings.activeTab); this.on('click', function (e) { var targetParent = e.target.parentNode; if (targetParent && targetParent.id === self._id + '-head') { var i = targetParent.childNodes.length; while (i--) { if (targetParent.childNodes[i] === e.target) { self.activateTab(i); } } } }); }, initLayoutRect: function () { var self = this; var rect, minW, minH; minW = funcs.getSize(self.getEl('head')).width; minW = minW < 0 ? 0 : minW; minH = 0; self.items().each(function (item) { minW = Math.max(minW, item.layoutRect().minW); minH = Math.max(minH, item.layoutRect().minH); }); self.items().each(function (ctrl) { ctrl.settings.x = 0; ctrl.settings.y = 0; ctrl.settings.w = minW; ctrl.settings.h = minH; ctrl.layoutRect({ x: 0, y: 0, w: minW, h: minH }); }); var headH = funcs.getSize(self.getEl('head')).height; self.settings.minWidth = minW; self.settings.minHeight = minH + headH; rect = self._super(); rect.deltaH += headH; rect.innerH = rect.h - rect.deltaH; return rect; } }); var TextBox = Widget.extend({ init: function (settings) { var self = this; self._super(settings); self.classes.add('textbox'); if (settings.multiline) { self.classes.add('multiline'); } else { self.on('keydown', function (e) { var rootControl; if (e.keyCode === 13) { e.preventDefault(); self.parents().reverse().each(function (ctrl) { if (ctrl.toJSON) { rootControl = ctrl; return false; } }); self.fire('submit', { data: rootControl.toJSON() }); } }); self.on('keyup', function (e) { self.state.set('value', e.target.value); }); } }, repaint: function () { var self = this; var style, rect, borderBox, borderW, borderH = 0, lastRepaintRect; style = self.getEl().style; rect = self._layoutRect; lastRepaintRect = self._lastRepaintRect || {}; var doc = domGlobals.document; if (!self.settings.multiline && doc.all && (!doc.documentMode || doc.documentMode <= 8)) { style.lineHeight = rect.h - borderH + 'px'; } borderBox = self.borderBox; borderW = borderBox.left + borderBox.right + 8; borderH = borderBox.top + borderBox.bottom + (self.settings.multiline ? 8 : 0); if (rect.x !== lastRepaintRect.x) { style.left = rect.x + 'px'; lastRepaintRect.x = rect.x; } if (rect.y !== lastRepaintRect.y) { style.top = rect.y + 'px'; lastRepaintRect.y = rect.y; } if (rect.w !== lastRepaintRect.w) { style.width = rect.w - borderW + 'px'; lastRepaintRect.w = rect.w; } if (rect.h !== lastRepaintRect.h) { style.height = rect.h - borderH + 'px'; lastRepaintRect.h = rect.h; } self._lastRepaintRect = lastRepaintRect; self.fire('repaint', {}, false); return self; }, renderHtml: function () { var self = this; var settings = self.settings; var attrs, elm; attrs = { id: self._id, hidefocus: '1' }; global$4.each([ 'rows', 'spellcheck', 'maxLength', 'size', 'readonly', 'min', 'max', 'step', 'list', 'pattern', 'placeholder', 'required', 'multiple' ], function (name) { attrs[name] = settings[name]; }); if (self.disabled()) { attrs.disabled = 'disabled'; } if (settings.subtype) { attrs.type = settings.subtype; } elm = funcs.create(settings.multiline ? 'textarea' : 'input', attrs); elm.value = self.state.get('value'); elm.className = self.classes.toString(); return elm.outerHTML; }, value: function (value) { if (arguments.length) { this.state.set('value', value); return this; } if (this.state.get('rendered')) { this.state.set('value', this.getEl().value); } return this.state.get('value'); }, postRender: function () { var self = this; self.getEl().value = self.state.get('value'); self._super(); self.$el.on('change', function (e) { self.state.set('value', e.target.value); self.fire('change', e); }); }, bindStates: function () { var self = this; self.state.on('change:value', function (e) { if (self.getEl().value !== e.value) { self.getEl().value = e.value; } }); self.state.on('change:disabled', function (e) { self.getEl().disabled = e.value; }); return self._super(); }, remove: function () { this.$el.off(); this._super(); } }); var getApi = function () { return { Selector: Selector, Collection: Collection$2, ReflowQueue: ReflowQueue, Control: Control$1, Factory: global$b, KeyboardNavigation: KeyboardNavigation, Container: Container, DragHelper: DragHelper, Scrollable: Scrollable, Panel: Panel, Movable: Movable, Resizable: Resizable, FloatPanel: FloatPanel, Window: Window, MessageBox: MessageBox, Tooltip: Tooltip, Widget: Widget, Progress: Progress, Notification: Notification, Layout: Layout$1, AbsoluteLayout: AbsoluteLayout, Button: Button, ButtonGroup: ButtonGroup, Checkbox: Checkbox, ComboBox: ComboBox, ColorBox: ColorBox, PanelButton: PanelButton, ColorButton: ColorButton, ColorPicker: ColorPicker, Path: Path, ElementPath: ElementPath, FormItem: FormItem, Form: Form, FieldSet: FieldSet, FilePicker: FilePicker, FitLayout: FitLayout, FlexLayout: FlexLayout, FlowLayout: FlowLayout, FormatControls: FormatControls, GridLayout: GridLayout, Iframe: Iframe, InfoBox: InfoBox, Label: Label, Toolbar: Toolbar$1, MenuBar: MenuBar, MenuButton: MenuButton, MenuItem: MenuItem, Throbber: Throbber, Menu: Menu, ListBox: ListBox, Radio: Radio, ResizeHandle: ResizeHandle, SelectBox: SelectBox, Slider: Slider, Spacer: Spacer, SplitButton: SplitButton, StackLayout: StackLayout, TabPanel: TabPanel, TextBox: TextBox, DropZone: DropZone, BrowseButton: BrowseButton }; }; var appendTo = function (target) { if (target.ui) { global$4.each(getApi(), function (ref, key) { target.ui[key] = ref; }); } else { target.ui = getApi(); } }; var registerToFactory = function () { global$4.each(getApi(), function (ref, key) { global$b.add(key, ref); }); }; var Api = { appendTo: appendTo, registerToFactory: registerToFactory }; Api.registerToFactory(); Api.appendTo(window.tinymce ? window.tinymce : {}); global.add('inlite', function (editor) { var panel = create$3(); FormatControls.setup(editor); Buttons.addToEditor(editor, panel); return ThemeApi.get(editor, panel); }); function Theme () { } return Theme; }(window)); })(); PK!@)##"tinymce/themes/inlite/theme.min.jsnu[!function(_){"use strict";var u,t,e,n,i,r=tinymce.util.Tools.resolve("tinymce.ThemeManager"),h=tinymce.util.Tools.resolve("tinymce.Env"),v=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.util.Delay"),o=function(t){return t.reduce(function(t,e){return Array.isArray(e)?t.concat(o(e)):t.concat(e)},[])},s={flatten:o},a=function(t,e){for(var n=0;n+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,zt=/^\s*|\s*$/g,Ft=St.extend({init:function(t){var o=this.match;function s(t,e,n){var i;function r(t){t&&e.push(t)}return r(function(e){if(e)return e=e.toLowerCase(),function(t){return"*"===e||t.type===e}}((i=Lt.exec(t.replace(zt,"")))[1])),r(function(e){if(e)return function(t){return t._name===e}}(i[2])),r(function(n){if(n)return n=n.split("."),function(t){for(var e=n.length;e--;)if(!t.classes.contains(n[e]))return!1;return!0}}(i[3])),r(function(n,i,r){if(n)return function(t){var e=t[n]?t[n]():"";return i?"="===i?e===r:"*="===i?0<=e.indexOf(r):"~="===i?0<=(" "+e+" ").indexOf(" "+r+" "):"!="===i?e!==r:"^="===i?0===e.indexOf(r):"$="===i&&e.substr(e.length-r.length)===r:!!r}}(i[4],i[5],i[6])),r(function(i){var e;if(i)return(i=/(?:not\((.+)\))|(.+)/i.exec(i))[1]?(e=a(i[1],[]),function(t){return!o(t,e)}):(i=i[2],function(t,e,n){return"first"===i?0===e:"last"===i?e===n-1:"even"===i?e%2==0:"odd"===i?e%2==1:!!t[i]&&t[i]()})}(i[7])),e.pseudo=!!i[7],e.direct=n,e}function a(t,e){var n,i,r,o=[];do{if(It.exec(""),(i=It.exec(t))&&(t=i[3],o.push(i[1]),i[2])){n=i[3];break}}while(i);for(n&&a(n,e),t=[],r=0;r"!==o[r]&&t.push(s(o[r],[],">"===o[r-1]));return e.push(t),e}this._selectors=a(t,[])},match:function(t,e){var n,i,r,o,s,a,l,u,c,d,f,h,m;for(n=0,i=(e=e||this._selectors).length;na.maxW?a.maxW:n,a.w=n,a.innerW=n-i),(n=t.h)!==undefined&&(n=(n=na.maxH?a.maxH:n,a.h=n,a.innerH=n-r),(n=t.innerW)!==undefined&&(n=(n=na.maxW-i?a.maxW-i:n,a.innerW=n,a.w=n+i),(n=t.innerH)!==undefined&&(n=(n=na.maxH-r?a.maxH-r:n,a.innerH=n,a.h=n+r),t.contentW!==undefined&&(a.contentW=t.contentW),t.contentH!==undefined&&(a.contentH=t.contentH),(e=s._lastLayoutRect).x===a.x&&e.y===a.y&&e.w===a.w&&e.h===a.h||((o=Jt.repaintControls)&&o.map&&!o.map[s._id]&&(o.push(s),o.map[s._id]=!0),e.x=a.x,e.y=a.y,e.w=a.w,e.h=a.h),s):a},repaint:function(){var t,e,n,i,r,o,s,a,l,u,c=this;l=_.document.createRange?function(t){return t}:Math.round,t=c.getEl().style,i=c._layoutRect,a=c._lastRepaintRect||{},o=(r=c.borderBox).left+r.right,s=r.top+r.bottom,i.x!==a.x&&(t.left=l(i.x)+"px",a.x=i.x),i.y!==a.y&&(t.top=l(i.y)+"px",a.y=i.y),i.w!==a.w&&(u=l(i.w-o),t.width=(0<=u?u:0)+"px",a.w=i.w),i.h!==a.h&&(u=l(i.h-s),t.height=(0<=u?u:0)+"px",a.h=i.h),c._hasBody&&i.innerW!==a.innerW&&(u=l(i.innerW),(n=c.getEl("body"))&&((e=n.style).width=(0<=u?u:0)+"px"),a.innerW=i.innerW),c._hasBody&&i.innerH!==a.innerH&&(u=l(i.innerH),(n=n||c.getEl("body"))&&((e=e||n.style).height=(0<=u?u:0)+"px"),a.innerH=i.innerH),c._lastRepaintRect=a,c.fire("repaint",{},!1)},updateLayoutRect:function(){var t=this;t.parent()._lastRect=null,Ht.css(t.getEl(),{width:"",height:""}),t._layoutRect=t._lastRepaintRect=t._lastLayoutRect=null,t.initLayoutRect()},on:function(t,e){var n,i,r,o=this;return oe(o).on(t,"string"!=typeof(n=e)?n:function(t){return i||o.parentsAndSelf().each(function(t){var e=t.settings.callbacks;if(e&&(i=e[n]))return r=t,!1}),i?i.call(r,t):(t.action=n,void this.fire("execute",t))}),o},off:function(t,e){return oe(this).off(t,e),this},fire:function(t,e,n){if((e=e||{}).control||(e.control=this),e=oe(this).fire(t,e),!1!==n&&this.parent)for(var i=this.parent();i&&!e.isPropagationStopped();)i.fire(t,e,!1),i=i.parent();return e},hasEventListeners:function(t){return oe(this).has(t)},parents:function(t){var e,n=new qt;for(e=this.parent();e;e=e.parent())n.add(e);return t&&(n=n.filter(t)),n},parentsAndSelf:function(t){return new qt(this).add(this.parents(t))},next:function(){var t=this.parent().items();return t[t.indexOf(this)+1]},prev:function(){var t=this.parent().items();return t[t.indexOf(this)-1]},innerHtml:function(t){return this.$el.html(t),this},getEl:function(t){var e=t?this._id+"-"+t:this._id;return this._elmCache[e]||(this._elmCache[e]=Tt("#"+e)[0]),this._elmCache[e]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(t){}return this},blur:function(){return this.getEl().blur(),this},aria:function(t,e){var n=this,i=n.getEl(n.ariaTarget);return void 0===e?n._aria[t]:(n._aria[t]=e,n.state.get("rendered")&&i.setAttribute("role"===t?t:"aria-"+t,e),n)},encode:function(t,e){return!1!==e&&(t=this.translate(t)),(t||"").replace(/[&<>"]/g,function(t){return"&#"+t.charCodeAt(0)+";"})},translate:function(t){return Jt.translate?Jt.translate(t):t},before:function(t){var e=this.parent();return e&&e.insert(t,e.items().indexOf(this),!0),this},after:function(t){var e=this.parent();return e&&e.insert(t,e.items().indexOf(this)),this},remove:function(){var e,t,n=this,i=n.getEl(),r=n.parent();if(n.items){var o=n.items().toArray();for(t=o.length;t--;)o[t].remove()}r&&r.items&&(e=[],r.items().each(function(t){t!==n&&e.push(t)}),r.items().set(e),r._lastRect=null),n._eventsRoot&&n._eventsRoot===n&&Tt(i).off();var s=n.getRoot().controlIdLookup;return s&&delete s[n._id],i&&i.parentNode&&i.parentNode.removeChild(i),n.state.set("rendered",!1),n.state.destroy(),n.fire("remove"),n},renderBefore:function(t){return Tt(t).before(this.renderHtml()),this.postRender(),this},renderTo:function(t){return Tt(t||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'
    '},postRender:function(){var t,e,n,i,r,o=this,s=o.settings;for(i in o.$el=Tt(o.getEl()),o.state.set("rendered",!0),s)0===i.indexOf("on")&&o.on(i.substr(2),s[i]);if(o._eventsRoot){for(n=o.parent();!r&&n;n=n.parent())r=n._eventsRoot;if(r)for(i in r._nativeEvents)o._nativeEvents[i]=!0}se(o),s.style&&(t=o.getEl())&&(t.setAttribute("style",s.style),t.style.cssText=s.style),o.settings.border&&(e=o.borderBox,o.$el.css({"border-top-width":e.top,"border-right-width":e.right,"border-bottom-width":e.bottom,"border-left-width":e.left}));var a=o.getRoot();for(var l in a.controlIdLookup||(a.controlIdLookup={}),(a.controlIdLookup[o._id]=o)._aria)o.aria(l,o._aria[l]);!1===o.state.get("visible")&&(o.getEl().style.display="none"),o.bindStates(),o.state.on("change:visible",function(t){var e,n=t.value;o.state.get("rendered")&&(o.getEl().style.display=!1===n?"none":"",o.getEl().getBoundingClientRect()),(e=o.parent())&&(e._lastRect=null),o.fire(n?"show":"hide"),Zt.add(o)}),o.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(t){var e,n,i,r,o,s,a=this.getEl(),l=a.parentNode,u=function(t,e){var n,i,r=t;for(n=i=0;r&&r!==e&&r.nodeType;)n+=r.offsetLeft||0,i+=r.offsetTop||0,r=r.offsetParent;return{x:n,y:i}}(a,l);return e=u.x,n=u.y,i=a.offsetWidth,r=a.offsetHeight,o=l.clientWidth,s=l.clientHeight,"end"===t?(e-=o-i,n-=s-r):"center"===t&&(e-=o/2-i/2,n-=s/2-r/2),l.scrollLeft=e,l.scrollTop=n,this},getRoot:function(){for(var t,e=this,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),e=(t=e).parent()}t||(t=this);for(var i=n.length;i--;)n[i].rootControl=t;return t},reflow:function(){Zt.remove(this);var t=this.parent();return t&&t._layout&&!t._layout.isNative()&&t.reflow(),this}};function oe(n){return n._eventDispatcher||(n._eventDispatcher=new Mt({scope:n,toggleEvent:function(t,e){e&&Mt.isNative(t)&&(n._nativeEvents||(n._nativeEvents={}),n._nativeEvents[t]=!0,n.state.get("rendered")&&se(n))}})),n._eventDispatcher}function se(a){var t,e,n,l,i,r;function o(t){var e=a.getParentCtrl(t.target);e&&e.fire(t.type,t)}function s(){var t=l._lastHoverCtrl;t&&(t.fire("mouseleave",{target:t.getEl()}),t.parents().each(function(t){t.fire("mouseleave",{target:t.getEl()})}),l._lastHoverCtrl=null)}function u(t){var e,n,i,r=a.getParentCtrl(t.target),o=l._lastHoverCtrl,s=0;if(r!==o){if((n=(l._lastHoverCtrl=r).parents().toArray().reverse()).push(r),o){for((i=o.parents().toArray().reverse()).push(o),s=0;sn.x&&r.x+r.wn.y&&r.y+r.h
    '+t.encode(t.state.get("text"))+"
"},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 t,e;t=this.getEl().style,e=this._layoutRect,t.left=e.x+"px",t.top=e.y+"px",t.zIndex=131070}}),ge=ae.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.canFocus=!0,i.tooltip&&!1!==ge.tooltips&&(r.on("mouseenter",function(t){var e=r.tooltip().moveTo(-65535);if(t.control===r){var n=e.text(i.tooltip).show().testMoveRel(r.getEl(),["bc-tc","bc-tl","bc-tr"]);e.classes.toggle("tooltip-n","bc-tc"===n),e.classes.toggle("tooltip-nw","bc-tl"===n),e.classes.toggle("tooltip-ne","bc-tr"===n),e.moveRel(r.getEl(),n)}else e.hide()}),r.on("mouseleave mousedown click",function(){r.tooltip().remove(),r._tooltip=null})),r.aria("label",i.ariaLabel||i.tooltip)},tooltip:function(){return this._tooltip||(this._tooltip=new me({type:"tooltip"}),te.inheritUiContainer(this,this._tooltip),this._tooltip.renderTo()),this._tooltip},postRender:function(){var t=this,e=t.settings;t._super(),t.parent()||!e.width&&!e.height||(t.initLayoutRect(),t.repaint()),e.autofocus&&t.focus()},bindStates:function(){var e=this;function n(t){e.aria("disabled",t),e.classes.toggle("disabled",t)}function i(t){e.aria("pressed",t),e.classes.toggle("active",t)}return e.state.on("change:disabled",function(t){n(t.value)}),e.state.on("change:active",function(t){i(t.value)}),e.state.get("disabled")&&n(!0),e.state.get("active")&&i(!0),e._super()},remove:function(){this._super(),this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}}),pe=ge.extend({Defaults:{value:0},init:function(t){this._super(t),this.classes.add("progress"),this.settings.filter||(this.settings.filter=function(t){return Math.round(t)})},renderHtml:function(){var t=this._id,e=this.classPrefix;return'
0%
'},postRender:function(){return this._super(),this.value(this.settings.value),this},bindStates:function(){var e=this;function n(t){t=e.settings.filter(t),e.getEl().lastChild.innerHTML=t+"%",e.getEl().firstChild.firstChild.style.width=t+"%"}return e.state.on("change:value",function(t){n(t.value)}),n(e.state.get("value")),e._super()}}),ve=function(t,e){t.getEl().lastChild.textContent=e+(t.progressBar?" "+t.progressBar.value()+"%":"")},be=ae.extend({Mixins:[he],Defaults:{classes:"widget notification"},init:function(t){var e=this;e._super(t),e.maxWidth=t.maxWidth,t.text&&e.text(t.text),t.icon&&(e.icon=t.icon),t.color&&(e.color=t.color),t.type&&e.classes.add("notification-"+t.type),t.timeout&&(t.timeout<0||0'),t=' style="max-width: '+e.maxWidth+"px;"+(e.color?"background-color: "+e.color+';"':'"'),e.closeButton&&(r=''),e.progressBar&&(o=e.progressBar.renderHtml()),''},postRender:function(){var t=this;return c.setTimeout(function(){t.$el.addClass(t.classPrefix+"in"),ve(t,t.state.get("text"))},100),t._super()},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().firstChild.innerHTML=t.value,ve(e,t.value)}),e.progressBar&&(e.progressBar.bindStates(),e.progressBar.state.on("change:value",function(t){ve(e,e.state.get("text"))})),e._super()},close:function(){return this.fire("close").isDefaultPrevented()||this.remove(),this},repaint:function(){var t,e;t=this.getEl().style,e=this._layoutRect,t.left=e.x+"px",t.top=e.y+"px",t.zIndex=65534}});function ye(o){var s=function(t){return t.inline?t.getElement():t.getContentAreaContainer()};return{open:function(t,e){var n,i=R.extend(t,{maxWidth:(n=s(o),Ht.getSize(n).width)}),r=new be(i);return 0<(r.args=i).timeout&&(r.timer=setTimeout(function(){r.close(),e()},i.timeout)),r.on("close",function(){e()}),r.renderTo(),r},close:function(t){t.close()},reposition:function(t){Ct(t,function(t){t.moveTo(0,0)}),function(n){if(0").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:d}).appendTo(x.body),Tt(x).on("mousemove touchmove",v).on("mouseup touchend",p),h.start(t)},v=function(t){if(xe(t),t.button!==g)return p(t);t.deltaX=t.screenX-b,t.deltaY=t.screenY-y,t.preventDefault(),h.drag(t)},p=function(t){xe(t),Tt(x).off("mousemove touchmove",v).off("mouseup touchend",p),m.remove(),h.stop&&h.stop(t)},this.destroy=function(){Tt(w).off()},Tt(w).on("mousedown touchstart",e)}var _e=tinymce.util.Tools.resolve("tinymce.ui.Factory"),Re=function(t){return!!t.getAttribute("data-mce-tabstop")};function Ce(t){var o,r,n=t.root;function i(t){return t&&1===t.nodeType}try{o=_.document.activeElement}catch(e){o=_.document.body}function s(t){return i(t=t||o)?t.getAttribute("role"):null}function a(t){for(var e,n=t||o;n=n.parentNode;)if(e=s(n))return e}function l(t){var e=o;if(i(e))return e.getAttribute("aria-"+t)}function u(t){var e=t.tagName.toUpperCase();return"INPUT"===e||"TEXTAREA"===e||"SELECT"===e}function c(e){var r=[];return function t(e){if(1===e.nodeType&&"none"!==e.style.display&&!e.disabled){var n;(u(n=e)&&!n.hidden||Re(n)||/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(s(n)))&&r.push(e);for(var i=0;i=e.length&&(t=0),e[t]&&e[t].focus(),t}function h(t,e){var n=-1,i=d();e=e||c(i.getEl());for(var r=0;r
'+(t.settings.html||"")+e.renderHtml(t)+"
"},postRender:function(){var t,e=this;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=Ce({root:e})),e},initLayoutRect:function(){var t=this._super();return this._layout.recalc(this),t},recalc:function(){var t=this,e=t._layoutRect,n=t._lastRect;if(!n||n.w!==e.w||n.h!==e.h)return t._layout.recalc(t),e=t.layoutRect(),t._lastRect={x:e.x,y:e.y,w:e.w,h:e.h},!0},reflow:function(){var t;if(Zt.remove(this),this.visible()){for(ae.repaintControls=[],ae.repaintControls.map={},this.recalc(),t=ae.repaintControls.length;t--;)ae.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),ae.repaintControls=[]}return this}}),Ne={init:function(){this.on("repaint",this.renderScroll)},renderScroll:function(){var p=this,v=2;function n(){var m,g,t;function e(t,e,n,i,r,o){var s,a,l,u,c,d,f,h;if(a=p.getEl("scroll"+t)){if(f=e.toLowerCase(),h=n.toLowerCase(),Tt(p.getEl("absend")).css(f,p.layoutRect()[i]-1),!r)return void Tt(a).css("display","none");Tt(a).css("display","block"),s=p.getEl("body"),l=p.getEl("scroll"+t+"t"),u=s["client"+n]-2*v,c=(u-=m&&g?a["client"+o]:0)/s["scroll"+n],(d={})[f]=s["offset"+e]+v,d[h]=u,Tt(a).css(d),(d={})[f]=s["scroll"+e]*c,d[h]=u*c,Tt(l).css(d)}}t=p.getEl("body"),m=t.scrollWidth>t.clientWidth,g=t.scrollHeight>t.clientHeight,e("h","Left","Width","contentW",m,"Height"),e("v","Top","Height","contentH",g,"Width")}p.settings.autoScroll&&(p._hasScroll||(p._hasScroll=!0,function(){function t(s,a,l,u,c){var d,t=p._id+"-scroll"+s,e=p.classPrefix;Tt(p.getEl()).append('
'),p.draghelper=new we(t+"t",{start:function(){d=p.getEl("body")["scroll"+a],Tt("#"+t).addClass(e+"active")},drag:function(t){var e,n,i,r,o=p.layoutRect();n=o.contentW>o.innerW,i=o.contentH>o.innerH,r=p.getEl("body")["client"+l]-2*v,e=(r-=n&&i?p.getEl("scroll"+s)["client"+c]:0)/p.getEl("body")["scroll"+l],p.getEl("body")["scroll"+a]=d+t["delta"+u]/e},stop:function(){Tt("#"+t).removeClass(e+"active")}})}p.classes.add("scroll"),t("v","Top","Height","Y","Width"),t("h","Left","Width","X","Height")}(),p.on("wheel",function(t){var e=p.getEl("body");e.scrollLeft+=10*(t.deltaX||0),e.scrollTop+=10*t.deltaY,n()}),Tt(p.getEl("body")).on("scroll",n)),n())}},Oe=Me.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[Ne],renderHtml:function(){var t=this,e=t._layout,n=t.settings.html;return t.preRender(),e.preRender(t),void 0===n?n='
'+e.renderHtml(t)+"
":("function"==typeof n&&(n=n.call(t)),t._hasBody=!1),'
'+(t._preBodyHtml||"")+n+"
"}}),We={resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,e){if(t<=1||e<=1){var n=Ht.getWindowSize();t=t<=1?t*n.w:t,e=e<=1?e*n.h:e}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:e,w:t,h:e}).reflow()},resizeBy:function(t,e){var n=this.layoutRect();return this.resizeTo(n.w+t,n.h+e)}},Pe=[],De=[];function Ae(t,e){for(;t;){if(t===e)return!0;t=t.parent()}}function Be(){ke||(ke=function(t){2!==t.button&&function(t){for(var e=Pe.length;e--;){var n=Pe[e],i=n.getParentCtrl(t.target);if(n.settings.autohide){if(i&&(Ae(i,n)||n.parent()===i))continue;(t=n.fire("autohide",{target:t.target})).isDefaultPrevented()||n.hide()}}}(t)},Tt(_.document).on("click touchstart",ke))}function Le(r){var t=Ht.getViewPort().y;function e(t,e){for(var n,i=0;it&&(r.fixed(!1).layoutRect({y:r._autoFixY}).repaint(),e(!1,r._autoFixY-t)):(r._autoFixY=r.layoutRect().y,r._autoFixY').appendTo(i.getContainerElm())),c.setTimeout(function(){e.addClass(n+"in"),Tt(i.getEl()).addClass(n+"in")}),Te=!0),Ie(!0,i)}}),i.on("show",function(){i.parents().each(function(t){if(t.state.get("fixed"))return i.fixed(!0),!1})}),t.popover&&(i._preBodyHtml='
',i.classes.add("popover").add("bottom").add(i.isRtl()?"end":"start")),i.aria("label",t.ariaLabel),i.aria("labelledby",i._id),i.aria("describedby",i.describedBy||i._id+"-none")},fixed:function(t){var e=this;if(e.state.get("fixed")!==t){if(e.state.get("rendered")){var n=Ht.getViewPort();t?e.layoutRect().y-=n.y:e.layoutRect().y+=n.y}e.classes.toggle("fixed",t),e.state.set("fixed",t)}return e},show:function(){var t,e=this._super();for(t=Pe.length;t--&&Pe[t]!==this;);return-1===t&&Pe.push(this),e},hide:function(){return Fe(this),Ie(!1,this),this._super()},hideAll:function(){ze.hideAll()},close:function(){return this.fire("close").isDefaultPrevented()||(this.remove(),Ie(!1,this)),this},remove:function(){Fe(this),this._super()},postRender:function(){return this.settings.bodyRole&&this.getEl("body").setAttribute("role",this.settings.bodyRole),this._super()}});function Fe(t){var e;for(e=Pe.length;e--;)Pe[e]===t&&Pe.splice(e,1);for(e=De.length;e--;)De[e]===t&&De.splice(e,1)}ze.hideAll=function(){for(var t=Pe.length;t--;){var e=Pe[t];e&&e.settings.autohide&&(e.hide(),Pe.splice(t,1))}};var Ue=[],Ve="";function qe(t){var e,n=Tt("meta[name=viewport]")[0];!1!==h.overrideViewPort&&(n||((n=_.document.createElement("meta")).setAttribute("name","viewport"),_.document.getElementsByTagName("head")[0].appendChild(n)),(e=n.getAttribute("content"))&&void 0!==Ve&&(Ve=e),n.setAttribute("content",t?"width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0":Ve))}function Ye(t,e){(function(){for(var t=0;tt.w&&(n=t.x-Math.max(0,e/2),r.layoutRect({w:e,x:n}),i=!0),o&&(o.layoutRect({w:r.layoutRect().innerW}).recalc(),(e=o.layoutRect().minW+t.deltaW)>t.w&&(n=t.x-Math.max(0,e-t.w),r.layoutRect({w:e,x:n}),i=!0)),i&&r.recalc()},initLayoutRect:function(){var t,e=this,n=e._super(),i=0;if(e.settings.title&&!e._fullscreen){t=e.getEl("head");var r=Ht.getSize(t);n.headerW=r.width,n.headerH=r.height,i+=n.headerH}e.statusbar&&(i+=e.statusbar.layoutRect().h),n.deltaH+=i,n.minH+=i,n.h+=i;var o=Ht.getWindowSize();return n.x=e.settings.x||Math.max(0,o.w/2-n.w/2),n.y=e.settings.y||Math.max(0,o.h/2-n.h/2),n},renderHtml:function(){var t=this,e=t._layout,n=t._id,i=t.classPrefix,r=t.settings,o="",s="",a=r.html;return t.preRender(),e.preRender(t),r.title&&(o='
'+t.encode(r.title)+'
'),r.url&&(a=''),void 0===a&&(a=e.renderHtml(t)),t.statusbar&&(s=t.statusbar.renderHtml()),'
'+o+'
'+a+"
"+s+"
"},fullscreen:function(t){var n,e,i=this,r=_.document.documentElement,o=i.classPrefix;if(t!==i._fullscreen)if(Tt(_.window).on("resize",function(){var t;if(i._fullscreen)if(n)i._timer||(i._timer=c.setTimeout(function(){var t=Ht.getWindowSize();i.moveTo(0,0).resizeTo(t.w,t.h),i._timer=0},50));else{t=(new Date).getTime();var e=Ht.getWindowSize();i.moveTo(0,0).resizeTo(e.w,e.h),50<(new Date).getTime()-t&&(n=!0)}}),e=i.layoutRect(),i._fullscreen=t){i._initial={x:e.x,y:e.y,w:e.w,h:e.h},i.borderBox=Nt("0"),i.getEl("head").style.display="none",e.deltaH-=e.headerH+2,Tt([r,_.document.body]).addClass(o+"fullscreen"),i.classes.add("fullscreen");var s=Ht.getWindowSize();i.moveTo(0,0).resizeTo(s.w,s.h)}else i.borderBox=Nt(i.settings.border),i.getEl("head").style.display="",e.deltaH+=e.headerH,Tt([r,_.document.body]).removeClass(o+"fullscreen"),i.classes.remove("fullscreen"),i.moveTo(i._initial.x,i._initial.y).resizeTo(i._initial.w,i._initial.h);return i.reflow()},postRender:function(){var e,n=this;setTimeout(function(){n.classes.add("in"),n.fire("open")},0),n._super(),n.statusbar&&n.statusbar.postRender(),n.focus(),this.dragHelper=new we(n._id+"-dragh",{start:function(){e={x:n.layoutRect().x,y:n.layoutRect().y}},drag:function(t){n.moveTo(e.x+t.deltaX,e.y+t.deltaY)}}),n.on("submit",function(t){t.isDefaultPrevented()||n.close()}),Ue.push(n),qe(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var t,e=this;for(e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),Ye(e.classPrefix,!1),t=Ue.length;t--;)Ue[t]===e&&Ue.splice(t,1);qe(0",n=0;n
";r+=""}return r+="",r+=""}(r,o)),(t=i.dom.select("*[data-mce-id]")[0]).removeAttribute("data-mce-id"),e=i.dom.select("td,th",t),i.selection.setCursorLocation(e[0],0)}))},bn=function(t,e){t.execCommand("FormatBlock",!1,e)},yn=function(t,e,n){var i,r;r=(i=t.editorUpload.blobCache).create(sn("mceu"),n,e),i.add(r),t.insertContent(t.dom.createHTML("img",{src:r.blobUri()}))},xn=function(t,e){0===e.trim().length?gn(t):pn(t,e)},wn=gn,_n=function(n,t){n.addButton("quicklink",{icon:"link",tooltip:"Insert/Edit link",stateSelector:"a[href]",onclick:function(){t.showForm(n,"quicklink")}}),n.addButton("quickimage",{icon:"image",tooltip:"Insert image",onclick:function(){rn().then(function(t){var e=t[0];nn(e).then(function(t){yn(n,t,e)})})}}),n.addButton("quicktable",{icon:"table",tooltip:"Insert table",onclick:function(){t.hide(),vn(n,2,2)}}),function(e){for(var t=function(t){return function(){bn(e,t)}},n=1;n<6;n++){var i="h"+n;e.addButton(i,{text:i.toUpperCase(),tooltip:"Heading "+n,stateSelector:i,onclick:t(i),onPostRender:function(){this.getEl().firstChild.firstChild.style.fontWeight="bold"}})}}(n)},Rn=function(){var t=h.container;if(t&&"static"!==v.DOM.getStyle(t,"position",!0)){var e=v.DOM.getPos(t),n=e.x-t.scrollLeft,i=e.y-t.scrollTop;return mt.some({x:n,y:i})}return mt.none()},Cn=function(t){return/^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(t.trim())},kn=function(t){return/^https?:\/\//.test(t.trim())},En=function(t,e){return!kn(e)&&Cn(e)?(n=t,i=e,new en(function(e){n.windowManager.confirm("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(t){e(!0===t?"http://"+i:i)})})):en.resolve(e);var n,i},Hn=function(r,e){var t,n,i,o={};return t="quicklink",n={items:[{type:"button",name:"unlink",icon:"unlink",onclick:function(){r.focus(),wn(r),e()},tooltip:"Remove link"},{type:"filepicker",name:"linkurl",placeholder:"Paste or type a link",filetype:"file",onchange:function(t){var e=t.meta;e&&e.attach&&(o={href:this.value(),attach:e.attach})}},{type:"button",icon:"checkmark",subtype:"primary",tooltip:"Ok",onclick:"submit"}],onshow:function(t){if(t.control===this){var e,n="";(e=r.dom.getParent(r.selection.getStart(),"a[href]"))&&(n=r.dom.getAttrib(e,"href")),this.fromJSON({linkurl:n}),i=this.find("#unlink"),e?i.show():i.hide(),this.find("#linkurl")[0].focus()}var i},onsubmit:function(t){En(r,t.data.linkurl).then(function(t){r.undoManager.transact(function(){t===o.href&&(o.attach(),o={}),xn(r,t)}),e()})}},(i=_e.create(R.extend({type:"form",layout:"flex",direction:"row",padding:5,name:t,spacing:3},n))).on("show",function(){i.find("textbox").eq(0).each(function(t){t.focus()})}),i},Tn=function(n,t,e){var o,i,s=[];if(e)return R.each(B(i=e)?i:W(i)?i.split(/[ ,]/):[],function(t){if("|"===t)o=null;else if(n.buttons[t]){o||(o={type:"buttongroup",items:[]},s.push(o));var e=n.buttons[t];A(e)&&(e=e()),e.type=e.type||"button",(e=_e.create(e)).on("postRender",(i=n,r=e,function(){var e,t,n=(t=function(t,e){return{selector:t,handler:e}},(e=r).settings.stateSelector?t(e.settings.stateSelector,function(t){e.active(t)}):e.settings.disabledStateSelector?t(e.settings.disabledStateSelector,function(t){e.disabled(t)}):null);null!==n&&i.selection.selectorChanged(n.selector,n.handler)})),o.items.push(e)}var i,r}),_e.create({type:"toolbar",layout:"flow",name:t,items:s})},Sn=function(){var l,c,o=function(t){return 0'+this._super(t)}}),On=ge.extend({Defaults:{classes:"widget btn",role:"button"},init:function(t){var e,n=this;n._super(t),t=n.settings,e=n.settings.size,n.on("click mousedown",function(t){t.preventDefault()}),n.on("touchstart",function(t){n.fire("click",t),t.preventDefault()}),t.subtype&&n.classes.add(t.subtype),e&&n.classes.add("btn-"+e),t.icon&&n.icon(t.icon)},icon:function(t){return arguments.length?(this.state.set("icon",t),this):this.state.get("icon")},repaint:function(){var t,e=this.getEl().firstChild;e&&((t=e.style).width=t.height="100%"),this._super()},renderHtml:function(){var t,e,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a="",l=n.settings;return(t=l.image)?(o="none","string"!=typeof t&&(t=_.window.getSelection?t[0]:t[1]),t=" style=\"background-image: url('"+t+"')\""):t="",s&&(n.classes.add("btn-has-text"),a=''+n.encode(s)+""),o=o?r+"ico "+r+"i-"+o:"",e="boolean"==typeof l.active?' aria-pressed="'+l.active+'"':"",'
"},bindStates:function(){var o=this,n=o.$,i=o.classPrefix+"txt";function s(t){var e=n("span."+i,o.getEl());t?(e[0]||(n("button:first",o.getEl()).append(''),e=n("span."+i,o.getEl())),e.html(o.encode(t))):e.remove(),o.classes.toggle("btn-has-text",!!t)}return o.state.on("change:text",function(t){s(t.value)}),o.state.on("change:icon",function(t){var e=t.value,n=o.classPrefix;e=(o.settings.icon=e)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];e?(r&&r===i.firstChild||(r=_.document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=e):r&&i.removeChild(r),s(o.state.get("text"))}),o._super()}}),Wn=On.extend({init:function(t){t=R.extend({text:"Browse...",multiple:!1,accept:null},t),this._super(t),this.classes.add("browsebutton"),t.multiple&&this.classes.add("multiple")},postRender:function(){var n=this,e=Ht.create("input",{type:"file",id:n._id+"-browse",accept:n.settings.accept});n._super(),Tt(e).on("change",function(t){var e=t.target.files;n.value=function(){return e.length?n.settings.multiple?e:e[0]:null},t.preventDefault(),e.length&&n.fire("change",t)}),Tt(e).on("click",function(t){t.stopPropagation()}),Tt(n.getEl("button")).on("click touchstart",function(t){t.stopPropagation(),e.click(),t.preventDefault()}),n.getEl().appendChild(e)},remove:function(){Tt(this.getEl("button")).off(),Tt(this.getEl("input")).off(),this._super()}}),Pn=Me.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var t=this,e=t._layout;return t.classes.add("btn-group"),t.preRender(),e.preRender(t),'
'+(t.settings.html||"")+e.renderHtml(t)+"
"}}),Dn=ge.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(t){var e=this;e._super(t),e.on("click mousedown",function(t){t.preventDefault()}),e.on("click",function(t){t.preventDefault(),e.disabled()||e.checked(!e.checked())}),e.checked(e.settings.checked)},checked:function(t){return arguments.length?(this.state.set("checked",t),this):this.state.get("checked")},value:function(t){return arguments.length?this.checked(t):this.checked()},renderHtml:function(){var t=this,e=t._id,n=t.classPrefix;return'
'+t.encode(t.state.get("text"))+"
"},bindStates:function(){var o=this;function e(t){o.classes.toggle("checked",t),o.aria("checked",t)}return o.state.on("change:text",function(t){o.getEl("al").firstChild.data=o.translate(t.value)}),o.state.on("change:checked change:value",function(t){o.fire("change"),e(t.value)}),o.state.on("change:icon",function(t){var e=t.value,n=o.classPrefix;if(void 0===e)return o.settings.icon;e=(o.settings.icon=e)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];e?(r&&r===i.firstChild||(r=_.document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=e):r&&i.removeChild(r)}),o.state.get("checked")&&e(!0),o._super()}}),An=tinymce.util.Tools.resolve("tinymce.util.VK"),Bn=ge.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.classes.add("combobox"),r.subinput=!0,r.ariaTarget="inp",i.menu=i.menu||i.values,i.menu&&(i.icon="caret"),r.on("click",function(t){var e=t.target,n=r.getEl();if(Tt.contains(n,e)||e===n)for(;e&&e!==n;)e.id&&-1!==e.id.indexOf("-open")&&(r.fire("action"),i.menu&&(r.showMenu(),t.aria&&r.menu.items()[0].focus())),e=e.parentNode}),r.on("keydown",function(t){var e;13===t.keyCode&&"INPUT"===t.target.nodeName&&(t.preventDefault(),r.parents().reverse().each(function(t){if(t.toJSON)return e=t,!1}),r.fire("submit",{data:e.toJSON()}))}),r.on("keyup",function(t){if("INPUT"===t.target.nodeName){var e=r.state.get("value"),n=t.target.value;n!==e&&(r.state.set("value",n),r.fire("autocomplete",t))}}),r.on("mouseover",function(t){var e=r.tooltip().moveTo(-65535);if(r.statusLevel()&&-1!==t.target.className.indexOf(r.classPrefix+"status")){var n=r.statusMessage()||"Ok",i=e.text(n).show().testMoveRel(t.target,["bc-tc","bc-tl","bc-tr"]);e.classes.toggle("tooltip-n","bc-tc"===i),e.classes.toggle("tooltip-nw","bc-tl"===i),e.classes.toggle("tooltip-ne","bc-tr"===i),e.moveRel(t.target,i)}})},statusLevel:function(t){return 0